11 Jan, 2012

40 commits

  • Factor out some boilerplate code for i2c driver registration
    into module_i2c_driver.

    Signed-off-by: Axel Lin
    Cc: Haojian Zhuang
    Cc: Mark Brown
    Cc: Richard Purdie
    Cc: Michael Hennerich
    Cc: Mike Rapoport
    Cc: Guennadi Liakhovetski
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Axel Lin
     
  • Factor out some boilerplate code for platform driver registration into
    module_platform_driver.

    Signed-off-by: Axel Lin
    Acked-by: Haojian Zhuang [led-88pm860x.c]
    Acked-by: Mark Brown
    Cc: Richard Purdie
    Cc: Michael Hennerich
    Cc: Mike Rapoport
    Cc: Guennadi Liakhovetski
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Axel Lin
     
  • Should be no functional changes, mainly a reorganisation to support future
    work.

    [akpm@linux-foundation.org: fix CONFIG_PM=n build]
    Signed-off-by: Mark Brown
    Cc: Richard Purdie
    Cc: Florian Tobias Schandinat
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Brown
     
  • Saves some error handling code and eliminates a class of leaks.

    Signed-off-by: Mark Brown
    Cc: Richard Purdie
    Cc: Florian Tobias Schandinat
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Brown
     
  • The usage of simple_strtoul() or strict_strtoul() is not preferred. Thus,
    kstrtoul should be used.

    This patch also fixes checkpatch error as follows:
    ERROR: space required after that ',' (ctx:VxV)

    Signed-off-by: Jingoo Han
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • module.h is included twice.

    Signed-off-by: Jingoo Han
    Acked-by: H Hartley Sweeten
    Cc: Ryan Mallon
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     
  • This patch supports regulator power control in the driver. Current ld9040
    driver was controlled power on/off sequence by callback function in the
    board file. But, by doing this, there's no need to register lcd power
    on/off callback function in the board file.

    Signed-off-by: Donghwa Lee
    Signed-off-by: Kyungmin Park
    Signed-off-by: Inki Dae
    Cc: Richard Purdie
    Cc: Florian Tobias Schandinat
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Donghwa Lee
     
  • Convert the drivers in drivers/video/backlight/* to use the
    module_platform_driver() macro which makes the code smaller and a bit
    simpler.

    Signed-off-by: Axel Lin
    Acked-by: Haojian Zhuang
    Acked-by: H Hartley Sweeten [ep93xx_bl.c]
    Cc: Mike Rapoport
    Cc: Richard Purdie
    Acked-by: Michael Hennerich
    Acked-by: Mark Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Axel Lin
     
  • Support for the Avionic Design Xanthos backlight device got added in
    commit 3b96ea9ef8 ("backlight: Add support for the Avionic Design Xanthos
    backlight device."). That support depends on ARCH_PXA_ADX. The code that
    should have provided that Kconfig symbol never got submitted. It has
    never been possible to even build this driver. Remove it.

    Signed-off-by: Paul Bolle
    Acked-by: Thierry Reding
    Cc: Richard Purdie
    Cc: Wim Van Sebroeck
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Bolle
     
  • As devfreq is merged at mainline. Also update the maintainer entry.

    Signed-off-by: Kyungmin Park
    Cc: Kevin Hilman
    Cc: MyungJoo Ham
    Acked-by: Rafael J. Wysocki
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kyungmin Park
     
  • commit ca632f55669 ("spi: reorganize drivers") renamed the files, update
    the F: patterns.

    Signed-off-by: Joe Perches
    Acked-by: Grant Likely
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • commit 0c6967b5a0 ("serial:blackfin: rename Blackfin serial driver to
    bfin_uart.c") renamed the file, update the pattern.

    Signed-off-by: Joe Perches
    Acked-by: Sonic Zhang
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • commit 4860c73804c ("staging: Move media drivers to staging/media") moved
    the files, update the F: patterns.

    Signed-off-by: Joe Perches
    Acked-by: Mauro Carvalho Chehab
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • commit 61cf45d0199 ("encrypted-keys: create encrypted-keys directory")
    moved the files, update the patterns.

    Signed-off-by: Joe Perches
    Cc: Mimi Zohar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • commit 1fe003fd424 ("greth: Move the Aeroflex Gaisler driver") moved the
    files, update the patterns.

    Signed-off-by: Joe Perches
    Cc: Kristoffer Glembo
    Cc: Jeff Kirsher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • commit a88394cfb58 ("ewrk3/tulip: Move the DEC - Tulip drivers") moved the
    files, update the patterns.

    Signed-off-by: Joe Perches
    Acked-by: Grant Grundler
    Cc: Jeff Kirsher
    Cc: Tobias Ringstrom
    Cc: Grant Grundler
    Cc: David Davies
    Cc: David Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • commit 38576af1f8c ("mmc: sdhci: make sdhci-of device drivers self
    registered") moved the files around. Update the patterns.

    Signed-off-by: Joe Perches
    Cc: Shawn Guo
    Cc: Chris Ball
    Acked-by: Anton Vorontsov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • commit 8959e74399c ("mfd: Delete ab3550 driver") removed the driver,
    update the patterns.

    Signed-off-by: Joe Perches
    Acked-by: Linus Walleij
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Commit f8fc729870ee ("[media] marvell-cam: Move cafe-ccic into its own
    directory") moved the files, update the pattern.

    Signed-off-by: Joe Perches
    Cc: Jonathan Corbet
    Acked-by: Mauro Carvalho Chehab
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Commit c103de240439d ("gpio: reorganize drivers") renamed the file, update
    the pattern.

    Signed-off-by: Joe Perches
    Cc: Grant Likely
    Cc: Michael Buesch
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Commit c103de240439df ("gpio: reorganize drivers") renamed the files,
    update the patterns.

    Signed-off-by: Joe Perches
    Acked-by: Grant Likely
    Acked-by: Michael Hennerich
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Track renames and missing or deleted files.

    Signed-off-by: Joe Perches
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • I happen to have had a commit to various network drivers since the big
    renaming/reorg which happened to drivers/net recently. This means that I
    now appear to be in the top few commit signers (by %age) for many of them
    so am getting sent all sorts of stuff and people who are involved with the
    driver are not. e.g. (to pick one at random):

    $ ./scripts/get_maintainer.pl -f drivers/net/ethernet/nvidia/forcedeth.c
    "David S. Miller" (commit_signer:5/7=71%)
    Ian Campbell (commit_signer:2/7=29%)
    Eric Dumazet (commit_signer:1/7=14%)
    Jeff Kirsher (commit_signer:1/7=14%)
    Jiri Pirko (commit_signer:1/7=14%)
    netdev@vger.kernel.org (open list:NETWORKING DRIVERS)
    linux-kernel@vger.kernel.org (open list)

    With the following patch the renames are followed and the result appears
    much more sensible:

    $ ./scripts/get_maintainer.pl -f drivers/net/ethernet/nvidia/forcedeth.c
    "David S. Miller" (commit_signer:31/34=91%)
    Joe Perches (commit_signer:11/34=32%)
    Szymon Janc (commit_signer:5/34=15%)
    Jiri Pirko (commit_signer:3/34=9%)
    Paul (commit_signer:2/34=6%)
    netdev@vger.kernel.org (open list:NETWORKING DRIVERS)
    linux-kernel@vger.kernel.org (open list)

    Signed-off-by: Ian Campbell
    Acked-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Campbell
     
  • vmap_area->private is void* but we don't use the field for various purpose
    but use only for vm_struct. So change it to a vm_struct* with naming to
    improve for readability and type checking.

    Signed-off-by: Minchan Kim
    Acked-by: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Minchan Kim
     
  • It is not the tag page but the cursor page that we should process, and it
    looks a typo.

    Signed-off-by: Hillf Danton
    Cc: Michal Hocko
    Cc: KAMEZAWA Hiroyuki
    Cc: Andrea Arcangeli
    Cc: David Rientjes
    Cc: Hugh Dickins
    Acked-by: KOSAKI Motohiro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hillf Danton
     
  • Lumpy reclaim does well to stop at a PageAnon when there's no swap, but
    better is to stop at any PageSwapBacked, which includes shmem/tmpfs too.

    Signed-off-by: Hugh Dickins
    Reviewed-by: KOSAKI Motohiro
    Reviewed-by: Minchan Kim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • lru_to_page is not used in mm/migrate.c.

    Signed-off-by: Wang Sheng-Hui
    Acked-by: Mel Gorman
    Acked-by: Kyungmin Park
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wang Sheng-Hui
     
  • If we have to hand back the newly allocated huge page to page allocator,
    for any reason, the changed counter should be recovered.

    This affects only s390 at present.

    Signed-off-by: Hillf Danton
    Reviewed-by: Michal Hocko
    Acked-by: KAMEZAWA Hiroyuki
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hillf Danton
     
  • mempool modifies gfp_mask so that the backing allocator doesn't try too
    hard or trigger warning message when there's pool to fall back on. In
    addition, for the first try, it removes __GFP_WAIT and IO, so that it
    doesn't trigger reclaim or wait when allocation can be fulfilled from
    pool; however, when that allocation fails and pool is empty too, it waits
    for the pool to be replenished before retrying.

    Allocation which could have succeeded after a bit of reclaim has to wait
    on the reserved items and it's not like mempool doesn't retry with
    __GFP_WAIT and IO. It just does that *after* someone returns an element,
    pointlessly delaying things.

    Fix it by retrying immediately if the first round of allocation attempts
    w/o __GFP_WAIT and IO fails.

    [akpm@linux-foundation.org: shorten the lock hold time]
    Signed-off-by: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tejun Heo
     
  • mempool_destroy() is a thin wrapper around free_pool(). The only thing it
    adds is BUG_ON(pool->curr_nr != pool->min_nr). The intention seems to be
    to enforce that all allocated elements are freed; however, the BUG_ON()
    can't achieve that (it doesn't know anything about objects above min_nr)
    and incorrect as mempool_resize() is allowed to leave the pool extended
    but not filled. Furthermore, panicking is way worse than any memory leak
    and there are better debug tools to track memory leaks.

    Drop the BUG_ON() from mempool_destory() and as that leaves the function
    identical to free_pool(), replace it.

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

    Tejun Heo
     
  • mempool_alloc/free() use undocumented smp_mb()'s. The code is slightly
    broken and misleading.

    The lockless part is in mempool_free(). It wants to determine whether the
    item being freed needs to be returned to the pool or backing allocator
    without grabbing pool->lock. Two things need to be guaranteed for correct
    operation.

    1. pool->curr_nr + #allocated should never dip below pool->min_nr.
    2. Waiters shouldn't be left dangling.

    For #1, The only necessary condition is that curr_nr visible at free is
    from after the allocation of the element being freed (details in the
    comment). For most cases, this is true without any barrier but there can
    be fringe cases where the allocated pointer is passed to the freeing task
    without going through memory barriers. To cover this case, wmb is
    necessary before returning from allocation and rmb is necessary before
    reading curr_nr. IOW,

    ALLOCATING TASK FREEING TASK

    update pool state after alloc;
    wmb();
    pass pointer to freeing task;
    read pointer;
    rmb();
    read pool state to free;

    The current code doesn't have wmb after pool update during allocation and
    may theoretically, on machines where unlock doesn't behave as full wmb,
    lead to pool depletion and deadlock. smp_wmb() needs to be added after
    successful allocation from reserved elements and smp_mb() in
    mempool_free() can be replaced with smp_rmb().

    For #2, the waiter needs to add itself to waitqueue and then check the
    wait condition and the waker needs to update the wait condition and then
    wake up. Because waitqueue operations always go through full spinlock
    synchronization, there is no need for extra memory barriers.

    Furthermore, mempool_alloc() is already holding pool->lock when it decides
    that it needs to wait. There is no reason to do unlock - add waitqueue -
    test condition again. It can simply add itself to waitqueue while holding
    pool->lock and then unlock and sleep.

    This patch adds smp_wmb() after successful allocation from reserved pool,
    replaces smp_mb() in mempool_free() with smp_rmb() and extend pool->lock
    over waitqueue addition. More importantly, it explains what memory
    barriers do and how the lockless testing is correct.

    -v2: Oleg pointed out that unlock doesn't imply wmb. Added explicit
    smp_wmb() after successful allocation from reserved pool and
    updated comments accordingly.

    Signed-off-by: Tejun Heo
    Cc: Oleg Nesterov
    Cc: "Paul E. McKenney"
    Cc: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tejun Heo
     
  • migration_entry_wait() can also be called from hugetlb_fault() now.
    Remove the incorrect comment.

    Signed-off-by: Wang Sheng-Hui
    Acked-by: Minchan Kim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wang Sheng-Hui
     
  • mpol_equal() logically returns a boolean. Use a bool type to slightly
    improve readability.

    Signed-off-by: KOSAKI Motohiro
    Cc: Stephen Wilson
    Acked-by: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KOSAKI Motohiro
     
  • The computation for pgoff is incorrect, at least with

    (vma->vm_pgoff >> PAGE_SHIFT)

    involved. It is fixed with the available method if HPAGE_SIZE is
    concerned in page cache lookup.

    [akpm@linux-foundation.org: use vma_hugecache_offset() directly, per Michal]
    Signed-off-by: Hillf Danton
    Cc: Mel Gorman
    Cc: Michal Hocko
    Reviewed-by: KAMEZAWA Hiroyuki
    Cc: Andrea Arcangeli
    Cc: David Rientjes
    Reviewed-by: Michal Hocko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hillf Danton
     
  • It's pointless to continue reclaiming when we have no swap space and lots
    of anon pages in the inactive list.

    Without this patch, it is possible when swap is disabled to continue
    trying to reclaim when there are only anonymous pages in the system even
    though that will not make any progress.

    Signed-off-by: Minchan Kim
    Cc: KOSAKI Motohiro
    Acked-by: Mel Gorman
    Reviewed-by: Rik van Riel
    Cc: Johannes Weiner
    Cc: Andrea Arcangeli
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Minchan Kim
     
  • The loop that frees pages to the page allocator while bootstrapping tries
    to free higher-order blocks only when the starting address is aligned to
    that block size. Otherwise it will free all pages on that node
    one-by-one.

    Change it to free individual pages up to the first aligned block and then
    try higher-order frees from there.

    Signed-off-by: Johannes Weiner
    Cc: Uwe Kleine-König
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     
  • The area node_bootmem_map represents is aligned to BITS_PER_LONG, and all
    bits in any aligned word of that map valid. When the represented area
    extends beyond the end of the node, the non-existant pages will be marked
    as reserved.

    As a result, when freeing a page block, doing an explicit range check for
    whether that block is within the node's range is redundant as the bitmap
    is consulted anyway to see whether all pages in the block are unreserved.

    Signed-off-by: Johannes Weiner
    Cc: Uwe Kleine-König
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     
  • __free_pages_bootmem() used to special-case higher-order frees to save
    individual page checking with free_pages_bulk().

    Nowadays, both zero order and non-zero order frees use free_pages(), which
    checks each individual page anyway, and so there is little point in making
    the distinction anymore. The higher-order loop will work just fine for
    zero order pages.

    Signed-off-by: Johannes Weiner
    Cc: Uwe Kleine-König
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     
  • oom_score_adj is used for guarding processes from OOM-Killer. One of
    problem is that it's inherited at fork(). When a daemon set oom_score_adj
    and make children, it's hard to know where the value is set.

    This patch adds some tracepoints useful for debugging. This patch adds
    3 trace points.
    - creating new task
    - renaming a task (exec)
    - set oom_score_adj

    To debug, users need to enable some trace pointer. Maybe filtering is useful as

    # EVENT=/sys/kernel/debug/tracing/events/task/
    # echo "oom_score_adj != 0" > $EVENT/task_newtask/filter
    # echo "oom_score_adj != 0" > $EVENT/task_rename/filter
    # echo 1 > $EVENT/enable
    # EVENT=/sys/kernel/debug/tracing/events/oom/
    # echo 1 > $EVENT/enable

    output will be like this.
    # grep oom /sys/kernel/debug/tracing/trace
    bash-7699 [007] d..3 5140.744510: oom_score_adj_update: pid=7699 comm=bash oom_score_adj=-1000
    bash-7699 [007] ...1 5151.818022: task_newtask: pid=7729 comm=bash clone_flags=1200011 oom_score_adj=-1000
    ls-7729 [003] ...2 5151.818504: task_rename: pid=7729 oldcomm=bash newcomm=ls oom_score_adj=-1000
    bash-7699 [002] ...1 5175.701468: task_newtask: pid=7730 comm=bash clone_flags=1200011 oom_score_adj=-1000
    grep-7730 [007] ...2 5175.701993: task_rename: pid=7730 oldcomm=bash newcomm=grep oom_score_adj=-1000

    Signed-off-by: KAMEZAWA Hiroyuki
    Cc: KOSAKI Motohiro
    Acked-by: David Rientjes
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • commit 297c5eee37 ("mm: make the vma list be doubly linked") added the
    vm_prev member to vm_area_struct. We can simplify find_vma_prev() by
    using it. Also, this change helps to improve page fault performance
    because it has stronger locality of reference.

    Signed-off-by: KOSAKI Motohiro
    Reviewed-by: KAMEZAWA Hiroyuki
    Cc: Hugh Dickins
    Cc: Peter Zijlstra
    Cc: Shaohua Li
    Cc: Michal Hocko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KOSAKI Motohiro