From patchwork Thu Sep 26 06:46:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13812877 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CE736CCF9E9 for ; Thu, 26 Sep 2024 06:53:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BmENsM1LVZMrc0W501TyzYIERT8c75Mhan1AJ9vs73Q=; b=Jrq+5duwpj+H43dkkr4u5NL7xf i905m/SuZVn2KSzO+oxGYfEE1DTiYxi5S9ECJ6wer6UyUiBumwcFSg/E+hFYE6QAQIBV0th42ynom leccLApmhOkC3uav67bZIZUeVJAGFh28X6311SSK86BngsFX4zm6JfnCELMGP379de9go0wPUNqgq 2wrwUqK4EWHGpkxdcEhzOLE1K4B/Fw12TfXKfW06ZA+JNVpIdsI2QY85yok4dlax6ZqjeJyQmp0ud oyR7BseQ0bYejxDlOrTkCJUuYvLRLMjA/dVTlGiWGwgZinFUu8Xg9cZG/XLCN9WNpLxL0vQykJ7Jk GNUbpgHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1stiMx-00000007On1-19so; Thu, 26 Sep 2024 06:52:55 +0000 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1stiHQ-00000007NGW-0zhe for linux-arm-kernel@lists.infradead.org; Thu, 26 Sep 2024 06:47:13 +0000 Received: by mail-qk1-x732.google.com with SMTP id af79cd13be357-7a9ab8e5f96so44559785a.1 for ; Wed, 25 Sep 2024 23:47:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1727333231; x=1727938031; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BmENsM1LVZMrc0W501TyzYIERT8c75Mhan1AJ9vs73Q=; b=kG+/wloWw/iUnVgXL6okmAIEZP246/hL5FZGvFFNCZw4r/7ex33fGwFZsQLE7/thps aqGa/xisADbU5AKx0zWQ4u5e35V1gBdQSTGCvosmgJXsoQv8RO9xNMT3Vlta3xoe6aTA QpTSIF5z9uO3K56qwjaQKRdsPRc3SmW8h1ZNPHGBwl8QBsnpatlNH6TJlBBZWo+B/NS/ 177RZjMTrk0z+EU3C7Gbwx30OuWs4WHAfai7fQ76mZNnMRuN2qD/YRbEsJyxQKVJMRyR IrO2NWkijiHgUhnuV5cXW6bhI1fwbVgWynpZVO1pN9B8lOeoCxUG2BA3qhJGFD5fbUbf ljKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727333231; x=1727938031; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BmENsM1LVZMrc0W501TyzYIERT8c75Mhan1AJ9vs73Q=; b=TaqOrrViKKP1bACbGwo7NdP/MOcGcgWkYisCZVwh09bWAM0fUogaNy1sW7ib1Ei5RN xVvaSn6MtzmByx9wdshIgnh3DieGv+1TG7jCzAAsVbofLxtcDuUTz5QKv5zFp7mYx8Bx cP6ayBev+q7e+oAZCkUtdAv778II6aMLfqmGeko9SeyJukmyUxIzenN6n2duEM2Ka8q7 uwiSrbX37Syr7CZCIu4fGMbEK6KY7luGaZNPhgR4Wno/vpFvg8rfNSEk/aYDf8yzrZ+l BiR9Kbzn5Uom7X+49rqLCMA6eg/9XFNf/GO2tBLV+XPkBQy5QxoR690bccvbUNI9HHWF mMIg== X-Forwarded-Encrypted: i=1; AJvYcCVEkR9GV5IwP/pyHDPoWdZBiCgsuXYESAw2LgO1XaxuBPw2drEILBMBD5iXVgPy0WWIXl6HhqwBzoKR3Mr8pRCI@lists.infradead.org X-Gm-Message-State: AOJu0YzsCNVySHdlEPjwNbyZlmEqmnrebIpx5izf0+2bgu3GdGTI/uEB TXmRTVYP6GV8PDPVP61DhaBxdeZastFel9upbWYC6W1RCtUueSBkbjMScs49PxI= X-Google-Smtp-Source: AGHT+IF3jq8XAx4d8MvdG//ydygdKBfb8RG21eWCHGRQrOC65QRa0E/gKmvca15+75cy4x5ki2/uwA== X-Received: by 2002:ac8:5914:0:b0:458:fb8:9dc3 with SMTP id d75a77b69052e-45b5def1dadmr61649591cf.25.1727333230912; Wed, 25 Sep 2024 23:47:10 -0700 (PDT) Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.150]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45b5257ff1esm23024611cf.38.2024.09.25.23.47.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2024 23:47:10 -0700 (PDT) From: Qi Zheng To: david@redhat.com, hughd@google.com, willy@infradead.org, muchun.song@linux.dev, vbabka@kernel.org, akpm@linux-foundation.org, rppt@kernel.org, vishal.moola@gmail.com, peterx@redhat.com, ryan.roberts@arm.com, christophe.leroy2@cs-soprasteria.com Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Qi Zheng Subject: [PATCH v5 03/13] mm: filemap: filemap_fault_recheck_pte_none() use pte_offset_map_ro_nolock() Date: Thu, 26 Sep 2024 14:46:16 +0800 Message-Id: <9f7cbbaa772385ced1b8931b67a8b9d246c9b82d.1727332572.git.zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240925_234712_292087_1F60529D X-CRM114-Status: GOOD ( 11.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In filemap_fault_recheck_pte_none(), we just do pte_none() check, so convert it to using pte_offset_map_ro_nolock(). Signed-off-by: Qi Zheng Acked-by: David Hildenbrand Reviewed-by: Muchun Song --- mm/filemap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index 3e46ca45e13dc..6c6ff8722550f 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -3271,8 +3271,8 @@ static vm_fault_t filemap_fault_recheck_pte_none(struct vm_fault *vmf) if (!(vmf->flags & FAULT_FLAG_ORIG_PTE_VALID)) return 0; - ptep = pte_offset_map_nolock(vma->vm_mm, vmf->pmd, vmf->address, - &vmf->ptl); + ptep = pte_offset_map_ro_nolock(vma->vm_mm, vmf->pmd, vmf->address, + &vmf->ptl); if (unlikely(!ptep)) return VM_FAULT_NOPAGE;