The patch titled
Subject: mm/hugetlb.c: teach follow_hugetlb_page() to handle FOLL_NOWAIT
has been removed from the -mm tree. Its filename was
mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Andrea Arcangeli <aarcange(a)redhat.com>
Subject: mm/hugetlb.c: teach follow_hugetlb_page() to handle FOLL_NOWAIT
hugetlb needs the same fix as faultin_nopage (which was applied in
96312e61282ae ("mm/gup.c: teach get_user_pages_unlocked to handle
FOLL_NOWAIT")) or KVM hangs because it thinks the mmap_sem was already
released by hugetlb_fault() if it returned VM_FAULT_RETRY, but it wasn't
in the FOLL_NOWAIT case.
Link: http://lkml.kernel.org/r/20190109020203.26669-2-aarcange@redhat.com
Fixes: ce53053ce378 ("kvm: switch get_user_page_nowait() to get_user_pages_unlocked()")
Signed-off-by: Andrea Arcangeli <aarcange(a)redhat.com>
Tested-by: "Dr. David Alan Gilbert" <dgilbert(a)redhat.com>
Reported-by: "Dr. David Alan Gilbert" <dgilbert(a)redhat.com>
Reviewed-by: Mike Kravetz <mike.kravetz(a)oracle.com>
Reviewed-by: Peter Xu <peterx(a)redhat.com>
Cc: Mike Rapoport <rppt(a)linux.vnet.ibm.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
mm/hugetlb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/mm/hugetlb.c~mm-hugetlbc-teach-follow_hugetlb_page-to-handle-foll_nowait
+++ a/mm/hugetlb.c
@@ -4268,7 +4268,8 @@ long follow_hugetlb_page(struct mm_struc
break;
}
if (ret & VM_FAULT_RETRY) {
- if (nonblocking)
+ if (nonblocking &&
+ !(fault_flags & FAULT_FLAG_RETRY_NOWAIT))
*nonblocking = 0;
*nr_pages = 0;
/*
_
Patches currently in -mm which might be from aarcange(a)redhat.com are
+ GKH
On 01/02/2019 17:23, Marc Gonzalez wrote:
> On 23/01/2019 13:31, Mike Rapoport wrote:
>
>> Signed-off-by: Mike Rapoport <rppt(a)linux.ibm.com>
>> Tested-by: Marc Gonzalez <marc.w.gonzalez(a)free.fr>
>> Acked-by: Marek Szyprowski <m.szyprowski(a)samsung.com>
>> ---
>> drivers/of/of_reserved_mem.c | 18 +++++-------------
>> 1 file changed, 5 insertions(+), 13 deletions(-)
>
> Thanks for the patch, Mike.
>
> Whose tree should this patch go through?
By the way, I think we can add
Acked-by: Prateek Patel <prpatel(a)nvidia.com>
Fixes: 3f0c820664483 ("drivers: of: add initialization code for dynamic reserved memory")
Cc: stable(a)vger.kernel.org # 3.15+
Regards.
Hello,
We ran automated tests on a patchset that was proposed for merging into this
kernel tree. The patches were applied to:
Kernel repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Commit: 65f42a73e553 Linux 4.20.6
The results of these automated tests are provided below.
Overall result: PASSED
Patch merge: OK
Compile: OK
Kernel tests: OK
Please reply to this email if you have any questions about the tests that we
ran or if you have any suggestions on how to make future tests more effective.
,-. ,-.
( C ) ( K ) Continuous
`-',-.`-' Kernel
( I ) Integration
`-'
______________________________________________________________________________
Merge testing
-------------
We cloned this repository and checked out a ref:
Repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Ref: 65f42a73e553 Linux 4.20.6
We then merged the following patches with `git am`:
drm-msm-gpu-fix-building-without-debugfs.patch
ipv6-sr-clear-ip6cb-skb-on-srh-ip4ip6-encapsulation.patch
ipvlan-l3mdev-fix-broken-l3s-mode-wrt-local-routes.patch
l2tp-copy-4-more-bytes-to-linear-part-if-necessary.patch
l2tp-fix-reading-optional-fields-of-l2tpv3.patch
net-ip_gre-always-reports-o_key-to-userspace.patch
net-ip_gre-use-erspan-key-field-for-tunnel-lookup.patch
net-ipv6-don-t-return-positive-numbers-when-nothing-was-dumped.patch
net-mlx4_core-add-masking-for-a-few-queries-on-hca-caps.patch
netrom-switch-to-sock-timer-api.patch
net-rose-fix-null-ax25_cb-kernel-panic.patch
net-set-default-network-namespace-in-init_dummy_netdev.patch
ravb-expand-rx-descriptor-data-to-accommodate-hw-checksum.patch
sctp-improve-the-events-for-sctp-stream-reset.patch
tun-move-the-call-to-tun_set_real_num_queues.patch
ucc_geth-reset-bql-queue-when-stopping-device.patch
vhost-fix-oob-in-get_rx_bufs.patch
net-ip6_gre-always-reports-o_key-to-userspace.patch
sctp-improve-the-events-for-sctp-stream-adding.patch
net-mlx5e-allow-mac-invalidation-while-spoofchk-is-on.patch
ip6mr-fix-notifiers-call-on-mroute_clean_tables.patch
revert-net-mlx5e-e-switch-initialize-eswitch-only-if-eswitch-manager.patch
sctp-set-chunk-transport-correctly-when-it-s-a-new-asoc.patch
sctp-set-flow-sport-from-saddr-only-when-it-s-0.patch
net-tls-fix-deadlock-in-free_resources-tx.patch
net-tls-save-iv-in-tls_rec-for-async-crypto-requests.patch
virtio_net-don-t-enable-napi-when-interface-is-down.patch
virtio_net-don-t-call-free_old_xmit_skbs-for-xdp_frames.patch
virtio_net-fix-not-restoring-real_num_rx_queues.patch
virtio_net-fix-out-of-bounds-access-of-sq.patch
virtio_net-don-t-process-redirected-xdp-frames-when-xdp-is-disabled.patch
virtio_net-use-xdp_return_frame-to-free-xdp_frames-on-destroying-vqs.patch
virtio_net-differentiate-sk_buff-and-xdp_frame-on-freeing.patch
ipv6-consider-sk_bound_dev_if-when-binding-a-socket-to-an-address.patch
cifs-do-not-count-enodata-as-failure-for-query-directory.patch
cifs-fix-possible-oops-and-memory-leaks-in-async-io.patch
cifs-fix-trace-command-logging-for-smb2-reads-and-writes.patch
cifs-fix-use-after-free-of-the-lease-keys.patch
cifs-do-not-consider-enodata-as-stat-failure-for-reads.patch
fs-dcache-fix-incorrect-nr_dentry_unused-accounting-in-shrink_dcache_sb.patch
iommu-vt-d-fix-memory-leak-in-intel_iommu_put_resv_regions.patch
selftests-seccomp-enhance-per-arch-ptrace-syscall-skip-tests.patch
nfs-fix-up-return-value-on-fatal-errors-in-nfs_page_async_flush.patch
arm-cns3xxx-fix-writing-to-wrong-pci-config-registers-after-alignment.patch
arm64-kaslr-ensure-randomized-quantities-are-clean-also-when-kaslr-is-off.patch
arm64-do-not-issue-ipis-for-user-executable-ptes.patch
arm64-hyp-stub-forbid-kprobing-of-the-hyp-stub.patch
arm64-hibernate-clean-the-__hyp_text-to-poc-after-resume.patch
gpio-altera-a10sr-set-proper-output-level-for-direction_output.patch
gpiolib-fix-line-event-timestamps-for-nested-irqs.patch
gpio-pcf857x-fix-interrupts-on-multiple-instances.patch
gpio-sprd-fix-the-incorrect-data-register.patch
gpio-sprd-fix-incorrect-irq-type-setting-for-the-async-eic.patch
gfs2-revert-fix-loop-in-gfs2_rbm_find.patch
mmc-bcm2835-fix-dma-channel-leak-on-probe-error.patch
mmc-mediatek-fix-incorrect-register-setting-of-hs400_cmd_int_delay.patch
alsa-usb-audio-add-opus-3-to-quirks-for-native-dsd-support.patch
alsa-hda-realtek-fixed-hp_pin-no-value.patch
alsa-pcm-fix-tight-loop-of-oss-capture-stream.patch
ib-uverbs-fix-oops-upon-device-disassociation.patch
ib-uverbs-fix-oops-in-uverbs_user_mmap_disassociate.patch
ib-hfi1-remove-overly-conservative-vm_exec-flag-check.patch
ib-hfi1-add-limit-test-for-rc-uc-send-via-loopback.patch
platform-x86-asus-nb-wmi-map-0x35-to-key_screenlock.patch
platform-x86-asus-nb-wmi-drop-mapping-of-0x33-and-0x.patch
btrfs-fix-deadlock-when-allocating-tree-block-during-leaf-node-split.patch
btrfs-on-error-always-free-subvol_name-in-btrfs_mount.patch
kernel-exit.c-release-ptraced-tasks-before-zap_pid_ns_processes.patch
mm-hugetlb.c-teach-follow_hugetlb_page-to-handle-foll_nowait.patch
oom-oom_reaper-do-not-enqueue-same-task-twice.patch
mm-memory_hotplug-fix-scan_movable_pages-for-gigantic-hugepages.patch
mm-oom-fix-use-after-free-in-oom_kill_process.patch
mm-hwpoison-use-do_send_sig_info-instead-of-force_sig.patch
mm-migrate-don-t-rely-on-__pagemovable-of-newpage-after-unlocking-it.patch
Compile testing
---------------
We compiled the kernel for 4 architectures:
s390x:
make options: make INSTALL_MOD_STRIP=1 -j64 targz-pkg -j64
configuration: https://artifacts.cki-project.org/builds/s390x/743eef229729cd24f8d68930968a…
powerpc64le:
make options: make INSTALL_MOD_STRIP=1 -j64 targz-pkg -j64
configuration: https://artifacts.cki-project.org/builds/ppc64le/5df366cff2307273e396f3a491…
aarch64:
make options: make INSTALL_MOD_STRIP=1 -j64 targz-pkg -j64
configuration: https://artifacts.cki-project.org/builds/aarch64/eb79bc8d51292cd2b49c4d97c1…
x86_64:
make options: make INSTALL_MOD_STRIP=1 -j64 targz-pkg -j64
configuration: https://artifacts.cki-project.org/builds/x86_64/cc70770ed103646ca100d3ebd8b…
Hardware testing
----------------
We booted each kernel and ran the following tests:
s390:
Boot test
- URL: https://github.com/CKI-project/tests-beaker/archive/master.zip#distribution…
/distribution/command
LTP lite - release 20180926
- URL: https://github.com/CKI-project/tests-beaker/archive/master.zip#distribution…
/kernel/loopdev/sanity
AMTU (Abstract Machine Test Utility)
- URL: https://github.com/CKI-project/tests-beaker/archive/master.zip#misc/amtu
powerpc:
Boot test
- URL: https://github.com/CKI-project/tests-beaker/archive/master.zip#distribution…
/distribution/command
LTP lite - release 20180926
- URL: https://github.com/CKI-project/tests-beaker/archive/master.zip#distribution…
/kernel/loopdev/sanity
xfstests: xfs
- URL: https://github.com/CKI-project/tests-beaker/archive/master.zip#/filesystems…
AMTU (Abstract Machine Test Utility)
- URL: https://github.com/CKI-project/tests-beaker/archive/master.zip#misc/amtu
Usex - version 1.9-29
- URL: https://github.com/CKI-project/tests-beaker/archive/master.zip#standards/us…
arm64:
Boot test
- URL: https://github.com/CKI-project/tests-beaker/archive/master.zip#distribution…
/distribution/command
LTP lite - release 20180926
- URL: https://github.com/CKI-project/tests-beaker/archive/master.zip#distribution…
/kernel/loopdev/sanity
xfstests: xfs
- URL: https://github.com/CKI-project/tests-beaker/archive/master.zip#/filesystems…
AMTU (Abstract Machine Test Utility)
- URL: https://github.com/CKI-project/tests-beaker/archive/master.zip#misc/amtu
Usex - version 1.9-29
- URL: https://github.com/CKI-project/tests-beaker/archive/master.zip#standards/us…
x86_64:
Boot test
- URL: https://github.com/CKI-project/tests-beaker/archive/master.zip#distribution…
/distribution/command
LTP lite - release 20180926
- URL: https://github.com/CKI-project/tests-beaker/archive/master.zip#distribution…
/kernel/loopdev/sanity
xfstests: xfs
- URL: https://github.com/CKI-project/tests-beaker/archive/master.zip#/filesystems…
AMTU (Abstract Machine Test Utility)
- URL: https://github.com/CKI-project/tests-beaker/archive/master.zip#misc/amtu
Usex - version 1.9-29
- URL: https://github.com/CKI-project/tests-beaker/archive/master.zip#standards/us…
Hi Ulf,
On 2/4/2019 6:06 AM, Ulf Hansson wrote:
> On Fri, 1 Feb 2019 at 17:34, Wei Xu <xuwei5(a)hisilicon.com> wrote:
>>
>> Hi Jan,
>>
>> On 1/24/2019 7:52 AM, Jan Kiszka wrote:
>>> From: Jan Kiszka <jan.kiszka(a)siemens.com>
>>>
>>> Somewhere along recent changes to power control of the wl1835, power-on
>>> became very unreliable on the hikey, failing like this:
>>>
>>> wl1271_sdio: probe of mmc2:0001:1 failed with error -16
>>> wl1271_sdio: probe of mmc2:0001:2 failed with error -16
>>>
>>> After playing with some dt parameters and comparing to other users of
>>> this chip, it turned out we need some power-on delay to make things
>>> stable again. In contrast to those other users which define 200 ms, the
>>> hikey would already be happy with 1 ms. Still, we use the safer 10 ms,
>>> like on the Ultra96.
>>>
>>> Fixes: ea452678734e ("arm64: dts: hikey: Fix WiFi support")
>>> Signed-off-by: Jan Kiszka <jan.kiszka(a)siemens.com>
>>> Acked-by: Ulf Hansson <ulf.hansson(a)linaro.org>
>>
>> Applied to the hisilicon soc dt tree.
>
> Wei, can you please also add a stable tag to it?
Yes, added below tag into this patch.
Cc: <stable(a)vger.kernel.org> #4.12+
Thanks for your kindly reminder :)
Best Regards,
Wei
>
> [...]
>
> Thanks and kind regards
> Uffe
>
> .
>
The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 9bcdeb51bd7d2ae9fe65ea4d60643d2aeef5bfe3 Mon Sep 17 00:00:00 2001
From: Tetsuo Handa <penguin-kernel(a)I-love.SAKURA.ne.jp>
Date: Fri, 1 Feb 2019 14:20:31 -0800
Subject: [PATCH] oom, oom_reaper: do not enqueue same task twice
Arkadiusz reported that enabling memcg's group oom killing causes
strange memcg statistics where there is no task in a memcg despite the
number of tasks in that memcg is not 0. It turned out that there is a
bug in wake_oom_reaper() which allows enqueuing same task twice which
makes impossible to decrease the number of tasks in that memcg due to a
refcount leak.
This bug existed since the OOM reaper became invokable from
task_will_free_mem(current) path in out_of_memory() in Linux 4.7,
T1@P1 |T2@P1 |T3@P1 |OOM reaper
----------+----------+----------+------------
# Processing an OOM victim in a different memcg domain.
try_charge()
mem_cgroup_out_of_memory()
mutex_lock(&oom_lock)
try_charge()
mem_cgroup_out_of_memory()
mutex_lock(&oom_lock)
try_charge()
mem_cgroup_out_of_memory()
mutex_lock(&oom_lock)
out_of_memory()
oom_kill_process(P1)
do_send_sig_info(SIGKILL, @P1)
mark_oom_victim(T1@P1)
wake_oom_reaper(T1@P1) # T1@P1 is enqueued.
mutex_unlock(&oom_lock)
out_of_memory()
mark_oom_victim(T2@P1)
wake_oom_reaper(T2@P1) # T2@P1 is enqueued.
mutex_unlock(&oom_lock)
out_of_memory()
mark_oom_victim(T1@P1)
wake_oom_reaper(T1@P1) # T1@P1 is enqueued again due to oom_reaper_list == T2@P1 && T1@P1->oom_reaper_list == NULL.
mutex_unlock(&oom_lock)
# Completed processing an OOM victim in a different memcg domain.
spin_lock(&oom_reaper_lock)
# T1P1 is dequeued.
spin_unlock(&oom_reaper_lock)
but memcg's group oom killing made it easier to trigger this bug by
calling wake_oom_reaper() on the same task from one out_of_memory()
request.
Fix this bug using an approach used by commit 855b018325737f76 ("oom,
oom_reaper: disable oom_reaper for oom_kill_allocating_task"). As a
side effect of this patch, this patch also avoids enqueuing multiple
threads sharing memory via task_will_free_mem(current) path.
Link: http://lkml.kernel.org/r/e865a044-2c10-9858-f4ef-254bc71d6cc2@i-love.sakura…
Link: http://lkml.kernel.org/r/5ee34fc6-1485-34f8-8790-903ddabaa809@i-love.sakura…
Fixes: af8e15cc85a25315 ("oom, oom_reaper: do not enqueue task if it is on the oom_reaper_list head")
Signed-off-by: Tetsuo Handa <penguin-kernel(a)I-love.SAKURA.ne.jp>
Reported-by: Arkadiusz Miskiewicz <arekm(a)maven.pl>
Tested-by: Arkadiusz Miskiewicz <arekm(a)maven.pl>
Acked-by: Michal Hocko <mhocko(a)suse.com>
Acked-by: Roman Gushchin <guro(a)fb.com>
Cc: Tejun Heo <tj(a)kernel.org>
Cc: Aleksa Sarai <asarai(a)suse.de>
Cc: Jay Kamat <jgkamat(a)fb.com>
Cc: Johannes Weiner <hannes(a)cmpxchg.org>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds(a)linux-foundation.org>
diff --git a/include/linux/sched/coredump.h b/include/linux/sched/coredump.h
index ec912d01126f..ecdc6542070f 100644
--- a/include/linux/sched/coredump.h
+++ b/include/linux/sched/coredump.h
@@ -71,6 +71,7 @@ static inline int get_dumpable(struct mm_struct *mm)
#define MMF_HUGE_ZERO_PAGE 23 /* mm has ever used the global huge zero page */
#define MMF_DISABLE_THP 24 /* disable THP for all VMAs */
#define MMF_OOM_VICTIM 25 /* mm is the oom victim */
+#define MMF_OOM_REAP_QUEUED 26 /* mm was queued for oom_reaper */
#define MMF_DISABLE_THP_MASK (1 << MMF_DISABLE_THP)
#define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK |\
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index f0e8cd9edb1a..059e617a1847 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -647,8 +647,8 @@ static int oom_reaper(void *unused)
static void wake_oom_reaper(struct task_struct *tsk)
{
- /* tsk is already queued? */
- if (tsk == oom_reaper_list || tsk->oom_reaper_list)
+ /* mm is already queued? */
+ if (test_and_set_bit(MMF_OOM_REAP_QUEUED, &tsk->signal->oom_mm->flags))
return;
get_task_struct(tsk);
On 2019-02-04 06:14:51 [+0000], Sasha Levin wrote:
> Hi,
>
> [This is an automated email]
>
> This commit has been processed because it contains a -stable tag.
> The stable tag indicates that it's relevant for the following trees: all
>
> The bot has tested the following trees: v4.20.6, v4.19.19, v4.14.97, v4.9.154, v4.4.172, v3.18.133.
>
> v4.20.6: Build OK!
> v4.19.19: Build OK!
> v4.14.97: Build OK!
> v4.9.154: Build OK!
> v4.4.172: Build OK!
> v3.18.133: Failed to apply! Possible dependencies:
> 81e8f2e930fe ("net: dp83640: Fix tx timestamp overflow handling.")
>
>
> How should we proceed with this patch?
I would skip v3.18, I backported more patches for my testing on v4.9.
Sebastian