From patchwork Mon Jun 12 21:04:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13277355 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 3D0B6C88CB2 for ; Mon, 12 Jun 2023 21:05:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6D84D940014; Mon, 12 Jun 2023 17:05:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 68ABC94000B; Mon, 12 Jun 2023 17:05:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 48D5F940014; Mon, 12 Jun 2023 17:05:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 3B3AE94000B for ; Mon, 12 Jun 2023 17:05:11 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 028831C79BA for ; Mon, 12 Jun 2023 21:05:10 +0000 (UTC) X-FDA: 80895326022.02.E9BD4CD Received: from mail-yw1-f170.google.com (mail-yw1-f170.google.com [209.85.128.170]) by imf25.hostedemail.com (Postfix) with ESMTP id 3A461A000C for ; Mon, 12 Jun 2023 21:05:08 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=cJPixJ7f; spf=pass (imf25.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.128.170 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=1686603909; 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=e/NReaJdz90gZ2NQIlUYsxuwjuA5PoSk9HvAIR22dRg=; b=zuGi4cdA9cpdj548Ip1guP4ToDt+mj0gbIMhodIQJaUFTRhopy4O0V3XQrPBSxH+AWDgKI Nhv3OzxFF7rRvHVQGqNJkKN3NsOe9AtzlZWxVeLB6nqkRWO+LyY+6fbPhqyBjgOR8BIXd1 +wW9OWhcu7D0Ll08ZhDek5k1AUDjzRo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686603909; a=rsa-sha256; cv=none; b=4t4j57Zx6nCnejfCIJ82ed98RQXp+svRYy0wG2dlu4WCMzsPq9VTp0BNPfXw5xKZarrHqU UYijiZzmVP+uB1ITwKB0J2cDm33rKj8APr4VIl45k2GKSbJ8iMoEJUypqMTuAMUbbBqMgq a6ulU47afjxZ0WdljSPUDMcgTrA+fw0= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=cJPixJ7f; spf=pass (imf25.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.128.170 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-yw1-f170.google.com with SMTP id 00721157ae682-56d2b7a9465so15630037b3.3 for ; Mon, 12 Jun 2023 14:05:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686603908; x=1689195908; 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=e/NReaJdz90gZ2NQIlUYsxuwjuA5PoSk9HvAIR22dRg=; b=cJPixJ7fvL8lj4msWoT6T4UdDliAegelx3fhfZFkllamFJSmCzzBfgBkJHvHf5VBH4 +bFQaX0c9HvMpz3cMr64OoUwpvHF+4NrriYC39tboK0Z4VjLF9J6MmzkevSDnSF+eJ9S vsFP6THd62TglAym5r/waWV4KiQYY/X7Hysf9ft4FBrKTw7bicGfQMMhWM2I4CuvKtOv cwDTHbNBV8LRmkAEvkAc0kAr+XDxv+lhnXg68dTw4NnjCIip7ummoW4kmN1lP3wtz1t1 rgvGb1IbL+Qt1u/Y4z+ep/GLJI6yTMWmeJDiLjESMtlIxdtrVlVrtQkxPe5yKm5XHK1M 0mYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686603908; x=1689195908; 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=e/NReaJdz90gZ2NQIlUYsxuwjuA5PoSk9HvAIR22dRg=; b=JUWZCY2YhfxSEBZez44vq/UbI2ic+VJKJ6+2Lsvc+u1kODiZU3oP59Sv0Nj82CZe6M j0FkmcWw9KaZF7AYNiRIfl+jOb4o9i6fQG0ryYevm/jB/xrhEDDFcfrNQIvva8/JaYEl RzyDa0GLJ/CIKa3V3bGo1rzVp+PSey8TyDaapcijcAMF/XytO8P5HQSSbLgywFuDo+/C dxxHvtQRCMLm8GPFkv9K/GXe9OAjeGIgx1W4qBlLHXBu52MkQYbvUcOFU1Vs6QKeXayL qUCFQ7pUMZ4OzJkaXsalBW2+JnqqzTFw41UNOqsJ67dyhnQ+szEtfnm8mg8/qG5MWCzf CqSA== X-Gm-Message-State: AC+VfDwTPuGd/7/sqRHJt+6D3XXl9uMc/GmFS3fbGRA9V6zgjtiXJFY6 DLQpmxIAgVKE7WClPlebHrA= X-Google-Smtp-Source: ACHHUZ5kijcVYXBTbbFcK1VnPllJL1iB2ONZxmZAAAXhO7jcUSS10Gkxlzbwqmp6U6Z9PG+yvX9PWw== X-Received: by 2002:a81:9288:0:b0:56c:f916:905 with SMTP id j130-20020a819288000000b0056cf9160905mr7254032ywg.32.1686603908266; Mon, 12 Jun 2023 14:05:08 -0700 (PDT) Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16]) by smtp.googlemail.com with ESMTPSA id s125-20020a817783000000b00569eb609458sm2757115ywc.81.2023.06.12.14.05.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 14:05:08 -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)" Subject: [PATCH v4 11/34] mm: Convert pmd_ptlock_free() to use ptdescs Date: Mon, 12 Jun 2023 14:04:00 -0700 Message-Id: <20230612210423.18611-12-vishal.moola@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230612210423.18611-1-vishal.moola@gmail.com> References: <20230612210423.18611-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Stat-Signature: cti5ikgcmh7q6bzm9j1cc65u4zisjtnf X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 3A461A000C X-Rspam-User: X-HE-Tag: 1686603908-302508 X-HE-Meta: U2FsdGVkX1+I4EJ8mZff6aHZWysUGe96RdEe2EgwoY9K3CD6+tdanbVOUUDkCPwuGuBZMgSGjeW9V0/TrFKfMLMg1RQuf0+BPKCkEMKR0upO498EMpyFxKV6Ylp1gDyU+r+LMrlXtp56oj1iRTSWa/ja1PsG76h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hScOcT3i/KSWEuHgPvPdnJJVdcXUGM/7l3YS3xyCzn45Yj1TFhZ8WuMIdqg204ZrKbKqTnHIuI8IRayILiQc3aP4S4nvIokow5nlAOfWASDKmM12do6b5jcagSw0TZgj5muW4JfBO4hzpDpyEal1IB/1SP38WLGUzbS6vgHUqy5WFksEmXGkjXQ/Ugi/YheFgxOLZUsjhWxwiOS2HU7Zqssw5Q6wWu1zfyzqYDOnOaJ8JJlwr00KChdc4/BX4Jhigcr+X1h9qpaP7IXLfQLQpNwS5GBM681Z8Powp0Ld8fagkk6Zpx2v0XaZ+gchNXBGC3BAXKN4qnl3stsw= 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 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index f48e626d9c98..3b54bb4c9753 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2950,12 +2950,12 @@ static inline bool pmd_ptlock_init(struct ptdesc *ptdesc) return ptlock_init(ptdesc); } -static inline void pmd_ptlock_free(struct page *page) +static inline void pmd_ptlock_free(struct ptdesc *ptdesc) { #ifdef CONFIG_TRANSPARENT_HUGEPAGE - VM_BUG_ON_PAGE(page->pmd_huge_pte, page); + VM_BUG_ON_PAGE(ptdesc->pmd_huge_pte, ptdesc_page(ptdesc)); #endif - ptlock_free(page); + ptlock_free(ptdesc_page(ptdesc)); } #define pmd_huge_pte(mm, pmd) (pmd_ptdesc(pmd)->pmd_huge_pte) @@ -2968,7 +2968,7 @@ static inline spinlock_t *pmd_lockptr(struct mm_struct *mm, pmd_t *pmd) } static inline bool pmd_ptlock_init(struct ptdesc *ptdesc) { return true; } -static inline void pmd_ptlock_free(struct page *page) {} +static inline void pmd_ptlock_free(struct ptdesc *ptdesc) {} #define pmd_huge_pte(mm, pmd) ((mm)->pmd_huge_pte) @@ -2992,7 +2992,7 @@ static inline bool pgtable_pmd_page_ctor(struct page *page) static inline void pgtable_pmd_page_dtor(struct page *page) { - pmd_ptlock_free(page); + pmd_ptlock_free(page_ptdesc(page)); __ClearPageTable(page); dec_lruvec_page_state(page, NR_PAGETABLE); }