14 Jan, 2011

16 commits

  • In userspace, the .lzma format has become mostly a legacy file format that
    got superseded by the .xz format. Similarly, LZMA Utils was superseded by
    XZ Utils.

    These patches add support for XZ decompression into the kernel. Most of
    the code is as is from XZ Embedded .
    It was written for the Linux kernel but is usable in other projects too.

    Advantages of XZ over the current LZMA code in the kernel:
    - Nice API that can be used by other kernel modules; it's
    not limited to kernel, initramfs, and initrd decompression.
    - Integrity check support (CRC32)
    - BCJ filters improve compression of executable code on
    certain architectures. These together with LZMA2 can
    produce a few percent smaller kernel or Squashfs images
    than plain LZMA without making the decompression slower.

    This patch: Add the main decompression code (xz_dec), testing module
    (xz_dec_test), wrapper script (xz_wrap.sh) for the xz command line tool,
    and documentation. The xz_dec module is enough to have a usable XZ
    decompressor e.g. for Squashfs.

    Signed-off-by: Lasse Collin
    Cc: "H. Peter Anvin"
    Cc: Alain Knaff
    Cc: Albin Tonnerre
    Cc: Phillip Lougher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lasse Collin
     
  • Callback-to-callback decompression mode is used for initrd (not
    initramfs). The LZO wrapper is broken for this use case for two reasons:

    - The argument validation is needlessly too strict by
    requiring that "posp" is non-NULL when "fill" is non-NULL.

    - The buffer handling code didn't work at all for this
    use case.

    I tested with LZO-compressed kernel, initramfs, initrd, and corrupt
    (truncated) initramfs and initrd images.

    Signed-off-by: Lasse Collin
    Cc: "H. Peter Anvin"
    Cc: Alain Knaff
    Cc: Albin Tonnerre
    Cc: Phillip Lougher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lasse Collin
     
  • The code assumes that the input is valid and not truncated. Add checks to
    avoid reading past the end of the input buffer. Change the type of "skip"
    from u8 to int to fix a possible integer overflow.

    Signed-off-by: Lasse Collin
    Cc: "H. Peter Anvin"
    Cc: Alain Knaff
    Cc: Albin Tonnerre
    Cc: Phillip Lougher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lasse Collin
     
  • The return value of flush() is not checked in unlzo(). This means that
    the decompressor won't stop even if the caller doesn't want more data.
    This can happen e.g. with a corrupt LZO-compressed initramfs image.

    Signed-off-by: Lasse Collin
    Cc: "H. Peter Anvin"
    Cc: Alain Knaff
    Cc: Albin Tonnerre
    Cc: Phillip Lougher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lasse Collin
     
  • Validate the newly decoded distance (rep0) in process_bit1(). This is to
    detect corrupt LZMA data quickly. The old code can run for long time
    producing garbage until it hits the end of the input.

    Signed-off-by: Lasse Collin
    Cc: "H. Peter Anvin"
    Cc: Alain Knaff
    Cc: Albin Tonnerre
    Cc: Phillip Lougher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lasse Collin
     
  • The return value of wr->flush() is not checked in write_byte(). This
    means that the decompressor won't stop even if the caller doesn't want
    more data. This can happen e.g. with corrupt LZMA-compressed initramfs.
    Returning the error quickly allows the user to see the error message
    quicker.

    There is a similar missing check for wr.flush() near the end of unlzma().

    Signed-off-by: Lasse Collin
    Cc: "H. Peter Anvin"
    Cc: Alain Knaff
    Cc: Albin Tonnerre
    Cc: Phillip Lougher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lasse Collin
     
  • Return value of rc->fill() is checked in rc_read() and error() is called
    when needed, but then the code continues as if nothing had happened.

    rc_read() is a void function and it's on the top of performance critical
    call stacks, so propagating the error code via return values doesn't sound
    like the best fix. It seems better to check rc->buffer_size (which holds
    the return value of rc->fill()) in the main loop. It does nothing bad
    that the code runs a little with unknown data after a failed rc->fill().

    This fixes an infinite loop in initramfs decompression if the
    LZMA-compressed initramfs image is corrupt.

    Signed-off-by: Lasse Collin
    Cc: "H. Peter Anvin"
    Cc: Alain Knaff
    Cc: Albin Tonnerre
    Cc: Phillip Lougher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lasse Collin
     
  • Validation of header.pos calls error() but doesn't make the function
    return to indicate an error to the caller. Instead the decoding is
    attempted with invalid header.pos. This fixes it.

    Signed-off-by: Lasse Collin
    Cc: "H. Peter Anvin"
    Cc: Alain Knaff
    Cc: Albin Tonnerre
    Cc: Phillip Lougher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lasse Collin
     
  • Signed-off-by: Lasse Collin
    Cc: "H. Peter Anvin"
    Cc: Alain Knaff
    Cc: Albin Tonnerre
    Cc: Phillip Lougher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lasse Collin
     
  • Currently users of mm.h need to include to use the macros
    malloc() and free() provided by mm.h. This fixes it.

    Signed-off-by: Lasse Collin
    Cc: "H. Peter Anvin"
    Cc: Alain Knaff
    Cc: Albin Tonnerre
    Cc: Phillip Lougher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lasse Collin
     
  • set_error_fn() has become a useless complication after c1e7c3ae59
    ("bzip2/lzma/gzip: pre-boot malloc doesn't return NULL on failure") fixed
    the use of error() in malloc(). Only decompress_unlzma.c had some use for
    it and that was easy to change too.

    This also gets rid of the static function pointer "error", which
    should have been marked as __initdata.

    Signed-off-by: Lasse Collin
    Cc: "H. Peter Anvin"
    Cc: Alain Knaff
    Cc: Albin Tonnerre
    Cc: Phillip Lougher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lasse Collin
     
  • Signed-off-by: Lasse Collin
    Cc: "H. Peter Anvin"
    Cc: Alain Knaff
    Cc: Albin Tonnerre
    Cc: Phillip Lougher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lasse Collin
     
  • Alex said:

    I want to use flex_array to store a sparse array of ATM cell
    re-assembly buffers for my ATM over Ethernet driver. Using the per-vcc
    user_back structure causes problems when stacked with things like
    br2684.

    Add EXPORT_SYMBOL() for all publically accessible flex array functions
    and move to obj-y so that modules may use this library.

    Signed-off-by: David Rientjes
    Cc: Dave Hansen
    Cc: Paul Mundt
    Reported-by: Alex Bennee
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     
  • vscnprintf() should return 0 if @size is == 0. Update the comment for it,
    as @size is unsigned.

    This change based on the code of commit
    b903c0b8899b46829a9b80ba55b61079b35940ec ("lib: fix scnprintf() if @size
    is == 0") moves the real fix into vscnprinf() from scnprintf() and makes
    scnprintf() call vscnprintf(), thus avoid code duplication.

    Signed-off-by: Anton Arapov
    Acked-by: Changli Gao
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Arapov
     
  • - Move prototypes and align arguments.

    - Add CONFIG_PRINTK guard for print_hex functions

    Signed-off-by: Joe Perches
    Cc: Matt Mackall
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Add the %pK printk format specifier and the /proc/sys/kernel/kptr_restrict
    sysctl.

    The %pK format specifier is designed to hide exposed kernel pointers,
    specifically via /proc interfaces. Exposing these pointers provides an
    easy target for kernel write vulnerabilities, since they reveal the
    locations of writable structures containing easily triggerable function
    pointers. The behavior of %pK depends on the kptr_restrict sysctl.

    If kptr_restrict is set to 0, no deviation from the standard %p behavior
    occurs. If kptr_restrict is set to 1, the default, if the current user
    (intended to be a reader via seq_printf(), etc.) does not have CAP_SYSLOG
    (currently in the LSM tree), kernel pointers using %pK are printed as 0's.
    If kptr_restrict is set to 2, kernel pointers using %pK are printed as
    0's regardless of privileges. Replacing with 0's was chosen over the
    default "(null)", which cannot be parsed by userland %p, which expects
    "(nil)".

    [akpm@linux-foundation.org: check for IRQ context when !kptr_restrict, save an indent level, s/WARN/WARN_ONCE/]
    [akpm@linux-foundation.org: coding-style fixup]
    [randy.dunlap@oracle.com: fix kernel/sysctl.c warning]
    Signed-off-by: Dan Rosenberg
    Signed-off-by: Randy Dunlap
    Cc: James Morris
    Cc: Eric Dumazet
    Cc: Thomas Graf
    Cc: Eugene Teo
    Cc: Kees Cook
    Cc: Ingo Molnar
    Cc: David S. Miller
    Cc: Peter Zijlstra
    Cc: Eric Paris

    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Rosenberg
     

12 Jan, 2011

1 commit

  • …/git/tip/linux-2.6-tip

    * 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (28 commits)
    perf session: Fix infinite loop in __perf_session__process_events
    perf evsel: Support perf_evsel__open(cpus > 1 && threads > 1)
    perf sched: Use PTHREAD_STACK_MIN to avoid pthread_attr_setstacksize() fail
    perf tools: Emit clearer message for sys_perf_event_open ENOENT return
    perf stat: better error message for unsupported events
    perf sched: Fix allocation result check
    perf, x86: P4 PMU - Fix unflagged overflows handling
    dynamic debug: Fix build issue with older gcc
    tracing: Fix TRACE_EVENT power tracepoint creation
    tracing: Fix preempt count leak
    tracepoint: Add __rcu annotation
    tracing: remove duplicate null-pointer check in skb tracepoint
    tracing/trivial: Add missing comma in TRACE_EVENT comment
    tracing: Include module.h in define_trace.h
    x86: Save rbp in pt_regs on irq entry
    x86, dumpstack: Fix unused variable warning
    x86, NMI: Clean-up default_do_nmi()
    x86, NMI: Allow NMI reason io port (0x61) to be processed on any CPU
    x86, NMI: Remove DIE_NMI_IPI
    x86, NMI: Add priorities to handlers
    ...

    Linus Torvalds
     

11 Jan, 2011

1 commit

  • * 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (390 commits)
    drm/radeon/kms: disable underscan by default
    drm/radeon/kms: only enable hdmi features if the monitor supports audio
    drm: Restore the old_fb upon modeset failure
    drm/nouveau: fix hwmon device binding
    radeon: consolidate asic-specific function decls for pre-r600
    vga_switcheroo: comparing too few characters in strncmp()
    drm/radeon/kms: add NI pci ids
    drm/radeon/kms: don't enable pcie gen2 on NI yet
    drm/radeon/kms: add radeon_asic struct for NI asics
    drm/radeon/kms/ni: load default sclk/mclk/vddc at pm init
    drm/radeon/kms: add ucode loader for NI
    drm/radeon/kms: add support for DCE5 display LUTs
    drm/radeon/kms: add ni_reg.h
    drm/radeon/kms: add bo blit support for NI
    drm/radeon/kms: always use writeback/events for fences on NI
    drm/radeon/kms: adjust default clock/vddc tracking for pm on DCE5
    drm/radeon/kms: add backend map workaround for barts
    drm/radeon/kms: fill gpu init for NI asics
    drm/radeon/kms: add disabled vbios accessor for NI asics
    drm/radeon/kms: handle NI thermal controller
    ...

    Linus Torvalds
     

10 Jan, 2011

1 commit


08 Jan, 2011

2 commits

  • On older gcc (3.3) dynamic debug fails to compile:

    include/net/inet_connection_sock.h: In function `inet_csk_reset_xmit_timer':
    include/net/inet_connection_sock.h:236: error: duplicate label declaration `do_printk'
    include/net/inet_connection_sock.h:219: error: this is a previous declaration
    include/net/inet_connection_sock.h:236: error: duplicate label declaration `out'
    include/net/inet_connection_sock.h:219: error: this is a previous declaration
    include/net/inet_connection_sock.h:236: error: duplicate label `do_printk'
    include/net/inet_connection_sock.h:236: error: duplicate label `out'

    Fix, by reverting the usage of JUMP_LABEL() in dynamic debug for now.

    Cc:
    Reported-by: Tetsuo Handa
    Tested-by: Tetsuo Handa
    Signed-off-by: Jason Baron
    Signed-off-by: Steven Rostedt

    Jason Baron
     
  • * 'for-2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (30 commits)
    gameport: use this_cpu_read instead of lookup
    x86: udelay: Use this_cpu_read to avoid address calculation
    x86: Use this_cpu_inc_return for nmi counter
    x86: Replace uses of current_cpu_data with this_cpu ops
    x86: Use this_cpu_ops to optimize code
    vmstat: User per cpu atomics to avoid interrupt disable / enable
    irq_work: Use per cpu atomics instead of regular atomics
    cpuops: Use cmpxchg for xchg to avoid lock semantics
    x86: this_cpu_cmpxchg and this_cpu_xchg operations
    percpu: Generic this_cpu_cmpxchg() and this_cpu_xchg support
    percpu,x86: relocate this_cpu_add_return() and friends
    connector: Use this_cpu operations
    xen: Use this_cpu_inc_return
    taskstats: Use this_cpu_ops
    random: Use this_cpu_inc_return
    fs: Use this_cpu_inc_return in buffer.c
    highmem: Use this_cpu_xx_return() operations
    vmstat: Use this_cpu_inc_return for vm statistics
    x86: Support for this_cpu_add, sub, dec, inc_return
    percpu: Generic support for this_cpu_add, sub, dec, inc_return
    ...

    Fixed up conflicts: in arch/x86/kernel/{apic/nmi.c, apic/x2apic_uv_x.c, process.c}
    as per Tejun.

    Linus Torvalds
     

07 Jan, 2011

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1436 commits)
    cassini: Use local-mac-address prom property for Cassini MAC address
    net: remove the duplicate #ifdef __KERNEL__
    net: bridge: check the length of skb after nf_bridge_maybe_copy_header()
    netconsole: clarify stopping message
    netconsole: don't announce stopping if nothing happened
    cnic: Fix the type field in SPQ messages
    netfilter: fix export secctx error handling
    netfilter: fix the race when initializing nf_ct_expect_hash_rnd
    ipv4: IP defragmentation must be ECN aware
    net: r6040: Return proper error for r6040_init_one
    dcb: use after free in dcb_flushapp()
    dcb: unlock on error in dcbnl_ieee_get()
    net: ixp4xx_eth: Return proper error for eth_init_one
    include/linux/if_ether.h: Add #define ETH_P_LINK_CTL for HPNA and wlan local tunnel
    net: add POLLPRI to sock_def_readable()
    af_unix: Avoid socket->sk NULL OOPS in stream connect security hooks.
    net_sched: pfifo_head_drop problem
    mac80211: remove stray extern
    mac80211: implement off-channel TX using hw r-o-c offload
    mac80211: implement hardware offload for remain-on-channel
    ...

    Linus Torvalds
     
  • * 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    MAINTAINERS: Update timer related entries
    timers: Use this_cpu_read
    timerqueue: Make timerqueue_getnext() static inline
    hrtimer: fix timerqueue conversion flub
    hrtimers: Convert hrtimers to use timerlist infrastructure
    timers: Fixup allmodconfig build issue
    timers: Rename timerlist infrastructure to timerqueue
    timers: Introduce timerlist infrastructure.
    hrtimer: Remove stale comment on curr_timer
    timer: Warn when del_timer_sync() is called in hardirq context
    timer: Del_timer_sync() can be used in softirq context
    timer: Make try_to_del_timer_sync() the same on SMP and UP
    posix-timers: Annotate lock_timer()
    timer: Permit statically-declared work with deferrable timers
    time: Use ARRAY_SIZE macro in timecompare.c
    timer: Initialize the field slack of timer_list
    timer_list: Remove alignment padding on 64 bit when CONFIG_TIMER_STATS
    time: Compensate for rounding on odd-frequency clocksources

    Fix up trivial conflict in MAINTAINERS

    Linus Torvalds
     

27 Dec, 2010

1 commit


23 Dec, 2010

1 commit

  • The x86 arch has shifted its use of the nmi_watchdog from a
    local implementation to the global one provide by
    kernel/watchdog.c. This shift has caused a whole bunch of
    compile problems under different config options. I attempt to
    simplify things with the patch below.

    In order to simplify things, I had to come to terms with the
    meaning of two terms ARCH_HAS_NMI_WATCHDOG and
    CONFIG_HARDLOCKUP_DETECTOR. Basically they mean the same thing,
    the former on a local level and the latter on a global level.

    With the old x86 nmi watchdog gone, there is no need to rely on
    defining the ARCH_HAS_NMI_WATCHDOG variable because it doesn't
    make sense any more. x86 will now use the global
    implementation.

    The changes below do a few things. First it changes the few
    places that relied on ARCH_HAS_NMI_WATCHDOG to use
    CONFIG_X86_LOCAL_APIC (the former was an alias for the latter
    anyway, so nothing unusual here). Those pieces of code were
    relying more on local apic functionality the nmi watchdog
    functionality, so the change should make sense.

    Second, I removed the x86 implementation of
    touch_nmi_watchdog(). It isn't need now, instead x86 will rely
    on kernel/watchdog.c's implementation.

    Third, I removed the #define ARCH_HAS_NMI_WATCHDOG itself from
    x86. And tweaked the include/linux/nmi.h file to tell users to
    look for an externally defined touch_nmi_watchdog in the case of
    ARCH_HAS_NMI_WATCHDOG _or_ CONFIG_HARDLOCKUP_DETECTOR. This
    changes removes some of the ugliness in that file.

    Finally, I added a Kconfig dependency for
    CONFIG_HARDLOCKUP_DETECTOR that said you can't have
    ARCH_HAS_NMI_WATCHDOG _and_ CONFIG_HARDLOCKUP_DETECTOR. You can
    only have one nmi_watchdog.

    Tested with
    ARCH=i386: allnoconfig, defconfig, allyesconfig, (various broken
    configs) ARCH=x86_64: allnoconfig, defconfig, allyesconfig,
    (various broken configs)

    Hopefully, after this patch I won't get any more compile broken
    emails. :-)

    v3:
    changed a couple of 'linux/nmi.h' -> 'asm/nmi.h' to pick-up correct function
    prototypes when CONFIG_HARDLOCKUP_DETECTOR is not set.

    Signed-off-by: Don Zickus
    Cc: Peter Zijlstra
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Don Zickus
     

17 Dec, 2010

2 commits

  • The this_cpu_* options can be used to optimize __percpu_counter_add a bit. Avoids
    some address arithmetic and saves 12 bytes.

    Before:

    00000000000001d3 :
    1d3: 55 push %rbp
    1d4: 48 89 e5 mov %rsp,%rbp
    1d7: 41 55 push %r13
    1d9: 41 54 push %r12
    1db: 53 push %rbx
    1dc: 48 89 fb mov %rdi,%rbx
    1df: 48 83 ec 08 sub $0x8,%rsp
    1e3: 4c 8b 67 30 mov 0x30(%rdi),%r12
    1e7: 65 4c 03 24 25 00 00 add %gs:0x0,%r12
    1ee: 00 00
    1f0: 4d 63 2c 24 movslq (%r12),%r13
    1f4: 48 63 c2 movslq %edx,%rax
    1f7: 49 01 f5 add %rsi,%r13
    1fa: 49 39 c5 cmp %rax,%r13
    1fd: 7d 0a jge 209
    1ff: f7 da neg %edx
    201: 48 63 d2 movslq %edx,%rdx
    204: 49 39 d5 cmp %rdx,%r13
    207: 7f 1e jg 227
    209: 48 89 df mov %rbx,%rdi
    20c: e8 00 00 00 00 callq 211
    211: 4c 01 6b 18 add %r13,0x18(%rbx)
    215: 48 89 df mov %rbx,%rdi
    218: 41 c7 04 24 00 00 00 movl $0x0,(%r12)
    21f: 00
    220: e8 00 00 00 00 callq 225
    225: eb 04 jmp 22b
    227: 45 89 2c 24 mov %r13d,(%r12)
    22b: 5b pop %rbx
    22c: 5b pop %rbx
    22d: 41 5c pop %r12
    22f: 41 5d pop %r13
    231: c9 leaveq
    232: c3 retq

    After:

    00000000000001d3 :
    1d3: 55 push %rbp
    1d4: 48 63 ca movslq %edx,%rcx
    1d7: 48 89 e5 mov %rsp,%rbp
    1da: 41 54 push %r12
    1dc: 53 push %rbx
    1dd: 48 89 fb mov %rdi,%rbx
    1e0: 48 8b 47 30 mov 0x30(%rdi),%rax
    1e4: 65 44 8b 20 mov %gs:(%rax),%r12d
    1e8: 4d 63 e4 movslq %r12d,%r12
    1eb: 49 01 f4 add %rsi,%r12
    1ee: 49 39 cc cmp %rcx,%r12
    1f1: 7d 0a jge 1fd
    1f3: f7 da neg %edx
    1f5: 48 63 d2 movslq %edx,%rdx
    1f8: 49 39 d4 cmp %rdx,%r12
    1fb: 7f 21 jg 21e
    1fd: 48 89 df mov %rbx,%rdi
    200: e8 00 00 00 00 callq 205
    205: 4c 01 63 18 add %r12,0x18(%rbx)
    209: 48 8b 43 30 mov 0x30(%rbx),%rax
    20d: 48 89 df mov %rbx,%rdi
    210: 65 c7 00 00 00 00 00 movl $0x0,%gs:(%rax)
    217: e8 00 00 00 00 callq 21c
    21c: eb 04 jmp 222
    21e: 65 44 89 20 mov %r12d,%gs:(%rax)
    222: 5b pop %rbx
    223: 41 5c pop %r12
    225: c9 leaveq
    226: c3 retq

    Reviewed-by: Pekka Enberg
    Reviewed-by: Tejun Heo
    Reviewed-by: Mathieu Desnoyers
    Acked-by: H. Peter Anvin
    Signed-off-by: Christoph Lameter
    Signed-off-by: Tejun Heo

    Christoph Lameter
     
  • Chris Wilson
     

14 Dec, 2010

1 commit


11 Dec, 2010

3 commits


07 Dec, 2010

1 commit

  • Using bitshifts instead of division and multiplication should improve
    performance. That requires weight and factor to be powers of two, but i think
    this is something we can live with.

    Thanks to Peter Zijlstra for the improved formula!

    Signed-off-by: Bruno Randolf

    --

    v2: use log2.h functions
    Signed-off-by: John W. Linville

    Bruno Randolf
     

03 Dec, 2010

1 commit

  • The timerlist infrastructure is a thin layer over the rbtree
    code that implements a simple list of timers sorted by an
    expires value, and a getnext function that provides a pointer
    to the earliest timer.

    This infrastructure allows drivers and other kernel infrastructure
    to easily implement timers without duplicating code.

    Signed-off-by: John Stultz
    LKML Reference:
    Reviewed-by: Thomas Gleixner
    CC: Alessandro Zummo
    CC: Thomas Gleixner
    CC: Richard Cochran

    John Stultz
     

30 Nov, 2010

1 commit

  • This reverts commit e0fdace10e75dac67d906213b780ff1b1a4cc360.

    On-list discussion seems to suggest that the robustness fixes for printk
    make this unnecessary and DaveM has also agreed in person at Kernel Summit
    and on list.

    The main problem with this code is once we hit a lockdep splat we always
    keep oops_in_progress set, the console layer uses oops_in_progress with KMS
    to decide when it should be showing the oops and not showing X, so it causes
    problems around suspend/resume time when a userspace resume can cause a console
    switch away from X, only if oops_in_progress is set (which is what we want
    if an oops actually is in progress, but not because we had a lockdep splat
    2 days prior).

    Cc: David S Miller
    Cc: Ingo Molnar
    Signed-off-by: Dave Airlie
    Signed-off-by: Linus Torvalds

    Dave Airlie
     

29 Nov, 2010

1 commit

  • Similar to the kgdb_hex2mem() code, hex2bin converts a string
    to binary using the hex_to_bin() library call.

    Changelog:
    - Replace parameter names with src/dst (based on David Howell's comment)
    - Add 'const' where needed (based on David Howell's comment)
    - Replace int with size_t (based on David Howell's comment)

    Signed-off-by: Mimi Zohar
    Acked-by: Serge E. Hallyn
    Acked-by: David Howells
    Signed-off-by: James Morris

    Mimi Zohar
     

25 Nov, 2010

1 commit


22 Nov, 2010

1 commit

  • Makes it possible to optimize batched multiple unrefs.
    Initial user will be drivers/gpu/ttm which accumulates unrefs to be
    processed outside of atomic code.

    Signed-off-by: Thomas Hellstrom
    Signed-off-by: Dave Airlie

    Thomas Hellstrom
     

19 Nov, 2010

1 commit

  • This adds generic functions for calculating Exponentially Weighted Moving
    Averages (EWMA). This implementation makes use of a structure which keeps the
    EWMA parameters and a scaled up internal representation to reduce rounding
    errors.

    The original idea for this implementation came from the rt2x00 driver
    (rt2x00link.c). I would like to use it in several places in the mac80211 and
    ath5k code and I hope it can be useful in many other places in the kernel code.

    Signed-off-by: Bruno Randolf
    Reviewed-by: KOSAKI Motohiro
    Signed-off-by: John W. Linville

    Bruno Randolf
     

17 Nov, 2010

1 commit


12 Nov, 2010

1 commit

  • Salman Qazi describes the following radix-tree bug:

    In the following case, we get can get a deadlock:

    0. The radix tree contains two items, one has the index 0.
    1. The reader (in this case find_get_pages) takes the rcu_read_lock.
    2. The reader acquires slot(s) for item(s) including the index 0 item.
    3. The non-zero index item is deleted, and as a consequence the other item is
    moved to the root of the tree. The place where it used to be is queued for
    deletion after the readers finish.
    3b. The zero item is deleted, removing it from the direct slot, it remains in
    the rcu-delayed indirect node.
    4. The reader looks at the index 0 slot, and finds that the page has 0 ref
    count
    5. The reader looks at it again, hoping that the item will either be freed or
    the ref count will increase. This never happens, as the slot it is looking
    at will never be updated. Also, this slot can never be reclaimed because
    the reader is holding rcu_read_lock and is in an infinite loop.

    The fix is to re-use the same "indirect" pointer case that requires a slot
    lookup retry into a general "retry the lookup" bit.

    Signed-off-by: Nick Piggin
    Reported-by: Salman Qazi
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin