From patchwork Mon Jul 31 17:03:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13335106 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 DB58DC001DC for ; Mon, 31 Jul 2023 17:03:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7407C6B016C; Mon, 31 Jul 2023 13:03:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6A19F28006F; Mon, 31 Jul 2023 13:03:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 51B406B016E; Mon, 31 Jul 2023 13:03:55 -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 3D09C6B016C for ; Mon, 31 Jul 2023 13:03:55 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id A55B9A0345 for ; Mon, 31 Jul 2023 17:03:54 +0000 (UTC) X-FDA: 81072529188.12.E1443B8 Received: from mail-yb1-f172.google.com (mail-yb1-f172.google.com [209.85.219.172]) by imf18.hostedemail.com (Postfix) with ESMTP id B61531C0025 for ; Mon, 31 Jul 2023 17:03:48 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=XxfUVCtc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.219.172 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690823028; a=rsa-sha256; cv=none; b=2IUls45invT3KtxagcsoDjgxIDYPh+xa8V0iJkjHZBkZPf4CmwGpKFsKWfT+pPsp/KZRMg I8JksPggu3opk7R7d1zhIQgayIzBzf8Bgt7YNWxf+zOgAnDoKf7VMuIQXfUZXW04AZGIZo mCz650XeSOJo/faF4BbrRNmeAu9gWCU= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=XxfUVCtc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.219.172 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=1690823028; 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=hLtCJBysrabsGyMeKlbK2lKTjEzHhmjaMpElw0hOQuQ=; b=uOdutrLiG/dqjh/SaTAzPRdXq20NA/2OUpE+o/D6vjDT12nn4zlZnfrNaV11TBlzJungHD SQX1Mdg+BrMWHGdvBCv6x1Jiew2+2HeNxsJFReKP2zu/vAAjO74TRz2z5dFQ9KQg4nBjVC C4mgQK+k3mbmYTD9O5RKX3+E/EdFJMA= Received: by mail-yb1-f172.google.com with SMTP id 3f1490d57ef6-d0548cf861aso4902361276.3 for ; Mon, 31 Jul 2023 10:03:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690823028; x=1691427828; 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=hLtCJBysrabsGyMeKlbK2lKTjEzHhmjaMpElw0hOQuQ=; b=XxfUVCtc+QbMuKLsIQZYFotQjD1uPn39bJPNzHnLSpRxaT3fJeSLcUYSJwnJQ3Db/g leWI/21K6KvWZhIzEH7DHukGj5D7XdCtwzeO763ZUH4LeT7PuPE1GzPcQcYVnv/vf13j n79Pu8SKl7LjDKW1vidx9U3g5HX3hsbCLIInKKKoydsrph/bfVYnRh1jLyq8obFjpp4I 8/fNfhvrK0O+QQmUluanQgTc5DFDNrxKYjhdFJW8WfDVLkfAQZABhu93QV+IfN33Z8yL iOGQEq8tdk7NtoCkxwkrl9w2lNi5iRHnhmaZ+oTac0bEezCH6FvgLddmkBsJ59So10Oj RPOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690823028; x=1691427828; 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=hLtCJBysrabsGyMeKlbK2lKTjEzHhmjaMpElw0hOQuQ=; b=OgsTtBNh+ojdzbUEJJcVVObuyACp0cZKbvG7pf9bU1zNTZVTuyOfPLSgE6KAQH6ggv 4gqasunS4eIrtQ666seb3izOrfejKYMB6Nrz+yxbElub/U+iNn31pdRyuIy4TFtU+A/J A8yVTPQEg+P2Ryt4QsfBU34xPD6yva9l9mn86DNmNCWppvyttU2JdAT220fnWGBMaCcz l7ufVZFmM22sog3fjjBTl5uUpIsrytnB/WqjcXERHbnX/Yh5yTmwyAgteDlEgIfLzagO pbO0Xp8p+PpSqyBHpZwDTw6s1xafL9DYAWNaQhYXbWCE/tNLJfcZSs1+F7lmhddAfAU3 eN+Q== X-Gm-Message-State: ABy/qLbNqoB1nvQ8unCSd9y6Ku5flEfagrnQueW0citOMQcYRgOLvDPU QORMcXjmrxb4bAzAbXc2CTQ= X-Google-Smtp-Source: APBJJlGaLQRI5Q0HqdaC/SmgbvgNuoyQchTQtq0hJYQ2S7wch31RC4bpLlQZjYY1DDyT4+2cD/rUkg== X-Received: by 2002:a25:9bc8:0:b0:c91:cc0e:1aef with SMTP id w8-20020a259bc8000000b00c91cc0e1aefmr8613166ybo.58.1690823027825; Mon, 31 Jul 2023 10:03:47 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 10:03:47 -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 05/31] mm: Convert ptlock_alloc() to use ptdescs Date: Mon, 31 Jul 2023 10:03:06 -0700 Message-Id: <20230731170332.69404-6-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-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: B61531C0025 X-Stat-Signature: j5o93met8j848wb66fac8s1zft8554m1 X-HE-Tag: 1690823028-548253 X-HE-Meta: U2FsdGVkX19gK/F+LoIa3Me3d93ecJ14yCseVrcRCJ8to59Q9i0/tTIiA1eKc++YnMDHODYs6/9XcHZuqCZp7m9KTsjb9XQK4ZmzYxrOgWsWZyx5u5MIOy2kgnck9f8R5P9LgPd8YxU3GKGawFxpviDJBRhDbfFMwOfU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WxJRlSFfkGP0iyrlUYGzD0KKYyjNXKP7q3ip/LCfSNbStE7qJm9l3ku8es5x0iN+oxH6PXjJU/YbzxcsTZxUkJfPzg+8RMSYZUnT7pRm98zZxVwkbSBt6enJcRLdJ25qQwfFm/LSWggd4RzvytXuOh1opyishSFt9GPaPCf5NDEcvqpZqMr/apnv9aSYmyDFtsLNRr8lad/O/mxy5NWUvJUf+c5XgkrkCmdKTRGWgX/hdXp6a2MWmZu5nMWvHwWa8ZW9Z6/Zx2PJ50FpAwA3lrhudL3ddL3sEVWvLUe+3kCjgstWjtYmaSH4zsdSLTAgoW6Fekzbtt8gGdvCA2Vw2PdqrQi0A5eHGMTs9DJaSa8ReFPVx7R/JVT3ff3pTsihHtlprYEIlVpgKWGZf4G/GfBGJGukII= 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 | 6 +++--- mm/memory.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index bf552a106e4a..b3fce0bfe201 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2841,7 +2841,7 @@ static inline void pagetable_free(struct ptdesc *pt) #if USE_SPLIT_PTE_PTLOCKS #if ALLOC_SPLIT_PTLOCKS void __init ptlock_cache_init(void); -extern bool ptlock_alloc(struct page *page); +bool ptlock_alloc(struct ptdesc *ptdesc); extern void ptlock_free(struct page *page); static inline spinlock_t *ptlock_ptr(struct page *page) @@ -2853,7 +2853,7 @@ static inline void ptlock_cache_init(void) { } -static inline bool ptlock_alloc(struct page *page) +static inline bool ptlock_alloc(struct ptdesc *ptdesc) { return true; } @@ -2883,7 +2883,7 @@ static inline bool ptlock_init(struct page *page) * slab code uses page->slab_cache, which share storage with page->ptl. */ VM_BUG_ON_PAGE(*(unsigned long *)&page->ptl, page); - if (!ptlock_alloc(page)) + if (!ptlock_alloc(page_ptdesc(page))) return false; spin_lock_init(ptlock_ptr(page)); return true; diff --git a/mm/memory.c b/mm/memory.c index 2130bad76eb1..4fee273595e2 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -6231,14 +6231,14 @@ void __init ptlock_cache_init(void) SLAB_PANIC, NULL); } -bool ptlock_alloc(struct page *page) +bool ptlock_alloc(struct ptdesc *ptdesc) { spinlock_t *ptl; ptl = kmem_cache_alloc(page_ptl_cachep, GFP_KERNEL); if (!ptl) return false; - page->ptl = ptl; + ptdesc->ptl = ptl; return true; }