From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6688EC77B7A for ; Thu, 25 May 2023 20:26:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241471AbjEYU0F (ORCPT ); Thu, 25 May 2023 16:26:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233159AbjEYU0E (ORCPT ); Thu, 25 May 2023 16:26:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70B7CB3; Thu, 25 May 2023 13:26:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 01AFA64A34; Thu, 25 May 2023 20:26:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 185ECC433D2; Thu, 25 May 2023 20:25:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685046362; bh=q0CSXKuNpY/cOn/THS8/5Wy4aJR83TTmgU6zxWwJSXw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SQE8oA8lQRwEus253i9PgXAYxS+1hfEWgxQkG8dNMuK5+C2MzFWHC2gCVa/sCTaIh mINB5DgFECw+pGenAIWbq/ant+MDQxcFaxJeNamZqmWfH2SE50ljnoCt5WDkZMFN/y zSsFGUWBnPo7WzVzFj57OnJKTLZv8v06II8J4E2+FMu/J0lzw0cg8/Um5wKRhTuiBz M1a9kePx9hC6/XnF66pTT3tDmfydVWOZ+PUuN61Pd1nQtUDi8l6wozX8HGFWMhSLig QS2F5MDwxfui88OZl1d4xhMuIeMffwSLM7NnRPkICdlmFaTyYVH5nOaWhDuFI01iqL PEjExdKRm1jxQ== Date: Thu, 25 May 2023 23:25:37 +0300 From: Mike Rapoport To: Vishal Moola Cc: Andrew Morton , Matthew Wilcox , 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 Subject: Re: [PATCH v2 05/34] mm: add utility functions for ptdesc Message-ID: <20230525202537.GA4967@kernel.org> References: <20230501192829.17086-1-vishal.moola@gmail.com> <20230501192829.17086-6-vishal.moola@gmail.com> <20230525090956.GX4967@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org On Thu, May 25, 2023 at 11:04:28AM -0700, Vishal Moola wrote: > On Thu, May 25, 2023 at 2:10 AM Mike Rapoport wrote: > > > + > > > +static inline struct ptdesc *ptdesc_alloc(gfp_t gfp, unsigned int order) > > > +{ > > > + struct page *page = alloc_pages(gfp | __GFP_COMP, order); > > > + > > > + return page_ptdesc(page); > > > +} > > > + > > > +static inline void ptdesc_free(struct ptdesc *pt) > > > +{ > > > + struct page *page = ptdesc_page(pt); > > > + > > > + __free_pages(page, compound_order(page)); > > > +} > > > > The ptdesc_{alloc,free} API does not sound right to me. The name > > ptdesc_alloc() implies the allocation of the ptdesc itself, rather than > > allocation of page table page. The same goes for free. > > I'm not sure I see the difference. Could you elaborate? I read ptdesc_alloc() as "allocate a ptdesc" rather than as "allocate a page for page table and return ptdesc pointing to that page". Seems very confusing to me already and it will be even more confusion when we'll start allocating actual ptdescs. -- Sincerely yours, Mike. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Rapoport Subject: Re: [PATCH v2 05/34] mm: add utility functions for ptdesc Date: Thu, 25 May 2023 23:25:37 +0300 Message-ID: <20230525202537.GA4967@kernel.org> References: <20230501192829.17086-1-vishal.moola@gmail.com> <20230501192829.17086-6-vishal.moola@gmail.com> <20230525090956.GX4967@kernel.org> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685046362; bh=q0CSXKuNpY/cOn/THS8/5Wy4aJR83TTmgU6zxWwJSXw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SQE8oA8lQRwEus253i9PgXAYxS+1hfEWgxQkG8dNMuK5+C2MzFWHC2gCVa/sCTaIh mINB5DgFECw+pGenAIWbq/ant+MDQxcFaxJeNamZqmWfH2SE50ljnoCt5WDkZMFN/y zSsFGUWBnPo7WzVzFj57OnJKTLZv8v06II8J4E2+FMu/J0lzw0cg8/Um5wKRhTuiBz M1a9kePx9hC6/XnF66pTT3tDmfydVWOZ+PUuN61Pd1nQtUDi8l6wozX8HGFWMhSLig QS2F5MDwxfui88OZl1d4xhMuIeMffwSLM7NnRPkICdlmFaTyYVH5nOaWhDuFI01iqL PEjExdKRm1jxQ== Content-Disposition: inline In-Reply-To: List-ID: Content-Type: text/plain; charset="windows-1252" To: Vishal Moola Cc: Andrew Morton , Matthew Wilcox , 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 On Thu, May 25, 2023 at 11:04:28AM -0700, Vishal Moola wrote: > On Thu, May 25, 2023 at 2:10=E2=80=AFAM Mike Rapoport w= rote: > > > + > > > +static inline struct ptdesc *ptdesc_alloc(gfp_t gfp, unsigned int or= der) > > > +{ > > > + struct page *page =3D alloc_pages(gfp | __GFP_COMP, order); > > > + > > > + return page_ptdesc(page); > > > +} > > > + > > > +static inline void ptdesc_free(struct ptdesc *pt) > > > +{ > > > + struct page *page =3D ptdesc_page(pt); > > > + > > > + __free_pages(page, compound_order(page)); > > > +} > > > > The ptdesc_{alloc,free} API does not sound right to me. The name > > ptdesc_alloc() implies the allocation of the ptdesc itself, rather than > > allocation of page table page. The same goes for free. >=20 > I'm not sure I see the difference. Could you elaborate? I read ptdesc_alloc() as "allocate a ptdesc" rather than as "allocate a page for page table and return ptdesc pointing to that page". Seems very confusing to me already and it will be even more confusion when we'll start allocating actual ptdescs. =20 --=20 Sincerely yours, Mike. From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 32833C77B7E for ; Thu, 25 May 2023 20:26:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JEy5GDRZkWl0lWdPjRD8riTFkRHIf8fRr2zePyf4L2Y=; b=U2MREqT/ANe+iK WLk5ynEoTFb3MTs+kDC5S+uGCU6T8xjiEzPselWWhjY2w9gtA9R6t1C6CL2T1Bzaa+hPqmeH5qT+V P5+tanx9zhgD45Usz9Gje/v0ooJgNUHfW09XlKfzQzlq7fpa7whenq4Z3Qx+afIO/1qpPp2IM/8ir zLMCbjBAwxRRVfy3DVpykmg34sLiYiG64yNPMv2Le9UPknPsRr0NPADBU1woK956RlwjmxPB2F5TF ywMlMhJ9hh8lvTHOdzDVNbqlmYi4PiF/2y/73gcm80RgwANcDxMpBkypLPxmG2134jV9VHXKrVP9B Bx6RdLeOp7HAgzMvKZQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q2HXF-0005Jl-2M; Thu, 25 May 2023 20:26:09 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q2HX9-0005Hw-1m; Thu, 25 May 2023 20:26:07 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EBF4A600BE; Thu, 25 May 2023 20:26:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 185ECC433D2; Thu, 25 May 2023 20:25:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685046362; bh=q0CSXKuNpY/cOn/THS8/5Wy4aJR83TTmgU6zxWwJSXw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SQE8oA8lQRwEus253i9PgXAYxS+1hfEWgxQkG8dNMuK5+C2MzFWHC2gCVa/sCTaIh mINB5DgFECw+pGenAIWbq/ant+MDQxcFaxJeNamZqmWfH2SE50ljnoCt5WDkZMFN/y zSsFGUWBnPo7WzVzFj57OnJKTLZv8v06II8J4E2+FMu/J0lzw0cg8/Um5wKRhTuiBz M1a9kePx9hC6/XnF66pTT3tDmfydVWOZ+PUuN61Pd1nQtUDi8l6wozX8HGFWMhSLig QS2F5MDwxfui88OZl1d4xhMuIeMffwSLM7NnRPkICdlmFaTyYVH5nOaWhDuFI01iqL PEjExdKRm1jxQ== Date: Thu, 25 May 2023 23:25:37 +0300 From: Mike Rapoport To: Vishal Moola Cc: Andrew Morton , Matthew Wilcox , 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 Subject: Re: [PATCH v2 05/34] mm: add utility functions for ptdesc Message-ID: <20230525202537.GA4967@kernel.org> References: <20230501192829.17086-1-vishal.moola@gmail.com> <20230501192829.17086-6-vishal.moola@gmail.com> <20230525090956.GX4967@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230525_132603_635156_F1426FE1 X-CRM114-Status: GOOD ( 15.18 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer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SBwYWdlLiBUaGUg c2FtZSBnb2VzIGZvciBmcmVlLgo+IAo+IEknbSBub3Qgc3VyZSBJIHNlZSB0aGUgZGlmZmVyZW5j ZS4gQ291bGQgeW91IGVsYWJvcmF0ZT8KCkkgcmVhZCBwdGRlc2NfYWxsb2MoKSBhcyAiYWxsb2Nh dGUgYSBwdGRlc2MiIHJhdGhlciB0aGFuIGFzICJhbGxvY2F0ZSBhCnBhZ2UgZm9yIHBhZ2UgdGFi bGUgYW5kIHJldHVybiBwdGRlc2MgcG9pbnRpbmcgdG8gdGhhdCBwYWdlIi4gU2VlbXMgdmVyeQpj b25mdXNpbmcgdG8gbWUgYWxyZWFkeSBhbmQgaXQgd2lsbCBiZSBldmVuIG1vcmUgY29uZnVzaW9u IHdoZW4gd2UnbGwgc3RhcnQKYWxsb2NhdGluZyBhY3R1YWwgcHRkZXNjcy4KIAotLSAKU2luY2Vy ZWx5IHlvdXJzLApNaWtlLgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX18KbGludXgtcmlzY3YgbWFpbGluZyBsaXN0CmxpbnV4LXJpc2N2QGxpc3RzLmluZnJh ZGVhZC5vcmcKaHR0cDovL2xpc3RzLmluZnJhZGVhZC5vcmcvbWFpbG1hbi9saXN0aW5mby9saW51 eC1yaXNjdgo= From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D3B0BC77B7E for ; Thu, 25 May 2023 20:26:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WHBa4tfnPxHKKR+8CVFtTt19gHRHXgixvEelsga3FNo=; b=o2D0CYtN/6GInu STUddycP3gvcUtlTeYfTii+zNTQZjmM1yw7AdOBIEVrk37xj214L1ksgexOnrzM+kbI9Ae7kPhQCB jrQdnY42OFuAvdBiS00cxtL5ytcmbHtzXIRYq0wYaL0N0xqVsdnQR2uTGghGDg5vESNPP1ZTwWXzR IUJ4zwcPEBwPDqOm1uN3WUFRMOIJg/OJL5MPbu9p7Kjd3X3a9neamJPCzDCUNqQvvPxHdZvtFhwuO uPU/Q6raUruwACFNGZ7r6keTQoQCJkGGEAI9OKhdhD55ceWsXvlBqTFgKdDYoRWssBsYsoijCp4ID Ly/vONNQ4mj6CaZ83KTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q2HXG-0005KA-0o; Thu, 25 May 2023 20:26:10 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q2HX9-0005Hw-1m; Thu, 25 May 2023 20:26:07 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EBF4A600BE; Thu, 25 May 2023 20:26:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 185ECC433D2; Thu, 25 May 2023 20:25:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685046362; bh=q0CSXKuNpY/cOn/THS8/5Wy4aJR83TTmgU6zxWwJSXw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SQE8oA8lQRwEus253i9PgXAYxS+1hfEWgxQkG8dNMuK5+C2MzFWHC2gCVa/sCTaIh mINB5DgFECw+pGenAIWbq/ant+MDQxcFaxJeNamZqmWfH2SE50ljnoCt5WDkZMFN/y zSsFGUWBnPo7WzVzFj57OnJKTLZv8v06II8J4E2+FMu/J0lzw0cg8/Um5wKRhTuiBz M1a9kePx9hC6/XnF66pTT3tDmfydVWOZ+PUuN61Pd1nQtUDi8l6wozX8HGFWMhSLig QS2F5MDwxfui88OZl1d4xhMuIeMffwSLM7NnRPkICdlmFaTyYVH5nOaWhDuFI01iqL PEjExdKRm1jxQ== Date: Thu, 25 May 2023 23:25:37 +0300 From: Mike Rapoport To: Vishal Moola Cc: Andrew Morton , Matthew Wilcox , 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 Subject: Re: [PATCH v2 05/34] mm: add utility functions for ptdesc Message-ID: <20230525202537.GA4967@kernel.org> References: <20230501192829.17086-1-vishal.moola@gmail.com> <20230501192829.17086-6-vishal.moola@gmail.com> <20230525090956.GX4967@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230525_132603_635156_F1426FE1 X-CRM114-Status: GOOD ( 15.18 ) X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-um" Errors-To: linux-um-bounces+linux-um=archiver.kernel.org@lists.infradead.org T24gVGh1LCBNYXkgMjUsIDIwMjMgYXQgMTE6MDQ6MjhBTSAtMDcwMCwgVmlzaGFsIE1vb2xhIHdy b3RlOgo+IE9uIFRodSwgTWF5IDI1LCAyMDIzIGF0IDI6MTDigK9BTSBNaWtlIFJhcG9wb3J0IDxy cHB0QGtlcm5lbC5vcmc+IHdyb3RlOgo+ID4gPiArCj4gPiA+ICtzdGF0aWMgaW5saW5lIHN0cnVj dCBwdGRlc2MgKnB0ZGVzY19hbGxvYyhnZnBfdCBnZnAsIHVuc2lnbmVkIGludCBvcmRlcikKPiA+ ID4gK3sKPiA+ID4gKyAgICAgc3RydWN0IHBhZ2UgKnBhZ2UgPSBhbGxvY19wYWdlcyhnZnAgfCBf X0dGUF9DT01QLCBvcmRlcik7Cj4gPiA+ICsKPiA+ID4gKyAgICAgcmV0dXJuIHBhZ2VfcHRkZXNj KHBhZ2UpOwo+ID4gPiArfQo+ID4gPiArCj4gPiA+ICtzdGF0aWMgaW5saW5lIHZvaWQgcHRkZXNj X2ZyZWUoc3RydWN0IHB0ZGVzYyAqcHQpCj4gPiA+ICt7Cj4gPiA+ICsgICAgIHN0cnVjdCBwYWdl ICpwYWdlID0gcHRkZXNjX3BhZ2UocHQpOwo+ID4gPiArCj4gPiA+ICsgICAgIF9fZnJlZV9wYWdl cyhwYWdlLCBjb21wb3VuZF9vcmRlcihwYWdlKSk7Cj4gPiA+ICt9Cj4gPgo+ID4gVGhlIHB0ZGVz Y197YWxsb2MsZnJlZX0gQVBJIGRvZXMgbm90IHNvdW5kIHJpZ2h0IHRvIG1lLiBUaGUgbmFtZQo+ ID4gcHRkZXNjX2FsbG9jKCkgaW1wbGllcyB0aGUgYWxsb2NhdGlvbiBvZiB0aGUgcHRkZXNjIGl0 c2VsZiwgcmF0aGVyIHRoYW4KPiA+IGFsbG9jYXRpb24gb2YgcGFnZSB0YWJsZSBwYWdlLiBUaGUg c2FtZSBnb2VzIGZvciBmcmVlLgo+IAo+IEknbSBub3Qgc3VyZSBJIHNlZSB0aGUgZGlmZmVyZW5j ZS4gQ291bGQgeW91IGVsYWJvcmF0ZT8KCkkgcmVhZCBwdGRlc2NfYWxsb2MoKSBhcyAiYWxsb2Nh dGUgYSBwdGRlc2MiIHJhdGhlciB0aGFuIGFzICJhbGxvY2F0ZSBhCnBhZ2UgZm9yIHBhZ2UgdGFi bGUgYW5kIHJldHVybiBwdGRlc2MgcG9pbnRpbmcgdG8gdGhhdCBwYWdlIi4gU2VlbXMgdmVyeQpj b25mdXNpbmcgdG8gbWUgYWxyZWFkeSBhbmQgaXQgd2lsbCBiZSBldmVuIG1vcmUgY29uZnVzaW9u IHdoZW4gd2UnbGwgc3RhcnQKYWxsb2NhdGluZyBhY3R1YWwgcHRkZXNjcy4KIAotLSAKU2luY2Vy ZWx5IHlvdXJzLApNaWtlLgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX18KbGludXgtdW0gbWFpbGluZyBsaXN0CmxpbnV4LXVtQGxpc3RzLmluZnJhZGVhZC5v cmcKaHR0cDovL2xpc3RzLmluZnJhZGVhZC5vcmcvbWFpbG1hbi9saXN0aW5mby9saW51eC11bQo= From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AB1A2C77B7A for ; Thu, 25 May 2023 20:26:56 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4QS02l2Rb7z3fF3 for ; Fri, 26 May 2023 06:26:55 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=SQE8oA8l; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2604:1380:4641:c500::1; helo=dfw.source.kernel.org; envelope-from=rppt@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=SQE8oA8l; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4QS01p0KxXz3f7D for ; Fri, 26 May 2023 06:26:05 +1000 (AEST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EBF4A600BE; Thu, 25 May 2023 20:26:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 185ECC433D2; Thu, 25 May 2023 20:25:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685046362; bh=q0CSXKuNpY/cOn/THS8/5Wy4aJR83TTmgU6zxWwJSXw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SQE8oA8lQRwEus253i9PgXAYxS+1hfEWgxQkG8dNMuK5+C2MzFWHC2gCVa/sCTaIh mINB5DgFECw+pGenAIWbq/ant+MDQxcFaxJeNamZqmWfH2SE50ljnoCt5WDkZMFN/y zSsFGUWBnPo7WzVzFj57OnJKTLZv8v06II8J4E2+FMu/J0lzw0cg8/Um5wKRhTuiBz M1a9kePx9hC6/XnF66pTT3tDmfydVWOZ+PUuN61Pd1nQtUDi8l6wozX8HGFWMhSLig QS2F5MDwxfui88OZl1d4xhMuIeMffwSLM7NnRPkICdlmFaTyYVH5nOaWhDuFI01iqL PEjExdKRm1jxQ== Date: Thu, 25 May 2023 23:25:37 +0300 From: Mike Rapoport To: Vishal Moola Subject: Re: [PATCH v2 05/34] mm: add utility functions for ptdesc Message-ID: <20230525202537.GA4967@kernel.org> References: <20230501192829.17086-1-vishal.moola@gmail.com> <20230501192829.17086-6-vishal.moola@gmail.com> <20230525090956.GX4967@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, kvm@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-sh@vger.kernel.org, linux-um@lists.infradead.org, linux-mips@vger.kernel.org, linux-csky@vger.kernel.org, linux-mm@kvack.org, linux-m68k@lists.linux-m68k.org, Matthew Wilcox , loongarch@lists.linux.dev, sparclinux@vger.kernel.org, xen-devel@lists.xenproject.org, Andrew Morton , linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Thu, May 25, 2023 at 11:04:28AM -0700, Vishal Moola wrote: > On Thu, May 25, 2023 at 2:10 AM Mike Rapoport wrote: > > > + > > > +static inline struct ptdesc *ptdesc_alloc(gfp_t gfp, unsigned int order) > > > +{ > > > + struct page *page = alloc_pages(gfp | __GFP_COMP, order); > > > + > > > + return page_ptdesc(page); > > > +} > > > + > > > +static inline void ptdesc_free(struct ptdesc *pt) > > > +{ > > > + struct page *page = ptdesc_page(pt); > > > + > > > + __free_pages(page, compound_order(page)); > > > +} > > > > The ptdesc_{alloc,free} API does not sound right to me. The name > > ptdesc_alloc() implies the allocation of the ptdesc itself, rather than > > allocation of page table page. The same goes for free. > > I'm not sure I see the difference. Could you elaborate? I read ptdesc_alloc() as "allocate a ptdesc" rather than as "allocate a page for page table and return ptdesc pointing to that page". Seems very confusing to me already and it will be even more confusion when we'll start allocating actual ptdescs. -- Sincerely yours, Mike. From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A47B0C77B7E for ; Thu, 25 May 2023 20:26:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mbvx8guk4GR0weHEpJXgGoww2ke/XiaXhBjP1YeHN7A=; b=tMZdbZWAeij8UL yIoBPOAUebWUR3VwD9xN1b2Ni/Itv/qhopoLU7QawA6ezHRHfiGgRpdcAdoY8MgvpyKiTUiSG2l3a 7BtEcjbbtbj8iqf1UNKujagJv0RbRFr8la5Mhusl5T8unQrcJE0DRXEiPg4bguKyxdSuY1W271LqA rN7nvElELZhJ2urdqTEQG6dQCOpgsuxct1RkD9HqpRRgkbcZbCpqDzMwYsnTRpsRyv02zCNYUZsZd NcLRWNg3c9QnHuAl63lckg2vAPkQNvBFx68epw9x2C35emUnkxaLoAcrAwVRm8WMd1pMiFLTQQ9gV eofcgo/YuB/ijqkyXfXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q2HXF-0005Jg-0t; Thu, 25 May 2023 20:26:09 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q2HX9-0005Hw-1m; Thu, 25 May 2023 20:26:07 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EBF4A600BE; Thu, 25 May 2023 20:26:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 185ECC433D2; Thu, 25 May 2023 20:25:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685046362; bh=q0CSXKuNpY/cOn/THS8/5Wy4aJR83TTmgU6zxWwJSXw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SQE8oA8lQRwEus253i9PgXAYxS+1hfEWgxQkG8dNMuK5+C2MzFWHC2gCVa/sCTaIh mINB5DgFECw+pGenAIWbq/ant+MDQxcFaxJeNamZqmWfH2SE50ljnoCt5WDkZMFN/y zSsFGUWBnPo7WzVzFj57OnJKTLZv8v06II8J4E2+FMu/J0lzw0cg8/Um5wKRhTuiBz M1a9kePx9hC6/XnF66pTT3tDmfydVWOZ+PUuN61Pd1nQtUDi8l6wozX8HGFWMhSLig QS2F5MDwxfui88OZl1d4xhMuIeMffwSLM7NnRPkICdlmFaTyYVH5nOaWhDuFI01iqL PEjExdKRm1jxQ== Date: Thu, 25 May 2023 23:25:37 +0300 From: Mike Rapoport To: Vishal Moola Cc: Andrew Morton , Matthew Wilcox , 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 Subject: Re: [PATCH v2 05/34] mm: add utility functions for ptdesc Message-ID: <20230525202537.GA4967@kernel.org> References: <20230501192829.17086-1-vishal.moola@gmail.com> <20230501192829.17086-6-vishal.moola@gmail.com> <20230525090956.GX4967@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230525_132603_635156_F1426FE1 X-CRM114-Status: GOOD ( 15.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org T24gVGh1LCBNYXkgMjUsIDIwMjMgYXQgMTE6MDQ6MjhBTSAtMDcwMCwgVmlzaGFsIE1vb2xhIHdy b3RlOgo+IE9uIFRodSwgTWF5IDI1LCAyMDIzIGF0IDI6MTDigK9BTSBNaWtlIFJhcG9wb3J0IDxy cHB0QGtlcm5lbC5vcmc+IHdyb3RlOgo+ID4gPiArCj4gPiA+ICtzdGF0aWMgaW5saW5lIHN0cnVj dCBwdG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