Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp487676lqm; Wed, 1 May 2024 06:59:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVBercyb+hPf4/eiOL0DacOlMQ0R59gSoPVt1x7qbrH3ZxqLGY0daqbzK2O3SQmcm4qz9GhvQRhiAvidEVhBXKjyVDJ0smVl+yJ+RhgRQ== X-Google-Smtp-Source: AGHT+IEEhI4cNq3/svO9ATBwnGEyMZb9zjYsyLg8aV3vd27ZPJg547pm+MOLLX74NvNXLifeEVFb X-Received: by 2002:a25:d658:0:b0:dc7:4b0a:589 with SMTP id n85-20020a25d658000000b00dc74b0a0589mr2653606ybg.55.1714571973629; Wed, 01 May 2024 06:59:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714571973; cv=pass; d=google.com; s=arc-20160816; b=LewSDcvWj59DKIpy7KQrIATtBn8NpexEmD+NzbNVAwDfG4ri1A2y4bOcJHjWT3RcYR lW0Bq9qLHa7AL/Vu6bEcfMfZxtBY3zpTChOtoJPsgVCaltqQgixOwbdzGxPdtZYuBda5 b/JVDCiDP2INZrblB5Za4CYqLWdCu+v8WceKbYvQjcOIxA9fXAH8U7T13CtrRmFBx97Y 3/Dwi8FuwPvZPjfYNJXdsFSI4/wClc2xgT1VTakfi2z/lS1gQHwBGZA2iok79gPCGIWW XKONxr6kEuqC+DdpkWQ3NrPTgWeh0riSaxfd0qW8qXG2NR9/tmNQ0iPjX2PvH95lc7vt SPnw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=gOze/2fzXHO/81tG2YTfo5sSZRKuFMGwh2n6uNRkncs=; fh=6RsdeGpB7aYE9y4uyZwa8i5Vrnu05wg7IPTPnJrAZlc=; b=aJlJRT1fghJTHHHzkuHXrnbOXo4RshS3HD08qSMF23203nGpYMj+ssNaUnVMd+x76T JQU/nuyvIc+TYZtsG36ULR39dCvDuk0b7R4h69pzxJX4cjMn+By3ZEZSuydkV1rEA01P H2iIPFc25/5ui4752lsJUcwkgmXSwyJlNkaRsO8DfmwMnlx1Hc2FHqQVTx06C8COTOWe iiVU5YenICsTzDkyCgZnSDEbql70sR8Qwengv806zkdoQooRrB6rELVshQ+mtUkKs/jk 4itfp5e8mRFLOgMAFwPS4QyzXdMzIupwq5S6eccg0b+so6gGyRKE5OHpEj1S14h/Fp02 WxcQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sCbrUaES; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-165345-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165345-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ga19-20020a05622a591300b00439f97e7226si20953298qtb.328.2024.05.01.06.59.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 06:59:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165345-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sCbrUaES; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-165345-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165345-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5A1681C2194B for ; Wed, 1 May 2024 13:59:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DBDF312F381; Wed, 1 May 2024 13:59:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sCbrUaES" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC09212C490; Wed, 1 May 2024 13:59:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714571957; cv=none; b=J3nv4JNhCH3zr/s7JdeCsI2Z5LuWf1arbxDg7Qyw7WRs8NW/s+Ms+ZHv1rgylDWWOPIEg7X1kQ0Ich2HQzQ+nboY35WZXfcQc7sKgsxTfa8x/5sXx2f+pVpQnKr9XRTaacybTZNig9nm+QFiRTEg5LGAeJjQFINFafgtD1bON2E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714571957; c=relaxed/simple; bh=Fi4PvMRZrF9DXNpSOwwia/BblzTiRO6iyf1z/eVq1XU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=NbchjvG3iRoD7tZsVbSHBC2VDA1pFY2cj3SWAp5gw7+QlIJJAkkhCxOyXperwsUU5+WmLLsJDxONdC8ykFbY6y9qB9qCS+FG6ugqs8QH6pC8ieafJ/cFNzvbEp2j2Hhzi3kO26lzjrgh3dVTN/naxrWwGNw4DCa+GCEq30m/AXM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sCbrUaES; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B3C7C072AA; Wed, 1 May 2024 13:59:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714571956; bh=Fi4PvMRZrF9DXNpSOwwia/BblzTiRO6iyf1z/eVq1XU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=sCbrUaESax+zNwmTNdY7otL0UFOQLPT1tCLvxhS1E2UCWFKHW4CFOG8eHXGAPEzYV K59HSeGnESqWuVyypeDsfjxCGIwlrkTiIB8RtlSIeODJISpG+bjrjqgUZTNnVYoXFo 0nAjOD3kay/wsGxmwOPaAc5VD0eUhuiBlauj3Z2WQisvO7reiDxOn7qiXguQyswbXz eGzZQLUgdh76hRrtTEFJVQdEHnMA2UjgtwHVl2z9L4Tsb3ZTSE/wBE57PdTiTs8Ocp FhNUI+PSuIOyAwwjpVUsbAi1uNR+QWMI+7HqtFjSwPStPFYwbkZKYGKHcbZk0YZOQW CZlqUKG4oenXA== Message-ID: <779b9542-4170-483a-af54-ca0dd471f774@kernel.org> Date: Wed, 1 May 2024 15:58:59 +0200 Precedence: bulk X-Mailing-List: linux-kernel@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: Jens Axboe , Mina Almasry Cc: David Wei , 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 , 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> <11f52113-7b67-4b45-ba1d-29b070050cec@kernel.dk> Content-Language: en-US From: Jesper Dangaard Brouer In-Reply-To: <11f52113-7b67-4b45-ba1d-29b070050cec@kernel.dk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 30/04/2024 20.55, Jens Axboe wrote: > On 4/30/24 12:29 PM, Mina Almasry wrote: >> On Tue, Apr 30, 2024 at 6:46?AM Jens Axboe wrote: [...] >>> 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. >>> >> The history there is that this check adds 1 cycle regression to the >> page_pool fast path benchmark. The regression last I measured is 8->9 >> cycles, so in % wise it's a quite significant 12.5% (more details in >> the cover letter[1]). I doubt I can do much better than that to be >> honest. > > I'm all for cycle counting, and do it myself too, but is that even > measurable in anything that isn't a super targeted microbenchmark? Or > even in that? The reason for page_pool fast path being critical is that it is used for the XDP_DROP use-case. E.g on Mellanox mlx5 driver we see 24 Mpps XDP_DROP, which is approx 42 nanosec per packet. Adding 9 nanosec will reduce this to 19.6 Mpps. 1/(42+9)*10^9 = 19607843 --Jesper p.s. Upstreaming my PP microbenchmark[1] is still at the bottom of my todo-list. [1] https://github.com/netoptimizer/prototype-kernel/blob/master/kernel/lib/bench_page_pool_simple.c