From patchwork Thu Aug 22 07:13:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13772841 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 0F6EEC531DF for ; Thu, 22 Aug 2024 07:15:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9290080012; Thu, 22 Aug 2024 03:15:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 845526B0290; Thu, 22 Aug 2024 03:15:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 461C06B00A5; Thu, 22 Aug 2024 03:15: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 216E06B00CE for ; Thu, 22 Aug 2024 03:15:06 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id CFDEA1412C1 for ; Thu, 22 Aug 2024 07:15:05 +0000 (UTC) X-FDA: 82479019770.16.6683DC7 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by imf15.hostedemail.com (Postfix) with ESMTP id 043EFA0013 for ; Thu, 22 Aug 2024 07:15:03 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=fw8gDEab; spf=pass (imf15.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.210.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=1724310840; 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=gFdM7jnff0z8zF8oYknH78hRu/cQudWIIbslP9zGsAs=; b=r1oyXecFAJ0Ks/7ThHNIFOmQ0IS8V0BYex51cv1YIA4A+uFKN2M2SwrmN9brolpXR/jAa9 aYnQpxWAZl5Uyg3AK4l5Iv4iD0PMG7TN2Nz9NUCnp1Y8E1cUc17No17mES6PjFp6Tydjn4 iwH0GGn2x/VNIR+n0CQDwcCVJyGYwes= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=fw8gDEab; spf=pass (imf15.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.210.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=1724310840; a=rsa-sha256; cv=none; b=yWCqGeaMAJRqkYdlflhxWVYT/gCdjEprUyioMSePF8mDGzc8N8vXzon88YfJ9Z9B67fMYa Yx7r2i8TAhLiTsAvqv++MNLGQmOjRLaojiatF2cKl87qNnSuGt5nvPjgn/BNUwdMWJN7D1 lNWYylKVMnKloTJQP4uyt8PhBnqXVfQ= Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-7142a93ea9cso394533b3a.3 for ; Thu, 22 Aug 2024 00:15:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1724310903; x=1724915703; 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=gFdM7jnff0z8zF8oYknH78hRu/cQudWIIbslP9zGsAs=; b=fw8gDEabvoan/h/LJYIZ53R758as0n+ebnL+dU+quZjiZSFlk5pnbRQ22q2OiQcTzT CT7GrsjsGmX0FfGIq6aR0M/0PxdPWjkVp/RUPYzhhguAQyTKo1NAJB/4kwh/8SeYSbtM OH/bKhjf4YUG8Gn4cA608FySqVAn9Q7gTexj1GO7HfQVMisJbaEQe6yRv8JiU2jzX38K qUpfKD57veNtme4yhHZa+mJH+5itI/Eq3YS3n+lvr5KQLEAHmxduKuWzDRy0BnnicJ9+ Ffo5OW2Yjm1YJv89zW3SC0WukXjmaxJXzf7egGX9lftxzXNvdYOceR9bJrDkjxIn0v9L UgnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724310903; x=1724915703; 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=gFdM7jnff0z8zF8oYknH78hRu/cQudWIIbslP9zGsAs=; b=EAMK0MHEc1/tBUXcbtUiYLAwBJSvrKd06HxcYuDc5DMMFN/XGU/4vVaukd4BXV2z0e N7A/BFHfxGuetA59qKLJM3F35wZTIFPYcwLaLHihld68RSB2JlUDMI2KNa2LCwn1I7Xn cgCK9DJ+xOTSiRWVPGV0yCmfH6348OzG/usIKNiPhch6lEhLfNGHU/YvdVzt1zdCPj4D krmBba/fGfIsRQbGyQ6JbUMQuW4RwEJ8Uf+vwIi4PskeaM87tw6aotq45AwOvZ3C/k5u mKKI0ISYxrluKqbLMYQRoQQJYLngrJwPsKm10Ck6KJEsjv1PriZEeXFMjIyZqF3le/z/ 5LpA== X-Forwarded-Encrypted: i=1; AJvYcCV6pXH9W00DE80/3QBUYrteXM//0Qp7+6V3Dsq/JxYEbaE+z5ixXgGwKTSToSNbRJcO3u0iulY0qQ==@kvack.org X-Gm-Message-State: AOJu0YxAPfGL9LGq+mZhTiqoAmLOKu85EzVT+K7lNCg+kLemVcp8ieLj CEJkQHgNVs26Eaxw4CCBlx9el3ZjwPjO3LliJ6KyjYaXPMNBzLUuJx48TFATeZE= X-Google-Smtp-Source: AGHT+IElSFOoF4KMPSsF0Gy5tbhJtfEKgqkCJ+pjJm8bK93AAf5vkcbpbvWiZRIPotD+TEYG0fABhg== X-Received: by 2002:a05:6a00:b53:b0:70d:2fb5:f996 with SMTP id d2e1a72fcca58-714234922a8mr5431869b3a.11.1724310902611; Thu, 22 Aug 2024 00:15:02 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Aug 2024 00:15: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 v2 13/14] mm: pgtable: remove pte_offset_map_nolock() Date: Thu, 22 Aug 2024 15:13:28 +0800 Message-Id: <061a61c5871948680488ad02fd1e03547948a500.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-Stat-Signature: 5oey9dowysjx8w6gtiqe1eq9ogu8a1tb X-Rspam-User: X-Rspamd-Queue-Id: 043EFA0013 X-Rspamd-Server: rspam02 X-HE-Tag: 1724310903-297752 X-HE-Meta: U2FsdGVkX19kOe5Qnwnim9HhM9Q4Po+zGjlwfKSHfoLBcpKy8hXeA4pJqistx6GZ13WIf6YEyKiu4Pevdfd2hhx9yKBBOqHgIivvIY/6kPpT+VKv9qcH4/7/jQzL83v4rsEq6D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N04ztgAj65yN0BD0ZhOl7Sp6fl+rorDMDYqfD9RPB2RIHgrVEXmQZHxSMx4E6eu0T+19eU8ofeV4f6A69L/lACcELPu54ltVuCJI43+cSY7gMJv7ViG7IQkiWMbD3GeSxLWADdPU9GkGEuPbfqDJI4FqusaiVNp/LAu7chzl/k5EwvNTjklyQbQHrakDwJkvyhxvjU1sB7VTZzeK3abIIalvN3nNPlLMwAXNXCrDKl5AU+hA 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: Now no users are using the pte_offset_map_nolock(), remove it. Signed-off-by: Qi Zheng --- Documentation/mm/split_page_table_lock.rst | 3 --- include/linux/mm.h | 2 -- mm/pgtable-generic.c | 21 --------------------- 3 files changed, 26 deletions(-) diff --git a/Documentation/mm/split_page_table_lock.rst b/Documentation/mm/split_page_table_lock.rst index 08d0e706a32db..581446d4a4eba 100644 --- a/Documentation/mm/split_page_table_lock.rst +++ b/Documentation/mm/split_page_table_lock.rst @@ -16,9 +16,6 @@ There are helpers to lock/unlock a table and other accessor functions: - pte_offset_map_lock() maps PTE and takes PTE table lock, returns pointer to PTE with pointer to its PTE table lock, or returns NULL if no PTE table; - - pte_offset_map_nolock() - maps PTE, returns pointer to PTE with pointer to its PTE table - lock (not taken), or returns NULL if no PTE table; - pte_offset_map_ro_nolock() maps PTE, returns pointer to PTE with pointer to its PTE table lock (not taken), or returns NULL if no PTE table; diff --git a/include/linux/mm.h b/include/linux/mm.h index a00cb35ce065f..1d3e8882f6ba1 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2952,8 +2952,6 @@ static inline pte_t *pte_offset_map_lock(struct mm_struct *mm, pmd_t *pmd, return pte; } -pte_t *pte_offset_map_nolock(struct mm_struct *mm, pmd_t *pmd, - unsigned long addr, spinlock_t **ptlp); pte_t *pte_offset_map_ro_nolock(struct mm_struct *mm, pmd_t *pmd, unsigned long addr, spinlock_t **ptlp); pte_t *pte_offset_map_rw_nolock(struct mm_struct *mm, pmd_t *pmd, diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c index 9a1666574c959..3b6dd8bb5b134 100644 --- a/mm/pgtable-generic.c +++ b/mm/pgtable-generic.c @@ -305,18 +305,6 @@ pte_t *__pte_offset_map(pmd_t *pmd, unsigned long addr, pmd_t *pmdvalp) return NULL; } -pte_t *pte_offset_map_nolock(struct mm_struct *mm, pmd_t *pmd, - unsigned long addr, spinlock_t **ptlp) -{ - pmd_t pmdval; - pte_t *pte; - - pte = __pte_offset_map(pmd, addr, &pmdval); - if (likely(pte)) - *ptlp = pte_lockptr(mm, &pmdval); - return pte; -} - pte_t *pte_offset_map_ro_nolock(struct mm_struct *mm, pmd_t *pmd, unsigned long addr, spinlock_t **ptlp) { @@ -374,15 +362,6 @@ pte_t *pte_offset_map_rw_nolock(struct mm_struct *mm, pmd_t *pmd, * and disconnected table. Until pte_unmap(pte) unmaps and rcu_read_unlock()s * afterwards. * - * pte_offset_map_nolock(mm, pmd, addr, ptlp), above, is like pte_offset_map(); - * but when successful, it also outputs a pointer to the spinlock in ptlp - as - * pte_offset_map_lock() does, but in this case without locking it. This helps - * the caller to avoid a later pte_lockptr(mm, *pmd), which might by that time - * act on a changed *pmd: pte_offset_map_nolock() provides the correct spinlock - * pointer for the page table that it returns. In principle, the caller should - * recheck *pmd once the lock is taken; in practice, no callsite needs that - - * either the mmap_lock for write, or pte_same() check on contents, is enough. - * * pte_offset_map_ro_nolock(mm, pmd, addr, ptlp), above, is like * pte_offset_map(); but when successful, it also outputs a pointer to the * spinlock in ptlp - as pte_offset_map_lock() does, but in this case without