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 E59C2C77B73 for ; Tue, 6 Jun 2023 08:26:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236529AbjFFI0O (ORCPT ); Tue, 6 Jun 2023 04:26:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230220AbjFFI0M (ORCPT ); Tue, 6 Jun 2023 04:26:12 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CD191B5 for ; Tue, 6 Jun 2023 01:25:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686039926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tl5oPK3uVnMf7j5Be8wyxIVYpd+Z0ksF6FBEMTvD5A0=; b=cmZ37iipo3QPRZpgPkM2BZ0gsw50T+5PvGJKlbOUl67yR8qDh3dpKLFdkSq4VCj/WxmkM+ rkvJavCinmsx6mKXNgxR0oFfrhmUfRCkTn+cklqKP/uYKXjCuJc4LocSGskkMdlIjezs0C OTuH21zmwH0Q2tN3x67oh9Ecx2Wf84Q= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-481-WVBBMtVdOw6x8tgl-6tseQ-1; Tue, 06 Jun 2023 04:25:22 -0400 X-MC-Unique: WVBBMtVdOw6x8tgl-6tseQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 52E34811E78; Tue, 6 Jun 2023 08:25:20 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id 38D27492B00; Tue, 6 Jun 2023 08:25:14 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 In-Reply-To: References: <20230524153311.3625329-1-dhowells@redhat.com> <20230524153311.3625329-5-dhowells@redhat.com> To: Alexander H Duyck Cc: Yunsheng Lin , David Howells , netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , David Ahern , Matthew Wilcox , Jens Axboe , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Jeroen de Borst , Catherine Sullivan , Shailend Chand , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , Lorenzo Bianconi , Matthias Brugger , AngeloGioacchino Del Regno , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , Andrew Morton , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-nvme@lists.infradead.org Subject: Re: [PATCH net-next 04/12] mm: Make the page_frag_cache allocator use multipage folios MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1841893.1686039890.1@warthog.procyon.org.uk> From: David Howells Date: Tue, 06 Jun 2023 09:25:13 +0100 Message-ID: <1841913.1686039913@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alexander H Duyck wrote: > Also I have some concerns about going from page to folio as it seems > like the folio_alloc setups the transparent hugepage destructor instead > of using the compound page destructor. I would think that would slow > down most users as it looks like there is a spinlock that is taken in > the hugepage destructor that isn't there in the compound page > destructor. Note that this code is going to have to move to folios[*] at some point. "Old-style" compound pages are going to go away, I believe. Matthew Wilcox and the mm folks are on a drive towards simplifying memory management, formalising chunks larger than a single page - with the ultimate aim of reducing the page struct to a single, typed pointer. So, take, for example, a folio: As I understand it, this will no longer overlay struct page, but rather will become a single, dynamically-allocated struct that covers a pow-of-2 number of pages. A contiguous subset of page structs will point at it. However, rather than using a folio, we could define a "page fragment" memory type. Rather than having all the flags and fields to be found in struct folio, it could have just the set to be found in page_frag_cache. David [*] It will be possible to have some other type than "folio". See "struct slab" in mm/slab.h for example. struct slab corresponds to a set of pages and, in the future, a number of struct pages will point at it. 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 E9B17C77B73 for ; Tue, 6 Jun 2023 08:25:53 +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:Message-ID:Date:From:Content-ID: MIME-Version:Subject:Cc:To:References:In-Reply-To:Reply-To: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Wm5XCO4SlrHk/oKr8wXdnh4JOOoX5yIoA7FmbDAI+74=; b=3oR8tdW5wLIRycntRC1BL0GxaI LSIPk3zRluj9m1R0YeTdN1LcSetGk4Zc4WOvS76AH25x3OZDxWIfDmG7VlUNilEsVavDQqeaekNRe 4wx6eqOu2d+V5TW10cVKSy6gxbpEn/r5p4Lhi0+F8UK5dmWT7w7ApBpRsXl17mm3tCUMU92qosruf jXjz3C3vcfSWfGjxRZ2oeEiAjLDX9n88cZsyO2Oh0w+6aNvM0POVxsh1/PaGaUmjKN0IGS4wBUhzs eHslHSVbfV90NP244K/11250Fexeh8Y+b9w/gxjhdL8ewo2coqR+OdPLwr2ofTKOawHe/wEuhiEpX c/sCyLaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6S0O-000nNd-2O; Tue, 06 Jun 2023 08:25:28 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6S0M-000nLo-0J for linux-arm-kernel@lists.infradead.org; Tue, 06 Jun 2023 08:25:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686039925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tl5oPK3uVnMf7j5Be8wyxIVYpd+Z0ksF6FBEMTvD5A0=; b=Z6b9ePiB8LoVkrIwz4MAjORliPjgF6kKuQobMSAjKk/VbSPwuSYI3mK+NRxkZWH5FkvG/y f0JbNo0In/fq4Q/Ftol1rHcRcU8njuLp6M9euTlnECMnrZy2AxkvG7RwaQmYI5si505WmQ Y3Kv82/9SGhBcq3lreESl+FfDL3wFCE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-481-WVBBMtVdOw6x8tgl-6tseQ-1; Tue, 06 Jun 2023 04:25:22 -0400 X-MC-Unique: WVBBMtVdOw6x8tgl-6tseQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 52E34811E78; Tue, 6 Jun 2023 08:25:20 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id 38D27492B00; Tue, 6 Jun 2023 08:25:14 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 In-Reply-To: References: <20230524153311.3625329-1-dhowells@redhat.com> <20230524153311.3625329-5-dhowells@redhat.com> To: Alexander H Duyck Cc: Yunsheng Lin , David Howells , netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , David Ahern , Matthew Wilcox , Jens Axboe , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Jeroen de Borst , Catherine Sullivan , Shailend Chand , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , Lorenzo Bianconi , Matthias Brugger , AngeloGioacchino Del Regno , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , Andrew Morton , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-nvme@lists.infradead.org Subject: Re: [PATCH net-next 04/12] mm: Make the page_frag_cache allocator use multipage folios MIME-Version: 1.0 Content-ID: <1841893.1686039890.1@warthog.procyon.org.uk> From: David Howells Date: Tue, 06 Jun 2023 09:25:13 +0100 Message-ID: <1841913.1686039913@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230606_012526_212033_09D2764F X-CRM114-Status: GOOD ( 26.55 ) 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="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Alexander H Duyck wrote: > Also I have some concerns about going from page to folio as it seems > like the folio_alloc setups the transparent hugepage destructor instead > of using the compound page destructor. I would think that would slow > down most users as it looks like there is a spinlock that is taken in > the hugepage destructor that isn't there in the compound page > destructor. Note that this code is going to have to move to folios[*] at some point. "Old-style" compound pages are going to go away, I believe. Matthew Wilcox and the mm folks are on a drive towards simplifying memory management, formalising chunks larger than a single page - with the ultimate aim of reducing the page struct to a single, typed pointer. So, take, for example, a folio: As I understand it, this will no longer overlay struct page, but rather will become a single, dynamically-allocated struct that covers a pow-of-2 number of pages. A contiguous subset of page structs will point at it. However, rather than using a folio, we could define a "page fragment" memory type. Rather than having all the flags and fields to be found in struct folio, it could have just the set to be found in page_frag_cache. David [*] It will be possible to have some other type than "folio". See "struct slab" in mm/slab.h for example. struct slab corresponds to a set of pages and, in the future, a number of struct pages will point at it. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel