1. 20 7月, 2018 1 次提交
  2. 12 7月, 2018 1 次提交
    • V
      ARC: mm: allow mprotect to make stack mappings executable · 93312b6d
      Vineet Gupta 提交于
      mprotect(EXEC) was failing for stack mappings as default vm flags was
      missing MAYEXEC.
      
      This was triggered by glibc test suite nptl/tst-execstack testcase
      
      What is surprising is that despite running LTP for years on, we didn't
      catch this issue as it lacks a directed test case.
      
      gcc dejagnu tests with nested functions also requiring exec stack work
      fine though because they rely on the GNU_STACK segment spit out by
      compiler and handled in kernel elf loader.
      
      This glibc case is different as the stack is non exec to begin with and
      a dlopen of shared lib with GNU_STACK segment triggers the exec stack
      proceedings using a mprotect(PROT_EXEC) which was broken.
      
      CC: stable@vger.kernel.org
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      93312b6d
  3. 10 7月, 2018 6 次提交
    • A
      ARC: Fix CONFIG_SWAP · 6e376114
      Alexey Brodkin 提交于
      swap was broken on ARC due to silly copy-paste issue.
      
      We encode offset from swapcache page in __swp_entry() as (off << 13) but
      were not decoding back in __swp_offset() as (off >> 13) - it was still
      (off << 13).
      
      This finally fixes swap usage on ARC.
      
      | # mkswap /dev/sda2
      |
      | # swapon -a -e /dev/sda2
      | Adding 500728k swap on /dev/sda2.  Priority:-2 extents:1 across:500728k
      |
      | # free
      |              total       used       free     shared    buffers     cached
      | Mem:        765104      13456     751648       4736          8       4736
      | -/+ buffers/cache:       8712     756392
      | Swap:       500728          0     500728
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      6e376114
    • V
      ARC: [arcompact] entry.S: minor code movement · ca1147fc
      Vineet Gupta 提交于
      This is a non functional code changw, which moves r25 restore from macro
      into the caller of macro
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      ca1147fc
    • A
      ARC: configs: Remove CONFIG_INITRAMFS_SOURCE from defconfigs · 64234961
      Alexey Brodkin 提交于
      We used to have pre-set CONFIG_INITRAMFS_SOURCE with local path
      to intramfs in ARC defconfigs. This was quite convenient for
      in-house development but not that convenient for newcomers
      who obviusly don't have folders like "arc_initramfs" next to
      the Linux source tree. Which leads to quite surprising failure
      of defconfig building:
      ------------------------------->8-----------------------------
        ../scripts/gen_initramfs_list.sh: Cannot open '../../arc_initramfs_hs/'
      ../usr/Makefile:57: recipe for target 'usr/initramfs_data.cpio.gz' failed
      make[2]: *** [usr/initramfs_data.cpio.gz] Error 1
      ------------------------------->8-----------------------------
      
      So now when more and more people start to deal with our defconfigs
      let's make their life easier with removal of CONFIG_INITRAMFS_SOURCE.
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Cc: Kevin Hilman <khilman@baylibre.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      64234961
    • A
      ARC: configs: remove no longer needed CONFIG_DEVPTS_MULTIPLE_INSTANCES · 29c2068f
      Anders Roxell 提交于
      Since commit eedf265a ("devpts: Make each mount of devpts an
      independent filesystem.") CONFIG_DEVPTS_MULTIPLE_INSTANCES isn't needed
      in the defconfig anymore.
      Signed-off-by: NAnders Roxell <anders.roxell@linaro.org>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      29c2068f
    • P
      ARC: Improve cmpxchg syscall implementation · e8708786
      Peter Zijlstra 提交于
      This is used in configs lacking hardware atomics to emulate atomic r-m-w
      for user space, implemented by disabling preemption in kernel.
      
      However there are issues in current implementation:
      
      1. Process not terminated if invalid user pointer passed:
         i.e. __get_user() failed.
      
      2. The reason for this patch was __put_user() failure not being handled
         either, specifically for the COW break scenario.
         The zero page is initially wired up and read from __get_user()
         succeeds. A subsequent write by __put_user() induces a
         Protection Violation, but COW can't finish as Linux page fault
         handler is disabled due to preempt disable.
         And what's worse is we silently return the stale value to user space.
         Fix this specific case by re-enabling preemption and explicitly
         fixing up the fault and retrying the whole sequence over.
      
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: linux-arch@vger.kernel.org
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      [vgupta: rewrote the changelog]
      e8708786
    • G
      ARC: [plat-hsdk]: Configure APB GPIO controller on ARC HSDK platform · ec58ba16
      Gustavo Pimentel 提交于
      In case of HSDK we have intermediate INTC in for of DW APB GPIO controller
      which is used as a de-bounce logic for interrupt wires that come from
      outside the board.
      
      We cannot use existing "irq-dw-apb-ictl" driver here because all input
      lines are routed to corresponding output lines but not muxed into one
      line (this is configured in RTL and we cannot change this in software).
      
      But even if we add such a feature to "irq-dw-apb-ictl" driver that won't
      benefit us as higher-level INTC (in case of HSDK it is IDU) anyways has
      per-input control so adding fully-controller intermediate INTC will only
      bring some overhead on interrupt processing but no other benefits.
      
      Thus we just do one-time configuration of DW APB GPIO controller and
      forget about it.
      
      Based on implementation available on arch/arc/plat-axs10x/axs10x.c file.
      Acked-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NGustavo Pimentel <gustavo.pimentel@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      ec58ba16
  4. 22 6月, 2018 1 次提交
  5. 21 6月, 2018 1 次提交
  6. 14 6月, 2018 1 次提交
    • A
      ARC: Explicitly add -mmedium-calls to CFLAGS · 74c11e30
      Alexey Brodkin 提交于
      GCC built for arc*-*-linux has "-mmedium-calls" implicitly enabled by default
      thus we don't see any problems during Linux kernel compilation.
      ----------------------------->8------------------------
      arc-linux-gcc -mcpu=arc700 -Q --help=target | grep calls
        -mlong-calls                          [disabled]
        -mmedium-calls                        [enabled]
      ----------------------------->8------------------------
      
      But if we try to use so-called Elf32 toolchain with GCC configured for
      arc*-*-elf* then we'd see the following failure:
      ----------------------------->8------------------------
      init/do_mounts.o: In function 'init_rootfs':
      do_mounts.c:(.init.text+0x108): relocation truncated to fit: R_ARC_S21W_PCREL
      against symbol 'unregister_filesystem' defined in .text section in fs/filesystems.o
      
      arc-elf32-ld: final link failed: Symbol needs debug section which does not exist
      make: *** [vmlinux] Error 1
      ----------------------------->8------------------------
      
      That happens because neither "-mmedium-calls" nor "-mlong-calls" are enabled in
      Elf32 GCC:
      ----------------------------->8------------------------
      arc-elf32-gcc -mcpu=arc700 -Q --help=target | grep calls
        -mlong-calls                          [disabled]
        -mmedium-calls                        [disabled]
      ----------------------------->8------------------------
      
      Now to make it possible to use Elf32 toolchain for building Linux kernel
      we're explicitly add "-mmedium-calls" to CFLAGS.
      
      And since we add "-mmedium-calls" to the global CFLAGS there's no point in
      having per-file copies thus removing them.
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      74c11e30
  7. 04 6月, 2018 4 次提交
    • L
      Linux 4.17 · 29dcea88
      Linus Torvalds 提交于
      29dcea88
    • L
      Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 325e14f9
      Linus Torvalds 提交于
      Pull vfs fixes from Al Viro.
      
       - fix io_destroy()/aio_complete() race
      
       - the vfs_open() change to get rid of open_check_o_direct() boilerplate
         was nice, but buggy. Al has a patch avoiding a revert, but that's
         definitely not a last-day fodder, so for now revert it is...
      
      * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        Revert "fs: fold open_check_o_direct into do_dentry_open"
        fix io_destroy()/aio_complete() race
      325e14f9
    • A
      Revert "fs: fold open_check_o_direct into do_dentry_open" · af04fadc
      Al Viro 提交于
      This reverts commit cab64df1.
      
      Having vfs_open() in some cases drop the reference to
      struct file combined with
      
      	error = vfs_open(path, f, cred);
      	if (error) {
      		put_filp(f);
      		return ERR_PTR(error);
      	}
      	return f;
      
      is flat-out wrong.  It used to be
      
      		error = vfs_open(path, f, cred);
      		if (!error) {
      			/* from now on we need fput() to dispose of f */
      			error = open_check_o_direct(f);
      			if (error) {
      				fput(f);
      				f = ERR_PTR(error);
      			}
      		} else {
      			put_filp(f);
      			f = ERR_PTR(error);
      		}
      
      and sure, having that open_check_o_direct() boilerplate gotten rid of is
      nice, but not that way...
      
      Worse, another call chain (via finish_open()) is FUBAR now wrt
      FILE_OPENED handling - in that case we get error returned, with file
      already hit by fput() *AND* FILE_OPENED not set.  Guess what happens in
      path_openat(), when it hits
      
      	if (!(opened & FILE_OPENED)) {
      		BUG_ON(!error);
      		put_filp(file);
      	}
      
      The root cause of all that crap is that the callers of do_dentry_open()
      have no way to tell which way did it fail; while that could be fixed up
      (by passing something like int *opened to do_dentry_open() and have it
      marked if we'd called ->open()), it's probably much too late in the
      cycle to do so right now.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      af04fadc
    • L
      Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 874cd339
      Linus Torvalds 提交于
      Pull scheduler fixes from Thomas Gleixner:
      
       - two patches addressing the problem that the scheduler allows under
         certain conditions user space tasks to be scheduled on CPUs which are
         not yet fully booted which causes a few subtle and hard to debug
         issue
      
       - add a missing runqueue clock update in the deadline scheduler which
         triggers a warning under certain circumstances
      
       - fix a silly typo in the scheduler header file
      
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/headers: Fix typo
        sched/deadline: Fix missing clock update
        sched/core: Require cpu_active() in select_task_rq(), for user tasks
        sched/core: Fix rules for running on online && !active CPUs
      874cd339
  8. 03 6月, 2018 14 次提交
    • L
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 26bdace7
      Linus Torvalds 提交于
      Pull perf tooling fixes from Thomas Gleixner:
      
       - fix 'perf test Session topology' segfault on s390 (Thomas Richter)
      
       - fix NULL return handling in bpf__prepare_load() (YueHaibing)
      
       - fix indexing on Coresight ETM packet queue decoder (Mathieu Poirier)
      
       - fix perf.data format description of NRCPUS header (Arnaldo Carvalho
         de Melo)
      
       - update perf.data documentation section on cpu topology
      
       - handle uncore event aliases in small groups properly (Kan Liang)
      
       - add missing perf_sample.addr into python sample dictionary (Leo Yan)
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf tools: Fix perf.data format description of NRCPUS header
        perf script python: Add addr into perf sample dict
        perf data: Update documentation section on cpu topology
        perf cs-etm: Fix indexing for decoder packet queue
        perf bpf: Fix NULL return handling in bpf__prepare_load()
        perf test: "Session topology" dumps core on s390
        perf parse-events: Handle uncore event aliases in small groups properly
      26bdace7
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 918fe1b3
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
      
       1) Infinite loop in _decode_session6(), from Eric Dumazet.
      
       2) Pass correct argument to nla_strlcpy() in netfilter, also from Eric
          Dumazet.
      
       3) Out of bounds memory access in ipv6 srh code, from Mathieu Xhonneux.
      
       4) NULL deref in XDP_REDIRECT handling of tun driver, from Toshiaki
          Makita.
      
       5) Incorrect idr release in cls_flower, from Paul Blakey.
      
       6) Probe error handling fix in davinci_emac, from Dan Carpenter.
      
       7) Memory leak in XPS configuration, from Alexander Duyck.
      
       8) Use after free with cloned sockets in kcm, from Kirill Tkhai.
      
       9) MTU handling fixes fo ip_tunnel and ip6_tunnel, from Nicolas
          Dichtel.
      
      10) Fix UAPI hole in bpf data structure for 32-bit compat applications,
          from Daniel Borkmann.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (33 commits)
        bpf: fix uapi hole for 32 bit compat applications
        net: usb: cdc_mbim: add flag FLAG_SEND_ZLP
        ip6_tunnel: remove magic mtu value 0xFFF8
        ip_tunnel: restore binding to ifaces with a large mtu
        net: dsa: b53: Add BCM5389 support
        kcm: Fix use-after-free caused by clonned sockets
        net-sysfs: Fix memory leak in XPS configuration
        ixgbe: fix parsing of TC actions for HW offload
        net: ethernet: davinci_emac: fix error handling in probe()
        net/ncsi: Fix array size in dumpit handler
        cls_flower: Fix incorrect idr release when failing to modify rule
        net/sonic: Use dma_mapping_error()
        xfrm Fix potential error pointer dereference in xfrm_bundle_create.
        vhost_net: flush batched heads before trying to busy polling
        tun: Fix NULL pointer dereference in XDP redirect
        be2net: Fix error detection logic for BE3
        net: qmi_wwan: Add Netgear Aircard 779S
        mlxsw: spectrum: Forbid creation of VLAN 1 over port/LAG
        atm: zatm: fix memcmp casting
        iwlwifi: pcie: compare with number of IRQs requested for, not number of CPUs
        ...
      918fe1b3
    • L
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · e0255aec
      Linus Torvalds 提交于
      Pull SCSI fix from James Bottomley:
       "Eve of merge window fix: The original code was so bogus as to be
        casting the wrong generic device to an rport and proceeding to take
        actions based on the bogus values it found.
      
        Fortunately it seems the location that is dereferenced always exists,
        so the code hasn't oopsed yet, but it certainly annoys the memory
        checkers"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: scsi_transport_srp: Fix shost to rport translation
      e0255aec
    • L
      Merge tag 'drm-fixes-for-v4.17-rc8' of git://people.freedesktop.org/~airlied/linux · ada7339e
      Linus Torvalds 提交于
      Pull drm fixes from Dave Airlie:
       "A few final fixes:
      
        i915:
         - fix for potential Spectre vector in the new query uAPI
         - fix NULL pointer deref (FDO #106559)
         - DMI fix to hide LVDS for Radiant P845 (FDO #105468)
      
        amdgpu:
         - suspend/resume DC regression fix
         - underscan flicker fix on fiji
         - gamma setting fix after dpms
      
        omap:
         - fix oops regression
      
        core:
         - fix PSR timing
      
        dw-hdmi:
         - fix oops regression"
      
      * tag 'drm-fixes-for-v4.17-rc8' of git://people.freedesktop.org/~airlied/linux:
        drm/amd/display: Update color props when modeset is required
        drm/amd/display: Make atomic-check validate underscan changes
        drm/bridge/synopsys: dw-hdmi: fix dw_hdmi_setup_rx_sense
        drm/amd/display: Fix BUG_ON during CRTC atomic check update
        drm/i915/query: nospec expects no more than an unsigned long
        drm/i915/query: Protect tainted function pointer lookup
        drm/i915/lvds: Move acpi lid notification registration to registration phase
        drm/i915: Disable LVDS on Radiant P845
        drm/omap: fix NULL deref crash with SDI displays
        drm/psr: Fix missed entry in PSR setup time table.
      ada7339e
    • D
      Merge branch 'drm-fixes-4.17' of git://people.freedesktop.org/~agd5f/linux into drm-fixes · 012cface
      Dave Airlie 提交于
      Two last minute DC fixes for 4.17.  A fix for underscan on fiji and
      a fix for gamma settings getting after dpms.
      
      * 'drm-fixes-4.17' of git://people.freedesktop.org/~agd5f/linux:
        drm/amd/display: Update color props when modeset is required
        drm/amd/display: Make atomic-check validate underscan changes
      012cface
    • L
      Merge tag 'mips_fixes_4.17_3' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux · 4277e6b9
      Linus Torvalds 提交于
      Pull MIPS fixes from James Hogan:
       "A final few MIPS fixes for 4.17:
      
         - drop Lantiq gphy reboot/remove reset (4.14)
      
         - prctl(PR_SET_FP_MODE): Disallow PRE without FR (4.0)
      
         - ptrace(PTRACE_PEEKUSR): Fix 64-bit FGRs (3.15)"
      
      * tag 'mips_fixes_4.17_3' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
        MIPS: ptrace: Fix PTRACE_PEEKUSR requests for 64-bit FGRs
        MIPS: prctl: Disallow FRE without FR with PR_SET_FP_MODE requests
        MIPS: lantiq: gphy: Drop reboot/remove reset asserts
      4277e6b9
    • L
      Merge tag 'vfio-v4.17' of git://github.com/awilliam/linux-vfio · 7172a69c
      Linus Torvalds 提交于
      Pull VFIO fix from Alex Williamson:
       "Revert a pfn page mapping optimization identified as introducing a bad
        page state regression (Alex Williamson)"
      
      * tag 'vfio-v4.17' of git://github.com/awilliam/linux-vfio:
        Revert "vfio/type1: Improve memory pinning process for raw PFN mapping"
      7172a69c
    • L
      Merge tag 'char-misc-4.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 6ac9f42c
      Linus Torvalds 提交于
      Pull char/misc driver fixes from Greg KH:
       "Here are four small bugfixes for some char/misc drivers. Well, really
        three fixes and one fix for one of those fixes due to problems found
        by 0-day.
      
        This resolves some reported issues with the hwtracing drivers, and a
        reported regression for the thunderbolt subsystem. All of these have
        been in linux-next for a while now with no reported problems"
      
      * tag 'char-misc-4.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        hwtracing: stm: fix build error on some arches
        intel_th: Use correct device when freeing buffers
        stm class: Use vmalloc for the master map
        thunderbolt: Handle NULL boot ACL entries properly
      6ac9f42c
    • L
      Merge tag 'staging-4.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 34a8e640
      Linus Torvalds 提交于
      Pull IIO driver fixes from Greg KH:
       "Here are some old IIO driver fixes that were sitting in my tree for a
        few weeks. Sorry about not getting them to you sooner. They fix a
        number of small IIO driver issues that have been reported.
      
        All of these have been in linux-next for a while with no reported
        problems"
      
      * tag 'staging-4.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        iio: adc: select buffer for at91-sama5d2_adc
        iio: hid-sensor-trigger: Fix sometimes not powering up the sensor after resume
        iio: adc: at91-sama5d2_adc: fix channel configuration for differential channels
        iio:kfifo_buf: check for uint overflow
        iio:buffer: make length types match kfifo types
        iio: adc: stm32-dfsdm: fix sample rate for div2 spi clock
        iio: adc: stm32-dfsdm: fix successive oversampling settings
        iio: ad7793: implement IIO_CHAN_INFO_SAMP_FREQ
      34a8e640
    • L
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · 7fdf3e86
      Linus Torvalds 提交于
      Pull rdma fixes from Jason Gunthorpe:
       "Just three small last minute regressions that were found in the last
        week. The Broadcom fix is a bit big for rc7, but since it is fixing
        driver crash regressions that were merged via netdev into rc1, I am
        sending it.
      
         - bnxt netdev changes merged this cycle caused the bnxt RDMA driver
           to crash under certain situations
      
         - Arnd found (several, unfortunately) kconfig problems with the
           patches adding INFINIBAND_ADDR_TRANS. Reverting this last part,
           will fix it more fully outside -rc.
      
         - Subtle change in error code for a uapi function caused breakage in
           userspace. This was bug was subtly introduced cycle"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        IB/core: Fix error code for invalid GID entry
        IB: Revert "remove redundant INFINIBAND kconfig dependencies"
        RDMA/bnxt_re: Fix broken RoCE driver due to recent L2 driver changes
      7fdf3e86
    • L
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · a36b7968
      Linus Torvalds 提交于
      Pull i2c fixes from Wolfram Sang:
       "A documentation bugfix and a MAINTAINERS addition"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: ocores: update HDL sources URL
        i2c: xlp9xx: Add MAINTAINERS entry
      a36b7968
    • L
      Merge branch 'akpm' (patches from Andrew) · 0938a8f5
      Linus Torvalds 提交于
      Merge two fixes from Andrew Morton.
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        mm: fix the NULL mapping case in __isolate_lru_page()
        mm/huge_memory.c: __split_huge_page() use atomic ClearPageDirty()
      0938a8f5
    • H
      mm: fix the NULL mapping case in __isolate_lru_page() · 145e1a71
      Hugh Dickins 提交于
      George Boole would have noticed a slight error in 4.16 commit
      69d763fc ("mm: pin address_space before dereferencing it while
      isolating an LRU page").  Fix it, to match both the comment above it,
      and the original behaviour.
      
      Although anonymous pages are not marked PageDirty at first, we have an
      old habit of calling SetPageDirty when a page is removed from swap
      cache: so there's a category of ex-swap pages that are easily
      migratable, but were inadvertently excluded from compaction's async
      migration in 4.16.
      
      Link: http://lkml.kernel.org/r/alpine.LSU.2.11.1805302014001.12558@eggly.anvils
      Fixes: 69d763fc ("mm: pin address_space before dereferencing it while isolating an LRU page")
      Signed-off-by: NHugh Dickins <hughd@google.com>
      Acked-by: NMinchan Kim <minchan@kernel.org>
      Acked-by: NMel Gorman <mgorman@techsingularity.net>
      Reported-by: NIvan Kalvachev <ikalvachev@gmail.com>
      Cc: "Huang, Ying" <ying.huang@intel.com>
      Cc: Jan Kara <jack@suse.cz>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      145e1a71
    • H
      mm/huge_memory.c: __split_huge_page() use atomic ClearPageDirty() · 2d077d4b
      Hugh Dickins 提交于
      Swapping load on huge=always tmpfs (with khugepaged tuned up to be very
      eager, but I'm not sure that is relevant) soon hung uninterruptibly,
      waiting for page lock in shmem_getpage_gfp()'s find_lock_entry(), most
      often when "cp -a" was trying to write to a smallish file.  Debug showed
      that the page in question was not locked, and page->mapping NULL by now,
      but page->index consistent with having been in a huge page before.
      
      Reproduced in minutes on a 4.15 kernel, even with 4.17's 605ca5ed
      ("mm/huge_memory.c: reorder operations in __split_huge_page_tail()") added
      in; but took hours to reproduce on a 4.17 kernel (no idea why).
      
      The culprit proved to be the __ClearPageDirty() on tails beyond i_size in
      __split_huge_page(): the non-atomic __bitoperation may have been safe when
      4.8's baa355fd ("thp: file pages support for split_huge_page()")
      introduced it, but liable to erase PageWaiters after 4.10's 62906027
      ("mm: add PageWaiters indicating tasks are waiting for a page bit").
      
      Link: http://lkml.kernel.org/r/alpine.LSU.2.11.1805291841070.3197@eggly.anvils
      Fixes: 62906027 ("mm: add PageWaiters indicating tasks are waiting for a page bit")
      Signed-off-by: NHugh Dickins <hughd@google.com>
      Acked-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
      Cc: Nicholas Piggin <npiggin@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2d077d4b
  9. 02 6月, 2018 8 次提交
  10. 01 6月, 2018 3 次提交