24 Dec, 2007

1 commit

  • Zhe Jiang noticed that its possible to underflow pl->events in
    prop_norm_percpu() when the value returned by percpu_counter_read() is less
    than the error on that read and the period delay > 1. In that case half might
    not trigger the batch increment and the value will be identical on the next
    iteration, causing the same half to be subtracted again and again.

    Fix this by rewriting the division as a single subtraction instead of a
    subtraction loop and using percpu_counter_sum() when the value returned by
    percpu_counter_read() is smaller than the error.

    The latter is still needed if we want pl->events to shrink properly in the
    error region.

    [akpm@linux-foundation.org: cleanups]
    Signed-off-by: Peter Zijlstra
    Reviewed-by: Jiang Zhe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     

18 Dec, 2007

2 commits

  • This following commit

    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=fdf8cb0909b531f9ae8f9b9d7e4eb35ba3505f07

    un-inlined a low-level rwsem function, but did not mark it as __sched.
    The result is that it now shows up as thread wchan (which also affects
    /proc/profile stats). The following simple patch fixes this by properly
    marking rwsem_down_failed_common() as a __sched function.

    Also in this patch, which is up for discussion, marks down_read() and
    down_write() proper as __sched. For profiling, it is pretty much
    useless to know that a semaphore is beig help - it is necessary to know
    _which_ one. By going up another frame on the stack, the information
    becomes much more useful.

    In summary, the below change to lib/rwsem.c should be applied; the
    changes to kernel/rwsem.c could be applied if other kernel hackers agree
    with my proposal that down_read()/down_write() in the profile is not
    enough.

    [ akpm@linux-foundation.org: build fix ]

    Signed-off-by: Livio Soares
    Signed-off-by: Andrew Morton
    Signed-off-by: Ingo Molnar

    Livio Soares
     
  • Thanks to Dave Young for pointing out that I
    forgot to update the comment when I rewrote kobject_set_name.

    Cc: Dave Young
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

04 Dec, 2007

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/net-2.6: (27 commits)
    [INET]: Fix inet_diag dead-lock regression
    [NETNS]: Fix /proc/net breakage
    [TEXTSEARCH]: Do not allow zero length patterns in the textsearch infrastructure
    [NETFILTER]: fix forgotten module release in xt_CONNMARK and xt_CONNSECMARK
    [NETFILTER]: xt_TCPMSS: remove network triggerable WARN_ON
    [DECNET]: dn_nl_deladdr() almost always returns no error
    [IPV6]: Restore IPv6 when MTU is big enough
    [RXRPC]: Add missing select on CRYPTO
    mac80211: rate limit wep decrypt failed messages
    rfkill: fix double-mutex-locking
    mac80211: drop unencrypted frames if encryption is expected
    mac80211: Fix behavior of ieee80211_open and ieee80211_close
    ieee80211: fix unaligned access in ieee80211_copy_snap
    mac80211: free ifsta->extra_ie and clear IEEE80211_STA_PRIVACY_INVOKED
    SCTP: Fix build issues with SCTP AUTH.
    SCTP: Fix chunk acceptance when no authenticated chunks were listed.
    SCTP: Fix the supported extensions paramter
    SCTP: Fix SCTP-AUTH to correctly add HMACS paramter.
    SCTP: Fix the number of HB transmissions.
    [TCP] illinois: Incorrect beta usage
    ...

    Linus Torvalds
     

30 Nov, 2007

2 commits


29 Nov, 2007

1 commit


23 Nov, 2007

1 commit


15 Nov, 2007

1 commit

  • mac80211 has a reference to __bitmap_empty() via bitmap_empty(). In
    lib/bitmap.c this is flagged with an EXPORT_SYMBOL(), but this is
    ultimately ineffective due to bitmap.o being linked in lib-y, resulting in:

    ERROR: "__bitmap_empty" [net/mac80211/mac80211.ko] undefined!

    Moving bitmap.o to obj-y fixes this up.

    Signed-off-by: Paul Mundt
    Cc: "John W. Linville"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Mundt
     

08 Nov, 2007

1 commit

  • crypto/crc32.c:chksum_final() is computing the digest as
    *(__le32 *)out = ~cpu_to_le32(mctx->crc);
    so the low-level crc32c_le routines should just keep
    the crc in cpu order, otherwise it is getting swabbed
    one too many times on big-endian machines.

    Signed-off-by: Benny Halevy
    Signed-off-by: Herbert Xu

    Benny Halevy
     

06 Nov, 2007

1 commit

  • When a bitmap is empty bitmap_scnlistprintf() would leave the buffer
    uninitialized. Set it to an empty string in this case.

    I didn't see any in normal kernel callers hitting this, but some custom
    debug code of mine did.

    Signed-off-by: Andi Kleen
    Acked-by: Paul Jackson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andi Kleen
     

31 Oct, 2007

1 commit


26 Oct, 2007

1 commit

  • The __deprecated marker is quite useful in highlighting the remnants of
    old APIs that want removing.

    However, it is quite normal for one or more years to pass, before the
    (usually ancient, bitrotten) code in question is either updated or
    deleted.

    Thus, like __must_check, add a Kconfig option that permits the silencing
    of this compiler warning.

    This change mimics the ifdef-ery and Kconfig defaults of MUST_CHECK as
    closely as possible.

    Signed-off-by: Jeff Garzik
    Signed-off-by: Linus Torvalds

    Jeff Garzik
     

23 Oct, 2007

3 commits

  • * git://git.infradead.org/mtd-2.6:
    [MTD] [NOR] Fix deadlock in Intel chip driver caused by get_chip recursion
    [JFFS2] Fix return value from jffs2_write_end()
    [MTD] [OneNAND] Fix wrong free the static address in onenand_sim
    [MTD] [NAND] Replace -1 with -EBADMSG in nand error correction code
    [RSLIB] BUG() when passing illegal parameters to decode_rs8() or decode_rs16()
    [MTD] [NAND] treat any negative return value from correct() as an error
    [MTD] [NAND] nandsim: bugfix in initialization
    [MTD] Fix typo in Alauda config option help text.
    [MTD] [NAND] add s3c2440-specific read_buf/write_buf
    [MTD] [OneNAND] onenand-sim: fix kernel-doc and typos
    [JFFS2] Tidy up fix for ACL/permissions problem.

    Linus Torvalds
     
  • Add a Kconfig entry which will toggle some sanity checks on the sg
    entry and tables.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • Signed-off-by: Jens Axboe

    Jens Axboe
     

21 Oct, 2007

2 commits


20 Oct, 2007

8 commits

  • Spelling fix in lib/.

    Signed-off-by: Simon Arlott
    Signed-off-by: Adrian Bunk

    Simon Arlott
     
  • Replace an irrelevant include of bug.h with the more appropriate
    includes of slab.h and module.h.

    it's not as if the original inclusion is an error, it's simply not
    related to the contents of that source file, while the other two are.

    compile-tested on i386.

    Signed-off-by: Robert P. J. Day
    Signed-off-by: Adrian Bunk

    Robert P. J. Day
     
  • Fix the various misspellings of "system", controller", "interrupt" and
    "[un]necessary".

    Signed-off-by: Robert P. J. Day
    Signed-off-by: Adrian Bunk

    Robert P. J. Day
     
  • Begin infrastructure for kernel code samples in the samples/ directory.
    Add its Kconfig and Kbuild files.
    Source its Kconfig file in all arch/ Kconfigs.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Mathieu Desnoyers
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Desnoyers
     
  • Some of the per-cpu counters and thus their locks are accessed from IRQ
    contexts. This can cause a deadlock if it interrupts a cpu-offline thread
    which is transferring a dead-cpu's counts to the global counter.

    Add appropriate IRQ protection in the cpu-hotplug callback path.

    Signed-off-by: Gautham R Shenoy
    Cc: KAMEZAWA Hiroyuki
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Gautham R Shenoy
     
  • The task_struct->pid member is going to be deprecated, so start
    using the helpers (task_pid_nr/task_pid_vnr/task_pid_nr_ns) in
    the kernel.

    The first thing to start with is the pid, printed to dmesg - in
    this case we may safely use task_pid_nr(). Besides, printks produce
    more (much more) than a half of all the explicit pid usage.

    [akpm@linux-foundation.org: git-drm went and changed lots of stuff]
    Signed-off-by: Pavel Emelyanov
    Cc: Dave Airlie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Emelyanov
     
  • remove asm/bitops.h includes

    including asm/bitops directly may cause compile errors. don't include it
    and include linux/bitops instead. next patch will deny including asm header
    directly.

    Cc: Adrian Bunk
    Signed-off-by: Jiri Slaby
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     
  • Cause writes to cpuset "cpus" file to update cpus_allowed for member tasks:

    - collect batches of tasks under tasklist_lock and then call
    set_cpus_allowed() on them outside the lock (since this can sleep).

    - add a simple generic priority heap type to allow efficient collection
    of batches of tasks to be processed without duplicating or missing any
    tasks in subsequent batches.

    - make "cpus" file update a no-op if the mask hasn't changed

    - fix race between update_cpumask() and sched_setaffinity() by making
    sched_setaffinity() post-check that it's not running on any cpus outside
    cpuset_cpus_allowed().

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Paul Menage
    Cc: Paul Jackson
    Cc: David Rientjes
    Cc: Nick Piggin
    Cc: Peter Zijlstra
    Cc: Balbir Singh
    Cc: Cedric Le Goater
    Cc: "Eric W. Biederman"
    Cc: Serge Hallyn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Menage
     

19 Oct, 2007

1 commit

  • To be consistent with the use of attributes in the rest of the kernel
    replace all use of __attribute_pure__ with __pure and delete the definition
    of __attribute_pure__.

    Signed-off-by: Ralf Baechle
    Cc: Russell King
    Acked-by: Mauro Carvalho Chehab
    Cc: Bryan Wu
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ralf Baechle
     

18 Oct, 2007

1 commit

  • * 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block:
    [SCSI] Remove full sg table memset()
    [SCSI] ide-scsi: remove usage of sg_last()
    Fix loop terminating conditions in fill_sg().
    [BLOCK] Clear sg entry before filling in blk_rq_map_sg()
    IA64: iommu uses sg_next with an invalid sg element
    cciss: disable DMA refetch on Smart Array P600
    swiotlb: fix map_sg failure handling
    SPARC64: fix iommu sg chaining
    [SCSI] ide-scsi: use scsi_sg_count() instead of ->use_sg

    Linus Torvalds
     

17 Oct, 2007

12 commits

  • Be explicit about printing hex.

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

    Rene Herman
     
  • Negative shifts are not allowed in C (the result is undefined). Same thing
    with full-width shifts.

    It works on most platforms but not on the VAX with gcc 4.0.1 (it results in an
    "operand reserved" fault).

    Shifting by more than the width of the value on the left is also not
    allowed. I think the extra '>> 1' tacked on at the end in the original
    code was an attempt to work around that. Getting rid of that is an extra
    feature of this patch.

    Here's the chapter and verse, taken from the final draft of the C99
    standard ("6.5.7 Bitwise shift operators", paragraph 3):

    "The integer promotions are performed on each of the operands. The
    type of the result is that of the promoted left operand. If the
    value of the right operand is negative or is greater than or equal
    to the width of the promoted left operand, the behavior is
    undefined."

    Thank you to Jan-Benedict Glaw, Christoph Hellwig, Maciej Rozycki, Pekka
    Enberg, Andreas Schwab, and Christoph Lameter for review. Special thanks
    to Andreas for spotting that my fix only removed half the undefined
    behaviour.

    Signed-off-by: Peter Lund
    Christoph Lameter
    Cc: Christoph Hellwig
    Cc: "Maciej W. Rozycki"
    Cc: Pekka Enberg
    Cc: Andreas Schwab
    Cc: Nick Piggin
    Cc: WU Fengguang
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Lund
     
  • Various architectures may call bust_spinlocks() recursively; the function
    itself, however, doesn't appear to be meant to be called in this manner.
    Nevertheless, this doesn't appear to be a problem as long as
    bust_spinlocks(0) doesn't get called twice in a row (otherwise,
    unblank_screen() may enter the scheduler). However, at least on i386 die()
    has been capable of returning (and on other architectures this should
    really be that way, too) when notify_die() returns NOTIFY_STOP.

    Short of getting a reply to a respective query, this patch makes
    bust_spinlocks() increment/decrement oops_in_progress, and wake klogd only
    when the count drops back to zero.

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

    Jan Beulich
     
  • Hello, I fixed and tested a small bug in lib/sort.c file, heap sort
    function.

    The fix avoids unnecessary swap of contents when i is 0 (saves few loads
    and stores), which happens every time sort function is called. I felt the
    fix is worth bringing it to your attention given the importance and
    frequent use of the sort function.

    Acked-by: Matt Mackall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Subbaiah Venkata
     
  • Every file should include the headers containing the prototypes for its global
    functions (in this case ioremap_page_range()).

    Signed-off-by: Adrian Bunk
    Acked-by: Haavard Skinnemoen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • It would be nice if the argv_split library function could gracefully handle
    a NULL pointer in the argcp parameter, so as to allow functions using it
    that did not care about the value of argc to not have to declare a useless
    variable. This patch accomplishes that. Tested by me, with successful
    results.

    Signed-off-by: Neil Horman
    Acked-by: Jeremy Fitzhardinge
    Cc: Satyam Sharma
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Neil Horman
     
  • Slab constructors currently have a flags parameter that is never used. And
    the order of the arguments is opposite to other slab functions. The object
    pointer is placed before the kmem_cache pointer.

    Convert

    ctor(void *object, struct kmem_cache *s, unsigned long flags)

    to

    ctor(struct kmem_cache *s, void *object)

    throughout the kernel

    [akpm@linux-foundation.org: coupla fixes]
    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     
  • Given a set of objects, floating proportions aims to efficiently give the
    proportional 'activity' of a single item as compared to the whole set. Where
    'activity' is a measure of a temporal property of the items.

    It is efficient in that it need not inspect any other items of the set
    in order to provide the answer. It is not even needed to know how many
    other items there are.

    It has one parameter, and that is the period of 'time' over which the
    'activity' is measured.

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

    Peter Zijlstra
     
  • provide a way to tell lockdep about percpu_counters that are supposed to be
    used from irq safe contexts.

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

    Peter Zijlstra
     
  • alloc_percpu can fail, propagate that error.

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

    Peter Zijlstra
     
  • Provide an accurate version of percpu_counter_read.

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

    Peter Zijlstra
     
  • s/percpu_counter_sum/&_positive/

    Because its consitent with percpu_counter_read*

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

    Peter Zijlstra