From patchwork Wed Sep 4 08:40:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13790101 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 DF9CDCD37B6 for ; Wed, 4 Sep 2024 08:42:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 73B248D023E; Wed, 4 Sep 2024 04:42:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6C3008D0239; Wed, 4 Sep 2024 04:42:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 53CCD8D023E; Wed, 4 Sep 2024 04:42:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 2EC788D0239 for ; Wed, 4 Sep 2024 04:42:13 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id E0C52140EBF for ; Wed, 4 Sep 2024 08:42:12 +0000 (UTC) X-FDA: 82526413704.28.3D19A42 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by imf14.hostedemail.com (Postfix) with ESMTP id 01163100006 for ; Wed, 4 Sep 2024 08:42:10 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=AMPk75Sg; spf=pass (imf14.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=1725439235; 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=TUS6V5hps9BhpBteFi/blbp/e+0aHtnhPyo5Zqj4Bag=; b=bnevHeUffScUwAMte0UBy7aEbfuTAJgSYhDE55fnOjKBcXXxHLzWIPCE8qArlwCzVoSv6r lbBJmsIoaxB8VCOfj6GElws6JOgJMs7xWX/kXZIfwMS1zAOXwMpYm250nYqCAAJ5bSNEba pSgv2hSY0LyfClkN2U1b7IfgsJo0QgI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725439235; a=rsa-sha256; cv=none; b=lRMssAmbkXV3lKUrXNnUGhmrv2tkc7YBKAX83DhxhGyC5zOtGylIwD99mOgsRInL8KazRi PV8qBk+6Yd4h6BhUqsoPJiON8N/oinz9Ix4wWx0UK9d0QSmTAL/l1h/LORma6TGsZonDJF X7yPfUEMoksBCPS8/576u3QnVMgPlyc= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=AMPk75Sg; spf=pass (imf14.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-206b9455460so3343435ad.0 for ; Wed, 04 Sep 2024 01:42:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1725439330; x=1726044130; 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=TUS6V5hps9BhpBteFi/blbp/e+0aHtnhPyo5Zqj4Bag=; b=AMPk75SgWNsmA/SqfqK0CuwI7ACRORWOtPdkJRiLWVABtYcB77qB/Pmdi3amFdukDt c8VtyY4XjvB2iKxkC5+2MjaDmk/IUzBjM8GyjcIse1ibDfOKDGnCX3PNWCGgo5vyehRL qN0I4JEEiHSNSVjBasivFESZQzudhsntpzMpiJRFyUkO3wmLLfRvrltSeBCuOTnYQY/Q lYRDOb6KtAb1YyLPHiZbtVekaOOaKUDNiLElNZoIChBneZLsaQxyBWXoC1lNCOjgt6jd nFdTpf/Q3xuMUQQ5fKCLHN18dqbvWFTNshtwouZnNT0xyXqc72TGsu8bgZfjhtDykbqy 1dRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725439330; x=1726044130; 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=TUS6V5hps9BhpBteFi/blbp/e+0aHtnhPyo5Zqj4Bag=; b=PN8lUGUke00613w4YuWgpvPoYJHrHcrUGWlVJNZtL/doW8rQ6Pt14z15dbyB+RaJO7 2pddmPBhZBXVrl2BTFTtk63gIul+5bjWPEIHHgJ2KAVW21ZUClzAbD7hCq4iqlMSl3Ox ebIDy3ZQb6VYVPSTY+SZxBlXRnVUhTc2MfuKW8bCCMGWw4qOVdp5dARdZQmty0OGB6U+ YjuGhJJVtr51N4tc2xWRLPcJBaCf+debgO2YZBkDelRha/8zXWxkub3RVuuzKkGg3fKk O/YQlciNCANoOMgLLnMyJiabQUKm1u4rrF2kRqlHFzdYq/UXlehqE1jb7LUxe+eZmhXp X2ZQ== X-Forwarded-Encrypted: i=1; AJvYcCVjxOTuVzCdV3dxA97nUbG2ia/BtS4EAFh2vS1c88xWvAs3MJK8Zj6aq7tCwsoYn0f30xmNWddipA==@kvack.org X-Gm-Message-State: AOJu0YzulU+rIAJQaZnARhgUNCZ5TPhB5Zf+WmaRzfyKrJzQAJd2ixCR ZEmQ1kn9Miw+1PPSmW/6kyqHjzgyYoplCprJtmKRj7F8cF0vQYd3+r737/J9jLY= X-Google-Smtp-Source: AGHT+IHV13v46mfi8eJv03VSK3v4h4kaXbg2iDfLcHBwpuweJiwY6TIZiDRC9qw17xCxMuqJ20qctg== X-Received: by 2002:a17:902:ecc9:b0:1fb:7654:4a40 with SMTP id d9443c01a7336-206b833e006mr24427095ad.14.1725439329649; Wed, 04 Sep 2024 01:42:09 -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.42.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 01:42:09 -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 13/14] mm: pgtable: remove pte_offset_map_nolock() Date: Wed, 4 Sep 2024 16:40:21 +0800 Message-Id: <20240904084022.32728-14-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-Stat-Signature: fdb7q3mt96usywpzf6t5os7ut9uqr78k X-Rspamd-Queue-Id: 01163100006 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1725439330-369858 X-HE-Meta: U2FsdGVkX1+8CNlj++f1yYZ5DwNwBq25nUjvEnQ6XNtuv0GW59pEZygIWiQ4E8Hpa71fLoAIsi1B2sXJSzcqBRHqQkJTK11eUtrWR90QDaLdUoibcVaNjiS/o7/RAgHIcEPeEcRn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wie2i0hpQOTOvhvsoVBNDkyJ5iYLVPg+t5TQhViVnaG3fw4kzLfFNvHHRZXSKdT4okSFMXg2nFdMwlY3l0rkOBYEAC6uhacQokuOJPngl+lC6pl1GjputwLgc9SSRPGRE4M7KvT1ejxGHH/E5CShpq5xwTqG5M8ndEeZtTVtsSVZF24YpNt20dHfCTaNusOFXrQoQ4a8cGzdfbDzKtIyKXQ== 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 --- 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 1fde9242231c9..5b5a774902bd6 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3004,8 +3004,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