Message ID | 20210807032521.7591-3-peterx@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <SRS0=Uq7m=M6=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,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 CA5B7C4338F for <linux-mm@archiver.kernel.org>; Sat, 7 Aug 2021 03:25:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1A6F461185 for <linux-mm@archiver.kernel.org>; Sat, 7 Aug 2021 03:25:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1A6F461185 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 94D8E6B0072; Fri, 6 Aug 2021 23:25:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8FD2C8D0001; Fri, 6 Aug 2021 23:25:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7776B6B0074; Fri, 6 Aug 2021 23:25:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0182.hostedemail.com [216.40.44.182]) by kanga.kvack.org (Postfix) with ESMTP id 56BB96B0072 for <linux-mm@kvack.org>; Fri, 6 Aug 2021 23:25:30 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 135268249980 for <linux-mm@kvack.org>; Sat, 7 Aug 2021 03:25:30 +0000 (UTC) X-FDA: 78446844420.23.D1082FD Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf02.hostedemail.com (Postfix) with ESMTP id 96F4E70037BC for <linux-mm@kvack.org>; Sat, 7 Aug 2021 03:25:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628306729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L/1RwXysWQ1sqglJySJDDwULyThf17AJDB9rf0b/YTw=; b=bGX27SEnLTAuEM8/0SjraWlF17iCsNgxqEsBUgYNUWEN5UZUDtvhj/s7YLNxtCG9d4F2wO mG5Qkpj0N3d6kgBLg7csr95mkSppuxWP3Xm/Th6vWs4T1AqB4hlkeF4XUcJijT51zrZmnt 3PaLgQ0qwsLvlHbOyhj/Ckpny0Ctiqk= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-147-YJV3eyi3ONqoVEFlMl5uDQ-1; Fri, 06 Aug 2021 23:25:27 -0400 X-MC-Unique: YJV3eyi3ONqoVEFlMl5uDQ-1 Received: by mail-qk1-f197.google.com with SMTP id h186-20020a37b7c30000b02903b914d9e335so7681359qkf.17 for <linux-mm@kvack.org>; Fri, 06 Aug 2021 20:25:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L/1RwXysWQ1sqglJySJDDwULyThf17AJDB9rf0b/YTw=; b=tNQm3U2ql02/STyww/OBKV8gVJEDOXzo4ufxtZTGrM7zgRW7HWs0x/Vi5zwlPD9ADj QZuHZmIsER1yApYdgm7RNAIGcEGpQ0M6FvVN+FJC74cRnHQxia60MZZFNQMvm5EjTca0 h2e/FLjVdL9YeaNr/FVIgfnmyJjLyeIFRQpe6wR9leYtWzR4UD8wmokZMlh9/F5XfRV3 N6UYNdDyu/j8SjvT0DdcjP3pFnW7aqNLuxLqoErPaur19kCJSHbL2YdrzRrxIr40Ktsg GcXE5Twy4HBw82XtKRkLWc6hz5loddkO0Er8fqKWspGm7tsPJGtM/UQSMWq/23HHJjdQ SyrA== X-Gm-Message-State: AOAM530n2LjZLJtb2UIXAzBiMEie4bKSINvhK1cUKCKZ20MSP6k5YdAy y81mycGSU7/N6h0jHfYC22ySl7zReIf7/tCoUJjUyTRR/TD/pN8QVR8qgcLBikqlw5hfJSr11J8 3yGTuGYZSh+o= X-Received: by 2002:ac8:7292:: with SMTP id v18mr11780646qto.301.1628306727497; Fri, 06 Aug 2021 20:25:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyV9N7QxwGCkDas76nsjjYHmx//9jTApLA8tn9+Vvt7uhtdjfAKM+aH0uMld3+bwGot4UtMDA== X-Received: by 2002:ac8:7292:: with SMTP id v18mr11780632qto.301.1628306727286; Fri, 06 Aug 2021 20:25:27 -0700 (PDT) Received: from localhost.localdomain (bras-base-toroon474qw-grc-92-76-70-75-133.dsl.bell.ca. [76.70.75.133]) by smtp.gmail.com with ESMTPSA id a5sm5514875qkk.92.2021.08.06.20.25.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Aug 2021 20:25:26 -0700 (PDT) From: Peter Xu <peterx@redhat.com> To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Alistair Popple <apopple@nvidia.com>, Tiberiu Georgescu <tiberiu.georgescu@nutanix.com>, ivan.teterevkov@nutanix.com, Mike Rapoport <rppt@linux.vnet.ibm.com>, Hugh Dickins <hughd@google.com>, peterx@redhat.com, Matthew Wilcox <willy@infradead.org>, Andrea Arcangeli <aarcange@redhat.com>, David Hildenbrand <david@redhat.com>, "Kirill A . Shutemov" <kirill@shutemov.name>, Andrew Morton <akpm@linux-foundation.org>, Mike Kravetz <mike.kravetz@oracle.com> Subject: [PATCH RFC 2/4] mm: Check against orig_pte for finish_fault() Date: Fri, 6 Aug 2021 23:25:19 -0400 Message-Id: <20210807032521.7591-3-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210807032521.7591-1-peterx@redhat.com> References: <20210807032521.7591-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="US-ASCII" X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 96F4E70037BC Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=bGX27SEn; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf02.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=peterx@redhat.com X-Stat-Signature: e57azofn1cacq7ndqhqm4s1a1uj634y3 X-HE-Tag: 1628306729-506116 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 |
mm: Enable PM_SWAP for shmem with PTE_MARKER
|
expand
|
diff --git a/mm/memory.c b/mm/memory.c index 25fc46e87214..7288f585544a 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4047,7 +4047,7 @@ vm_fault_t finish_fault(struct vm_fault *vmf) vmf->address, &vmf->ptl); ret = 0; /* Re-check under ptl */ - if (likely(pte_none(*vmf->pte))) + if (likely(pte_same(*vmf->pte, vmf->orig_pte))) do_set_pte(vmf, page, vmf->address); else ret = VM_FAULT_NOPAGE;
We used to check against none pte and in those cases orig_pte should always be none pte anyway. This change prepares us to be able to call do_fault() on !none ptes. For example, we should allow that to happen for pte marker that has PAGEOUT set. Signed-off-by: Peter Xu <peterx@redhat.com> --- mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)