From patchwork Wed Sep 4 08:40:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13790092 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 BC007CD3431 for ; Wed, 4 Sep 2024 08:41:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4C8056B02AA; Wed, 4 Sep 2024 04:41:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 451E16B02AC; Wed, 4 Sep 2024 04:41:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A5056B02B0; Wed, 4 Sep 2024 04:41:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 00FB76B02AA for ; Wed, 4 Sep 2024 04:41:12 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 99E841A0DCF for ; Wed, 4 Sep 2024 08:41:12 +0000 (UTC) X-FDA: 82526411184.04.8487500 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by imf05.hostedemail.com (Postfix) with ESMTP id C643A100008 for ; Wed, 4 Sep 2024 08:41:10 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=XcfsyuLv; spf=pass (imf05.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.214.174 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=1725439143; 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=Mwcb7WVpeL59BmxGU8FtBVb/FvaDY4mjrVacU9l97yw=; b=xOFy4kp/BQrRnZ5FZMKnNtjKiG65tS74S6SW2W6+C8+3d2QVQIibwLr4Zb2PEGuuoXWx9m aP7/K4vckwyJ5qTa9MlRdCG/1jRumEUKp1spg+3rBu22aB2OaQP8Zt2zXExY5xnuyhl2gU ptxj8z0SPBLoSN2Q2WoxqbbmWeKu33U= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=XcfsyuLv; spf=pass (imf05.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.214.174 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725439143; a=rsa-sha256; cv=none; b=5E0u/1A3uja2Xb5K+oXmAZHUcJvJTWVW6AV4EVqCiVbnfN9rZHBRi1N974c80osHUUT8Dl tOIKF6zaR2Nr405mKjVGnuOmAEl3OT2HZ5gxs36Id4dCfoQMbHYfNQ5nK3b8syFv4ixWRC 9hOrBM4Rn2yVS+EnP7LMGTrNV+6G1V0= Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2057c6c57b5so2890755ad.1 for ; Wed, 04 Sep 2024 01:41:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1725439269; x=1726044069; 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=Mwcb7WVpeL59BmxGU8FtBVb/FvaDY4mjrVacU9l97yw=; b=XcfsyuLvWUcCR3DfP1JofmvjM7DywAIjEO5qU6+Q6xNkQCrSMQNewDbcqdhIQ7PICc dRSnrNsS7fvGmJ2hiRIxGWFTpVSZmsei+v8r6fu70w8Wr6FyEpRI7ISU61g2YOW0NXof ULkm9G6zj0/Go5FLkqj6ctgy7ufcCpYPKn2RMx5n9OQdxs67IUj6SwscqDl2+SW1/oHK MBLfEaMPj68thnRp7v1IdJ2t56G+yB46dkUFWVUeG65XMSsi7zpMA4+U2IvjJBbHU9f7 xzBV29k8kuDpyzxUXA5nvciW0MQrHncyOwBxyj1Cb/zi6hrGd+ukz+GgG6unMRotHJhw 2zsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725439269; x=1726044069; 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=Mwcb7WVpeL59BmxGU8FtBVb/FvaDY4mjrVacU9l97yw=; b=w6S8CHVLwbJ2Vun9sS6jXJBwQbVT0HmbY9+HllV8n7LexPo1J4L8kUij+F8o0owtJP DqAMSmZhj8KAZTyaEh9VxPmhTt4+WIfmx37HP4uW1y10z6qimthOxBIwRjnVOPo27YpY UodAgXRnaQph+MSoEdqPvAGdyq1o+CKqVexFiMV0wj0q+5vLWZf6d8f+SkcL3NvqTYgg W8J2Ew8EoC0okcmX+3L8wt2rl8Z0hLVshQjuPKaJQFBT6zw+B2poAe9mixIA9CRi9Y7H 7yjpz2/dKcD83S5E8yll+o6NPxYrvYY2gCygeuQ0q8wDlZLzwZvIDDBRUBOJKby+hOtl TegQ== X-Forwarded-Encrypted: i=1; AJvYcCVnESz8rOWKuKDIAkXaLmPRV8j8W0WcNoJsLOkcW9ai5n0nMBZ9B0vtCQBddfsvE9Ir1lRlCzOqwQ==@kvack.org X-Gm-Message-State: AOJu0YxJixbgOr9eRDv7f4HDRAc4LKT+wrI1eDPKuSMTygFRvax/9GCn dt3ge5bXE2tZuBNZZ4depUBjXGESwEzwHguUd6HUjMhB5U1/CM1cfKfaYyAq72g= X-Google-Smtp-Source: AGHT+IHVi0h+YpQWstt2F+C2N++FuREpmzHqlVlqHX+adh/zaJT2MbahvdDpXAnk4gZu2G3FJSfhgA== X-Received: by 2002:a17:902:f60b:b0:206:9dfb:3e9e with SMTP id d9443c01a7336-206b832146bmr25150715ad.10.1725439269514; Wed, 04 Sep 2024 01:41:09 -0700 (PDT) Received: from C02DW0BEMD6R.bytedance.net ([139.177.225.242]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-206ae95a51csm9414045ad.117.2024.09.04.01.41.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 01:41:09 -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 v3 04/14] mm: filemap: filemap_fault_recheck_pte_none() use pte_offset_map_ro_nolock() Date: Wed, 4 Sep 2024 16:40:12 +0800 Message-Id: <20240904084022.32728-5-zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20240904084022.32728-1-zhengqi.arch@bytedance.com> References: <20240904084022.32728-1-zhengqi.arch@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: C643A100008 X-Stat-Signature: 1t4sxemht7khuadbwbq59f13csemhs1r X-Rspam-User: X-HE-Tag: 1725439270-126385 X-HE-Meta: U2FsdGVkX1/fJvKxfp7Y5RB/Ty0IimRf1j3uihjthfwfMkMJ8wu1kxmIcUK1AMT4FhiIhzBdPO6lRyvCT1o5f4/lSeJus5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iVo8wcNfl/nLqsApQTS1URldGj5AMUdN9+AfQTMwJ60sC+e4SfCjLe+s3x1TeJ88nUkEODIIAW7TsFvN4RkpfJPaxsgusYzk8VBEOO2agEsT6hyYnZzMDiNBqepSdkY+lDVm/5ic5/bpmj06Rb+ApdguIPQrMARtAcyEBZ5qRjDaHg+ov8RiyZC0V79jj1SMFoXPeiX2gDi4re+M9XlMXf2sCPIhmYkcAaPxm6PpTAeIUC53Zn3BeCI8uvps/Rud2kwiIkQhUDefGCiN1fBWOqX+peB+avdXvPh9oEA= 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 20346df53df3b..216405ba497ea 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -3251,8 +3251,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;