Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30744268rwd; Thu, 6 Jul 2023 10:04:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlGV5PVHIBZzxf8bdrwapHdUatYK/Lkit3OvtU05s1X5H8MRi1i6E8Txit6wZKn5IXzXR/W3 X-Received: by 2002:aca:f18:0:b0:3a3:e0ad:e33b with SMTP id 24-20020aca0f18000000b003a3e0ade33bmr1856178oip.18.1688663053523; Thu, 06 Jul 2023 10:04:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688663053; cv=none; d=google.com; s=arc-20160816; b=zvDqKYBNZUp5HSFGnLel3KDi40zN4rtj4E8xbYOfYSy6Ei1gTi2tIFOKZ61f8Ph7Ne fLzBan1irorcHlZiiqN84VQgOFpIPo8TSSRdfMWAHZ8nVifFIUSyB9Cd6nfh0nrIBfEK Fphq2XuODYuSlL9ICPgkjHG5s6kB9XJ3g88gl5B2fn1LAFXnzdLsJQon6htTMjjmUfK0 CJM6hIiU5oT8V3Ld8O7XzpHUd9oaiypiazx85dsu8cpWgzbjDjTFX6HQmgvSMssdFych 7FOEw/R7Unq2/hvkjeZzIv5233KF5LTNOrCUkISiuRXjAhAXsTb5hhZ86cpyCgQegY/C lKJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=ZJdfIK450krxSkuYf8Kc0MuuphW744ucwU6pzDk63A0=; fh=XQQGmVDn55f4s6GYYaT+H3UGFQw/iI91nLHAL0hngfU=; b=iOV9LirrGCOwv4fjkwM3xRNF+WOrcamNg8x/1QWM5umO/yYChiZLpkl141OGX7WhfS vyzFe7k4TZ+kTAP7ERmrpy62nv61h6zDBBqSGhn++ruA9ubgFgsPnGdjbhDfwGZeZHDV VjEZEjPYWEYCenXkA4Y+vYKW16w9MwRS+RqezRCor6TpVM0VYGyfo9ltMjXcMm8NUOX5 HjmrKb1nkq4nnNw4eES6+/hj1Az6aPJKRMnF3z6rudmMP9A4Qonjast1rfsvRLLZYZeu 2LUwIB5doSo4bPG4qH2D7JFOs6MYfLya3pAh3L6jYMBt01179p7ikAbnnBEuFzCrbFPJ 6NVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ir2qoTru; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b17-20020a631b51000000b0055baed6d244si971395pgm.193.2023.07.06.10.03.56; Thu, 06 Jul 2023 10:04:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ir2qoTru; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231565AbjGFQuf (ORCPT + 59 others); Thu, 6 Jul 2023 12:50:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231576AbjGFQue (ORCPT ); Thu, 6 Jul 2023 12:50:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 463A91BE9; Thu, 6 Jul 2023 09:50:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9237560F7F; Thu, 6 Jul 2023 16:50:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1BD1C433C8; Thu, 6 Jul 2023 16:50:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688662230; bh=JMMqVQ1L/TaeP106mVLOHP/qWvAPkrzYjnG3d18DeQI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ir2qoTruxn8EC28k39ppqWj7eeCov8opvLIoQZDd9BhZVvkq75++NiA9T82jyZMlh 6U1NrBurZzJhfQjPAN2sTXnXGC4DfyJzAcO0hs6Kz36cWRbuYi8qSUGcEz2wVc1/Wh pGMtk8MYumaTLJ8dFBEdjMMWmAfXNvu9r61AKfepXcOKlskr+CjiUhqnkU66slIy2A e1Kpy0y130Rov3/L/vDz+JPUAacRFI7+70NBn2tN/y+bvukoOufS+HrZ1PSFqgqE25 PuYlNZIFJ2WmeMrJnak39p7WkaAWuDU++qQoJO51pr3abUjH+93nsp3+ELFvhVYgqt 9piME/8krW9sg== Date: Thu, 6 Jul 2023 09:50:28 -0700 From: Jakub Kicinski To: Mina Almasry Cc: Jesper Dangaard Brouer , brouer@redhat.com, Alexander Duyck , Yunsheng Lin , davem@davemloft.net, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Lorenzo Bianconi , Yisen Zhuang , Salil Mehta , Eric Dumazet , Sunil Goutham , Geetha sowjanya , Subbaraya Sundeep , hariprasad , Saeed Mahameed , Leon Romanovsky , Felix Fietkau , Ryder Lee , Shayne Chen , Sean Wang , Kalle Valo , Matthias Brugger , AngeloGioacchino Del Regno , Jesper Dangaard Brouer , Ilias Apalodimas , linux-rdma@vger.kernel.org, linux-wireless@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Jonathan Lemon Subject: Re: Memory providers multiplexing (Was: [PATCH net-next v4 4/5] page_pool: remove PP_FLAG_PAGE_FRAG flag) Message-ID: <20230706095028.19c4c637@kernel.org> In-Reply-To: References: <20230612130256.4572-1-linyunsheng@huawei.com> <20230612130256.4572-5-linyunsheng@huawei.com> <20230614101954.30112d6e@kernel.org> <8c544cd9-00a3-2f17-bd04-13ca99136750@huawei.com> <20230615095100.35c5eb10@kernel.org> <908b8b17-f942-f909-61e6-276df52a5ad5@huawei.com> <72ccf224-7b45-76c5-5ca9-83e25112c9c6@redhat.com> <20230616122140.6e889357@kernel.org> <20230619110705.106ec599@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Thu, 29 Jun 2023 19:27:46 -0700 Mina Almasry wrote: > I've discussed your page pool frontend idea with our gve owners and > the idea is attractive. In particular it would be good not to insert > much custom code into the driver to support device memory pages or > other page types. I plan on trying to change my approach to match the > page pool provider you have in progress here: > https://github.com/kuba-moo/linux/tree/pp-providers > > In particular the main challenge right now seems to be that my device > memory pages are ZONE_DEVICE pages, which can't be inserted to the > page pool as-is due to the union in struct page between the page pool > entries and the ZONE_DEVICE entries. I have some ideas on how to work > around that I'm looking into. Right, have you talked to Willem? I mentioned to him that I initially pursued the idea of using the page pool as an abstraction but I realized that fitting both the dma addr and the frag reference count into struct page which isn't just a basic page will be a challenge. So the second best thing seems to be to create an API which matches the page pool API, and have it select between a page pool and another provider based on user configuration. As you said the main goal is to be able to feed kernel / user / device memory to the driver without having to modify driver code. I thought this would live "above" the page pool (perhaps that's what you mean by gen_pool) but Jesper brought up integrating it into the (middle of?) page pool and have page pool switch on the pp_magic. No strong preference on which on is better, seems like something that can only be ironed out by modifying a couple of drivers to find out what fits best :( I'm hoping to jump back into the pp_provider work and finish that up over the next few days, to at least post a PoC. Even if it doesn't work for user / device memory - being able to feed the page pool from huge pages is already a big win for the IOTLB.