From patchwork Mon Aug 7 23:04:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13345294 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 CE27BC001DE for ; Mon, 7 Aug 2023 23:05:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7F2AD94000F; Mon, 7 Aug 2023 19:05:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 752EF940008; Mon, 7 Aug 2023 19:05:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5CDBA94000F; Mon, 7 Aug 2023 19:05:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 4EB66940008 for ; Mon, 7 Aug 2023 19:05:41 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1B7B31607A0 for ; Mon, 7 Aug 2023 23:05:41 +0000 (UTC) X-FDA: 81098842482.21.24FE5E4 Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) by imf22.hostedemail.com (Postfix) with ESMTP id 53C13C0005 for ; Mon, 7 Aug 2023 23:05:39 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=Xru6G6ui; spf=pass (imf22.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.219.179 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691449539; 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=rO3hRWVBo6Y9vRkkphMYimV7kP+YdlMpTAZzrYQT330=; b=EtJPqFQpuVtZpeNIf2fLGY7rClKMWagWdl1oca+7LHQdEJBwZgXs5sKFze3YsOWsyHRlhz u1xFj+BpyqcET5M+zSDGqEk0AHnVnbJn2icbVHli/WdjIEQxXsF41pDvedJkcfYIY7juwW tfJv/UVl0bo8/p1JIAaT6QGDG9nOplU= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=Xru6G6ui; spf=pass (imf22.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.219.179 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691449539; a=rsa-sha256; cv=none; b=PWtsUeIYjeSIuq6y7o9/6nJpur/oZavXQx0Lrczbe7svvKYHTun/LFmW5WGdFL0menAmG8 nMsrPu7DyfK5MW0n7LvynS54LyykV65gb8PjYJXvTI5JyHwL6vTY0qWbEixXYJ35JyuFj2 NqDMT3fd/fCn90Zf8JVN5iD7PD6PQJ4= Received: by mail-yb1-f179.google.com with SMTP id 3f1490d57ef6-d2b8437d825so5087528276.3 for ; Mon, 07 Aug 2023 16:05:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691449538; x=1692054338; 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=rO3hRWVBo6Y9vRkkphMYimV7kP+YdlMpTAZzrYQT330=; b=Xru6G6uiZe/OuMY5nm6nRGhKKZT+cMjFr3ywYmjJVtK6bJQBvGQe4lb67TeNeIpRR1 vU6ROYd5sljoul9DQ182dcYNUtIjSE0g9ryH9BBQnyweF2i9F3a0tNr39lnubSpEzEzx D9dlEQ3L7Z6V9tMyRKOuG3jp1VK2LuxNqNXMsa/r8JF3v1c5M1/VvDBiBALX9JEbGcjF BYD5zunEjYtVpsA/+5S4bzMaVg5Xls19tVXYJS5Y3GWWrR9cQxHo66Iare/M20jic/7P QScGaLnDnqCa6oKmv6Q3fNTRqyTkrnI7S8dkrsktkT3ibHnZIlamT/1RRAzAV+HV4mnX P1Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691449538; x=1692054338; 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=rO3hRWVBo6Y9vRkkphMYimV7kP+YdlMpTAZzrYQT330=; b=DwQ8+3ZpVHetdtme/6vq9mLBb2PAMA8OZf1qO8CDPA9uleVTkQqY5EXrGGnBbbi7wx 9VD7ucwhxuX/EDXCu7qz7oxYiP7fBscRixWFvzue4E4a6zvC2zap44H6Y7LUzfI/bXhL ZbGqvqafwD1Ovqkbj6aED+W+/QocyP+iaC4rROlV8TroXkXeYLYomhwZgEM7cmtOBglh 4rPb4NNGztTNRWsrknKVx0+aTlnzeRKLmgBp4cbFTRGY0JAwijzzU0HGAJeRx8k71vyo vNJqLQQSH1s5nQAGE3LHf+O3tcVhHEuFVK3SSL99ZkE3e9QFHuMgaqeBC05fslXkmRmm mDSA== X-Gm-Message-State: AOJu0Yx2b6MurRYPGNDYXqUHWvkR8RyKkgixCsSQRUTLZUrKqp3CDNyh WwLf9UXjNRDw5pGAkI3m0P4= X-Google-Smtp-Source: AGHT+IFQ1sRvJZAfCY+VUYCk9fa9DxUgaBX+22XersqRcqzji4wcHGi6IN2gPixXkKaq4oGn1g4mnw== X-Received: by 2002:a25:8001:0:b0:d0f:ea4b:1dff with SMTP id m1-20020a258001000000b00d0fea4b1dffmr9335056ybk.8.1691449538435; Mon, 07 Aug 2023 16:05:38 -0700 (PDT) Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16]) by smtp.googlemail.com with ESMTPSA id d190-20020a25cdc7000000b00d3596aca5bcsm2545203ybf.34.2023.08.07.16.05.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 16:05:38 -0700 (PDT) From: "Vishal Moola (Oracle)" To: Andrew Morton , Matthew Wilcox Cc: linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, xen-devel@lists.xenproject.org, kvm@vger.kernel.org, Hugh Dickins , "Vishal Moola (Oracle)" , Mike Rapoport Subject: [PATCH mm-unstable v9 10/31] mm: Convert ptlock_free() to use ptdescs Date: Mon, 7 Aug 2023 16:04:52 -0700 Message-Id: <20230807230513.102486-11-vishal.moola@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230807230513.102486-1-vishal.moola@gmail.com> References: <20230807230513.102486-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 53C13C0005 X-Rspam-User: X-Stat-Signature: ps1a78sxbjok7iwkeemxdoifuzmwcsxj X-Rspamd-Server: rspam01 X-HE-Tag: 1691449539-795601 X-HE-Meta: U2FsdGVkX1+x+0w4nRjhxBfeO3OSLqnGKRz8InATrjQSFL8B5FUB6D3DCdLb3AE+KsdMBLbFo0Z3Xf7Kr3QfI7VpDQ25+g8LzVt/EryeXSkNBTQ6Vh/obyyRTXG9zMjVgWNp47J/r9jks/yx+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i7n9f/OJhxWbWXNvQWcN6hqEtsFQvd0blPaKp4uZrawuDpWR971cNfpXSTSHuwsTNGzuMMIZOG6mpn96fWq2ri72A6K6tIxTXjR3EAnqFbgR38H3NUrqobNcXzx5oJwcXQej+D419jTgYNN9Mgzk1spI+0VQK3+oSWUiS06J+9ZDyYPY6VPEMJxD7pNPM10wzVivIzEXLBkJNfX0botHjZaa9GLiko98xoiqp4TaE7k8i1sT5j5VuAO+gyB8vHR+60Go652LZJNhaqXLA9LiZizuHz8LPYDzKlqUqpp0uBu1kEMswQm7m9iIz6yRaOWSZ8HuSddOa6G5EN4e6ijA18YY2R6H6qNaDS2Iu39ig7Vrgq+VKMqo2atn/HILvfpFwSvY9jsMbrAIOuBPmS9zZLSxN0cL8W 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: This removes some direct accesses to struct page, working towards splitting out struct ptdesc from struct page. Acked-by: Mike Rapoport (IBM) Signed-off-by: Vishal Moola (Oracle) --- include/linux/mm.h | 10 +++++----- mm/memory.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index aa6f77c71453..94984d49ab01 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2861,7 +2861,7 @@ static inline void pagetable_free(struct ptdesc *pt) #if ALLOC_SPLIT_PTLOCKS void __init ptlock_cache_init(void); bool ptlock_alloc(struct ptdesc *ptdesc); -extern void ptlock_free(struct page *page); +void ptlock_free(struct ptdesc *ptdesc); static inline spinlock_t *ptlock_ptr(struct ptdesc *ptdesc) { @@ -2877,7 +2877,7 @@ static inline bool ptlock_alloc(struct ptdesc *ptdesc) return true; } -static inline void ptlock_free(struct page *page) +static inline void ptlock_free(struct ptdesc *ptdesc) { } @@ -2918,7 +2918,7 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd) } static inline void ptlock_cache_init(void) {} static inline bool ptlock_init(struct ptdesc *ptdesc) { return true; } -static inline void ptlock_free(struct page *page) {} +static inline void ptlock_free(struct ptdesc *ptdesc) {} #endif /* USE_SPLIT_PTE_PTLOCKS */ static inline bool pgtable_pte_page_ctor(struct page *page) @@ -2932,7 +2932,7 @@ static inline bool pgtable_pte_page_ctor(struct page *page) static inline void pgtable_pte_page_dtor(struct page *page) { - ptlock_free(page); + ptlock_free(page_ptdesc(page)); __ClearPageTable(page); dec_lruvec_page_state(page, NR_PAGETABLE); } @@ -3006,7 +3006,7 @@ static inline void pmd_ptlock_free(struct ptdesc *ptdesc) #ifdef CONFIG_TRANSPARENT_HUGEPAGE VM_BUG_ON_PAGE(ptdesc->pmd_huge_pte, ptdesc_page(ptdesc)); #endif - ptlock_free(ptdesc_page(ptdesc)); + ptlock_free(ptdesc); } #define pmd_huge_pte(mm, pmd) (pmd_ptdesc(pmd)->pmd_huge_pte) diff --git a/mm/memory.c b/mm/memory.c index 3606ef72ba70..d003076b218d 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -6145,8 +6145,8 @@ bool ptlock_alloc(struct ptdesc *ptdesc) return true; } -void ptlock_free(struct page *page) +void ptlock_free(struct ptdesc *ptdesc) { - kmem_cache_free(page_ptl_cachep, page->ptl); + kmem_cache_free(page_ptl_cachep, ptdesc->ptl); } #endif