From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-f194.google.com ([209.85.222.194]:41657 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729990AbeIFTp1 (ORCPT ); Thu, 6 Sep 2018 15:45:27 -0400 Received: by mail-qk1-f194.google.com with SMTP id h138-v6so7533226qke.8 for ; Thu, 06 Sep 2018 08:09:30 -0700 (PDT) From: Chas Williams <3chas3@gmail.com> To: stable@vger.kernel.org Cc: natechancellor@gmail.com, mark.rutland@arm.com, will.deacon@arm.com, steve.capper@arm.com, kirill.shutemov@linux.intel.com, vbabka@suse.cz, mgorman@suse.de, Chas Williams Subject: [PATCH][4.9.y] Fixes: Commit 2aa6d036b716 ("mm: numa: avoid waiting on freed migrated pages") Date: Thu, 6 Sep 2018 11:09:10 -0400 Message-Id: <20180906150910.17486-1-3chas3@gmail.com> In-Reply-To: <20180905085852.8122-1-3chas3@gmail.com> References: <20180905085852.8122-1-3chas3@gmail.com> Sender: stable-owner@vger.kernel.org List-ID: From: Chas Williams Commit 2aa6d036b716 ("mm: numa: avoid waiting on freed migrated pages") was an incomplete backport of the upstream commit. It is necessary to always reset page_nid before attempting any early exit. The original commit conflicted due to lack of commit 82b0f8c39a38 ("mm: join struct fault_env and vm_fault") in 4.9 so it wasn't a clean application, and the change must have just gotten lost in the noise. Signed-off-by: Chas Williams --- mm/huge_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 9efe88ef9702..e4c6c3edaf6a 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1259,12 +1259,12 @@ int do_huge_pmd_numa_page(struct fault_env *fe, pmd_t pmd) /* Migration could have started since the pmd_trans_migrating check */ if (!page_locked) { + page_nid = -1; if (!get_page_unless_zero(page)) goto out_unlock; spin_unlock(fe->ptl); wait_on_page_locked(page); put_page(page); - page_nid = -1; goto out; } -- 2.14.4