1. 30 10月, 2013 2 次提交
  2. 22 10月, 2013 3 次提交
  3. 21 10月, 2013 2 次提交
  4. 20 10月, 2013 3 次提交
  5. 19 10月, 2013 4 次提交
  6. 18 10月, 2013 13 次提交
    • N
      HID: Fix unit exponent parsing again · ad0e669b
      Nikolai Kondrashov 提交于
      Revert some changes done in 77463838.
      
      Revert all changes done in hidinput_calc_abs_res as it mistakingly used
      "Unit" item exponent nibbles to affect resolution value. This wasn't
      breaking resolution calculation of relevant axes of any existing
      devices, though, as they have only one dimension to their units and thus
      1 in the corresponding nible.
      
      Revert to reading "Unit Exponent" item value as a signed integer in
      hid_parser_global to fix reading specification-complying values. This
      fixes resolution calculation of devices complying to the HID standard,
      including Huion, KYE, Waltop and UC-Logic graphics tablets which have
      their report descriptors fixed by the drivers.
      
      Explanations follow.
      
      There are two "unit exponents" in HID specification and it is important
      not to mix them. One is the global "Unit Exponent" item and another is
      nibble values in the global "Unit" item. See 6.2.2.7 Global Items.
      
      The "Unit Exponent" value is just a signed integer and is used to scale
      the integer resolution unit values, so fractions can be expressed.
      
      The nibbles of "Unit" value are used to select the unit system (nibble
      0), and presence of a particular basic unit type in the unit formula and
      its *exponent* (or power, nibbles 1-6). And yes, the latter is in two
      complement and zero means absence of the unit type.
      
      Taking the representation example of (integer) joules from the
      specification:
      
      [mass(grams)][length(centimeters)^2][time(seconds)^-2] * 10^-7
      
      the "Unit Exponent" would be -7 (or 0xF9, if stored as a byte) and the
      "Unit" value would be 0xE121, signifying:
      
      Nibble  Part        Value   Meaning
      -----   ----        -----   -------
      0       System      1       SI Linear
      1       Length      2       Centimeters^2
      2       Mass        1       Grams
      3       Time        -2      Seconds^-2
      
      To give the resolution in e.g. hundredth of joules the "Unit Exponent"
      item value should have been -9.
      
      See also the examples of "Unit" values for some common units in the same
      chapter.
      
      However, there is a common misunderstanding about the "Unit Exponent"
      value encoding, where it is assumed to be stored the same as nibbles in
      "Unit" item. This is most likely due to the specification being a bit
      vague and overloading the term "unit exponent". This also was and still
      is proliferated by the official "HID Descriptor Tool", which makes this
      mistake and stores "Unit Exponent" as such. This format is also
      mentioned in books such as "USB Complete" and in Microsoft's hardware
      design guides.
      
      As a result many devices currently on the market use this encoding and
      so the driver should support them.
      Signed-off-by: NNikolai Kondrashov <spbnick@gmail.com>
      Acked-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      ad0e669b
    • R
      Merge branch 'acpi-fixes' · 981984cb
      Rafael J. Wysocki 提交于
      * acpi-fixes:
        ACPI / PM: Drop two functions that are not used any more
        ATA / ACPI: remove power dependent device handling
        ACPI / power: Drop automaitc resume of power resource dependent devices
        ACPI: remove /proc/acpi/event from ACPI_BUTTON help
        ACPI / power: Release resource_lock after acpi_power_get_state() return error
      981984cb
    • R
      Merge branch 'pm-fixes' · bdbff716
      Rafael J. Wysocki 提交于
      * pm-fixes:
        cpufreq: s3c64xx: Rename index to driver_data
        intel_pstate: Fix type mismatch warning
        cpufreq / intel_pstate: Fix max_perf_pct on resume
      bdbff716
    • L
      Merge branch 'for-linus' of git://git.samba.org/sfrench/cifs-2.6 · 04919afb
      Linus Torvalds 提交于
      Pull CIFS fixes from Steve French:
       "Five small cifs fixes (includes fixes for: unmount hang, 2 security
        related, symlink, large file writes)"
      
      * 'for-linus' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: ntstatus_to_dos_map[] is not terminated
        cifs: Allow LANMAN auth method for servers supporting unencapsulated authentication methods
        cifs: Fix inability to write files >2GB to SMB2/3 shares
        cifs: Avoid umount hangs with smb2 when server is unresponsive
        do not treat non-symlink reparse points as valid symlinks
      04919afb
    • L
      Merge tag 'driver-core-3.12-rc6' of... · 83f11a9c
      Linus Torvalds 提交于
      Merge tag 'driver-core-3.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      
      Pull driver core fix from Greg KH:
       "Here is one fix for the hotplug memory path that resolves a regression
        when removing memory that showed up in 3.12-rc1"
      
      * tag 'driver-core-3.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        driver core: Release device_hotplug_lock when store_mem_state returns EINVAL
      83f11a9c
    • L
      Merge tag 'usb-3.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 02a3250f
      Linus Torvalds 提交于
      Pull USB fixes from Greg KH:
       "Here are some USB fixes and new device ids for 3.12-rc6
      
        The largest change here is a bunch of new device ids for the option
        USB serial driver for new Huawei devices.  Other than that, just some
        small bug fixes for issues that people have reported (run-time and
        build-time), nothing major"
      
      * tag 'usb-3.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        usb: usb_phy_gen: refine conditional declaration of usb_nop_xceiv_register
        usb: misc: usb3503: Fix compile error due to incorrect regmap depedency
        usb/chipidea: fix oops on memory allocation failure
        usb-storage: add quirk for mandatory READ_CAPACITY_16
        usb: serial: option: blacklist Olivetti Olicard200
        USB: quirks: add touchscreen that is dazzeled by remote wakeup
        Revert "usb: musb: gadget: fix otg active status flag"
        USB: quirks.c: add one device that cannot deal with suspension
        USB: serial: option: add support for Inovia SEW858 device
        USB: serial: ti_usb_3410_5052: add Abbott strip port ID to combined table as well.
        USB: support new huawei devices in option.c
        usb: musb: start musb on the udc side, too
        xhci: Fix spurious wakeups after S5 on Haswell
        xhci: fix write to USB3_PSSEN and XUSB2PRM pci config registers
        xhci: quirk for extra long delay for S4
        xhci: Don't enable/disable RWE on bus suspend/resume.
      02a3250f
    • L
      Merge tag 'tty-3.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 7b4a5155
      Linus Torvalds 提交于
      Pull serial driver fixes from Greg KH:
       "Here are two serial driver fixes for your tree.  One is a revert of a
        patch that causes a build error, the other is a fix to provide the
        correct brace placement which resolves a bug where the driver was not
        working properly"
      
      * tag 'tty-3.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        serial: vt8500: add missing braces
        Revert "serial: i.MX: evaluate linux,stdout-path property"
      7b4a5155
    • L
      Merge tag 'char-misc-3.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 66eb411e
      Linus Torvalds 提交于
      Pull char/misc driver fixes from Greg KH:
       "Here are some small iio and w1 driver fixes for 3.12-rc6.
      
        There is also a hyper-v fix in here, which turned out to be incorrect,
        so it was reverted.  That will probably have to wait unto 3.13-rc1 to
        get accepted as it's still being discussed"
      
      * tag 'char-misc-3.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        Revert "Drivers: hv: vmbus: Fix a bug in channel rescind code"
        Drivers: hv: vmbus: Fix a bug in channel rescind code
        iio:buffer: Free active scan mask in iio_disable_all_buffers()
        iio: frequency: adf4350: add missing clk_disable_unprepare() on error in adf4350_probe()
        w1 - call request_module with w1 master mutex unlocked
        w1 - fix fops in w1_bus_notify
      66eb411e
    • L
      Merge tag 'sound-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 630db0e3
      Linus Torvalds 提交于
      Pull sound fixes from Takashi Iwai:
       "All reasonably small fixes as rc6: a HD-audio mic fix, a us122l mmap
        regression fix, and kernel memory leak fix in hdsp driver.  Hopefully
        this will be the last pull request for 3.12..."
      
      * tag 'sound-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hdsp - info leak in snd_hdsp_hwdep_ioctl()
        ALSA: us122l: Fix pcm_usb_stream mmapping regression
        ALSA: hda - Fix inverted internal mic not indicated on some machines
      630db0e3
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security · b2118ea9
      Linus Torvalds 提交于
      Pull apparmor fixes from James Morris:
       "A couple more regressions fixed"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
        apparmor: fix bad lock balance when introspecting policy
        apparmor: fix memleak of the profile hash
      b2118ea9
    • G
      Merge tag 'iio-fixes-for-3.12c' of... · e13cef8d
      Greg Kroah-Hartman 提交于
      Merge tag 'iio-fixes-for-3.12c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-linus
      
      Jonathan writes:
      
      Third set of IIO fixes for the 3.12 cycle.
      
      Two little ones this time:
      
      1) A missing clk_unprepare in adf4350.
      2) A missing free of the active_scan_mask when iio_disable_all_buffers is
      called during an unexpected device removal.  This leak was introduced by
      the fix
      a87c82e4 iio: Stop sampling when the device is removed
      and hence is a regression fix.
      e13cef8d
    • G
      usb: usb_phy_gen: refine conditional declaration of usb_nop_xceiv_register · 94468783
      Guenter Roeck 提交于
      Commit 3fa4d734 (usb: phy: rename nop_usb_xceiv => usb_phy_gen_xceiv)
      changed the conditional around the declaration of usb_nop_xceiv_register
      from
      	#if defined(CONFIG_NOP_USB_XCEIV) ||
      		(defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE))
      to
      	#if IS_ENABLED(CONFIG_NOP_USB_XCEIV)
      
      While that looks the same, it is semantically different. The first expression
      is true if CONFIG_NOP_USB_XCEIV is built as module and if the including
      code is built as module. The second expression is true if code depending on
      CONFIG_NOP_USB_XCEIV if built as module or into the kernel.
      
      As a result, the arm:allmodconfig build fails with
      
      arch/arm/mach-omap2/built-in.o: In function `omap3_evm_init':
      arch/arm/mach-omap2/board-omap3evm.c:703: undefined reference to
      	`usb_nop_xceiv_register'
      
      Fix the problem by reverting to the old conditional.
      
      Cc: Josh Boyer <jwboyer@redhat.com>
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      94468783
    • G
      Revert "Drivers: hv: vmbus: Fix a bug in channel rescind code" · b762799d
      Greg Kroah-Hartman 提交于
      This reverts commit 90d33f3e as it's not
      the correct fix for this issue, and it causes a build warning to be
      added to the kernel tree.
      
      Cc: K. Y. Srinivasan <kys@microsoft.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b762799d
  7. 17 10月, 2013 13 次提交
    • R
      ACPI / PM: Drop two functions that are not used any more · 2421ad48
      Rafael J. Wysocki 提交于
      Two functions defined in device_pm.c, acpi_dev_pm_add_dependent()
      and acpi_dev_pm_remove_dependent(), have no callers and may be
      dropped, so drop them.
      
      Moreover, they are the only functions adding entries to and removing
      entries from the power_dependent list in struct acpi_device, so drop
      that list too.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      2421ad48
    • A
      ATA / ACPI: remove power dependent device handling · b08fc109
      Aaron Lu 提交于
      Previously, we wanted SCSI devices corrsponding to ATA devices to
      be runtime resumed when the power resource for those ATA device was
      turned on by some other device, so we added the SCSI device to the
      dependent device list of the ATA device's ACPI node.  However, this
      code has no effect after commit 41863fce (ACPI / power: Drop automaitc
      resume of power resource dependent devices) and the mechanism it was
      supposed to implement is regarded as a bad idea now, so drop it.
      
      [rjw: Changelog]
      Signed-off-by: NAaron Lu <aaron.lu@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b08fc109
    • L
      Merge branch 'akpm' (fixes from Andrew Morton) · 056cdce0
      Linus Torvalds 提交于
      Merge misc fixes from Andrew Morton.
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (21 commits)
        mm: revert mremap pud_free anti-fix
        mm: fix BUG in __split_huge_page_pmd
        swap: fix set_blocksize race during swapon/swapoff
        procfs: call default get_unmapped_area on MMU-present architectures
        procfs: fix unintended truncation of returned mapped address
        writeback: fix negative bdi max pause
        percpu_refcount: export symbols
        fs: buffer: move allocation failure loop into the allocator
        mm: memcg: handle non-error OOM situations more gracefully
        tools/testing/selftests: fix uninitialized variable
        block/partitions/efi.c: treat size mismatch as a warning, not an error
        mm: hugetlb: initialize PG_reserved for tail pages of gigantic compound pages
        mm/zswap: bugfix: memory leak when re-swapon
        mm: /proc/pid/pagemap: inspect _PAGE_SOFT_DIRTY only on present pages
        mm: migration: do not lose soft dirty bit if page is in migration state
        gcov: MAINTAINERS: Add an entry for gcov
        mm/hugetlb.c: correct missing private flag clearing
        mm/vmscan.c: don't forget to free shrinker->nr_deferred
        ipc/sem.c: synchronize semop and semctl with IPC_RMID
        ipc: update locking scheme comments
        ...
      056cdce0
    • H
      mm: revert mremap pud_free anti-fix · 57a8f0cd
      Hugh Dickins 提交于
      Revert commit 1ecfd533 ("mm/mremap.c: call pud_free() after fail
      calling pmd_alloc()").
      
      The original code was correct: pud_alloc(), pmd_alloc(), pte_alloc_map()
      ensure that the pud, pmd, pt is already allocated, and seldom do they
      need to allocate; on failure, upper levels are freed if appropriate by
      the subsequent do_munmap().  Whereas commit 1ecfd533 did an
      unconditional pud_free() of a most-likely still-in-use pud: saved only
      by the near-impossiblity of pmd_alloc() failing.
      Signed-off-by: NHugh Dickins <hughd@google.com>
      Cc: Chen Gang <gang.chen@asianux.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      57a8f0cd
    • H
      mm: fix BUG in __split_huge_page_pmd · 750e8165
      Hugh Dickins 提交于
      Occasionally we hit the BUG_ON(pmd_trans_huge(*pmd)) at the end of
      __split_huge_page_pmd(): seen when doing madvise(,,MADV_DONTNEED).
      
      It's invalid: we don't always have down_write of mmap_sem there: a racing
      do_huge_pmd_wp_page() might have copied-on-write to another huge page
      before our split_huge_page() got the anon_vma lock.
      
      Forget the BUG_ON, just go back and try again if this happens.
      Signed-off-by: NHugh Dickins <hughd@google.com>
      Acked-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      750e8165
    • K
      swap: fix set_blocksize race during swapon/swapoff · 5b808a23
      Krzysztof Kozlowski 提交于
      Fix race between swapoff and swapon.  Swapoff used old_block_size from
      swap_info outside of swapon_mutex so it could be overwritten by
      concurrent swapon.
      
      The race has visible effect only if more than one swap block device
      exists with different block sizes (e.g.  /dev/sda1 with block size 4096
      and /dev/sdb1 with 512).  In such case it leads to setting the blocksize
      of swapped off device with wrong blocksize.
      
      The bug can be triggered with multiple concurrent swapoff and swapon:
      0. Swap for some device is on.
      1. swapoff:
      First the swapoff is called on this device and "struct swap_info_struct
      *p" is assigned. This is done under swap_lock however this lock is
      released for the call try_to_unuse().
      
      2. swapon:
      After the assignment above (and before acquiring swapon_mutex &
      swap_lock by swapoff) the swapon is called on the same device.
      The p->old_block_size is assigned to the value of block_size the device.
      This block size should be the same as previous but sometimes it is not.
      The swapon ends successfully.
      
      3. swapoff:
      Swapoff resumes, grabs the locks and mutex and continues to disable this
      swap device. Now it sets the block size to value taken from swap_info
      which was overwritten by swapon in 2.
      Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Reported-by: NWeijie Yang <weijie.yang.kh@gmail.com>
      Cc: Bob Liu <bob.liu@oracle.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Shaohua Li <shli@fusionio.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Acked-by: NHugh Dickins <hughd@google.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5b808a23
    • H
      procfs: call default get_unmapped_area on MMU-present architectures · fad1a86e
      HATAYAMA Daisuke 提交于
      Commit c4fe2448 ("sparc: fix PCI device proc file mmap(2)") added
      proc_reg_get_unmapped_area in proc_reg_file_ops and
      proc_reg_file_ops_no_compat, by which now mmap always returns EIO if
      get_unmapped_area method is not defined for the target procfs file,
      which causes regression of mmap on /proc/vmcore.
      
      To address this issue, like get_unmapped_area(), call default
      current->mm->get_unmapped_area on MMU-present architectures if
      pde->proc_fops->get_unmapped_area, i.e.  the one in actual file
      operation in the procfs file, is not defined.
      Reported-by: NMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: NHATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Tested-by: NMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fad1a86e
    • H
      procfs: fix unintended truncation of returned mapped address · 2cbe3b0a
      HATAYAMA Daisuke 提交于
      Currently, proc_reg_get_unmapped_area truncates upper 32-bit of the
      mapped virtual address returned from get_unmapped_area method in
      pde->proc_fops due to the variable rv of signed integer on x86_64.  This
      is too small to have vitual address of unsigned long on x86_64 since on
      x86_64, signed integer is of 4 bytes while unsigned long is of 8 bytes.
      To fix this issue, use unsigned long instead.
      
      Fixes a regression added in commit c4fe2448 ("sparc: fix PCI device
      proc file mmap(2)").
      Signed-off-by: NHATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Tested-by: NMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2cbe3b0a
    • F
      writeback: fix negative bdi max pause · e3b6c655
      Fengguang Wu 提交于
      Toralf runs trinity on UML/i386.  After some time it hangs and the last
      message line is
      
      	BUG: soft lockup - CPU#0 stuck for 22s! [trinity-child0:1521]
      
      It's found that pages_dirtied becomes very large.  More than 1000000000
      pages in this case:
      
      	period = HZ * pages_dirtied / task_ratelimit;
      	BUG_ON(pages_dirtied > 2000000000);
      	BUG_ON(pages_dirtied > 1000000000);      <---------
      
      UML debug printf shows that we got negative pause here:
      
      	ick: pause : -984
      	ick: pages_dirtied : 0
      	ick: task_ratelimit: 0
      
      	 pause:
      	+       if (pause < 0)  {
      	+               extern int printf(char *, ...);
      	+               printf("ick : pause : %li\n", pause);
      	+               printf("ick: pages_dirtied : %lu\n", pages_dirtied);
      	+               printf("ick: task_ratelimit: %lu\n", task_ratelimit);
      	+               BUG_ON(1);
      	+       }
      	        trace_balance_dirty_pages(bdi,
      
      Since pause is bounded by [min_pause, max_pause] where min_pause is also
      bounded by max_pause.  It's suspected and demonstrated that the
      max_pause calculation goes wrong:
      
      	ick: pause : -717
      	ick: min_pause : -177
      	ick: max_pause : -717
      	ick: pages_dirtied : 14
      	ick: task_ratelimit: 0
      
      The problem lies in the two "long = unsigned long" assignments in
      bdi_max_pause() which might go negative if the highest bit is 1, and the
      min_t(long, ...) check failed to protect it falling under 0.  Fix all of
      them by using "unsigned long" throughout the function.
      Signed-off-by: NFengguang Wu <fengguang.wu@intel.com>
      Reported-by: NToralf Förster <toralf.foerster@gmx.de>
      Tested-by: NToralf Förster <toralf.foerster@gmx.de>
      Reviewed-by: NJan Kara <jack@suse.cz>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e3b6c655
    • M
      percpu_refcount: export symbols · 5e9dd373
      Matias Bjorling 提交于
      Export the interface to be used within modules.
      Signed-off-by: NMatias Bjorling <m@bjorling.me>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5e9dd373
    • J
      fs: buffer: move allocation failure loop into the allocator · 84235de3
      Johannes Weiner 提交于
      Buffer allocation has a very crude indefinite loop around waking the
      flusher threads and performing global NOFS direct reclaim because it can
      not handle allocation failures.
      
      The most immediate problem with this is that the allocation may fail due
      to a memory cgroup limit, where flushers + direct reclaim might not make
      any progress towards resolving the situation at all.  Because unlike the
      global case, a memory cgroup may not have any cache at all, only
      anonymous pages but no swap.  This situation will lead to a reclaim
      livelock with insane IO from waking the flushers and thrashing unrelated
      filesystem cache in a tight loop.
      
      Use __GFP_NOFAIL allocations for buffers for now.  This makes sure that
      any looping happens in the page allocator, which knows how to
      orchestrate kswapd, direct reclaim, and the flushers sensibly.  It also
      allows memory cgroups to detect allocations that can't handle failure
      and will allow them to ultimately bypass the limit if reclaim can not
      make progress.
      Reported-by: NazurIt <azurit@pobox.sk>
      Signed-off-by: NJohannes Weiner <hannes@cmpxchg.org>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      84235de3
    • J
      mm: memcg: handle non-error OOM situations more gracefully · 49426420
      Johannes Weiner 提交于
      Commit 3812c8c8 ("mm: memcg: do not trap chargers with full
      callstack on OOM") assumed that only a few places that can trigger a
      memcg OOM situation do not return VM_FAULT_OOM, like optional page cache
      readahead.  But there are many more and it's impractical to annotate
      them all.
      
      First of all, we don't want to invoke the OOM killer when the failed
      allocation is gracefully handled, so defer the actual kill to the end of
      the fault handling as well.  This simplifies the code quite a bit for
      added bonus.
      
      Second, since a failed allocation might not be the abrupt end of the
      fault, the memcg OOM handler needs to be re-entrant until the fault
      finishes for subsequent allocation attempts.  If an allocation is
      attempted after the task already OOMed, allow it to bypass the limit so
      that it can quickly finish the fault and invoke the OOM killer.
      Reported-by: NazurIt <azurit@pobox.sk>
      Signed-off-by: NJohannes Weiner <hannes@cmpxchg.org>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      49426420
    • F
      tools/testing/selftests: fix uninitialized variable · c88b05b2
      Felipe Pena 提交于
      The err variable is intended to receive the timer_create() return before
      checking it
      Signed-off-by: NFelipe Pena <felipensp@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c88b05b2