From patchwork Mon Jul 31 17:03:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13335109 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 ABD90C001DE for ; Mon, 31 Jul 2023 17:04:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 47FD36B0172; Mon, 31 Jul 2023 13:04:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4303428006F; Mon, 31 Jul 2023 13:04:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2F88B6B0174; Mon, 31 Jul 2023 13:04:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 1C82B6B0172 for ; Mon, 31 Jul 2023 13:04:03 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 3F1F8402F0 for ; Mon, 31 Jul 2023 17:04:01 +0000 (UTC) X-FDA: 81072529482.09.7CCAA2E Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com [209.85.219.173]) by imf19.hostedemail.com (Postfix) with ESMTP id E44701A001E for ; Mon, 31 Jul 2023 17:03:58 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=TvM6DExj; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf19.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.219.173 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690823038; 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=7EZnRhm4Fj3KaK4sFjI+P1mIVDNOtVXSgVauozi7/LE=; b=U9TTpzElUxRWeki3MwlreWi6vbJ/eaC74IYvtoEtE+9mOfPxf8F2+3VoNqyIdpwGAD4SDh aZqUdNsd8uzNRGbINn0UBUhnhVgeT1JYHiHiyq69e9zPWaBd1tb9fKqLnSk6vDQKZKe6MU De0+fHx6vmi3CLgqpTsf8TfMBIB4iXQ= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=TvM6DExj; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf19.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.219.173 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690823038; a=rsa-sha256; cv=none; b=kR/h5YCoAxkVXPxy670ogKXcgcu04DRT0Z6Nl5fp1MGfXMZOHi/VjivDrmOb08o+yb67JJ pSiwOD7hxygwW1g4hY4pDreO/9QpDf/i/0jzaYs20vmYx3Hu90CccnTxSYYNYzk2gfzaJO uNq8kTQEQoXzX4/w9RwiycnyZPTTjHU= Received: by mail-yb1-f173.google.com with SMTP id 3f1490d57ef6-d1c988afebfso5035284276.2 for ; Mon, 31 Jul 2023 10:03:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690823038; x=1691427838; 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=7EZnRhm4Fj3KaK4sFjI+P1mIVDNOtVXSgVauozi7/LE=; b=TvM6DExj/MTq0Jm70GY7llkizJv0Xrt3jOhv1061u2jelnUc+8n8NrIEW+BAV0minS 1tyB2hh96LoZso6xWTQsTKE9iOzQkPYOcn2oO7CJPClzabUQT8JEbqLe1hGOluEbesF4 LKkTfn07m+I0Vuueep3IFUQUJltM6JJHBDBn8n653IK02ME5fuHReejoNwtCex5xQyzn Y1wOj8DVfr6r9eQ6TYR15inSR6hHDxry08oKRDaKIhjxxmp2hbT5OuHr1D1+R6xelNHE JPdzrcJvaKmiiybVsDU25/RyZDaqIgMV6uxOUr6sp0q3qR3F0X4P6bOEInakDYMw/wf5 mu/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690823038; x=1691427838; 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=7EZnRhm4Fj3KaK4sFjI+P1mIVDNOtVXSgVauozi7/LE=; b=SMLKUwBeSeLoDkJrVCqmqbAnRyN/WJlz+E79X9In8NVAnZjdnIzoGAJmrz116pnefj HztaN8H3XX212M6R/iQr2fFD4tDkX9hb6AIR1+WRoArzM4+eotHOsrUJM15/PAGNhSCf m3iYwie8iae6a+tiirb7Hhm6OXfHqSn8JXHl6UhBj0/o73Z0EV5oXlnxx/S0nYESdi0+ iTb2qpvuM7PVH3l1R1TdBNE5wVPeEDdiqT5gwgYOBq3aUFPVqjXpIy/gsBjiMcMSKZpz otbGvAMB7yuWsxteOftM34F2dehvLDeEVd96FoTsVYmA1xTkQpqnTRrcUkG1UzAd+LQw uRxw== X-Gm-Message-State: ABy/qLaWs+x6xzlzsK/mUbxvfBUs5HPsUz3j9Y4Y66+AwOCm1TYR/Y0a xKs26FlX2QDRDs5HtcfeDLg= X-Google-Smtp-Source: APBJJlH90WRLRIm5YDV2YMBRfelNi7WH7+bbsrmY7NpvynPWnsTYJfLOq9UWydp0DqF9z3jWR7ijAw== X-Received: by 2002:a25:e08b:0:b0:d18:e435:bdc0 with SMTP id x133-20020a25e08b000000b00d18e435bdc0mr11858543ybg.57.1690823037763; Mon, 31 Jul 2023 10:03:57 -0700 (PDT) Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16]) by smtp.googlemail.com with ESMTPSA id x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.03.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 10:03:57 -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 v8 10/31] mm: Convert ptlock_free() to use ptdescs Date: Mon, 31 Jul 2023 10:03:11 -0700 Message-Id: <20230731170332.69404-11-vishal.moola@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com> References: <20230731170332.69404-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: E44701A001E X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: mwrj9h8srkimtpquuggr6ze3ndhxgb7u X-HE-Tag: 1690823038-308515 X-HE-Meta: U2FsdGVkX1/RPf5q+n1DdOJQxq4bmgEP5aN0wN47hS4fCBbB1Ry0EzI7ra7oHzSMv3vRMj/iT2n5OTcQux9gjl9kiDiQBYR0pvTXb/oGjJVfPGFJbFkSNZCKerKFk5nkGkSYOu5tMFn2VKszFeaCGX4Q820TekN9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GmgBcQ6rct8fVUUQjoKLRXukvIeMtk/rg6ykw7y57aINV059Vv1FLjd7qZkgJckax7DdQeQEzob9CP6rm1KPGxStlaemant7GTQ4GbQ00cBZl9eWMK4WeVGfe2s7VQwrFCcai6tBdTP6SD8bXaUUFXLZaVTq1Pc+HZHmpTV5A3luPhLT8vFa77NCeu4pXfY6dAgoLIIVAkxiISEktdF9vkCozEffugEMW+2vEOIXKPxnqDFHe1WJXZMajcZ780CyCuznEWbE5a/wkYsN13BZcDUpDFGCPt3nTSQIjIRkLrO+IDVk+tjsLjzmZ6kKcML6nAcsIqC23z35QMVfY5YgwMgLr8JsxUMmEuS8CIZoq581UFFn3uHLdloFopVMiNzTuVf3NIZZFOw= 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. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- 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 774fe83c0c16..ffddae95af78 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2842,7 +2842,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) { @@ -2858,7 +2858,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) { } @@ -2899,7 +2899,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) @@ -2913,7 +2913,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); } @@ -2987,7 +2987,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 4fee273595e2..e5e370cdac23 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -6242,8 +6242,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