Message ID | 20230417205048.15870-7-vishal.moola@gmail.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 19786C77B7F for <linux-mm@archiver.kernel.org>; Mon, 17 Apr 2023 20:53:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BA3DD900005; Mon, 17 Apr 2023 16:52:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A1A81900004; Mon, 17 Apr 2023 16:52:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 86B1F900005; Mon, 17 Apr 2023 16:52:56 -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 689CB900004 for <linux-mm@kvack.org>; Mon, 17 Apr 2023 16:52:56 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 23FEC1C67EB for <linux-mm@kvack.org>; Mon, 17 Apr 2023 20:52:56 +0000 (UTC) X-FDA: 80692082352.17.6C939A9 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by imf25.hostedemail.com (Postfix) with ESMTP id 45CD6A0005 for <linux-mm@kvack.org>; Mon, 17 Apr 2023 20:52:54 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b="m9/ZIcz+"; spf=pass (imf25.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.53 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=1681764774; a=rsa-sha256; cv=none; b=qq/plsivs+Z0DZNmIZlixwHBDTaogs62bQYpb9xVRFdij3itfnO+VxUAZs1Y6KiftW8Lyu 20r5nP6jZKWj1hePLdPgEfNHa9QtRuQ7fsRKQAT1H18w6Rsb9CFGdblP07W44ADN6argln tutnhjre0BgWPXDEklyKd2II+cCHgXI= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b="m9/ZIcz+"; spf=pass (imf25.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.53 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=1681764774; 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=seoMdP0S43tB5tHiAJsyEn/McuL6oTkl/wxfiJ8zej0=; b=zut3WvBa26yNcjcuzvmc1/CVMyEpqGIEJBeTanMPd+UjlwcsyL6qvA/4PLafBuLlCMCq/5 coCv8GfV7BNjM4sXlNm6hXo8+qnyF+kH1Iw711mCZKThkT7HwUwzicE1vAv8wc+KXzxMyl zKZgCewkXyKEUPh1mIs2KxDMBNppE8s= Received: by mail-pj1-f53.google.com with SMTP id v21-20020a17090a459500b0024776162815so6439320pjg.2 for <linux-mm@kvack.org>; Mon, 17 Apr 2023 13:52:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681764774; x=1684356774; 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=seoMdP0S43tB5tHiAJsyEn/McuL6oTkl/wxfiJ8zej0=; b=m9/ZIcz+Tqctc8DsupfPgmRFjJ+xGEJ5QFcDJn618MR0YPogH6sfzkHf8JHJze9cJp x5NQYQBUB4f261Rif3c3u/e/lVyrkb7fkfJolfOwhFk6XOwO7D63t/TQQqs9S95k9Ae8 FKQXzDTaphWXYOHY2MRQP+XNQ8wh3L+YHkBgztA18oGJHjweyg/A/nWWIx5QMqDpAEPB X0wu3GkIqgBlm9RuBmiAr6UEFrV7LCwD9Gy8HkrUbR2REAIxrVGyinkjPCtpi11n6vo5 ARCTsKi2jOZHutSbPq4tlksgdP3OAZq4N0EqMo6MlYwn+u6KLBtMzuBeO5yqTZEreTX6 9o+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681764774; x=1684356774; 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=seoMdP0S43tB5tHiAJsyEn/McuL6oTkl/wxfiJ8zej0=; b=Q6CWAMtZzdNpr31esLNgRvsIxz6VXEfZuHAJy5GYQQvKeDSpBOIxWLkaNGRGCQFtbx mfdoEBbsEl+StyH7WJBFWeIFk040FZgdQHvXQUo/fTcQmUiFdPQdxJt70bLIhf0svaur EhzulqEVPJo54LTBFCwkD8JFA8UkPE+6hAA2f+812KZ+708Rr4Z7HAY2t5K6zJavaWev UfcR71yYubq65KXv3Yc7hhXxmuk1caxbDAJc3mLmC9DjXHqnSjFvftEl2+4F1UvN13f5 4u6/jr1Y+IPJ5+wUe6xNMqHk17zF9iMzsjDy/zmnaEulBKd3Qg+vsMjk0TH/CCRhjetD fEhg== X-Gm-Message-State: AAQBX9csCk833+86H+uGSOp2AKkw5e5oU3SptHFSzpiTllNz7bvlZhtl fWlwXFPlVOH65TqveYa5q38= X-Google-Smtp-Source: AKy350aUejw0DeO6puoaXC3R5n6x3DzcxqacgAq+Qj51dxkW8glMsrCpGOXbLfdvjTORWF+TApg9qw== X-Received: by 2002:a05:6a20:b21:b0:eb:8d47:332a with SMTP id x33-20020a056a200b2100b000eb8d47332amr14024065pzf.36.1681764773709; Mon, 17 Apr 2023 13:52:53 -0700 (PDT) Received: from fedora.hsd1.ca.comcast.net ([2601:644:937f:7f20::c139]) by smtp.googlemail.com with ESMTPSA id h7-20020a17090ac38700b0022335f1dae2sm7609707pjt.22.2023.04.17.13.52.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 13:52:53 -0700 (PDT) From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com> To: Andrew Morton <akpm@linux-foundation.org>, Matthew Wilcox <willy@infradead.org> 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, "Vishal Moola (Oracle)" <vishal.moola@gmail.com> Subject: [PATCH 06/33] mm: Convert ptlock_alloc() to use ptdescs Date: Mon, 17 Apr 2023 13:50:21 -0700 Message-Id: <20230417205048.15870-7-vishal.moola@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230417205048.15870-1-vishal.moola@gmail.com> References: <20230417205048.15870-1-vishal.moola@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Queue-Id: 45CD6A0005 X-Rspamd-Server: rspam01 X-Stat-Signature: c163shhfaoisga74b4p9ronehwa9y5wj X-HE-Tag: 1681764774-452619 X-HE-Meta: U2FsdGVkX1/Skjtp4cmXlY2FK812M2Ph3E3MRniylxnCiqz+Oq7rvZoHPo5w+zzKyEwNxyG6C/njf7QxpcusGPtSYN1nmLEtM3jFTgJ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KMJoz4tRiiMUtElWWUucQkU0aj29qTl75gVtdScPDe3FqCtoluQXCIk0puQx4wGZNqbmtURj3BGewGENTv38rpPwAx7C+1qc75v2mVp3sXDM+7IQ9llOfwAB0g0yi5nBds3Allc2n0rlc9gtxOo3suFW1X3cbEEX+jEbO4opGlkn454zn0UtQA3kp/4IEMTWk51Rd8MybI+TWTITu1EKWS0/e9LugSlFCcUAgozSw3fYGCo6117ttuiuM5zjUuuzaLph1wB2TBhTT4XaIcPQ3hw6Ri/vxKMUypLrXkV5DeuavhYe0VKyyn/Lm18ta/PCHfy0msYg3o1uOp16MgA8qJHc5DmmchqAmRMs1rY2syn05We2qXUCFWcT9EGA5Q5g73hdwgcldbtvWIuS38w== 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 |
Split ptdesc from struct page
|
expand
|
diff --git a/include/linux/mm.h b/include/linux/mm.h index 069187e84e35..17dc6e37ea03 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2786,7 +2786,7 @@ static inline void ptdesc_clear(void *x) #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) @@ -2798,7 +2798,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; } @@ -2828,7 +2828,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 d4d7df041b6f..37d408ac1b8d 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -5926,14 +5926,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; }
This removes some direct accesses to struct page, working towards splitting out struct ptdesc from struct page. Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com> --- include/linux/mm.h | 6 +++--- mm/memory.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-)