From: Luis Henriques <luis.henriques@canonical.com>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
kernel-team@lists.ubuntu.com
Cc: Chen Yucong <slaoub@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Luis Henriques <luis.henriques@canonical.com>
Subject: [PATCH 3.11 19/93] hwpoison, hugetlb: lock_page/unlock_page does not match for handling a free hugepage
Date: Mon, 23 Jun 2014 14:01:58 +0100 [thread overview]
Message-ID: <1403528592-2163-20-git-send-email-luis.henriques@canonical.com> (raw)
In-Reply-To: <1403528592-2163-1-git-send-email-luis.henriques@canonical.com>
3.11.10.12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Yucong <slaoub@gmail.com>
commit b985194c8c0a130ed155b71662e39f7eaea4876f upstream.
For handling a free hugepage in memory failure, the race will happen if
another thread hwpoisoned this hugepage concurrently. So we need to
check PageHWPoison instead of !PageHWPoison.
If hwpoison_filter(p) returns true or a race happens, then we need to
unlock_page(hpage).
Signed-off-by: Chen Yucong <slaoub@gmail.com>
Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Tested-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
mm/memory-failure.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index a86908134a8f..d3772a6118ee 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1083,15 +1083,16 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
return 0;
} else if (PageHuge(hpage)) {
/*
- * Check "just unpoisoned", "filter hit", and
- * "race with other subpage."
+ * Check "filter hit" and "race with other subpage."
*/
lock_page(hpage);
- if (!PageHWPoison(hpage)
- || (hwpoison_filter(p) && TestClearPageHWPoison(p))
- || (p != hpage && TestSetPageHWPoison(hpage))) {
- atomic_long_sub(nr_pages, &num_poisoned_pages);
- return 0;
+ if (PageHWPoison(hpage)) {
+ if ((hwpoison_filter(p) && TestClearPageHWPoison(p))
+ || (p != hpage && TestSetPageHWPoison(hpage))) {
+ atomic_long_sub(nr_pages, &num_poisoned_pages);
+ unlock_page(hpage);
+ return 0;
+ }
}
set_page_hwpoison_huge_page(hpage);
res = dequeue_hwpoisoned_huge_page(hpage);
--
1.9.1
next prev parent reply other threads:[~2014-06-23 13:03 UTC|newest]
Thread overview: 94+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-23 13:01 [3.11.y.z extended stable] Linux 3.11.10.12 stable review Luis Henriques
2014-06-23 13:01 ` [PATCH 3.11 01/93] cfg80211: free sme on connection failures Luis Henriques
2014-06-23 13:01 ` [PATCH 3.11 02/93] sched: Sanitize irq accounting madness Luis Henriques
2014-06-23 13:01 ` [PATCH 3.11 03/93] sched: Use CPUPRI_NR_PRIORITIES instead of MAX_RT_PRIO in cpupri check Luis Henriques
2014-06-23 13:01 ` [PATCH 3.11 04/93] net: cpsw: fix null dereference at probe Luis Henriques
2014-06-23 13:01 ` [PATCH 3.11 05/93] mac80211: fix suspend vs. association race Luis Henriques
2014-06-23 13:01 ` [PATCH 3.11 06/93] mac80211: fix on-channel remain-on-channel Luis Henriques
2014-06-23 13:01 ` [PATCH 3.11 07/93] af_iucv: wrong mapping of sent and confirmed skbs Luis Henriques
2014-06-23 13:01 ` [PATCH 3.11 08/93] net: filter: s390: fix JIT address randomization Luis Henriques
2014-06-23 13:01 ` [PATCH 3.11 09/93] perf: Limit perf_event_attr::sample_period to 63 bits Luis Henriques
2014-06-23 13:01 ` [PATCH 3.11 10/93] perf: Prevent false warning in perf_swevent_add Luis Henriques
2014-06-23 13:01 ` [PATCH 3.11 11/93] drm/gf119-/disp: fix nasty bug which can clobber SOR0's clock setup Luis Henriques
2014-06-23 13:01 ` [PATCH 3.11 12/93] drm/radeon: also try GART for CPU accessed buffers Luis Henriques
2014-06-23 13:01 ` [PATCH 3.11 13/93] drm/radeon: handle non-VGA class pci devices with ATRM Luis Henriques
2014-06-23 13:01 ` [PATCH 3.11 14/93] drm/radeon: fix register typo on si Luis Henriques
2014-06-23 13:01 ` [PATCH 3.11 15/93] drm/radeon: avoid segfault on device open when accel is not working Luis Henriques
2014-06-23 13:01 ` [PATCH 3.11 16/93] can: peak_pci: prevent use after free at netdev removal Luis Henriques
2014-06-23 13:01 ` [PATCH 3.11 17/93] nfsd4: remove lockowner when removing lock stateid Luis Henriques
2014-06-23 13:01 ` [PATCH 3.11 18/93] nfsd4: warn on finding lockowner without stateid's Luis Henriques
2014-06-23 13:01 ` Luis Henriques [this message]
2014-06-23 13:01 ` [PATCH 3.11 20/93] mm/memory-failure.c: fix memory leak by race between poison and unpoison Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 21/93] netfilter: ipv4: defrag: set local_df flag on defragmented skb Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 22/93] ARM: OMAP3: clock: Back-propagate rate change from cam_mclk to dpll4_m5 on all OMAP3 platforms Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 23/93] dma: dw: allow shared interrupts Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 24/93] dmaengine: dw: went back to plain {request,free}_irq() calls Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 25/93] ARM: omap5: hwmod_data: Correct IDLEMODE for McPDM Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 26/93] Input: synaptics - add min/max quirk for the ThinkPad W540 Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 27/93] futex: Add another early deadlock detection check Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 28/93] futex: Prevent attaching to kernel threads Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 29/93] ARM: OMAP4: Fix the boot regression with CPU_IDLE enabled Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 30/93] cpufreq: remove race while accessing cur_policy Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 31/93] cpufreq: cpu0: drop wrong devm usage Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 32/93] ARM: imx: fix error handling in ipu device registration Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 33/93] ALSA: hda - Fix onboard audio on Intel H97/Z97 chipsets Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 34/93] ARM: 8051/1: put_user: fix possible data corruption in put_user Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 35/93] ARM: 8064/1: fix v7-M signal return Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 36/93] Input: synaptics - T540p - unify with other LEN0034 models Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 37/93] drm/i915: Only copy back the modified fields to userspace from execbuffer Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 38/93] dm cache: always split discards on cache block boundaries Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 39/93] powerpc: Fix 64 bit builds with binutils 2.24 Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 40/93] powerpc, kexec: Fix "Processor X is stuck" issue during kexec from ST mode Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 41/93] rtmutex: Fix deadlock detector for real Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 42/93] drm/radeon: don't allow RADEON_GEM_DOMAIN_CPU for command submission Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 43/93] audit: restore order of tty and ses fields in log output Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 44/93] drm/nouveau/pm/fan: drop the fan lock in fan_update() before rescheduling Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 45/93] leds: leds-pwm: properly clean up after probe failure Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 46/93] clk: vexpress: NULL dereference on error path Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 47/93] [SCSI] fix our current target reap infrastructure Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 48/93] [SCSI] dual scan thread bug fix Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 49/93] genirq: Provide irq_force_affinity fallback for non-SMP Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 50/93] i2c: designware: Mask all interrupts during i2c controller enable Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 51/93] crypto: s390 - fix aes,des ctr mode concurrency finding Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 52/93] Staging: speakup: Move pasting into a work item Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 53/93] USB: Avoid runtime suspend loops for HCDs that can't handle suspend/resume Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 54/93] can: only rename enabled led triggers when changing the netdev name Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 55/93] USB: io_ti: fix firmware download on big-endian machines (part 2) Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 56/93] USB: ftdi_sio: add NovaTech OrionLXm product ID Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 57/93] USB: serial: option: add support for Novatel E371 PCIe card Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 58/93] USB: cdc-wdm: properly include types.h Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 59/93] md: always set MD_RECOVERY_INTR when aborting a reshape or other "resync" Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 60/93] xhci: delete endpoints from bandwidth list before freeing whole device Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 61/93] md: always set MD_RECOVERY_INTR when interrupting a reshape thread Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 62/93] ALSA: hda/analog - Fix silent output on ASUS A8JN Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 63/93] ALSA: hda/realtek - Correction of fixup codes for PB V7900 laptop Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 64/93] ALSA: hda/realtek - Fix COEF widget NID for ALC260 replacer fixup Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 65/93] iser-target: Add missing target_put_sess_cmd for ImmedateData failure Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 66/93] iscsi-target: Fix wrong buffer / buffer overrun in iscsi_change_param_value() Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 67/93] percpu-refcount: fix usage of this_cpu_ops Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 68/93] futex-prevent-requeue-pi-on-same-futex.patch futex: Forbid uaddr == uaddr2 in futex_requeue(..., requeue_pi=1) Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 69/93] futex: Validate atomic acquisition in futex_lock_pi_atomic() Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 70/93] futex: Always cleanup owner tid in unlock_pi Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 71/93] futex: Make lookup_pi_state more robust Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 72/93] target: Fix alua_access_state attribute OOPs for un-configured devices Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 73/93] mm: rmap: fix use-after-free in __put_anon_vma Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 74/93] usb: cdc-wdm: export cdc-wdm uapi header Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 75/93] staging: comedi: ni_daq_700: add mux settling delay Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 76/93] kvm: free resources after canceling async_pf Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 77/93] kvm: remove .done from struct kvm_async_pf Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 78/93] KVM: async_pf: mm->mm_users can not pin apf->mm Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 79/93] mm/page-writeback.c: fix divide by zero in pos_ratio_polynom Luis Henriques
2014-06-23 13:02 ` [PATCH 3.11 80/93] dma: mv_xor: Flush descriptors before activating a channel Luis Henriques
2014-06-23 13:03 ` [PATCH 3.11 81/93] skbuff: skb_segment: orphan frags before copying Luis Henriques
2014-06-23 13:03 ` [PATCH 3.11 82/93] Target/iscsi,iser: Avoid accepting transport connections during stop stage Luis Henriques
2014-06-23 13:03 ` [PATCH 3.11 83/93] iser-target: Fix multi network portal shutdown regression Luis Henriques
2014-06-23 13:03 ` [PATCH 3.11 84/93] target: Allow READ_CAPACITY opcode in ALUA Standby access state Luis Henriques
2014-06-23 13:03 ` [PATCH 3.11 85/93] mm: compaction: reset cached scanner pfn's before reading them Luis Henriques
2014-06-23 13:03 ` [PATCH 3.11 86/93] mm: compaction: detect when scanners meet in isolate_freepages Luis Henriques
2014-06-23 13:03 ` [PATCH 3.11 87/93] MIPS: asm: thread_info: Add _TIF_SECCOMP flag Luis Henriques
2014-06-23 13:03 ` [PATCH 3.11 88/93] perf: Fix race in removing an event Luis Henriques
2014-06-23 13:03 ` [PATCH 3.11 89/93] hwmon: (ntc_thermistor) Fix dependencies Luis Henriques
2014-06-23 13:03 ` [PATCH 3.11 90/93] hwmon: (ntc_thermistor) Fix OF device ID mapping Luis Henriques
2014-06-23 13:03 ` [PATCH 3.11 91/93] fs,userns: Change inode_capable to capable_wrt_inode_uidgid Luis Henriques
2014-06-23 13:03 ` [PATCH 3.11 92/93] auditsc: audit_krule mask accesses need bounds checking Luis Henriques
2014-06-23 13:03 ` [PATCH 3.11 93/93] [SCSI] megaraid: Use resource_size_t for PCI resources, not long Luis Henriques
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1403528592-2163-20-git-send-email-luis.henriques@canonical.com \
--to=luis.henriques@canonical.com \
--cc=akpm@linux-foundation.org \
--cc=kernel-team@lists.ubuntu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=slaoub@gmail.com \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®