Message ID | d3b01da5-2a6-833c-6681-67a3e024a16f@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 11810EB64D9 for <linux-mm@archiver.kernel.org>; Wed, 12 Jul 2023 04:30:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8597B6B0071; Wed, 12 Jul 2023 00:30:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 809396B0072; Wed, 12 Jul 2023 00:30:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6D13F6B0075; Wed, 12 Jul 2023 00:30:57 -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 5DE496B0071 for <linux-mm@kvack.org>; Wed, 12 Jul 2023 00:30:57 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 0CAECB0452 for <linux-mm@kvack.org>; Wed, 12 Jul 2023 04:30:57 +0000 (UTC) X-FDA: 81001684554.20.93F8559 Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) by imf25.hostedemail.com (Postfix) with ESMTP id 17E18A0007 for <linux-mm@kvack.org>; Wed, 12 Jul 2023 04:30:54 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=RBETceKT; spf=pass (imf25.hostedemail.com: domain of hughd@google.com designates 209.85.219.169 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689136255; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Lih86tpYDD3J7zG12H/yvKEagSCLBGtcWN3xnGIcrQ8=; b=MLjbVdD1V7148sbw5Ej9wIHM3wEakfYIa632kqqiWs9nwQ11OBfUNWnfvQc4rgT3YRfW4t o7xJ1f3/N1Pg6UzeS0NifPLXPmePaye2r0oF0xb0D0awgbgCq+nMLl8o/XbKam6rk3DV+8 jziv6DEbUwwskTuUxqKC115Via4AcXM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689136255; a=rsa-sha256; cv=none; b=1cYRDsDhj0XeVqUeRrJ6a9wZv/n3LCEno7IEdcp4qTld6dzIUx3tHdlzRVCNRNo8relouR Kxo3rU0rGcmRWHWxbqXWZjDHcz4XeWRcfieFazgZA4rLICekCcpy7yDYai2qThqjrECozw 0DEEfNaCJ4g2SKmBWynsdYQnmNIWSaU= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=RBETceKT; spf=pass (imf25.hostedemail.com: domain of hughd@google.com designates 209.85.219.169 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-yb1-f169.google.com with SMTP id 3f1490d57ef6-c4dd264359cso6099648276.3 for <linux-mm@kvack.org>; Tue, 11 Jul 2023 21:30:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689136254; x=1691728254; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=Lih86tpYDD3J7zG12H/yvKEagSCLBGtcWN3xnGIcrQ8=; b=RBETceKTxUIdE5Wthq5VyXl1iuewXFCZtvj7DAV2aR3XnxKua3oR4hmOqLeBfiK+Bo QX5kHPh+nmkLT9qkicOsu2l1qxImFf+42zqUi71fI6EVfsz6Wd8j8qUrewGd84C27fQF z08YkGvSrNifDm+H1bjPb9jqoZlNdzHFdJ/PGyx79rM0dM13MzFCo6oGzmwGF3H2DHxK jhmvYEXUAQ46tN3PfeVxdIIezDCwRgqWW3fiTQ5gpTM5B8KutupuJmp6cYEM5cSz9f5W fLAc5DNp+0Wj3x5T2KO5EPXVkVyBxsI6lOPcm2rzPIqTF2kKG/dKpgqnKRkoKETZyp95 sIwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689136254; x=1691728254; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Lih86tpYDD3J7zG12H/yvKEagSCLBGtcWN3xnGIcrQ8=; b=SYQc/Y3JiQdro6zu7O0ss/+wEb5b17w5WJ9i0+jglMPjqOogOvwOYMelHH7P3wdV5N 8LMS8458Bu7zwj0gIP6WXerbyXKvTYK94MfINWpnaxQwErU4XMYZIfVXj727aIUA1pxA AEMligAoc/dHcU95vinedAEM+jI86DaYXk1bCHVrqbBmvvV6rUBeeBL2yPZxRC5MSyE5 IYFSQs6mLsLbJNv5QhjXv8SSNzQc3AfmIn4Z/UdnRQoKjyZbXb+7FubzoUbGCDNecj/+ A0iEFr5vXRLnQYxFvv+B+VPWa2N3XaAbZlw8JgmuvjTvY798rNvlJfrEFU++I1OITPyp GQxQ== X-Gm-Message-State: ABy/qLZt4cvJLj5S8GZI7gk8dH4XFfKMFjAVNUC1AFypnpTRaCZDgykT qwgV4KXbN7mKSS+Z7Yw2Dwg77A== X-Google-Smtp-Source: APBJJlG+aqkZgSinL0H+vGhJ8SPTaMZTSfjnzUjRq5ezvCFkxr+RV56UV3ToUF/QNi8B1m8dggx9Pw== X-Received: by 2002:a25:8a06:0:b0:c3d:25af:45ec with SMTP id g6-20020a258a06000000b00c3d25af45ecmr14975706ybl.41.1689136254058; Tue, 11 Jul 2023 21:30:54 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id b8-20020a252e48000000b00c61af359b15sm750774ybn.43.2023.07.11.21.30.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jul 2023 21:30:53 -0700 (PDT) Date: Tue, 11 Jul 2023 21:30:40 -0700 (PDT) From: Hugh Dickins <hughd@google.com> X-X-Sender: hugh@ripple.attlocal.net To: Andrew Morton <akpm@linux-foundation.org> cc: Mike Kravetz <mike.kravetz@oracle.com>, Mike Rapoport <rppt@kernel.org>, "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>, Matthew Wilcox <willy@infradead.org>, David Hildenbrand <david@redhat.com>, Suren Baghdasaryan <surenb@google.com>, Qi Zheng <zhengqi.arch@bytedance.com>, Yang Shi <shy828301@gmail.com>, Mel Gorman <mgorman@techsingularity.net>, Peter Xu <peterx@redhat.com>, Peter Zijlstra <peterz@infradead.org>, Will Deacon <will@kernel.org>, Yu Zhao <yuzhao@google.com>, Alistair Popple <apopple@nvidia.com>, Ralph Campbell <rcampbell@nvidia.com>, Ira Weiny <ira.weiny@intel.com>, Steven Price <steven.price@arm.com>, SeongJae Park <sj@kernel.org>, Lorenzo Stoakes <lstoakes@gmail.com>, Huang Ying <ying.huang@intel.com>, Naoya Horiguchi <naoya.horiguchi@nec.com>, Christophe Leroy <christophe.leroy@csgroup.eu>, Zack Rusin <zackr@vmware.com>, Jason Gunthorpe <jgg@ziepe.ca>, Axel Rasmussen <axelrasmussen@google.com>, Anshuman Khandual <anshuman.khandual@arm.com>, Pasha Tatashin <pasha.tatashin@soleen.com>, Miaohe Lin <linmiaohe@huawei.com>, Minchan Kim <minchan@kernel.org>, Christoph Hellwig <hch@infradead.org>, Song Liu <song@kernel.org>, Thomas Hellstrom <thomas.hellstrom@linux.intel.com>, Russell King <linux@armlinux.org.uk>, "David S. Miller" <davem@davemloft.net>, Michael Ellerman <mpe@ellerman.id.au>, "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>, Heiko Carstens <hca@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Claudio Imbrenda <imbrenda@linux.ibm.com>, Alexander Gordeev <agordeev@linux.ibm.com>, Gerald Schaefer <gerald.schaefer@linux.ibm.com>, Vasily Gorbik <gor@linux.ibm.com>, Jann Horn <jannh@google.com>, Vishal Moola <vishal.moola@gmail.com>, Vlastimil Babka <vbabka@suse.cz>, Zi Yan <ziy@nvidia.com>, linux-arm-kernel@lists.infradead.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v3 01/13] mm/pgtable: add rcu_read_lock() and rcu_read_unlock()s In-Reply-To: <7cd843a9-aa80-14f-5eb2-33427363c20@google.com> Message-ID: <d3b01da5-2a6-833c-6681-67a3e024a16f@google.com> References: <7cd843a9-aa80-14f-5eb2-33427363c20@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Stat-Signature: 3j46yih6uecjfibdoz3t9sbicchjcy9f X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 17E18A0007 X-Rspam-User: X-HE-Tag: 1689136254-297270 X-HE-Meta: U2FsdGVkX1/YL+ur3lncx2FwAAnMs8X9+x2RVvmJZstFYmEAO/gid2LvonzKwZ1kYKrmlA8niHIcfMIe/E+1O1a31Xcyq1nSlS3j/Y3wWRmK0+BDja23m7eVjirWK1S+55/9SOd7R7qCBGIdOX1NNYKXTCmY1hIFiwDDr4AxfK1fcQ8i9RcOJWt7ikFA9sVxpfgsgfUtcRN1aiXPdA/TRQ/AwH4g2t69aV1BKooakBQN38GDhJRb7V5fsqp/5gvtREXBktfqrLeOHnIl80Ph2wNtI0CISK4pmi6bbJ3P8434xwmF4oENJfwkFtJsYTeFE3EDUR22ZEJXQ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JTj9j2xqwAXFQpi5C82lPNANm88+bSL04t7FJW8e1oksBrDz1Kqx2hHkHHi0mCr+6 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: <linux-mm.kvack.org> |
Series |
mm: free retracted page table by RCU
|
expand
|
diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index 5063b482e34f..5134edcec668 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -99,7 +99,7 @@ static inline pte_t *pte_offset_kernel(pmd_t *pmd, unsigned long address) ((pte_t *)kmap_local_page(pmd_page(*(pmd))) + pte_index((address))) #define pte_unmap(pte) do { \ kunmap_local((pte)); \ - /* rcu_read_unlock() to be added later */ \ + rcu_read_unlock(); \ } while (0) #else static inline pte_t *__pte_map(pmd_t *pmd, unsigned long address) @@ -108,7 +108,7 @@ static inline pte_t *__pte_map(pmd_t *pmd, unsigned long address) } static inline void pte_unmap(pte_t *pte) { - /* rcu_read_unlock() to be added later */ + rcu_read_unlock(); } #endif diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c index 4d454953046f..400e5a045848 100644 --- a/mm/pgtable-generic.c +++ b/mm/pgtable-generic.c @@ -236,7 +236,7 @@ pte_t *__pte_offset_map(pmd_t *pmd, unsigned long addr, pmd_t *pmdvalp) { pmd_t pmdval; - /* rcu_read_lock() to be added later */ + rcu_read_lock(); pmdval = pmdp_get_lockless(pmd); if (pmdvalp) *pmdvalp = pmdval; @@ -250,7 +250,7 @@ pte_t *__pte_offset_map(pmd_t *pmd, unsigned long addr, pmd_t *pmdvalp) } return __pte_map(&pmdval, addr); nomap: - /* rcu_read_unlock() to be added later */ + rcu_read_unlock(); return NULL; }
Before putting them to use (several commits later), add rcu_read_lock() to pte_offset_map(), and rcu_read_unlock() to pte_unmap(). Make this a separate commit, since it risks exposing imbalances: prior commits have fixed all the known imbalances, but we may find some have been missed. Signed-off-by: Hugh Dickins <hughd@google.com> --- include/linux/pgtable.h | 4 ++-- mm/pgtable-generic.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)