Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1180699lqt; Fri, 7 Jun 2024 10:07:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWjPPHqQuYuvoNpKs6u+Wxd92g2j/83R2B5kIcUEPcX1DxZ6/unnNnnB/lVclFLbYu8UHEceI5PPqgu4OfIxvhw4O8QGB+a063Fy8pcCg== X-Google-Smtp-Source: AGHT+IHthCa4QlxLQ0qQBSY7cehbURGCsBRNzj9VL1n90dLfMJZ8xmATK6YMrnZ20ZmYL7CyJCBR X-Received: by 2002:a17:906:b0ce:b0:a68:d2dd:e006 with SMTP id a640c23a62f3a-a6cd6d17d61mr208234966b.17.1717780071725; Fri, 07 Jun 2024 10:07:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717780071; cv=pass; d=google.com; s=arc-20160816; b=M7MD6XmAAAGtkb45QX71f2awvayKXUg/89bes7eRU2Q4qkFB0ECU7vafGk0LvkbDr0 nJqFfuHaEeDNUKvdIhmVvvX60NmSWxvMgbOMPiqIIRo0B7M8NstZf1xq0w5WsY6hlFOL +lHNKUwfp9qP7kIXIwYg/IeYHJmaA+tmE2GNRbpDd4CkblGF+MxW9/uY8jdhcmekIcA6 O86GO78AlLdbHEH0rdNbwydb7nuN/aZ2TIWLyfWgrg3VDu6sobzLLZBkN8uEI9ZS2FsI ZpIRGDkRk0v+o0xJ2gOpb/PzPFc+ZhsUtUPkjIpUDbiyIpxWv+yzB4Blqw58HtFMfpOL q+nQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=b716fHLqA+q2jVEnF0wQCq5rwwcoiNDI2tYRdVxGBJ8=; fh=QylNo/YmzEMWKn3uPHjhCnxzZcmTUX2ABjtjXdsqGA0=; b=CpCCYmPI4oBWQwNt3YxQ0k5qJo9GPas9jac2L3im7FbsA9IFvZuRN2aiYzP/VAO06T TMSXrd2U+Db1Ys/xoY5/F/T5KpNgqb0ErU4dvZSy60H0VnYGye5Ck5YCAo4cTqhxYTVN f496EaXb0AgGNoJtNVCVYjYxPZWSLpJ0DjZXYoAM3vYh9LC5ZSpSa0SeGXHsiIoA7w1M vQODv7Secm50rM078t1bz/Y2paU12UONA6NR9M0dEt1shFIcj4P28zM7XQpYOBfFlRT7 myJj2FRZO5f2G4Muw2PVhPsDc8/suEG4K8WmygJrD9GQ82231InSMvqz6G9+FQshIleN MYhQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=G2AVTqpi; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-206519-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206519-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6ef440216fsi45750166b.942.2024.06.07.10.07.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 10:07:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206519-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=G2AVTqpi; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-206519-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206519-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A84D81F248D8 for ; Fri, 7 Jun 2024 16:59:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E18AE19ADAE; Fri, 7 Jun 2024 16:59:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="G2AVTqpi" Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2694619AD56 for ; Fri, 7 Jun 2024 16:59:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717779572; cv=none; b=aBoOKsVTzFlkv/55ApwwMh4yxSLK2gjce09PjVDWVoumtFd/uEbXfsJf8hzFAU7YaehHFaJVUilEGjbFjY/0TcE+EkoDobEiTfNCHP+WQUq6oSdp0AOk2rFhTq50hmQ4b0HUTrqUqbtyn6zEXYQs6W0OblJ9pTWkz4UjwNpaNqA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717779572; c=relaxed/simple; bh=b716fHLqA+q2jVEnF0wQCq5rwwcoiNDI2tYRdVxGBJ8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=hVokE2Is4C4mJvpJ+Dzxt7LR+YP53pEb33TIovoGqtWcRppIGsd0TzwKdTU2JQQHofA4HlLzfxqzWltF2ozI4RcCBdRKG+g/xyjehBpamAkQttZdANVveG3o7WJd1bMEunViK/s5rSpOgF/TV9Xbt1a3F2eSl2MlG0s95Pf6J04= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=G2AVTqpi; arc=none smtp.client-ip=209.85.208.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-57a1fe63947so3011989a12.1 for ; Fri, 07 Jun 2024 09:59:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717779569; x=1718384369; darn=vger.kernel.org; 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=b716fHLqA+q2jVEnF0wQCq5rwwcoiNDI2tYRdVxGBJ8=; b=G2AVTqpij2cJhN5HRQo3ptWXB/TQ9YDh9RGrpGeXVnp1CnL9i2DHQgrabHfRJ+vI4v 6rj8PhKQhbrqw08lFKhBQBeW3OEzxZgvZ0sM8DqYOCgzynh/TqX8zhUpecpLeveUgZe/ 4WO2raT386olPe7+CqYN3aB+/KVKBRO+MtAq0XGvPQZgecLr0Yv0La164s3HFQRW75Oj zZN4yPFMx3bgrVJwSDOEuMmEHfxotBiwl6JuetdpyYQLp0Ofu9L4f3YRHWKNySwxc9/Q JR8ZXjlMx3qbDJacaMfkf8ysfsu1jvPB+cyZ9tvZ8GL8kf1mEaJBMzprr6qo856Q0ny6 yaFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717779569; x=1718384369; 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=b716fHLqA+q2jVEnF0wQCq5rwwcoiNDI2tYRdVxGBJ8=; b=FAOV6RvhehQUFY3EsgFV7PyyS5FzN/UL7I8YXkvVkb1OybqadHSXa03NSlfgiZqBc2 sGTtNcHHEgGukAXdvFwOeTN9jvuje+QmR7eWhDhOJHpWss+zPfqR+tyGd2ExqH5rLK6I UfN38lEKgAs+Ak+34TlkkFi6Ygno6RkhKkCkztVMy3JDP+d7EGRthvQhKVelU5nM8ldr D8Zs8Sv5zWdzFosRO0t3gW5T24icDlLG++wdFi3UE1cHzloibNuQNnlXDmILz08kgOlf cexlkt8u8UnHrLNY7xt+jibhaywvLXHKICabbTuM8ZafdC9AexRhP/v5h1/Nw3+qNgsS vNJA== X-Forwarded-Encrypted: i=1; AJvYcCUP0+CZDDOe6z6ToSjRgrOKoIG6CalBTnB3G20SQ0HdXK8jU4sECujwMVsW4H0UYbEbxFaCTsfjGoAoS5LgIbWq7wIkJECvDa4unLOR X-Gm-Message-State: AOJu0YziBf/FO9r0YT1wInhZ9dv5du2lfyuzEUIq30meoZZGAMDNvx7E MNIMyTPkdGLchcCSHe54MdqR+lt8B62fjch+GyUgecbVigDZLmqer90RCMlgWtJCPTahx4voBsP b+amMRytfmawRxj4SqBoYBImBLMNXp5A/cVqk X-Received: by 2002:a17:906:12c1:b0:a63:3cd4:97d2 with SMTP id a640c23a62f3a-a6cdbd0d2e5mr206803066b.63.1717779569136; Fri, 07 Jun 2024 09:59:29 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240530201616.1316526-1-almasrymina@google.com> <20240530201616.1316526-3-almasrymina@google.com> <5aee4bba-ca65-443c-bd78-e5599b814a13@gmail.com> <8f44ca2a-8910-418f-b4a6-ca1e051484ba@gmail.com> In-Reply-To: From: Mina Almasry Date: Fri, 7 Jun 2024 09:59:16 -0700 Message-ID: Subject: Re: [PATCH net-next v10 02/14] net: page_pool: create hooks for custom page providers To: Pavel Begunkov Cc: David Ahern , Christoph Hellwig , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-arch@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Donald Hunter , Jonathan Corbet , Richard Henderson , Ivan Kokshaysky , Matt Turner , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Andreas Larsson , Jesper Dangaard Brouer , Ilias Apalodimas , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Arnd Bergmann , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Steffen Klassert , Herbert Xu , Willem de Bruijn , Shuah Khan , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , David Wei , Jason Gunthorpe , Yunsheng Lin , Shailend Chand , Harshitha Ramamurthy , Shakeel Butt , Jeroen de Borst , Praveen Kaligineedi Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jun 7, 2024 at 8:47=E2=80=AFAM Pavel Begunkov wrote: > > On 6/7/24 16:42, Pavel Begunkov wrote: > > On 6/7/24 15:27, David Ahern wrote: > >> On 6/7/24 7:42 AM, Pavel Begunkov wrote: > >>> I haven't seen any arguments against from the (net) maintainers so > >>> far. Nor I see any objection against callbacks from them (considering > >>> that either option adds an if). > >> > >> I have said before I do not understand why the dmabuf paradigm is not > >> sufficient for both device memory and host memory. A less than ideal > >> control path to put hostmem in a dmabuf wrapper vs extra checks and > >> changes in the datapath. The former should always be preferred. > > > > If we're talking about types of memory specifically, I'm not strictly > > against wrapping into dmabuf in kernel, but that just doesn't give > > anything. > > And the reason I don't have too strong of an opinion on that is > mainly because it's just setup/cleanup path. > I agree wrapping io uring in dmabuf seems to be an unnecessary detour. I never understood the need or upside to do that, but it could be a lack of understanding on my part. However, the concern that David brings up may materialize. I've had to spend a lot of time minimizing or justifying checks to the code with page pool benchmarks that detect even 1 cycle regressions. You may be asked to run the same benchmarks and minimize similar overhead. The benchmark in question is Jesper's bench_page_pool_simple. I've forked it and applied it on top of net-next here: https://github.com/mina/linux/commit/927596f87ab5791a8a6ba8597ba2189747396e= 54 As io_uring ZC comes close to merging, I suspect it would be good to run this to understand the regression in the fast path, if any. If there are no to little regressions, I have no concerns over io uring memory not being wrapped in dmabufs, and David may agree as well. -- Thanks, Mina