From patchwork Thu Sep 26 06:46:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13812869 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 3586ACCFA15 for ; Thu, 26 Sep 2024 06:48:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BDF056B008A; Thu, 26 Sep 2024 02:48:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B8E816B008C; Thu, 26 Sep 2024 02:48:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A2DAD6B0093; Thu, 26 Sep 2024 02:48:30 -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 849776B008A for ; Thu, 26 Sep 2024 02:48:30 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id EECD881188 for ; Thu, 26 Sep 2024 06:48:29 +0000 (UTC) X-FDA: 82605960738.14.3FC267D Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by imf17.hostedemail.com (Postfix) with ESMTP id 312EC40008 for ; Thu, 26 Sep 2024 06:48:27 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b="BxOfjuV/"; spf=pass (imf17.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.160.175 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=1727333147; 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=XK9xLAd1aeWWLl9nHV9gcamA18VQvE5iTgorpb3Ql3Q=; b=SqTQg4zsswiTanZjoBVrIrKhuuCAFzlFjCUx/gRXKSATDtr+y4/q62FguqiUhzReqGr584 6CAOLsC2v4wTuJHjt++EEIhRrZFa/CPSyJUISK6W16fFcQCHedv2rC/JPnNRlI+pGudXNX u3Ina7Xno2LtY2XYFfvf3VTpDqD4gr4= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b="BxOfjuV/"; spf=pass (imf17.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.160.175 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=1727333147; a=rsa-sha256; cv=none; b=zypSXIjCwHHI7i2m6ogUdsA31lD21eIghEApXk5pokFGEioCxdmoxiqL1E3FV1qCrUR2cZ 4K1I0w/4eZIjLNoC6ozHt45UNiD4DVP4MaJzNC2QQz7sMLp/OM6GDre6tND0WslzfExAtW fannycBvqtaGreLAN5fHaudYeYnMeog= Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-4581d15c3e3so4777661cf.0 for ; Wed, 25 Sep 2024 23:48:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1727333307; x=1727938107; 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=XK9xLAd1aeWWLl9nHV9gcamA18VQvE5iTgorpb3Ql3Q=; b=BxOfjuV/f7oswGPeB1fvFPgKEhZi35teCgZqZ6ggbG/IBw1HelIyCZtokab2WK0+5F 8j5aI5w+pkry98HiAOpa3QyUOA8sdct+njbpjO+8QqNbyGmreZlzKVsbQwoIVbYMtyEB xOlU+CK0u/JLRi4ZcrcleKVjdQjZZSMlckCXs1V460AdQwdGq37De9whkvZATGpjFvOu yE+W3TOBj/1qyo1Z05ygHvW4N6AzQKi1P8lnH3cFw1PQtXq5gbooKpj8DQs9FrxZHX0j o/J//NrQk80FT8xSrZDn0dP9OoUwdyl7DafAOitLHjhRoyI26GhraC+sMrLTqSDCKxSx GIRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727333307; x=1727938107; 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=XK9xLAd1aeWWLl9nHV9gcamA18VQvE5iTgorpb3Ql3Q=; b=NPWAGdeygclBP1vSaC33b9KnobEy4QgvzWfeRprfg84026xzlh+jyJpKqI/45r1JxF D9OlpauucWT3kJaZNFESNbFq+FjYRuK1Rb+NEoL8cUaahuGNTN6eDmHKD99hYhylk9ei LcrRAFc++kBD7pex3VmSLwM22z8tXulmVqsw2+B+qF11V7AJphFr1NuoDSYJPRvmb1Zu A9eMbAFDDznpZnmPj4sGR9N3o1/quQgc06fzldLhKC1UVtGDZKfvXPRRHmvmj0i+ZRyt vSQkAw2dr+Nwdc3isr34SKY2OI1r+BAcN898a+j8OU/MCdRGyiniXzYssvd7KcvtFacQ GDCg== X-Forwarded-Encrypted: i=1; AJvYcCVEVa1JeQMcmnjqC43w+1GevsgbqrqZPdeFiUspWC7AFIt36MPr4uyD16gDjYEEo/nyw18DKszSkw==@kvack.org X-Gm-Message-State: AOJu0YwYakoqGZAxcRuiYXHSnN1ImLkQQF08Ta+bi9e+R/qIE5jPE8lo IhPDWv7rf2U3Qtd96GnaQU7Mvo6jrKr0KIE2jpmy1339GoRJERoF95xEUpQbJDQ= X-Google-Smtp-Source: AGHT+IHnYRThLjQtuqQ25g++f96or6jGXpOGKBOHjBYtOEzyfC2Zv3m6NDV/6g7eYEpePNjEvQY05w== X-Received: by 2002:a05:622a:2996:b0:458:37c6:46fa with SMTP id d75a77b69052e-45b5def2036mr66535021cf.28.1727333307294; Wed, 25 Sep 2024 23:48:27 -0700 (PDT) Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.150]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45b5257ff1esm23024611cf.38.2024.09.25.23.48.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2024 23:48:26 -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 v5 13/13] mm: pgtable: remove pte_offset_map_nolock() Date: Thu, 26 Sep 2024 14:46:26 +0800 Message-Id: X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 312EC40008 X-Stat-Signature: irqsfxhyoxa65y8t9sg8thk5gxmsmytk X-Rspam-User: X-HE-Tag: 1727333307-205162 X-HE-Meta: U2FsdGVkX18+JBLx+/iWl/4KfmVsEBfylG+xpNVydVc3BXaO196qih8ig+wXZEsrecRLXSUklpsD4m1z+gxj8KlvUJJg67ySUGoG0W72OpErjYGFNZMPXgyxrVyDt+i2q4eCiYb4SLqAdcaQlJ2hY3iWoyJKD1lSKPXYCsfFHukbE6N+qSUbW9Aoc1A7hWVAoFA7cS2FZcskernXCV03aGyapTanWY+96fcXosIF7VcgJMvniD3A+sWr5QXLOqbIfG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1OG7XhUD6aAAyIxGLXStd7yodvAmY9KyyoS5F24kxctPv3Sjt4r73OtunQtoHOFQqnY+ZYO39X0r6PWDhAz9ymA/BURWfPAlBH5jozNM= 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 46828b9a74f2c..60a55b28cf679 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 daa08b91ab6b2..5297dcc38c37a 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) { @@ -372,15 +360,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