From patchwork Tue Sep 24 06:10:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13810135 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 F0314CF9C6B for ; Tue, 24 Sep 2024 06:11:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 79CAF6B00A5; Tue, 24 Sep 2024 02:11:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 727A06B00A6; Tue, 24 Sep 2024 02:11:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 578306B00A7; Tue, 24 Sep 2024 02:11:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 390376B00A5 for ; Tue, 24 Sep 2024 02:11:52 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id EFAD6817F9 for ; Tue, 24 Sep 2024 06:11:51 +0000 (UTC) X-FDA: 82598610822.20.D3FC437 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by imf24.hostedemail.com (Postfix) with ESMTP id 0D4AD180011 for ; Tue, 24 Sep 2024 06:11:49 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=iBG8FHOt; spf=pass (imf24.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.214.172 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=1727158192; 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=e0T9lvI1pcCPfr6v8oRbivQAnqkZ5MJutHJ+/bNj+/g=; b=TDDOWYC5M/y5kFxOG69QtwpD+32trgyUSj2gfHi0if0GnDNy9bZAGVUDRPFEW8535R5FLu lGfIbKSN0gbuUyT4k0DCsB7NZWr20KDJEhVieUSLwPZ3FtmZ0GKp7eXEXSA2G7+Cn7Qlp+ u3PyI+NEHm98RbKtjnuCQR6USDNDvFM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727158192; a=rsa-sha256; cv=none; b=Iu7wAXwXelpqd0iPpxWTIZ0qQef6l610O/cmtawnVn7uex4eEFT5iYDahXn/jGjH9k7fch EohPkWkG7RGiEMfWPkHVCyz/fuX38fw7/0mP4D3WQcVl8f0N/6SwtVHmfW4th3r8HQT/b6 DJ4vdMxmruyyRFZ8UVoAISM+ZvVqouI= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=iBG8FHOt; spf=pass (imf24.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.214.172 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-20551eeba95so44280735ad.2 for ; Mon, 23 Sep 2024 23:11:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1727158309; x=1727763109; 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=e0T9lvI1pcCPfr6v8oRbivQAnqkZ5MJutHJ+/bNj+/g=; b=iBG8FHOt3kKI7UiLsbMyc68t/EC8p3jR5zgvRbgtC+MN6IapY3LDwHxNBInT5InSCV BrdD5PdAXsctGxEtuM2pjApud6TbmAduFc7n/idKPcOQRuJsy1ANi0ugnY32TCV+W71X sxeFj1G1jN/UJ8Q+qQ8MN/L/G+HSyI9fhXiWJrHLzfUhvD1G1hIomwqFYRm6HRsL2cbE 8ybmDFrMwo9H010lTSabysWErE5UKvLKhWtTdH1BYS7xlqSzhhLde4EvTlD/iYtgWEdS z05T66h31NMfEwuJiROxqUU3y6WTBzxTAUKrymU7bLfUyPH8zRqlPHNKddm4wv2ZecrW SavA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727158309; x=1727763109; 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=e0T9lvI1pcCPfr6v8oRbivQAnqkZ5MJutHJ+/bNj+/g=; b=Xkg/Hs4f/Q2oS+/pfFRy7IkGGt6zuWBOjJnxiI06fLrlteoO+5N7Iv05iuPxISM7rO eHnSlq3wjoWa7DzB5jV0PzPSwKkR0eZUGrMGeshcBd475oyfCRixv/1k3xPoqjlB0D9C iAiqYA0plOo9209JzY7yhQn9VXCJBnFxnCHa1lw//HSDpIaCRJBUPEutn3InqotWXxGo c4X/p+bYfbTfKJ8PrnBlBtSdDPVkjPdEv4keXyf2u2bv2rmHWAx+uSaI3ayDlzza2HmT P2D+5ZU1es+rHXhnHMptEDUPImYE2TVvutABFN5tQslBG57lkC9lQTI1N1kCL0CaeqN5 5seA== X-Forwarded-Encrypted: i=1; AJvYcCWd6NeoEXYEzMLwdguxri4DT97FJIVxLfyNtRyAhcEfy6F/dYfkRSiqIaCtmKDJ36GYAhCa7vsZZQ==@kvack.org X-Gm-Message-State: AOJu0YxJnc1n3ruzfBAVpCepxEXoiRqRS6OfjQ9vFbuTTJTNl1X1JWpA j3mPvx324HXsJsjcLXs6fO8jvQHMJ1afq3gTmDNd6vi2cbkddPsmb5tkw4jtFtqOTz1HoiE7ID2 mETc= X-Google-Smtp-Source: AGHT+IGkJQOlzg3g752NhI9RquMqodCfvTZ7obYXRPzPmN4sDO5P6Za1vWoZJJ9nTCdoHXRNF+rvtA== X-Received: by 2002:a17:902:ec8a:b0:202:311c:1a59 with SMTP id d9443c01a7336-208d83b6ce8mr195135205ad.27.1727158308785; Mon, 23 Sep 2024 23:11:48 -0700 (PDT) Received: from C02DW0BEMD6R.bytedance.net ([63.216.146.178]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20af17229c9sm4344885ad.85.2024.09.23.23.11.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 23:11:48 -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 v4 13/13] mm: pgtable: remove pte_offset_map_nolock() Date: Tue, 24 Sep 2024 14:10:05 +0800 Message-Id: <8eb7fcecf9ed8268980d0bd040c0a4f349cbca8f.1727148662.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-Rspamd-Queue-Id: 0D4AD180011 X-Stat-Signature: w9n584pigi3z1nb3hp9derht4nttzdcd X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1727158309-491149 X-HE-Meta: U2FsdGVkX18OFSA95jQJAvU9QJFnxQIaHu1TxIgbAuVZWftqD78ZKi8f/ZOQv+P3/FqL9jf+kABlBg8GgUXh8CY/bTtMZCflKJf8w6BdZJzMFaa3EvRv4c66utA15yInTfNL4x5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mRRN6d3FxGniNOh3nNCHXqV1j72Hu4M6G5V2lS8wvvaDjH0qZ2wnDNpywh9ncLDEsHoh4YjfyoBqAlbagama5W00KkJNpGMIlq8Zm1lgUxrtot1ciwV7/in544TOZFlfhakcrqjgdh46vFMjapr+Th7ytXBEU15YrJnNdSZxv+bhrCXsWcbJXohZvYuAl5jbmEbPnq0tXdEo9xwYSnGA4YMOOlKGog== 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 Reviewed-by: Muchun Song Acked-by: David Hildenbrand --- 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 9a4550cd830c9..e2a4502ab019b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3015,8 +3015,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 262b7065a5a2e..c68aa655b7872 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 locking it. This helps