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: 13812859 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A66E5CCFA07 for ; Thu, 26 Sep 2024 06:47:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3C5566B009F; Thu, 26 Sep 2024 02:47:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 374DF6B00A0; Thu, 26 Sep 2024 02:47:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 23C886B00A2; Thu, 26 Sep 2024 02:47:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 064356B009F for ; Thu, 26 Sep 2024 02:47:14 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id ADED4C08A4 for ; Thu, 26 Sep 2024 06:47:13 +0000 (UTC) X-FDA: 82605957546.23.F7052F4 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) by imf12.hostedemail.com (Postfix) with ESMTP id E3ADD40006 for ; Thu, 26 Sep 2024 06:47:11 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b="gZyaG/5T"; spf=pass (imf12.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.222.179 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727333111; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=BmENsM1LVZMrc0W501TyzYIERT8c75Mhan1AJ9vs73Q=; b=nz2fzJYM5fa0oV6pplVSrDSDWLLUzUFqPVNngv/irNwUW2Jk/uD44gpD8q1fqEMudu87FS LwmoGWzYHMRefDK4cdJYPv+jJfVtsAU7kG7afQJT4icAriK6Bfr1BTZymPrlCcGy9pdFHx 8w4P0cRKMBEKLvHWLgyzav5AJQu26b8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727333111; a=rsa-sha256; cv=none; b=yZ51/AcWEWc3h8XOZ6eP7yQYeSf3/V1IQFI+TN25ns2bX77edtwRygM5eNPiNuKb85isWu +6+zOQZP5hBfGT/VE9Socl8ObrmUYRlCLvA7FkiRS0UgIxmEAsiTXSeVjv+6k1Fbi1dwa8 cuskBGwjTqbLCn4r2/E6K2k5I+/Dsa4= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b="gZyaG/5T"; spf=pass (imf12.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.222.179 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com Received: by mail-qk1-f179.google.com with SMTP id af79cd13be357-7a9ab8e5f96so44559885a.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=kvack.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=gZyaG/5TslyB/h8enNEvF89PJ4XEKlGgdUR10C6Pr1LEo0ZLbZuJA727qrVMpeH8fv KeVLnHKliUTfDAFDYnaYhzgHU7auVHcHwdpXr9qUl+4Z+PbWdglQrB6LxivRL9NqbJvv fO87hGr6mL1RcA1WiGuYohOuJ2ZbGwF/jiF9v7qdRpvDoNY3E83ZlkrMT8KY5vgFheTO lPl3FNC/B+VV8TENrae+A5IrDdTk+fSKuDwAeqqHDSLOvPZ+gJFareYB0zOyg8kR1bNL 2hqBORCYR4boZif15+bpJzyiB9LDoEdVkdH9g6dRGa0yaGwRxTRQ2ORYQN6LMMYZWdJF pakg== 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=WO50JeGnnpl5U0IYJI9BV3CAtnFyUOpmcnWZVKDMls2UzjC1ohZOt8a1qsGuGqPRa/ lhyb1hEA5NjZAD1MA8pNwD6/z+m5XOqpXNESCPDp462pmYhbEiDmaj+on38iKdl/oq9p GFUBJqL5KOn8zypBTfKsA7n5lMgnhU7L8AWtdKyMPSUnUD9MnplLPwugHLO2EnMlbuIG 3VbE5EPL1mBIOyGWKkmw/eSzXHc8LqCu5vF6Q79C7dNntzqV4H/UpPWVeERzqTyN2nRQ /CQHJgdhxvJ5x1tPN/wCjA1owyGIwNPczPRaHQbF4dTeaPcK3Q34cv7x9YSpVMkJemIy 63ZA== X-Forwarded-Encrypted: i=1; AJvYcCU3AoIWpfpTyWQyHAe9GxxXL3cUdSk7Az0I4oCPFELrx3PVvamrT4seOLhZJBsWL6el22n0IERkSg==@kvack.org X-Gm-Message-State: AOJu0YxwxyjSgvxu6JsLKLRsN3c21mP7IXx2xpuEdabTZC8O40qkt9gC +OIV2duOtwjeOFHSqy7K6qEllLOuDymzj2rB9CFzAiSdVRPVm+1k7zUpurjLS60= 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-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: E3ADD40006 X-Stat-Signature: q8z8dkr4fbwicwdq39wooi9wq7s6mwq3 X-HE-Tag: 1727333231-707213 X-HE-Meta: U2FsdGVkX1+CY0+xKC09UFYsVazsP3K5pxx5/VUH2beP/zLllomeKfllbFTzsHhXr0jBoW4QvqnSBSxVMSrBfztaLKz547kdA8XrdBcDN7ct/sgsRvA5mlF53oWGoXj83tshZLRMHPcuYK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IAG3X2tfHSKhtEOuYInSipKl2OmCKVpOHn1ySZREwZlF0Px+AwbOJyLag1707DTCacXv6YreKWnDVIJPSL44S0YHw+LIqiPOdc1jML0FCS+lreZPpxVoo0ylK9w10vo4lrhfoTUKgF/NWaVxn+fSd31Ewj/I8+zYnIeKGU0ht231UFdK5nDpCGnr0UY4FrBg3Khe3XThj7DFqq4D1Sh0ZKmD0+0zMYO/eq5wQLNBN9tUBrCuM= 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: List-Subscribe: List-Unsubscribe: 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;