Skip to content
  1. Nov 17, 2012
    • Mel Gorman's avatar
      mm: revert "mm: vmscan: scale number of pages reclaimed by reclaim/compaction based on failures" · 96710098
      Mel Gorman authored
      Jiri Slaby reported the following:
      
      	(It's an effective revert of "mm: vmscan: scale number of pages
      	reclaimed by reclaim/compaction based on failures".) Given kswapd
      	had hours of runtime in ps/top output yesterday in the morning
      	and after the revert it's now 2 minutes in sum for the last 24h,
      	I would say, it's gone.
      
      The intention of the patch in question was to compensate for the loss of
      lumpy reclaim.  Part of the reason lumpy reclaim worked is because it
      aggressively reclaimed pages and this patch was meant to be a sane
      compromise.
      
      When compaction fails, it gets deferred and both compaction and
      reclaim/compaction is deferred avoid excessive reclaim.  However, since
      commit c6543459 ("mm: remove __GFP_NO_KSWAPD"), kswapd is woken up
      each time and continues reclaiming which was not taken into account when
      the patch was developed.
      
      Attempts to address the problem ended up just changing the shape of the
      problem instead of fixing it.  The release window gets closer and while
      a THP allocation failing is not a major problem, kswapd chewing up a lot
      of CPU is.
      
      This patch reverts commit 83fde0f2
      
       ("mm: vmscan: scale number of
      pages reclaimed by reclaim/compaction based on failures") and will be
      revisited in the future.
      
      Signed-off-by: default avatarMel Gorman <mgorman@suse.de>
      Cc: Zdenek Kabelac <zkabelac@redhat.com>
      Tested-by: default avatarValdis Kletnieks <Valdis.Kletnieks@vt.edu>
      Cc: Jiri Slaby <jirislaby@gmail.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Johannes Hirte <johannes.hirte@fem.tu-ilmenau.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      96710098
    • Randy Dunlap's avatar
      rapidio: fix kernel-doc warnings · 2ca3cb50
      Randy Dunlap authored
      
      
      Fix rapidio kernel-doc warnings:
      
        Warning(drivers/rapidio/rio.c:415): No description found for parameter 'local'
        Warning(drivers/rapidio/rio.c:415): Excess function parameter 'lstart' description in 'rio_map_inb_region'
        Warning(include/linux/rio.h:290): No description found for parameter 'switches'
        Warning(include/linux/rio.h:290): No description found for parameter 'destid_table'
      
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Matt Porter <mporter@kernel.crashing.org>
      Acked-by: default avatarAlexandre Bounine <alexandre.bounine@idt.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2ca3cb50
    • Xiaotian Feng's avatar
      swapfile: fix name leak in swapoff · f58b59c1
      Xiaotian Feng authored
      There's a name leak introduced by commit 91a27b2a
      
       ("vfs: define
      struct filename and have getname() return it").  Add the missing
      putname.
      
      [akpm@linux-foundation.org: cleanup]
      Signed-off-by: default avatarXiaotian Feng <dannyfeng@tencent.com>
      Reviewed-by: default avatarJeff Layton <jlayton@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f58b59c1
    • Hugh Dickins's avatar
      memcg: fix hotplugged memory zone oops · bea8c150
      Hugh Dickins authored
      
      
      When MEMCG is configured on (even when it's disabled by boot option),
      when adding or removing a page to/from its lru list, the zone pointer
      used for stats updates is nowadays taken from the struct lruvec.  (On
      many configurations, calculating zone from page is slower.)
      
      But we have no code to update all the lruvecs (per zone, per memcg) when
      a memory node is hotadded.  Here's an extract from the oops which
      results when running numactl to bind a program to a newly onlined node:
      
        BUG: unable to handle kernel NULL pointer dereference at 0000000000000f60
        IP:  __mod_zone_page_state+0x9/0x60
        Pid: 1219, comm: numactl Not tainted 3.6.0-rc5+ #180 Bochs Bochs
        Process numactl (pid: 1219, threadinfo ffff880039abc000, task ffff8800383c4ce0)
        Call Trace:
          __pagevec_lru_add_fn+0xdf/0x140
          pagevec_lru_move_fn+0xb1/0x100
          __pagevec_lru_add+0x1c/0x30
          lru_add_drain_cpu+0xa3/0x130
          lru_add_drain+0x2f/0x40
         ...
      
      The natural solution might be to use a memcg callback whenever memory is
      hotadded; but that solution has not been scoped out, and it happens that
      we do have an easy location at which to update lruvec->zone.  The lruvec
      pointer is discovered either by mem_cgroup_zone_lruvec() or by
      mem_cgroup_page_lruvec(), and both of those do know the right zone.
      
      So check and set lruvec->zone in those; and remove the inadequate
      attempt to set lruvec->zone from lruvec_init(), which is called before
      NODE_DATA(node) has been allocated in such cases.
      
      Ah, there was one exceptionr.  For no particularly good reason,
      mem_cgroup_force_empty_list() has its own code for deciding lruvec.
      Change it to use the standard mem_cgroup_zone_lruvec() and
      mem_cgroup_get_lru_size() too.  In fact it was already safe against such
      an oops (the lru lists in danger could only be empty), but we're better
      proofed against future changes this way.
      
      I've marked this for stable (3.6) since we introduced the problem in 3.5
      (now closed to stable); but I have no idea if this is the only fix
      needed to get memory hotadd working with memcg in 3.6, and received no
      answer when I enquired twice before.
      
      Reported-by: default avatarTang Chen <tangchen@cn.fujitsu.com>
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Acked-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
      Cc: Wen Congyang <wency@cn.fujitsu.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      bea8c150
    • David Rientjes's avatar
      mips, arc: fix build failure · 18f69427
      David Rientjes authored
      
      
      Using a cross-compiler to fix another issue, the following build error
      occurred for mips defconfig:
      
        arch/mips/fw/arc/misc.c: In function 'ArcHalt':
        arch/mips/fw/arc/misc.c:25:2: error: implicit declaration of function 'local_irq_disable'
      
      Fix it up by including irqflags.h.
      
      Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      18f69427
    • Michal Hocko's avatar
      memcg: oom: fix totalpages calculation for memory.swappiness==0 · 9a5a8f19
      Michal Hocko authored
      oom_badness() takes a totalpages argument which says how many pages are
      available and it uses it as a base for the score calculation.  The value
      is calculated by mem_cgroup_get_limit which considers both limit and
      total_swap_pages (resp.  memsw portion of it).
      
      This is usually correct but since fe35004f
      
       ("mm: avoid swapping out
      with swappiness==0") we do not swap when swappiness is 0 which means
      that we cannot really use up all the totalpages pages.  This in turn
      confuses oom score calculation if the memcg limit is much smaller than
      the available swap because the used memory (capped by the limit) is
      negligible comparing to totalpages so the resulting score is too small
      if adj!=0 (typically task with CAP_SYS_ADMIN or non zero oom_score_adj).
      A wrong process might be selected as result.
      
      The problem can be worked around by checking mem_cgroup_swappiness==0
      and not considering swap at all in such a case.
      
      Signed-off-by: default avatarMichal Hocko <mhocko@suse.cz>
      Acked-by: default avatarDavid Rientjes <rientjes@google.com>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Acked-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Acked-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9a5a8f19
    • David Rientjes's avatar
      mm: fix build warning for uninitialized value · 1756954c
      David Rientjes authored
      
      
      do_wp_page() sets mmun_called if mmun_start and mmun_end were
      initialized and, if so, may call mmu_notifier_invalidate_range_end()
      with these values.  This doesn't prevent gcc from emitting a build
      warning though:
      
        mm/memory.c: In function `do_wp_page':
        mm/memory.c:2530: warning: `mmun_start' may be used uninitialized in this function
        mm/memory.c:2531: warning: `mmun_end' may be used uninitialized in this function
      
      It's much easier to initialize the variables to impossible values and do
      a simple comparison to determine if they were initialized to remove the
      bool entirely.
      
      Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1756954c
    • Michel Lespinasse's avatar
      mm: add anon_vma_lock to validate_mm() · 63c3b902
      Michel Lespinasse authored
      
      
      Iterating over the vma->anon_vma_chain without anon_vma_lock may cause
      NULL ptr deref in anon_vma_interval_tree_verify(), because the node in the
      chain might have been removed.
      
        BUG: unable to handle kernel paging request at fffffffffffffff0
        IP: [<ffffffff8122c29c>] anon_vma_interval_tree_verify+0xc/0xa0
        PGD 4e28067 PUD 4e29067 PMD 0
        Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
        CPU 0
        Pid: 9050, comm: trinity-child64 Tainted: G        W    3.7.0-rc2-next-20121025-sasha-00001-g673f98e-dirty #77
        RIP: 0010: anon_vma_interval_tree_verify+0xc/0xa0
        Process trinity-child64 (pid: 9050, threadinfo ffff880045f80000, task ffff880048eb0000)
        Call Trace:
          validate_mm+0x58/0x1e0
          vma_adjust+0x635/0x6b0
          __split_vma.isra.22+0x161/0x220
          split_vma+0x24/0x30
          sys_madvise+0x5da/0x7b0
          tracesys+0xe1/0xe6
        RIP  anon_vma_interval_tree_verify+0xc/0xa0
        CR2: fffffffffffffff0
      
      Figured out by Bob Liu.
      
      Reported-by: default avatarSasha Levin <sasha.levin@oracle.com>
      Cc: Bob Liu <lliubbo@gmail.com>
      Signed-off-by: default avatarMichel Lespinasse <walken@google.com>
      Reviewed-by: default avatarRik van Riel <riel@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      63c3b902
  2. Nov 16, 2012
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://github.com/gxt/linux · c5e35d6c
      Linus Torvalds authored
      Pull unicore32 update from Guan Xuetao.
      
      * tag 'for-linus' of git://github.com/gxt/linux:
        arch/unicore32: remove CONFIG_EXPERIMENTAL
        unicore32: switch to generic sys_execve()
        unicore32: switch to generic kernel_thread()/kernel_execve()
        unicore32: Use Kbuild infrastructure for kvm_para.h
        UAPI: (Scripted) Disintegrate arch/unicore32/include/asm
        UniCore32-bugfix: Remove definitions in asm/bug.h to solve difference between native and cross compiler
        UniCore32-bugfix: fix mismatch return value of __xchg_bad_pointer
        UniCore32 bugfix: add missed CONFIG_ZONE_DMA
        unicore32/mm/fault.c: Port OOM changes to do_pf
      c5e35d6c
    • Linus Torvalds's avatar
      Merge tag 'upstream-3.7-rc6' of git://git.infradead.org/linux-ubifs · ce95a36b
      Linus Torvalds authored
      Pull UBIFS fixes from Artem Bityutskiy:
       "Two patches which fix a problem reported by several people in the
        past, but only fixed now because no one gave enough material for
        debugging.
      
        Anyway, these fix the problem that sometimes after a power cut the
        file-system is not mountable with the following symptom:
      
      	grab_empty_leb: could not find an empty LEB
      
        The fixes make the file-system mountable again."
      
      * tag 'upstream-3.7-rc6' of git://git.infradead.org/linux-ubifs:
        UBIFS: fix mounting problems after power cuts
        UBIFS: introduce categorized lprops counter
      ce95a36b
    • Linus Torvalds's avatar
      Merge tag 'for-v3.7-fixes' of git://git.infradead.org/users/cbou/linux-pstore · 006b9568
      Linus Torvalds authored
      Pull pstore fix from Anton Vorontsov:
       "A small fixup for the persistent storage subsystem.  The bug can
        prevent kernel booting on a APEI-enabled machines w/ PSTORE_CONSOLE=y
        (this is N by default, though)."
      
      * tag 'for-v3.7-fixes' of git://git.infradead.org/users/cbou/linux-pstore:
        pstore: Fix NULL pointer dereference in console writes
      006b9568
    • Linus Torvalds's avatar
      Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging · e8017454
      Linus Torvalds authored
      Pill i2c fixes from Jean Delvare.
      
      Well, "fixes"..  The biggest patch here is actually Jan marking Wolfram
      Sang as the main i2c subsystem maintainer, with Jan staying on as the PC
      controller maintainer.
      
      * 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
        i2c-mux-pinctrl: Fix probe error path
        MAINTAINERS: i2c: 7 years, this is it
      e8017454
    • Linus Torvalds's avatar
      Merge tag 'regulator-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator · 7c96cfcd
      Linus Torvalds authored
      Pull regulator fixes from Mark Brown:
       "A few fixes for teardown issues that will be rarely seen, plus a fix
        for a silly bug in regulator_is_supported_voltage() which shows how
        often the answer to the question should be false.
      
        The supported voltage commit is very new as I just edited to add a Cc
        to stable, the code itself has been in -next."
      
      * tag 'regulator-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
        regulator: fix voltage check in regulator_is_supported_voltage()
        regulator: core: Avoid deadlock when regulator_register fails
        Regulator: core: Unregister when gpio request fails.
      7c96cfcd
    • Linus Torvalds's avatar
      Merge tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 38216134
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "The only large LOC is seen in WM5102 driver, just writing a bunch of
        register updates, but the actual code change is small.  Other than
        that, all small fixes suitable for rc6."
      
      * tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: usb-audio: Fix mutex deadlock at disconnection
        ALSA: fm801: precedence bug in snd_fm801_tea575x_get_pins()
        ALSA: es1968: precedence bug in snd_es1968_tea575x_get_pins()
        ALSA: hda - Add a missing quirk entry for iMac 9,1
        ASoC: core: Double control update err for snd_soc_put_volsw_sx
        ASoC: dapm: Use card_list during DAPM shutdown
        ASoC: cs42l52: fix the return value of cs42l52_set_fmt()
        ASoC: bells: Correct type in sub speaker DAI name for WM5102
        ASoC: wm8978: pll incorrectly configured when codec is master
        ASoC: mxs-saif: Fix channel swap for 24-bit format
        ASoC: bells: Select WM1250-EV1 Springbank audio I/O module
        ASoC: bells: Add missing select of WM0010
        ASoC: mxs-saif: Add MODULE_ALIAS
        ASoC: wm5102: Write register value corrections after SYSCLK is enabled
      38216134
  3. Nov 15, 2012
  4. Nov 14, 2012
    • Takashi Iwai's avatar
      ALSA: usb-audio: Fix mutex deadlock at disconnection · 10e44239
      Takashi Iwai authored
      
      
      The recent change for USB-audio disconnection race fixes introduced a
      mutex deadlock again.  There is a circular dependency between
      chip->shutdown_rwsem and pcm->open_mutex, depicted like below, when a
      device is opened during the disconnection operation:
      
      A. snd_usb_audio_disconnect() ->
           card.c::register_mutex ->
             chip->shutdown_rwsem (write) ->
               snd_card_disconnect() ->
                 pcm.c::register_mutex ->
                   pcm->open_mutex
      
      B. snd_pcm_open() ->
           pcm->open_mutex ->
             snd_usb_pcm_open() ->
               chip->shutdown_rwsem (read)
      
      Since the chip->shutdown_rwsem protection in the case A is required
      only for turning on the chip->shutdown flag and it doesn't have to be
      taken for the whole operation, we can reduce its window in
      snd_usb_audio_disconnect().
      
      Reported-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      10e44239
    • Charles Keepax's avatar
      regulator: core: Avoid deadlock when regulator_register fails · 23ff2f0f
      Charles Keepax authored
      
      
      When regulator_register fails and exits through the scrub path the
      regulator_put function was called whilst holding the
      regulator_list_mutex, causing deadlock.
      
      This patch adds a private version of the regulator_put function which
      can be safely called whilst holding the mutex, replacing the
      aforementioned call.
      
      Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      23ff2f0f
    • Dan Carpenter's avatar
      ALSA: fm801: precedence bug in snd_fm801_tea575x_get_pins() · effded75
      Dan Carpenter authored
      
      
      There is a precedence bug because | has higher precedence than ?:.  This
      code was cut and pasted and I fixed a similar bug a few days ago.
      
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      effded75
    • Guenter Roeck's avatar
      i2c-mux-pinctrl: Fix probe error path · aa1e3e81
      Guenter Roeck authored
      
      
      When allocating the memory for i2c busses, the code checked the wrong
      variable and thus never detected if there was a memory error.
      
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      aa1e3e81
    • Jean Delvare's avatar
      MAINTAINERS: i2c: 7 years, this is it · d85c8a6a
      Jean Delvare authored
      
      
      I have been maintaining the i2c subsystem for 7 years now, it's about
      time to let someone else take over. Just before I leave, I would like
      to thank several individuals who made this possible at all:
      
      * Greg Kroah-Hartman, for his faith in my potential subsystem
        maintainer skills. Greg, I hope I met your expectations.
      * Late David Brownell, for helping me convert the i2c subsystem to the
        standard device driver model. Rest in peace David, we're missing you.
      * Ben Dooks, for stepping in when I asked for someone to take care of
        the huge flow of new i2c adapter drivers for embedded systems.
      * Wolfram Sang, for joining the crew when it became clear that there
        was more review work than Ben and myself could deal with.
      
      I hope I did not forget anyone, please forgive me if I did.
      
      Another big thank is due to Wolfram again, who quickly proposed to
      take over as the main i2c subsystem maintainer. This will allow for a
      smooth and fast transition.
      
      Note that I will keep maintaining all I2C/SMBus controller drivers for
      PC systems as well as a few others. I am hereby updating MAINTAINERS
      accordingly. I'll also keep maintaining user-space i2c-tools.
      
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Ben Dooks <ben-linux@fluff.org>
      Acked-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      d85c8a6a
  5. Nov 13, 2012