From patchwork Mon Jul 31 17:03:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13335108 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 82B20C001DE for ; Mon, 31 Jul 2023 17:04:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 14E4D6B016F; Mon, 31 Jul 2023 13:03:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0FCBA6B0170; Mon, 31 Jul 2023 13:03:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E1C816B0171; Mon, 31 Jul 2023 13:03:58 -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 CEC686B016F for ; Mon, 31 Jul 2023 13:03:58 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 9A1EA1C8C55 for ; Mon, 31 Jul 2023 17:03:58 +0000 (UTC) X-FDA: 81072529356.30.D11B02A Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) by imf23.hostedemail.com (Postfix) with ESMTP id A4CC714002B for ; Mon, 31 Jul 2023 17:03:56 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=YpVyYPxP; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf23.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.166.170 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=1690823036; 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=iZ7ozcISUSGoixC5UzzNE5tJz0+L18C1Imj6XmV/DYM=; b=0y/W+IhGRByFRPPh4A51a1ZnNkNrfEfJt9sTMD5rMbt0tRsXE12oWcR71UyxDW0Zss9P/C kAXzWDhrCvB6uf/vQmON8lhaIeSXyvuhVFLa+tMN4JJw2NTio712lwnwfXW9IqSus+GXPd A/DEsFjSzq9V9mdHS9Z/N3LlnvGH2Ug= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=YpVyYPxP; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf23.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.166.170 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690823036; a=rsa-sha256; cv=none; b=7DoV5vK9Og2wheyD6cugDbbji7jjnzTZ+R0lqsXQMrMyEefE9rX/DCAF92vKpq/mPoGqZs PMvOz08Iiv1eSWbpWpbLTLRx5K10ChvIvXP565zvgWLj0sis4DOBm49eAJ8YcJJb7b/FzS ROiV0Fku0h85Xm2ZvVYY9pagimqvhRY= Received: by mail-il1-f170.google.com with SMTP id e9e14a558f8ab-3491516c4aeso4949465ab.1 for ; Mon, 31 Jul 2023 10:03:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690823036; x=1691427836; 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=iZ7ozcISUSGoixC5UzzNE5tJz0+L18C1Imj6XmV/DYM=; b=YpVyYPxPRtPTKHT9+tyvzqfvzCuhkFnhsMCX6nJF7RWviYaDE6pxTcvqFICRytHQ3F mk3OEWmycmo6ouKKcTZJZ/J9GI0O0U+IOIhkq6cf5NcWzs3F3Ep7I9wPm/bnxo3IbGbP 5A5D1El9yg833uJSmp138hZ30DYMCVkIUWUYXAVHfkbTx4hT6PxevukL8QnCpSiv14Rw Ab1JsXOoVAvxWjOf0Fsk8pxufrrxg62ZUs/sWVYn8yXcxdG4Ij3aN3bFcjr1GQQkDcpq XCDoC5WGNDUaZUPNMTX8kXKJ799hVc0z6s0hq6YfOkQjqMhJ1aFCFD+uKI8XA047G16z xszQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690823036; x=1691427836; 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=iZ7ozcISUSGoixC5UzzNE5tJz0+L18C1Imj6XmV/DYM=; b=M0zIVsKgIGwDL7UdvL0LiRybMBesWICIdt147Ns5G8WYe3ZwLibwaAQZUwo6SjG+Al dC2BuPoLsaOOA04SAraw/lrNPKRSs7q1d1/axD6gI8GrRFmRG4PFU5xvLLu7DsQc3NXD HadKgZUdnzIu1/riDA+l7pZlYhVVMjCeKDW1wV2wjy0s0sTGm9yNGQpL3nJDGi3i0ajx N76aK7PysEv2wv8sXvhGkPHfjkhG1Z+N1Bite2afXJg8wDaDvlRmfoaRSEdi4taYRQ7z ujdcP2P36haRi1myRNtHxXoXrufvEQLct3IePAjOgTLsLOFn3KWXee+u3fJnYhXaU+Jf FRNw== X-Gm-Message-State: ABy/qLZsq6bUJ7cfTUJmzWGsFGnxC9sKIOrpYv0oFwXPuU8aLxdAeUTl saGFcKXWOLw9/u48YItehKw= X-Google-Smtp-Source: APBJJlHoVkOsri9H/NdsUsto2q+Ey0kzzV9aD886+MBagBeourqVjWpbCtZ0aJitRhXpadhn4PaeZQ== X-Received: by 2002:a05:6e02:1c26:b0:348:b910:313d with SMTP id m6-20020a056e021c2600b00348b910313dmr9675086ilh.14.1690823035707; Mon, 31 Jul 2023 10:03:55 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 10:03:55 -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 09/31] mm: Convert pmd_ptlock_free() to use ptdescs Date: Mon, 31 Jul 2023 10:03:10 -0700 Message-Id: <20230731170332.69404-10-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: rspam12 X-Rspamd-Queue-Id: A4CC714002B X-Stat-Signature: zofytdabrigjzdad43gwugimbr5u94gs X-HE-Tag: 1690823036-867390 X-HE-Meta: U2FsdGVkX1/pEG22+4F9BGcLws03TcuKwqgIYXIqgo8OxtXDpYNMu74RQkxKg/dbx5IdWLx0ECkcR5jsa7U/uKIYdEG7v8yC2l+GzT4y2n+1qAtICSC+R6Cm6Ig6HElqRKypvnCFOqx5TWKL2OveE92/iWe4w2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CYQBB6zBIR2JoYd9QmPCowJnZJlq625NxihD3N/tDrVPSCfdxD9xNV8+uY3hJJa6fSTCy7gn6jZOBJGbjmZ9WOYsfymnaLM3Uy1ocerUTORPMyRKi1VMP//JSj43/fk799aIFj8asd87pruPP6YjwMe+SubvPmU+iN9LsZDMrtkuqqyOi1y7kpDwT6T+RF2AV00ic6feg/F40v0utPxXHSIa3/lFApdM5CiWc9UWrJveAtZhTO483qVmoEI3zcC7nNGGt7IracaMszYCof3cMP7vYqsjd20Sk00mu9qm7LJ4daZ1DWcfAZIY+iTsnylIDJD6nnGFiK3nG47lHP86i71u2WH/AbtZmP5LB4Rr0RyGym2Lqsh+5QjK2sb/Ydf9EwhHD2ZxU0GXbMZh6iu6s4QjQkBwz+gE0= 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 675972d3f7e4..774fe83c0c16 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2982,12 +2982,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) @@ -3000,7 +3000,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) @@ -3024,7 +3024,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); }