Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35992469rwd; Mon, 10 Jul 2023 16:12:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlHYhoEDQGzSXSc427+hJ0EyKrVLqD63qMaiZLH1JrpSBJTIQIBBCVHovRocHDJ8c6gkPFCI X-Received: by 2002:a05:6358:2813:b0:132:d42f:8e19 with SMTP id k19-20020a056358281300b00132d42f8e19mr9656026rwb.31.1689030778261; Mon, 10 Jul 2023 16:12:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689030778; cv=none; d=google.com; s=arc-20160816; b=BiNqO16PRstDPb55ZbgQRAPkHi5X1C8/ThbCV5lxHBOCCc4jztUadjkASM88gU0hHp nYjByVIarRCV+4m26AWyggn/OIkzoOHoh6u24Wo8TSo/o3NKRf690GrB09zgSw30b2l2 6lrogjmVdFFqs+DYWqqBEeQ9w0qJLqFHq6b2PpYF55gGnAqnwKle8+aYAcZy+MYTXvps OrcHMZmnGEv5OZCOT2O0nI1wMzFEQXAdZfcyw0E1fIgVISOx5zYH5H205DFStptqixl7 4w1fnsKhUM9C7MMnrCNhF0BfEfUYtV3ZqmZK8CrobZg4a1kFzs17t+XJpKJURY8FMsNt gwDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=kYDiR4A6sQZndl0XT9fcGxrXdj+op4ndy7BoHFL4s70=; fh=NQWmIRLAToqSkcLcBYfbMoCZD2dRat6lqWrf1B2L1/g=; b=E4GNnxgF9SMQiU0L/CJbQttvDo8OjK9UDry405B1GdJBFQMeZS6Lf/hBECsZoUNNnZ hOeo1Xe3qluATTYKb5bL23AXiaePkbYPlHtgYzuav1VB26JMOT9R9PvIlsWKqWIbHq9j a5Uj8zvu+beAPKyzHhJVZkutkYtLN4Fzn7a4PPvxOLKzFPQptWWrEJg1glxccNaMY7N0 aDUSXpiTfLAVlSb6Nw/2ZTBI5i4I41bxyprfFkDlKeWZBbc9sKQ6IS9EYH0WnHYp4GB+ nZ3K25S1U5xQfT4/kdZiZGkoyT4gBN/cfCNnaqD8gJ+CNyTJs3VQpPBlgzhEsn/PVA0s vYNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=FVxq5TQO; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k24-20020a634b58000000b00542ad648fbasi336676pgl.188.2023.07.10.16.12.44; Mon, 10 Jul 2023 16:12:58 -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=@google.com header.s=20221208 header.b=FVxq5TQO; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230253AbjGJXDO (ORCPT + 60 others); Mon, 10 Jul 2023 19:03:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229532AbjGJXDN (ORCPT ); Mon, 10 Jul 2023 19:03:13 -0400 Received: from mail-ua1-x935.google.com (mail-ua1-x935.google.com [IPv6:2607:f8b0:4864:20::935]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBEA310D for ; Mon, 10 Jul 2023 16:03:11 -0700 (PDT) Received: by mail-ua1-x935.google.com with SMTP id a1e0cc1a2514c-79470b88d88so1601266241.0 for ; Mon, 10 Jul 2023 16:03:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689030191; x=1691622191; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=kYDiR4A6sQZndl0XT9fcGxrXdj+op4ndy7BoHFL4s70=; b=FVxq5TQOlzhUeYgxXSn6ArdwnVF2hbExv8ZbNJDmV9BNzKz3GBQj6+AD6uZMvrgdjA xH2s5MBcoPw8P9HZMTzQhVMKFl7KLPJ/0aYueLJBRDrbwr7gSzHyFM2YiWW1icDJju+E vvdGR1RgvoEhOEE7I/nKR+NRqYhT3L43ky2dAfF+c8Z90UTc/eqloAdFhr/7E+KCVHK9 hmmNiC+ql5Bd32aUQnuNmcp+0Qy7zkHQvVJSNgsTENiN4USow1G7e7mPbk+cREQGS465 1Oh+BTqTZLre92S8DtOsIdsUe/09sJwqAJZZGaMzR0YFR5OxuiKhWVVSnovORxiSqyLX xwyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689030191; x=1691622191; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kYDiR4A6sQZndl0XT9fcGxrXdj+op4ndy7BoHFL4s70=; b=JufpsZN9KX1qmIocujSsi6pKzdCZKXWswjppokV1pAVS+mhPSPqok0zBlQB8glvWUF fSe9nJEEDsp72m2d6DhPFrbCsNgCch8vNOyb865b0WkYudrSdgOyamgmd41+b79Z0EE8 o8Pd5owFakSekFwq3YhsEecCUQAm+T1JHZI4EBSEsCQgVPN6XYPjvLeO/ThGg4nPbImq 1clz8eL9L3tphzm9bb80E5/2VZgKVFJJZj92w7+Mngu0+le2wy73aS72bKINTzjgmmNA bDmIwaHEQ9CauggHthukD5P4Du2US3BKlubco5CAnK0Kd24FgcjKdIawDJWfHDixn+X0 tITA== X-Gm-Message-State: ABy/qLaRDglsKgmUef1KZKd1OCN6sBHh65lkh5CuYmSk7EfqvehgNfyk 1we0k9pP96zIvU3PkBi3rB6VgsHcMZqZm0eZcIx6YA== X-Received: by 2002:a67:ff91:0:b0:443:8eab:c664 with SMTP id v17-20020a67ff91000000b004438eabc664mr5887615vsq.13.1689030190853; Mon, 10 Jul 2023 16:03:10 -0700 (PDT) MIME-Version: 1.0 References: <72ccf224-7b45-76c5-5ca9-83e25112c9c6@redhat.com> <20230616122140.6e889357@kernel.org> <20230619110705.106ec599@kernel.org> <5e0ac5bb-2cfa-3b58-9503-1e161f3c9bd5@kernel.org> In-Reply-To: From: Mina Almasry Date: Mon, 10 Jul 2023 16:02:59 -0700 Message-ID: Subject: Re: Memory providers multiplexing (Was: [PATCH net-next v4 4/5] page_pool: remove PP_FLAG_PAGE_FRAG flag) To: Jason Gunthorpe Cc: David Ahern , Jakub Kicinski , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 Mon, Jul 10, 2023 at 10:44=E2=80=AFAM Jason Gunthorpe wro= te: > > On Wed, Jul 05, 2023 at 06:17:39PM -0700, Mina Almasry wrote: > > > Another issue is that in networks with low MTU, we could be DMAing > > 1400/1500 bytes into each allocation, which is problematic if the > > allocation is 8K+. I would need to investigate a bit to see if/how to > > solve that, and we may end up having to split the page and again run > > into the 'not enough room in struct page' problem. > > You don't have an intree driver to use this with, so who knows, but > the out of tree GPU drivers tend to use a 64k memory management page > size, and I don't expect you'd make progress with a design where a 64K > naturaly sized allocator is producing 4k/8k non-compound pages just > for netdev. We are still struggling with pagemap support for variable > page size folios, so there is a bunch of technical blockers before > drivers could do this. > > This is why it is so important to come with a complete in-tree > solution, as we cannot review this design if your work is done with > hacked up out of tree drivers. > I think you're assuming the proposal requires dma-buf exporter driver changes, and I have a 'hacked up out of tree driver' not visible to you. Both are not quite right. The proposal requires no changes to the dma-buf exporter, and works with udmabuf _as is_, proving that. Please do review the proposal: https://lore.kernel.org/netdev/20230710223304.1174642-1-almasrymina@google.= com/ If you still don't like the approach, we can try something else. > Fully and properly adding P2P ZONE_DEVICE to a real world driver is a > pretty big ask still. > There is no such ask. > > > Or allocate per page memory and do a memdesc like thing.. > > > > I need to review memdesc more closely. Do you imagine I add a pointer > > in struct page that points to the memdesc? > > Pointer to extra memory from the PFN has been the usual meaning of > memdesc, so doing an interm where the pointer is in the struct page is > a reasonable starting point. > > > > Though overall, you won't find devices creating struct pages for thei= r > > > P2P memory today, so I'm not sure what the purpose is. Jonathan > > > already got highly slammed for proposing code to the kernel that was > > > unusable. Please don't repeat that. Other than a special NVMe use cas= e > > > the interface for P2P is DMABUF right now and it is not struct page > > > backed. > > > > > > > Our approach is actually to extend DMABUF to provide struct page > > backed attachment mappings, which as far as I understand sidesteps the > > issues Jonathan ran into. > > No DMABUF exporters do this today, so your patch series is just as > incomplete as the prior ones. Please don't post it as non-RFC, > unusable code like this must not be merged. > > > that supports dmabuf and in fact a lot of my tests use udmabuf to > > minimize the dependencies. The RFC may come with a udmabuf selftest to > > showcase that any dmabuf, even a mocked one, would be supported. > > That is not good enough to get merged. You need to get agreement and > coded merged from actual driver owners of dmabuf exporters that they > want to support this direction. As above it has surprising road > blocks outside netdev :\ > The current proposal requires no changes to the dma-buf exporters: https://lore.kernel.org/netdev/20230710223304.1174642-1-almasrymina@google.= com/ On dma-buf changes required. I do need approval from the dma-buf maintainers, but AFAICT, no approval from the dma-buf exporters (all I need is already supported). If we need to change direction to a proposal that needs additional support from the driver owners, yes, we'd need their approval, but this is not the case at the moment. --=20 Thanks, Mina