From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) (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 CB87C171E73 for ; Tue, 30 Apr 2024 13:46:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714484765; cv=none; b=qhLHBtXe5XJT2wgpkBI4i+nM3BHid0M0ddRX3SzXh75le4Etn3BLY2QtsKyU4k7HunRNex9ylXfqqodNMxOcz1x3uJTZeitbd0aUT+pWvdLWFX4wOfDSCZgEStsrY6XdaraDduNUvvdC3nm4zbbyq9jzjsc82137N59ea/gqSMY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714484765; c=relaxed/simple; bh=T1pCeAqcp0hagoseX+NBrv4VuqjeZqvX4PDGNfjpbho=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MBTPMMrCqWx5jMnvh0PffBuPLFelFS0vVjgLI1S3ekmo/wu3ovcYpzMTj+Z3LUgpzzKjxp9Fs5cZLd/0hWckHrMEHZIM1fEVBxUXUYsx/fjd5xqhqqQ4z/6+0TWskcuI6PK3PqNitCIC7LXcgJX4EBMQLeNTMsTK/dLC8n68gjc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=TrbWzzUJ; arc=none smtp.client-ip=209.85.216.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="TrbWzzUJ" Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-2af37c18c10so1380219a91.2 for ; Tue, 30 Apr 2024 06:46:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1714484761; x=1715089561; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=JjNR4wPlgvb/NrdAvCR/ceifiIGObytGntMYaBKjRCU=; b=TrbWzzUJm4ACtdJyO8oibE6KYZmSqfTX2Jp4Q0yG9JcxctyXvP+CDWGCRkRrVsuMY5 iMVNVsN3muXq+fKDdYw5GJRGGzLAyrSmaV0eEKQRnVARtWliWdQoTqQ1FD1RUlHU5m3U gDdLu5C5HjkqWAIpLZ4ayF0asn66ueCZTz0j8eCPMTI0Z8v/bSHAT2v+b0W4MSZMvrlE oROpvzBoqEz7hAfm06s0TLcuLfyELeqxigNRtGhSdBSBaHmYeXwgI8qUnuKDsSwX9Nh2 5g8SyL48LiJV6qg+w5MFs+9pri8thZKS40PTXmP8hzxdCZM8eyX9NKg32HgQ9RPA9Rcw IC2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714484761; x=1715089561; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JjNR4wPlgvb/NrdAvCR/ceifiIGObytGntMYaBKjRCU=; b=lH5EdgVP+SG3JL66B+0I0eKBNNrbZ3HAkET28P1i9s6NmHPTWwTBhk3SufiQlDDHZx iVJ6x0LeLPbI6trJHuT0WEo/2K51k17H02YFXUNlRGKXWL0nQqg1gqW1b9CFxvJCHc80 3PrCvNAPkxc43MQNHbFSzbM0zyBKZBrtGhqTVBVreCCuwJY2yT9CER1y1e8WYk4ggkqJ 6zg0CvZ427lS1KOt2qQqtMVNv7o13rrtoyqXf8rOD7MhCk0nFEvT3T2i6buM+LQiT2rM 5XSxdooEkMKxe9dsPCYT/KkTrE4qnuyZM9UUe/DLPyX5dcAY+smBuqO5/7NiU05zZJLI mCfg== X-Forwarded-Encrypted: i=1; AJvYcCWUlaCRMDQc70GXAUz0Y+dGXmoWXcLv6aSTfD2EfSGFPdXoSiohPX7hKcJylQV3ltmWIrT7twzmFDFWu8fUHxahk2mMBAoc2AaaDg== X-Gm-Message-State: AOJu0Yy9rIgsi2VVo9UNQdHwlL8KN6DJ9QALY9EtXEzbUwlLrVFSJodh Jiixw/P8Z+pLf6hL0tnSBMZm67MV836SOzjfEvXNHd5VVRb9joiPm9PNu2UUpOk= X-Google-Smtp-Source: AGHT+IH9R1bNbi/b5An2t0YujuKFT91RDi4jOUG3j3R9m2Jy6nNwhLv9ihFj9tl7tQbksDchw49Kdw== X-Received: by 2002:a05:6a00:1d22:b0:6ed:cc50:36cd with SMTP id a34-20020a056a001d2200b006edcc5036cdmr14955130pfx.2.1714484761068; Tue, 30 Apr 2024 06:46:01 -0700 (PDT) Received: from [192.168.1.150] ([198.8.77.194]) by smtp.gmail.com with ESMTPSA id fe8-20020a056a002f0800b006ed00ea504asm21108186pfb.159.2024.04.30.06.45.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Apr 2024 06:46:00 -0700 (PDT) Message-ID: Date: Tue, 30 Apr 2024 07:45:52 -0600 Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH net-next v8 07/14] page_pool: devmem support To: Mina Almasry , David Wei Cc: 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 , 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 , David Ahern , Willem de Bruijn , Shuah Khan , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , Amritha Nambiar , Maciej Fijalkowski , Alexander Mikhalitsyn , Kaiyuan Zhang , Christian Brauner , Simon Horman , David Howells , Florian Westphal , Yunsheng Lin , Kuniyuki Iwashima , Arseniy Krasnov , Aleksander Lobakin , Michael Lass , Jiri Pirko , Sebastian Andrzej Siewior , Lorenzo Bianconi , Richard Gobert , Sridhar Samudrala , Xuan Zhuo , Johannes Berg , Abel Wu , Breno Leitao , Pavel Begunkov , Jason Gunthorpe , Shailend Chand , Harshitha Ramamurthy , Shakeel Butt , Jeroen de Borst , Praveen Kaligineedi , linux-mm@kvack.org, Matthew Wilcox References: <20240403002053.2376017-1-almasrymina@google.com> <20240403002053.2376017-8-almasrymina@google.com> <8357256a-f0e9-4640-8fec-23341fc607db@davidwei.uk> Content-Language: en-US From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/26/24 8:11 PM, Mina Almasry wrote: > On Fri, Apr 26, 2024 at 5:18?PM David Wei wrote: >> >> On 2024-04-02 5:20 pm, Mina Almasry wrote: >>> @@ -69,20 +106,26 @@ net_iov_binding(const struct net_iov *niov) >>> */ >>> typedef unsigned long __bitwise netmem_ref; >>> >>> +static inline bool netmem_is_net_iov(const netmem_ref netmem) >>> +{ >>> +#if defined(CONFIG_PAGE_POOL) && defined(CONFIG_DMA_SHARED_BUFFER) >> >> I am guessing you added this to try and speed up the fast path? It's >> overly restrictive for us since we do not need dmabuf necessarily. I >> spent a bit too much time wondering why things aren't working only to >> find this :( > > My apologies, I'll try to put the changelog somewhere prominent, or > notify you when I do something that I think breaks you. > > Yes, this is a by-product of a discussion with regards to the > page_pool benchmark regressions due to adding devmem. There is some > background on why this was added and the impact on the > bench_page_pool_simple tests in the cover letter. > > For you, I imagine you want to change this to something like: > > #if defined(CONFIG_PAGE_POOL) > #if defined(CONFIG_DMA_SHARED_BUFFER) || defined(CONFIG_IOURING) > > or something like that, right? Not sure if this is something I should > do here or if something more appropriate to be in the patches you > apply on top. In general, attempting to hide overhead behind config options is always a losing proposition. It merely serves to say "look, if these things aren't enabled, the overhead isn't there", while distros blindly enable pretty much everything and then you're back where you started. -- Jens Axboe