Message ID | 20210407014502.24091-18-michel@lespinasse.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=7Ll9=JE=kvack.org=owner-linux-mm@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31491C43600 for <linux-mm@archiver.kernel.org>; Wed, 7 Apr 2021 01:45:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D2B0B613A7 for <linux-mm@archiver.kernel.org>; Wed, 7 Apr 2021 01:45:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D2B0B613A7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=lespinasse.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EDC358E000D; Tue, 6 Apr 2021 21:45:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 914248E0005; Tue, 6 Apr 2021 21:45:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1924F6B0085; Tue, 6 Apr 2021 21:45:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0145.hostedemail.com [216.40.44.145]) by kanga.kvack.org (Postfix) with ESMTP id 4D40A6B0087 for <linux-mm@kvack.org>; Tue, 6 Apr 2021 21:45:08 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1F969180ACEE4 for <linux-mm@kvack.org>; Wed, 7 Apr 2021 01:45:08 +0000 (UTC) X-FDA: 78003877896.09.6AFA25B Received: from server.lespinasse.org (server.lespinasse.org [63.205.204.226]) by imf06.hostedemail.com (Postfix) with ESMTP id C519DC0007C9 for <linux-mm@kvack.org>; Wed, 7 Apr 2021 01:45:08 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-11-ed; t=1617759902; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=oDsaekR07u2ZtR1enj5FUb1cWHHQoW5twL22pxVnaDw=; b=aVLbPOwuUGPHPf1Ujhsv2FvPJz0fLCHY7Qk5nH/FdfC6t9RP45dBC+UVkh7OEJwRA5NGO gINHLP2nA2rEEImAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-11-rsa; t=1617759902; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=oDsaekR07u2ZtR1enj5FUb1cWHHQoW5twL22pxVnaDw=; b=IPnOCuRQxi3KY+ZyKablrM9wkR6ZD4fXn+28c+kkjDkkYrkusvUcQX/piob3616D3gf62 867C15f7ac0Z7Yfe2+ANNkmYV/Cdn2iHdUIvLzrvtXTwyzroXU/F5+tdBV5gCgTsZ3DRPD+ OFCC83+W+Btw7i/N6KVbq6llm0/a8KLfAe8uAGtIzc7jsTC3lMCAcfScT/Pn6mbPtVzzzBp DIryKpr1+tOH7RwTYt56bIOomT/HwAqSgI7HR+WPaGM4BMfuzgA2XHI1YwuXQfFKmdmvBqU q1Cav343GpyKux7Qqo3LPUSsXtGPMH/GpzC+UyOiansbtZ54CG0zffUbwEcA== Received: from zeus.lespinasse.org (zeus.lespinasse.org [IPv6:fd00::150:0]) by server.lespinasse.org (Postfix) with ESMTPS id DDE761602FF; Tue, 6 Apr 2021 18:45:02 -0700 (PDT) Received: by zeus.lespinasse.org (Postfix, from userid 1000) id CC30019F320; Tue, 6 Apr 2021 18:45:02 -0700 (PDT) From: Michel Lespinasse <michel@lespinasse.org> To: Linux-MM <linux-mm@kvack.org> Cc: Laurent Dufour <ldufour@linux.ibm.com>, Peter Zijlstra <peterz@infradead.org>, Michal Hocko <mhocko@suse.com>, Matthew Wilcox <willy@infradead.org>, Rik van Riel <riel@surriel.com>, Paul McKenney <paulmck@kernel.org>, Andrew Morton <akpm@linux-foundation.org>, Suren Baghdasaryan <surenb@google.com>, Joel Fernandes <joelaf@google.com>, Rom Lemarchand <romlem@google.com>, Linux-Kernel <linux-kernel@vger.kernel.org>, Michel Lespinasse <michel@lespinasse.org> Subject: [RFC PATCH 17/37] mm: implement speculative handling in do_numa_page() Date: Tue, 6 Apr 2021 18:44:42 -0700 Message-Id: <20210407014502.24091-18-michel@lespinasse.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210407014502.24091-1-michel@lespinasse.org> References: <20210407014502.24091-1-michel@lespinasse.org> MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: C519DC0007C9 X-Stat-Signature: kbd7mw8nmdjbnmdk147urycwqtjcsek8 Received-SPF: none (lespinasse.org>: No applicable sender policy available) receiver=imf06; identity=mailfrom; envelope-from="<walken@lespinasse.org>"; helo=server.lespinasse.org; client-ip=63.205.204.226 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617759908-367115 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
[RFC,01/37] mmap locking API: mmap_lock_is_contended returns a bool
|
expand
|
diff --git a/mm/memory.c b/mm/memory.c index a2c5bf29f989..78cc36749754 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4181,8 +4181,8 @@ static vm_fault_t do_numa_page(struct vm_fault *vmf) * validation through pte_unmap_same(). It's of NUMA type but * the pfn may be screwed if the read is non atomic. */ - vmf->ptl = pte_lockptr(vma->vm_mm, vmf->pmd); - spin_lock(vmf->ptl); + if (!pte_spinlock(vmf)) + return VM_FAULT_RETRY; if (unlikely(!pte_same(*vmf->pte, vmf->orig_pte))) { pte_unmap_unlock(vmf->pte, vmf->ptl); goto out;
change do_numa_page() to use pte_spinlock() when locking the page table, so that the mmap sequence counter will be validated in the speculative case. Signed-off-by: Michel Lespinasse <michel@lespinasse.org> --- mm/memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)