From patchwork Thu Aug 22 07:13:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13772824 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 3F8E2C5321E for ; Thu, 22 Aug 2024 07:14:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2DB826B011F; Thu, 22 Aug 2024 03:14:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2161F6B0126; Thu, 22 Aug 2024 03:14:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0415F6B02B3; Thu, 22 Aug 2024 03:14:08 -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 CC43B6B02B1 for ; Thu, 22 Aug 2024 03:14:08 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 93DA01A13DD for ; Thu, 22 Aug 2024 07:14:08 +0000 (UTC) X-FDA: 82479017376.03.B0FBE7A Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) by imf20.hostedemail.com (Postfix) with ESMTP id CA4D51C000C for ; Thu, 22 Aug 2024 07:14:06 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=lVp3FlNh; spf=pass (imf20.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.167.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=1724310766; 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=O1mpKMHwwZ1CFkcRRT4IxjhKZ5nh5A3TknIoqewquLI=; b=FlD1WTVXqxPCb0bYowObipq5U/RKwVLRh/4cpCxIaWMm6HCaprKpokzTE2HlIyGjz5Bota +twsJv/QhuLMQWbCxsokIBBD8QgwGKgmJUrVfEiTEZ8O8V91MzmwbPr5k0DfPEj8YtDDuj O6Zn0N/TOPq0reKC0hhJgxUIUYMgYA8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724310766; a=rsa-sha256; cv=none; b=nrwuY496XF6gJgRXkMoVUkOqJK3Am5tcIKrdRRALZb7+S8oRdr8/zobaP2U/WmHseIBicS Mx/FI8r8PwV0ZT35kcTSbbTRwReM/Gfbk15bwrhAMkpcwbAB5tItbrrL9/8/g9XI/FXh/2 O5V/YZy6LLunWNIeiJDR6MFB5lijh4A= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=lVp3FlNh; spf=pass (imf20.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.167.170 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com Received: by mail-oi1-f170.google.com with SMTP id 5614622812f47-3db22c02a42so272361b6e.3 for ; Thu, 22 Aug 2024 00:14:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1724310846; x=1724915646; 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=O1mpKMHwwZ1CFkcRRT4IxjhKZ5nh5A3TknIoqewquLI=; b=lVp3FlNhqcnR3ebTMJGsKCPrtHzMTP46SGOMPvwx1bEICs0za3fxyfrJi44LVXmod0 j4UC9zWC6hIgNBJQzoU/Rr4MhWGNYD9ZG+LRu21pNBPYUqFAfFKx0EvjclY2PiQmcaNq Y3dq4v9nvJfbMz02GXHp+Yi5IVWtYsMErlNn5v2m0VMb7CMqd+0ElJI9c2Zw6wn/gZY5 mNLa94jR8r1NYBeo51T/yqKpZ1IdT+hpyCPNdQYVDIyjgFbw0bhEyrNeE0JOX4k6cGle orPodP7Bfx1ri+DMKPYAeSC+nZDk/ZM4GV5uULouh6s/ed3j+zX0Wa3iy6E8YXvY8qWS IhHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724310846; x=1724915646; 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=O1mpKMHwwZ1CFkcRRT4IxjhKZ5nh5A3TknIoqewquLI=; b=FbsckIDtlFMfO+lMYU3ua0KX2BeUUFlytlp+LPqX20JJ4CjwroYof6DIR5V1EERkDI tONuxkg3IRENB8tmkdO+cHfe9HSAx5xYLHmWkrXRfahWvHciDROyDlqkKhZzmXqZ7/W+ 5MvDA7Z1uOIO9jjjd3MiethZ+dZ+jNUh2INAlhC2C5mmunuicBXvLOErLfC5qZvA22Tz 6NvfR1pCshIBHS8HmoAyB0WHmjI1RgT/GOLSdN81u/vtUVl7da53S8Eqlmwaf4BcbVaf HjcExiuLbsgygF4YXaaOO9vYv73GDYyBKM0RfmcXjZnR5LhY0gqUZB+9dYin5hUp2xZA vanA== X-Forwarded-Encrypted: i=1; AJvYcCWEQQC4edPSGNb25AocyJApjKKBn5mOXOU7BQtDrp3j6CO2QJoEd3EVTqaRTWXAXEHYnC0BlXvhRw==@kvack.org X-Gm-Message-State: AOJu0YznBfVP+B0XJsphkVO23Hw+uYd44yVkLsEzheKB9Hi/Pl77YAps MsMd210cx6jCJ8Gu4QzrwFMHwYeGhC135LhWjrIgIY0cXRoVHXgbam1MtX9gbZA= X-Google-Smtp-Source: AGHT+IFDX2PqWoIoI6wCA8pFxmw/BmBf/PDUvtd9hijDBvTgLhn0KCKCIBnod1yVuIa/+/M4c6qbig== X-Received: by 2002:a05:6808:1a08:b0:3da:a16e:1764 with SMTP id 5614622812f47-3de194e0e97mr6243309b6e.4.1724310845744; Thu, 22 Aug 2024 00:14:05 -0700 (PDT) Received: from C02DW0BEMD6R.bytedance.net ([240e:473:c90:f96:d029:ea8a:4e6d:d272]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7cd9ac994a3sm695095a12.16.2024.08.22.00.14.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Aug 2024 00:14:05 -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 v2 03/14] powerpc: assert_pte_locked() use pte_offset_map_ro_nolock() Date: Thu, 22 Aug 2024 15:13:18 +0800 Message-Id: <89ae94f722996b4ee7ef20d44cd7f5e2f0495c47.1724310149.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: CA4D51C000C X-Stat-Signature: wzbkdifiqaeaptdggxc6mydcftqu7n11 X-HE-Tag: 1724310846-455938 X-HE-Meta: U2FsdGVkX1/iFFYqGXJDpsw1TtR9VaFTBW+/rQNGIjzs+Q+lVxTqZSWBPThbcJsKOA/DnTND/iggb1bhXAm/C7IuBwU+C1mDoARvQkK6qU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6/7ncLY8LcBRVNSyWCcALSmU8fiQVjj3aUuKzXY+X4Pt9lp6pZhOSXANr6OuQDsqjfoEyT0Akow5JTHA2Tnvx0vl5WbFEQ7YNPyiCOMMaIR+gcSvjMDSaQNgOVL8QNgD0HyqafqPV7+vzFYAOJ2pVTQkZ+E1xNBR0Au/cunsbRiO9KsmlOMOYBykhbyxRNF29wLNVF+osYMi7i4xwQeRav5P0NBavoyR7AacgvepWFV7Ba0gO 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);