From patchwork Wed Aug 21 08:18:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13770996 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 E47F1C52D7C for ; Wed, 21 Aug 2024 08:20:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 732F06B00D6; Wed, 21 Aug 2024 04:20:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6BADB6B00D8; Wed, 21 Aug 2024 04:20:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 534346B00D9; Wed, 21 Aug 2024 04:20:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 325966B00D6 for ; Wed, 21 Aug 2024 04:20:58 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id EF329A0AA9 for ; Wed, 21 Aug 2024 08:20:57 +0000 (UTC) X-FDA: 82475556954.01.F8A5D54 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by imf09.hostedemail.com (Postfix) with ESMTP id 18ECD140017 for ; Wed, 21 Aug 2024 08:20:55 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=ceBmxYvo; spf=pass (imf09.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.210.173 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=1724228376; 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=FpkIwk88smkdA0CmKwnRaaffLUYg3/8r+GLLHrp0y28=; b=g0ZrOIZcQQWtoaiGNVcsZTLvS3AGo3MV/u6j6FIuOgmcLzSgIb17+/6grYuMg4sWgHpnNO FNAKeN+Vn+uc7R2NK7M7kF68F8c4DxRjj1F0V3VwKdgK5fJHf9rqP3Uhmp/RpsG/pr6IJK ltjGf+Um5S8+N5X7zqJua5sepojrhqQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724228376; a=rsa-sha256; cv=none; b=59kFz05rER1FaTxIG+9NoasKVBcwIdLXtKrxcvgypG0nvy7hgQVRUw1/q9+lzXLuJVdWH7 uMzGAUC80LX6YgoTIB7xbiW4xL9oDX6H/BN2OZ+ZkgxtOThGmSuclRhSqNRXQTmNRQZabY ORccGH1jV9T1Yl3aFMeK3rtWeFPHqdg= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=ceBmxYvo; spf=pass (imf09.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.210.173 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-710e39961f4so4383778b3a.3 for ; Wed, 21 Aug 2024 01:20:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1724228455; x=1724833255; 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=FpkIwk88smkdA0CmKwnRaaffLUYg3/8r+GLLHrp0y28=; b=ceBmxYvoJhvLze9MbOpvPPGRMm60AQnhSLve1bnQ9C5NPQcFCt5bcBOnEGd+CnG96/ ngWxvj3GFkr+gC43f+6wXwxS3UpzpcNIue1Y0feND5XZ8BLbb1zr6+LG6Tp55eoKArCK auntXcY2ubiBT57+95SsTzB2KMRjlANoPNGIzWrtx7MJiA5fQyRQ1XEd7ivtNVxlirXC B7EijCpQKyuHjMRxSNgFVsCdnkXw9UZq5o2sjDdXrxIyXLuVvKoDPgFe0RGevYepXzIL lidSPLocfnq9yhRjrMARIXt/BX68tv5tdte6btXQqUy6H/8AabvQK6QBPcYsntx20SPB JP+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724228455; x=1724833255; 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=FpkIwk88smkdA0CmKwnRaaffLUYg3/8r+GLLHrp0y28=; b=Y9ahOb3Dmw0XAZPLerJ3/0NvzoWywZLz657Zh02m+NYSushIQXAn6ofzj/zg0Napgh 027pT2jJ1kgvMYVf0gW7Y9WrXD0WyWI15Kp4eXt0v0Ble1D19jauHw4y36DR/Yz4gObs ZBFaHjtjM7CYWJjT6V2erJ2dZvXrE1C6c6a/DozYMYWLzJe6JHTP8+wKYKfhL7eIM7wz tIi/y8fIHnCbQAGtdB1GrCF7L7xP6ybqSVMl2TMvnoeJJpDc73ENs9Y83Sg6am2UJDFi ByuFX4yJcEn0NXxDsWQEQpXhQnbNKtGhd9u9GT7eTnpsLmwdX6fTq2Zi9hEwiNu9Qj6T lfxg== X-Forwarded-Encrypted: i=1; AJvYcCV+YDdREnJDMIsvCI1exQTh+/EDLrN1PjEqCKA3kLIf7y+Mp7zpZjmRnOkYQyIFx0HlN72+N8KmEA==@kvack.org X-Gm-Message-State: AOJu0YzaHe5fhoyLh5A2rT2pOEFHoKuneXK4+XbWzmDfn1H5lFefL9jt q/7bFTukwgfAOhrr1XtoOghpjSspQIwzngTfoZGyuZVwZEWWLChd9vTe6kTgfXg= X-Google-Smtp-Source: AGHT+IGrVkekNFESU70hIpUuBMPasbPeBaSvK0LFz7NLCJlpTpTqHUrWHKc0kKTsT//aSMihe2hbaA== X-Received: by 2002:a05:6a20:ce47:b0:1c4:a49b:403 with SMTP id adf61e73a8af0-1cad81a4248mr2186429637.46.1724228454750; Wed, 21 Aug 2024 01:20:54 -0700 (PDT) Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.150]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2d5eb9049b0sm1091453a91.17.2024.08.21.01.20.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2024 01:20:54 -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 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 13/14] mm: pgtable: remove pte_offset_map_nolock() Date: Wed, 21 Aug 2024 16:18:56 +0800 Message-Id: <129f11e3434c5af898096c1cf3fe378f50bc94b3.1724226076.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: yk94d78rf4ea7n9fbbaypzpqwsc47tg6 X-Rspamd-Queue-Id: 18ECD140017 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1724228455-859933 X-HE-Meta: U2FsdGVkX19cSXBcp46tN0sQ4EpQ6BMP6LOqzYcMVHS6b+56RQYRaew/q/eaGKFAopzrGet944PmO0EO5dxvay/rSrfl12sPfnHq7XD5YoQg+VZkf1SGqLjFN8COlXtVFGupRUkotl/HCfhyYhdEO5L4JnYfK5OxJDavQocNvikO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/+I4FzmsQZme2q5q4G1bNWFNE6mYogErFjk4gRDPSOYM8+tXX9aZK2CrWBgrdlVDxNSDzZWgeWYUE5lZGMgDI5MzIFOt6z0VYXtxGs6Lc0TV0eu8zco4DP1xsvobI5oyJEVqPX1LQMDWJSc+IkfgI1M04QjcLip53fKTd7ogg/CCERlUHoY8SY1 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 f54f717ae8bdf..596b425fb28e6 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_readonly_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 1fe0ceabcaf39..f7c207c3ab701 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_readonly_nolock(struct mm_struct *mm, pmd_t *pmd, unsigned long addr, spinlock_t **ptlp); pte_t *pte_offset_map_maywrite_nolock(struct mm_struct *mm, pmd_t *pmd, diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c index 29d1fd6fd2963..9ba2e423bdb41 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_readonly_nolock(struct mm_struct *mm, pmd_t *pmd, unsigned long addr, spinlock_t **ptlp) { @@ -374,15 +362,6 @@ pte_t *pte_offset_map_maywrite_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_readonly_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