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: 13771057 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13D08C52D7C for ; Wed, 21 Aug 2024 08:30:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FpkIwk88smkdA0CmKwnRaaffLUYg3/8r+GLLHrp0y28=; b=ES9peVyxRCF9bvSNovk1AQSPzs xlDyQDdtYWWIwvoQKqXOrt2CXWRZhIkHw8jzUolBzM0ZQPl8ktKMx/Gikvqgne04iKh0l4qaR2q3h 0BPmZ1md0+/IEwxk8QrIpLmx14xLnMsnbtthoyFvrfMJe9aOHxv12r6Lxz8qOsQeGKJpLDHkh7HJH pRqHHmW1F58a/nVwCIpGuaJS3R8xJYKZ5U4pysYiuNu94Pj9ZcVYnlT9maO0CDW7SLMHnWyiu05Iq MCe2COdv0B9hjprXjDAB+apJFJGwGqeAqYq3HfMwxU72koMS/ubQg3hObya/YB/QjHPPSz4IYeHWl Zm9L2EoQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sggjI-000000084QJ-3IdQ; Wed, 21 Aug 2024 08:30:08 +0000 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sggaN-000000082Hn-3t5H for linux-arm-kernel@lists.infradead.org; Wed, 21 Aug 2024 08:20:57 +0000 Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-7a18ba4143bso4178392a12.2 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=lists.infradead.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=QlQckOwMgFp6bfzfOVUhXWs0W9omEsNduYUQp2VJ7WGKKt2YNxlHn3RMRCXVWacdFA 3yeN0Z/1Rb4OD7Bvj2Y369mqCLbxNUdc2M1wh/+dphROVl6jW8STwlKRwYzzVl+ZUD8d 4yKKUzehsyslpjInq8Vco+4jnLN2aNNP5a24LUVfGacJ/kDV0qo8sYYQAxcB8LfsswkV kaiQIXoJtckElZj5rcmBOvrWx9muAy9gwhQ6aXoXeqQYzxH3gonwGcd9tEpdkrr4+wK8 RdOq1pnyo3zcFyeLW0739LKm/F8f65OZk0wmqM0Uq7kGL7tHCZ0BgxTAHeiL8XhQOhBi qyng== 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=AVvYIiLnpbkOfACQxOBSnLfzsWAMPCn2ALLIiLxBwj71FcdVoT/AkoZ296djf237Mb 3kU/Ypwst1mWMFyr/EFZ89BF7OFWOx0ahfs1/430kgcAzuJa6p6d85GTqVueh8Re2t9d 1vyxXqQOGh1DSDdJXwK3C3NPz1cgkd4rFPItW7U0qoMk55OHw01giouGqM2m++NnCHLS ZcY/2y5EFFoyP7ZiNbrqZzHFheN+Uin2607qErWYvjdwZsrELQt7H5hBaNKc/mqWPV5D 07fAdWygkYCG2LBb75WIudMk5IeFkSktnJ5vnvL8tpUcB06IH1QFCqTRkyOoXVJMFkBW nxmQ== X-Forwarded-Encrypted: i=1; AJvYcCV2Eq7iFmyKhFvmCNnBqK54CnscVkIoPw5BKa1kcT2+wnd84XSSqy31dbPvHVldke3F6tB/Mrw0U3tORAFTitB2@lists.infradead.org X-Gm-Message-State: AOJu0YwxMrXgYDbtVA85ZERVkf+9XDxXURfy9/195E2AACY6CND22JQz KjVAz6U15goTb4X3UlRwD22tgF9SERaAcKnkqHCA62R1rx/gzrhe0WiR3MHoxi0= 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_012055_977798_9DF1ECCB X-CRM114-Status: GOOD ( 12.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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