01 Nov, 2011

40 commits

  • Standardize the style for compiler based printf format verification.
    Standardized the location of __printf too.

    Done via script and a little typing.

    $ grep -rPl --include=*.[ch] -w "__attribute__" * | \
    grep -vP "^(tools|scripts|include/linux/compiler-gcc.h)" | \
    xargs perl -n -i -e 'local $/; while (<>) { s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.+)\s*,\s*(.+)\s*\)\s*\)\s*\)/__printf($1, $2)/g ; print; }'

    [akpm@linux-foundation.org: revert arch bits]
    Signed-off-by: Joe Perches
    Cc: "Kirill A. Shutemov"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Currently log_prefix is testing that the first character of the log level
    and facility is less than '0' and greater than '9' (which is always
    false).

    Since the code being updated works because strtoul bombs out (endp isn't
    updated) and 0 is returned anyway just remove the check and don't change
    the behavior of the function.

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

    William Douglas
     
  • Currently log_prefix is testing that the first character of the log level
    and facility is less than '0' and greater than '9' (which is always
    false). It should be testing to see if the character less than '0' or
    greater than '9' instead. This patch makes that change.

    The code being changed worked because strtoul bombs out (endp isn't
    updated) and 0 is returned anyway.

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

    William Douglas
     
  • We are enabling some power features on medfield. To test suspend-2-RAM
    conveniently, we need turn on/off console_suspend_enabled frequently.

    Add a module parameter, so users could change it by:
    /sys/module/printk/parameters/console_suspend

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

    Yanmin Zhang
     
  • We are enabling some power features on medfield. To test suspend-2-RAM
    conveniently, we need turn on/off ignore_loglevel frequently without
    rebooting.

    Add a module parameter, so users can change it by:
    /sys/module/printk/parameters/ignore_loglevel

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

    Yanmin Zhang
     
  • Userspace needs to know the highest valid capability of the running
    kernel, which right now cannot reliably be retrieved from the header files
    only. The fact that this value cannot be determined properly right now
    creates various problems for libraries compiled on newer header files
    which are run on older kernels. They assume capabilities are available
    which actually aren't. libcap-ng is one example. And we ran into the
    same problem with systemd too.

    Now the capability is exported in /proc/sys/kernel/cap_last_cap.

    [akpm@linux-foundation.org: make cap_last_cap const, per Ulrich]
    Signed-off-by: Dan Ballard
    Cc: Randy Dunlap
    Cc: Ingo Molnar
    Cc: Lennart Poettering
    Cc: Kay Sievers
    Cc: Ulrich Drepper
    Cc: James Morris
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Ballard
     
  • Fix compilation warnings for CONFIG_SYSCTL=n:

    fixed compilation warnings in case of disabled CONFIG_SYSCTL
    kernel/watchdog.c:483:13: warning: `watchdog_enable_all_cpus' defined but not used
    kernel/watchdog.c:500:13: warning: `watchdog_disable_all_cpus' defined but not used

    these functions are static and are used only in sysctl handler, so move
    them inside #ifdef CONFIG_SYSCTL too

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

    Vasily Averin
     
  • Make stop_machine() safe to call early in boot, before SMP has been set
    up, by simply calling the callback function directly if there's only one
    CPU online.

    [ Fixes from AKPM:
    - add comment
    - local_irq_flags, not save_flags
    - also call hard_irq_disable() for systems which need it

    Tejun suggested using an explicit flag rather than just looking at
    the online cpu count. ]

    Cc: Tejun Heo
    Acked-by: Rusty Russell
    Cc: Peter Zijlstra
    Cc: H. Peter Anvin
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Acked-by: Tejun Heo
    Cc: Konrad Rzeszutek Wilk
    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeremy Fitzhardinge
     
  • Commit 6c536e4ce8e ("ad525x_dpot: add support for SPI parts") added
    support for the AD5161 through SPI, but the device supports both I2C and
    SPI (depending on the DIS pin), so add it to -i2c as well.

    Signed-off-by: Peter Korsgaard
    Acked-by: Mike Frysinger
    Acked-by: Michael Hennerich
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Korsgaard
     
  • Signed-off-by: Jonghwan Choi
    Cc: Donggeun Kim
    Cc: Kyungmin Park
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jonghwan Choi
     
  • The regulator API contains a range of features for stubbing itself out
    when not in use and for transparently restricting the actual effect of
    regulator API calls where they can't be supported on a particular system
    so that drivers don't need to individually implement this. Simplify the
    driver slightly by making use of this idiom.

    The only in tree user is ecovec24 which does not use the regulator API.

    Signed-off-by: Mark Brown
    Cc: Éric Piel
    Cc: Ilkka Koskinen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Brown
     
  • [ilkka.koskinen@nokia.com: fix arg to lis3->read()]
    Signed-off-by: Ilkka Koskinen
    Signed-off-by: Éric Piel
    Cc: Matthew Garrett
    Cc: Witold Pilat
    Cc: Lyall Pearce
    Cc: Malte Starostik
    Cc: Thadeu Lima de Souza Cascardo
    Cc: Christian Lamparter
    Subject: lis3-remove-the-references-to-the-global-variable-in-core-driver-fix
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Éric Piel
     
  • Change exported functions to use the device given as parameter
    instead of the global one.

    Signed-off-by: Ilkka Koskinen
    Signed-off-by: Éric Piel
    Cc: Matthew Garrett
    Cc: Witold Pilat
    Cc: Lyall Pearce
    Cc: Malte Starostik
    Cc: Thadeu Lima de Souza Cascardo
    Cc: Christian Lamparter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Éric Piel
     
  • Signed-off-by: Ilkka Koskinen
    Signed-off-by: Éric Piel
    Cc: Matthew Garrett
    Cc: Witold Pilat
    Cc: Lyall Pearce
    Cc: Malte Starostik
    Cc: Thadeu Lima de Souza Cascardo
    Cc: Christian Lamparter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Éric Piel
     
  • Signed-off-by: Ilkka Koskinen
    Signed-off-by: Éric Piel
    Cc: Matthew Garrett
    Cc: Witold Pilat
    Cc: Lyall Pearce
    Cc: Malte Starostik
    Cc: Thadeu Lima de Souza Cascardo
    Cc: Christian Lamparter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Éric Piel
     
  • Add axis correction for HP ProBook 6555b.

    Signed-off-by: Malte Starostik
    Signed-off-by: Éric Piel
    Cc: Matthew Garrett
    Cc: Witold Pilat
    Cc: Lyall Pearce
    Cc: Ilkka Koskinen
    Cc: Thadeu Lima de Souza Cascardo
    Cc: Christian Lamparter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Éric Piel
     
  • Add axis correction for HP EliteBook 8540w.

    Reported-by: Lyall Pearce
    Signed-off-by: Éric Piel
    Cc: Matthew Garrett
    Cc: Witold Pilat
    Cc: Malte Starostik
    Cc: Ilkka Koskinen
    Cc: Thadeu Lima de Souza Cascardo
    Cc: Christian Lamparter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Éric Piel
     
  • Add axis correction for HP EliteBook 2730p.

    Tested-by: Witold Pilat
    Signed-off-by: Éric Piel
    Cc: Matthew Garrett
    Cc: Lyall Pearce
    Cc: Malte Starostik
    Cc: Ilkka Koskinen
    Cc: Thadeu Lima de Souza Cascardo
    Cc: Christian Lamparter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Éric Piel
     
  • In the move of the lis3 driver, the hp_accel.c file got dropped from the
    MAINTAINER file. Make it explicit again that this file is tied to lis3
    again.

    Signed-off-by: Éric Piel
    Cc: Matthew Garrett
    Cc: Witold Pilat
    Cc: Lyall Pearce
    Cc: Malte Starostik
    Cc: Ilkka Koskinen
    Cc: Thadeu Lima de Souza Cascardo
    Cc: Christian Lamparter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Éric Piel
     
  • After an "unexpected" reboot, I found this Oops in my logs:

    divide error: 0000 [#1] PREEMPT SMP=20
    CPU 0=20
    Modules linked in: lis3lv02d hp_wmi input_polldev [...]
    Pid: 390, comm: modprobe Tainted: G C 2.6.39-rc7-wl+=20
    RIP: 0010:[] []
    lis3lv02d_poweron+0x4e/0x94 [lis3lv02d]
    RSP: 0018:ffff8801d6407cf8 EFLAGS: 00010246
    RAX: 0000000000000bb8 RBX: ffffffffa014e000 RCX: 0000000000000000
    RDX: 0000000000000000 RSI: ffffea00066e4708 RDI: ffff8801df002700
    RBP: ffff8801d6407d18 R08: ffffea00066c5a30 R09: ffffffff812498c9
    R10: ffff8801d7bfcea0 R11: ffff8801d7bfce10 R12: 0000000000000bb8
    R13: 00000000ffffffda R14: ffffffffa0154120 R15: ffffffffa0154030
    =46S: 00007fc0705db700(0000) GS:ffff8801dfa00000(0000) knlGS:0
    CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: 00007f33549174f0 CR3: 00000001d65c9000 CR4: 00000000000406f0
    Process modprobe (pid: 390, threadinfo ffff8801d6406000, task ffff8801d6b40=
    000)
    Stack:
    ffffffffa0154120 62ffffffa0154030 ffffffffa014e000 00000000ffffffea
    ffff8801d6407d58 ffffffffa014bcc1 0000000000000000 0000000000000048
    ffff8801d8bae800 00000000ffffffea 00000000ffffffda ffffffffa0154120
    Call Trace:
    [] lis3lv02d_init_device+0x1ce/0x496 [lis3lv02d]
    [] lis3lv02d_add+0x10f/0x17c [hp_accel]
    [] acpi_device_probe+0x49/0x117
    [...]
    Code: 3a 75 06 80 4d ef 50 eb 04 80 4d ef 40 0f b6 55 ef be 21
    00 00 00 48 89 df ff 53 18 44 8b 63 6c e8 3e fc ff ff 89 c1 44
    89 e0 99 f9 89 c7 e8 93 82 ef e0 48 83 7b 30 00 74 2d 45
    31 e4 80 7b=20
    RIP [] lis3lv02d_poweron+0x4e/0x94 [lis3lv02d]
    RSP

    >From my POV, it looks like the hardware is not working as expected
    and returns a bogus data rate. The driver doesn't check the result
    and directly uses it as some sort of divisor in some places:

    msleep(lis3->pwron_delay / lis3lv02d_get_odr());

    Under this circumstances, this could very well cause the
    "divide by zero" exception from above.

    For now, I fixed it the easiest and most obvious way:
    Check if the result is sane and if it isn't use a sane default
    instead. I went for "100" in the latter case, simply because
    /sys/devices/platform/lis3lv02d/rate returns it on a successful
    boot.

    Signed-off-by: Christian Lamparter
    Signed-off-by: Éric Piel
    Cc: Matthew Garrett
    Cc: Witold Pilat
    Cc: Lyall Pearce
    Cc: Malte Starostik
    Cc: Ilkka Koskinen
    Cc: Thadeu Lima de Souza Cascardo
    Cc: Christian Lamparter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Éric Piel
     
  • A straightforward looking use of idr for a device id.

    Signed-off-by: Jonathan Cameron
    Cc: Rusty Russell
    Cc: Tejun Heo
    Cc: Guenter Roeck
    Cc: James Bottomley
    Acked-by: Darrick J. Wong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jonathan Cameron
     
  • hwmon was using an idr with a NULL pointer, so convert to an
    ida which then allows use of Rusty's ida_simple_get.

    Signed-off-by: Jonathan Cameron
    Cc: Rusty Russell
    Cc: Tejun Heo
    Acked-by: Guenter Roeck
    Cc: James Bottomley
    Cc: David Airlie
    Cc: Thomas Hellstrom
    Cc: Evgeniy Polyakov
    Cc: Darrick J. Wong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jonathan Cameron
     
  • Added missing _secs in the help message of config DEFAULT_HUNG_TASK_TIMEOUT.

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

    Jiaju Zhang
     
  • Currently a statfs on a pipe's /proc//fd/ link returns -ENOSYS. Wire
    pipfs up so that the statfs succeeds.

    This is required by checkpoint-restart in the userspace to make it
    possible to distinguish pipes from fifos.

    When we dump information about task's open files we use the /proc/pid/fd
    directoy's symlinks and the fact that opening any of them gives us exactly
    the same dentry->inode pair as the original process has. Now if a task
    we're dumping has opened pipe and fifo we need to detect this and act
    accordingly. Knowing that an fd with type S_ISFIFO resides on a pipefs is
    the most precise way.

    Signed-off-by: Pavel Emelyanov
    Reviewed-by: Tejun Heo
    Acked-by: Serge Hallyn
    Signed-off-by: Cyrill Gorcunov
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Emelyanov
     
  • Signed-off-by: Michael Cree
    Reviewed-by: Matt Turner
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Cree
     
  • Somehow wiring up the accept4 syscall on Alpha was missed long ago.
    This commit rectifies that oversight.

    Signed-off-by: Michael Cree
    Reviewed-by: Matt Turner
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Cree
     
  • Avoid false sharing of the vm_stat array.

    This was found to adversely affect tmpfs I/O performance.

    Tests run on a 640 cpu UV system.

    With 120 threads doing parallel writes, each to different tmpfs mounts:
    No patch: ~300 MB/sec
    With vm_stat alignment: ~430 MB/sec

    Signed-off-by: Dimitri Sivanich
    Acked-by: Christoph Lameter
    Acked-by: Mel Gorman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dimitri Sivanich
     
  • A process spent 30 minutes exiting, just munlocking the pages of a large
    anonymous area that had been alternately mprotected into page-sized vmas:
    for every single page there's an anon_vma walk through all the other
    little vmas to find the right one.

    A general fix to that would be a lot more complicated (use prio_tree on
    anon_vma?), but there's one very simple thing we can do to speed up the
    common case: if a page to be munlocked is mapped only once, then it is our
    vma that it is mapped into, and there's no need whatever to walk through
    all the others.

    Okay, there is a very remote race in munlock_vma_pages_range(), if between
    its follow_page() and lock_page(), another process were to munlock the
    same page, then page reclaim remove it from our vma, then another process
    mlock it again. We would find it with page_mapcount 1, yet it's still
    mlocked in another process. But never mind, that's much less likely than
    the down_read_trylock() failure which munlocking already tolerates (in
    try_to_unmap_one()): in due course page reclaim will discover and move the
    page to unevictable instead.

    [akpm@linux-foundation.org: add comment]
    Signed-off-by: Hugh Dickins
    Cc: Michel Lespinasse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • There are three cases of update_mmu_cache() in the file, and the case in
    function collapse_huge_page() has a typo, namely the last parameter used,
    which is corrected based on the other two cases.

    Due to the define of update_mmu_cache by X86, the only arch that
    implements THP currently, the change here has no really crystal point, but
    one or two minutes of efforts could be saved for those archs that are
    likely to support THP in future.

    Signed-off-by: Hillf Danton
    Cc: Johannes Weiner
    Reviewed-by: Andrea Arcangeli
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hillf Danton
     
  • The THP copy-on-write handler falls back to regular-sized pages for a huge
    page replacement upon allocation failure or if THP has been individually
    disabled in the target VMA. The loop responsible for copying page-sized
    chunks accidentally uses multiples of PAGE_SHIFT instead of PAGE_SIZE as
    the virtual address arg for copy_user_highpage().

    Signed-off-by: Hillf Danton
    Acked-by: Johannes Weiner
    Reviewed-by: Andrea Arcangeli
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hillf Danton
     
  • MCL_FUTURE does not move pages between lru list and draining the LRU per
    cpu pagevecs is a nasty activity. Avoid doing it unecessarily.

    Signed-off-by: Christoph Lameter
    Cc: David Rientjes
    Reviewed-by: Minchan Kim
    Acked-by: KOSAKI Motohiro
    Cc: Mel Gorman
    Acked-by: Johannes Weiner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     
  • If compaction can proceed, shrink_zones() stops doing any work but its
    callers still call shrink_slab() which raises the priority and potentially
    sleeps. This is unnecessary and wasteful so this patch aborts direct
    reclaim/compaction entirely if compaction can proceed.

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

    Mel Gorman
     
  • When suffering from memory fragmentation due to unfreeable pages, THP page
    faults will repeatedly try to compact memory. Due to the unfreeable
    pages, compaction fails.

    Needless to say, at that point page reclaim also fails to create free
    contiguous 2MB areas. However, that doesn't stop the current code from
    trying, over and over again, and freeing a minimum of 4MB (2UL <<
    sc->order pages) at every single invocation.

    This resulted in my 12GB system having 2-3GB free memory, a corresponding
    amount of used swap and very sluggish response times.

    This can be avoided by having the direct reclaim code not reclaim from
    zones that already have plenty of free memory available for compaction.

    If compaction still fails due to unmovable memory, doing additional
    reclaim will only hurt the system, not help.

    [jweiner@redhat.com: change comment to explain the order check]
    Signed-off-by: Rik van Riel
    Acked-by: Johannes Weiner
    Acked-by: Mel Gorman
    Cc: Andrea Arcangeli
    Reviewed-by: Minchan Kim
    Signed-off-by: Johannes Weiner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rik van Riel
     
  • When a race between putback_lru_page() and shmem_lock with lock=0 happens,
    progrom execution order is as follows, but clear_bit in processor #1 could
    be reordered right before spin_unlock of processor #1. Then, the page
    would be stranded on the unevictable list.

    spin_lock
    SetPageLRU
    spin_unlock
    clear_bit(AS_UNEVICTABLE)
    spin_lock
    if PageLRU()
    if !test_bit(AS_UNEVICTABLE)
    move evictable list
    smp_mb
    if !test_bit(AS_UNEVICTABLE)
    move evictable list
    spin_unlock

    But, pagevec_lookup() in scan_mapping_unevictable_pages() has
    rcu_read_[un]lock() so it could protect reordering before reaching
    test_bit(AS_UNEVICTABLE) on processor #1 so this problem never happens.
    But it's a unexpected side effect and we should solve this problem
    properly.

    This patch adds a barrier after mapping_clear_unevictable.

    I didn't meet this problem but just found during review.

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

    Minchan Kim
     
  • Quiet the sparse noise:

    warning: symbol 'khugepaged_scan' was not declared. Should it be static?
    warning: context imbalance in 'khugepaged_scan_mm_slot' - unexpected unlock

    Signed-off-by: H Hartley Sweeten
    Cc: Andrea Arcangeli
    Cc: Rik van Riel
    Cc: Johannes Weiner
    Cc: KAMEZAWA Hiroyuki
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    H Hartley Sweeten
     
  • Quiet the spares noise:

    warning: symbol 'default_policy' was not declared. Should it be static?

    Signed-off-by: H Hartley Sweeten
    Cc: KOSAKI Motohiro
    Cc: Stephen Wilson
    Cc: Andrea Arcangeli
    Cc: Mel Gorman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    H Hartley Sweeten
     
  • Quiet the following sparse noise:

    warning: symbol 'swap_token_memcg' was not declared. Should it be static?

    Signed-off-by: H Hartley Sweeten
    Cc: Rik van Riel
    Cc: KOSAKI Motohiro
    Cc: KAMEZAWA Hiroyuki
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    H Hartley Sweeten
     
  • Quiet the following sparse noise in this file:

    warning: symbol 'memblock_overlaps_region' was not declared. Should it be static?

    Signed-off-by: H Hartley Sweeten
    Cc: Yinghai Lu
    Cc: "H. Peter Anvin"
    Cc: Benjamin Herrenschmidt
    Cc: Tomi Valkeinen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    H Hartley Sweeten
     
  • At one point, anonymous pages were supposed to go on the unevictable list
    when no swap space was configured, and the idea was to manually rescue
    those pages after adding swap and making them evictable again. But
    nowadays, swap-backed pages on the anon LRU list are not scanned without
    available swap space anyway, so there is no point in moving them to a
    separate list anymore.

    The manual rescue could also be used in case pages were stranded on the
    unevictable list due to race conditions. But the code has been around for
    a while now and newly discovered bugs should be properly reported and
    dealt with instead of relying on such a manual fixup.

    In addition to the lack of a usecase, the sysfs interface to rescue pages
    from a specific NUMA node has been broken since its introduction, so it's
    unlikely that anybody ever relied on that.

    This patch removes the functionality behind the sysctl and the
    node-interface and emits a one-time warning when somebody tries to access
    either of them.

    Signed-off-by: Johannes Weiner
    Reported-by: Kautuk Consul
    Reviewed-by: Minchan Kim
    Acked-by: KAMEZAWA Hiroyuki
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     
  • write_scan_unevictable_node() checks the value req returned by
    strict_strtoul() and returns 1 if req is 0.

    However, when strict_strtoul() returns 0, it means successful conversion
    of buf to unsigned long.

    Due to this, the function was not proceeding to scan the zones for
    unevictable pages even though we write a valid value to the
    scan_unevictable_pages sys file.

    Change this check slightly to check for invalid value in buf as well as 0
    value stored in res after successful conversion via strict_strtoul. In
    both cases, we do not perform the scanning of this node's zones.

    Signed-off-by: Kautuk Consul
    Reviewed-by: KAMEZAWA Hiroyuki
    Cc: Johannes Weiner
    Cc: Lee Schermerhorn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kautuk Consul