From patchwork Wed Sep 4 08:40:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13790091 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 613DCCD4847 for ; Wed, 4 Sep 2024 08:41:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DF04E8D0228; Wed, 4 Sep 2024 04:41:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D78768D0238; Wed, 4 Sep 2024 04:41:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BCE8E8D0228; Wed, 4 Sep 2024 04:41:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 9984F6B029A for ; Wed, 4 Sep 2024 04:41:06 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 5BFD240E52 for ; Wed, 4 Sep 2024 08:41:06 +0000 (UTC) X-FDA: 82526410932.23.648EBCB Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by imf28.hostedemail.com (Postfix) with ESMTP id 826B3C0015 for ; Wed, 4 Sep 2024 08:41:04 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=G02ae3vd; spf=pass (imf28.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.214.170 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=1725439170; 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=7WBwKEY9MWquOlo01BPdpzLz4TZdRIsQgPATlcDwMyk=; b=hYFQSu0zD1rsHNKIHN+pdmm8DrPk7x0gT0WxZZMiKBIY+x+61ldwiLqw1VKyqRDlPeyf3X k93hf5MCdV5HE//iqKNJe8lL7pJvRJPnI6qx56sRAUdSrksAVyaRE7m6btIDvOxBdEpVi9 t063ow/E78TuNdzJFroSr1IvxAY9VHA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725439170; a=rsa-sha256; cv=none; b=uCMvhlAZyOzd2xki4+LfSbvFcZYA5m00clGLToy/hNYK4c1KSyV8GzTKQ6i0kCXpelxjv+ wkZyjuQePZDwz0UYUhjaYeej0VPdZsfAIji0vyFsj/yY9hfTSLG6eMH5dFEhMEPeJAy2Uf 1YCit1n0aYRPqghTv2EPJ5JYiiySvP8= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=G02ae3vd; spf=pass (imf28.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.214.170 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2057c6c57b5so2890305ad.1 for ; Wed, 04 Sep 2024 01:41:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1725439263; x=1726044063; 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=7WBwKEY9MWquOlo01BPdpzLz4TZdRIsQgPATlcDwMyk=; b=G02ae3vd8w9ZXmj0HTwnYzuatCDDiGkmnbS2Y9xYI2p4YqMfCxIBDMJTPCDWmo7YK7 G5VHJnMk49TuNUhZL/eJRfqf9F+jviXCKb8EIZhO/jBGG25lVTQ1rILxbme179ofXFMq oFEE02ndi5NgKJpKlYmaj6PsjxETu02JJIyfYMEkbvKaiLh3ZVFrP5DcpHN16POVVhaJ JzW1Ow7NSpH6jP/ql8PX2WEMwsycoffb4UlbDIUZreXWKk8bFKcxXHIRVXPj+pwNLy5Z M4RElofhvIQsTFFK3lUbP+E5qjwSMf0DUgrHsZ4VR9FLWA9Cy6Ndds+1YVxF/wdVtPgU RezQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725439263; x=1726044063; 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=7WBwKEY9MWquOlo01BPdpzLz4TZdRIsQgPATlcDwMyk=; b=Ac2yKWMhijvccXYyUnncJZ7T/NMYRE7aTk7cCRVkcp8oJSjyhpy5TNMOGzU6QDP/CR Jb5yJQz3cnQCIuE8oLmM3OdQ7if6Bap0QPD0A5JCGZC2eT7V4u89HlghoWqXaXoYkOmT 9m/o2bjfP9NE6elwjbf22W/2PGrEjgfrWCUmYHot11oRM8sbSgn6oTvGLr78LKi5yO1/ /bvShVx06AsA93aYRrSH2LXxFGjgW6iq20xezYJaBT/dcWYoKt73csPfwKtYgpLr43oN DxOE/Vr0+f0MwZxHnIzCq42Tv8JmcS5eZpHj3Tpbp5Uo+ryvYOwoKooOH5dKHGDhoTbL xsUA== X-Forwarded-Encrypted: i=1; AJvYcCXsJxQ4MHb2y9C3gnZJXhpLT+POsKMGrM8vdHbIY3oB620FWglY7UGVNprGvfI1xTxysa8YhYcSSw==@kvack.org X-Gm-Message-State: AOJu0YzAEf75gYsBvqWFHT4hypReoS4zZoBPyulKD4SdDxTPRsYewfFg ULm3DUY4VxGIpaQnd7TXLmZWFS7ceZ5hW4xq1RLjpq2itgI9VhvGFhOHM4sM9P8= X-Google-Smtp-Source: AGHT+IFosxGKKraD23O7QyExDWz973MicB0gfFUEF3j/RrDnY2sLd35727GFsppJnEl62/xkyI7W0A== X-Received: by 2002:a17:902:c412:b0:204:e471:8f06 with SMTP id d9443c01a7336-206b83566dcmr20294065ad.17.1725439263160; Wed, 04 Sep 2024 01:41:03 -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.40.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 01:41:02 -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 03/14] powerpc: assert_pte_locked() use pte_offset_map_ro_nolock() Date: Wed, 4 Sep 2024 16:40:11 +0800 Message-Id: <20240904084022.32728-4-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-Queue-Id: 826B3C0015 X-Stat-Signature: 8icukmcps778rmbopyj7adp8f3pit5ab X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1725439264-917980 X-HE-Meta: U2FsdGVkX1+uo0vhupZ3RRyVNEzdC6wWPYrgJUGHDND4kd/6uONC+nUsodFVnivnTWvHPDkQUUR2IO3XrSxerjHLvJJrVCwG7EWfGLAQyTtcl22fMI01J9fm5093sSTLtr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iC6ePmpg5mPf6HRFTtF8EcoTCoNF/8Mn59xCkzNAASwryZgjrINvxT4cknI1NDR0YL+mmiysz6uYeTDb7EB6naSB/+qUnCqdcc+uxYvwF5q7jZOPljOPAwFSyZtlk5w0mWq5RBGvThX5vVIrNRPfnc/zA8eIyd3+M4/xicLKTWCbKSsHukfqe7a9LUNGZibY44Jq4rn9gHoKlDNWb5mSH5MJmqKAspfSqdz2k9+EHPc63Kab1Ul8= 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 assert_pte_locked(), we just get the ptl and assert if it was already held, so convert it to using pte_offset_map_ro_nolock(). Signed-off-by: Qi Zheng Acked-by: David Hildenbrand Reviewed-by: Muchun Song --- arch/powerpc/mm/pgtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c index 7316396e452d8..61df5aed79894 100644 --- a/arch/powerpc/mm/pgtable.c +++ b/arch/powerpc/mm/pgtable.c @@ -398,7 +398,7 @@ void assert_pte_locked(struct mm_struct *mm, unsigned long addr) */ if (pmd_none(*pmd)) return; - pte = pte_offset_map_nolock(mm, pmd, addr, &ptl); + pte = pte_offset_map_ro_nolock(mm, pmd, addr, &ptl); BUG_ON(!pte); assert_spin_locked(ptl); pte_unmap(pte);