From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 A9C1522E01E for ; Fri, 20 Jun 2025 07:49:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750405768; cv=none; b=AJ+iAey3ydus2eB+rbzXeNvvOKX7vdgPFMMmWIeCNNn7EEWCOHeAjKedBy7sc9ZCHg0oSsJpiS6kbKuLLGIRftA02s6tMa2hben/wJ5IcvY2Y/OTvSLPfXyAQ5P1oakzulRqOTsyAIU6LtEhRVpUgGKl0dZTttWYii5srtcq7t4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750405768; c=relaxed/simple; bh=lPTn097d3RKmYQXcQJXHtz90CBTGa1mOLWU8ZI0qkp8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=VrzVQfwM3UgNftBF6B+O+6eWYPYNW3kzoAg3AgC4aRKlcb7xyvcweKDNieI3clNGlVa+HJGNVs9UK10JDoo3OFfuM+c0ZYVoqN11LnBF/vrh6XSFPW5tvI8M37/YaTKxl9LbeXwQU7pIV96TNIA+5sUN3sEwPvPYGnRMwrLYkBw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Yzl19JMI; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Yzl19JMI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1750405764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8/NfKHQF9oEI9qiwLXTW6bFDUNC1qeYOK5nIoYRGjPo=; b=Yzl19JMIY5R14RaRYubJV+78OEkgc0EwUAINugJyMGuDWanK89ac8gFMOd1mWQRdvGggA/ hDN2eA21a2zwwAt+9Xrdp91M7hP3bf0C11Phu5ytWHKnd27FXIagXx+YsEHlMi80eAVx1V mW2ZkwsX4UwTJS34UszRG/z+s35ZBM4= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-130-ba0yiVqmP--haSDqGJVjxA-1; Fri, 20 Jun 2025 03:49:22 -0400 X-MC-Unique: ba0yiVqmP--haSDqGJVjxA-1 X-Mimecast-MFC-AGG-ID: ba0yiVqmP--haSDqGJVjxA_1750405761 Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-553b902b3cdso840939e87.1 for ; Fri, 20 Jun 2025 00:49:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750405761; x=1751010561; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8/NfKHQF9oEI9qiwLXTW6bFDUNC1qeYOK5nIoYRGjPo=; b=S+4xGadGYBsNc+1XZSZixj3b0WpyNrR0L7JXHixRK9gl491wfQBYOn7F5BnTkh4D1T cvogiK74SrFJlK0QJryFnZf00g4PDocYS0/mYsXBAQRn1UUlFtJLPAb07xfmNajPbraV 5jp3DV+8Zi8NihgKMYuN9BoKoy/HyeEtDCzyu0BIZWhzHb/FDKqkeMLM4Jm/Vh5N05nE IUyh/uKwX8EwjZFAM5Q1fFPQMfbteVeoAqZUYXfqaRBupG0L872l7TufBXH2ycVvQc9p JjuRi9+BJZZvOCwvWio5043Z9cDxXp7mxnQgIXEzi0jyOSM/89bJKm6/l5BltdSX+J9e NnHg== X-Forwarded-Encrypted: i=1; AJvYcCVxB0B43vbh8frHDEvJYIQdwHNXp77Jl3IVXV6gcb4ru/UbopkTSqB7Hq8lq/hrENmL+zKXpcC+Y0gSXKI=@vger.kernel.org X-Gm-Message-State: AOJu0YwsAqdL1sTp5oL2Xti/1l+DMk4sMEHkjYfI7LEsS+QzIHSTram/ pl+PQfMtYwu5fsmQTh1IXxm9UpUbmcJCZ5XUPPJG6GETbc9M3p5uMT891K8UVzFcRbXxl1VOmDU oSnPvQZzQEUR3KvQuD4idNon0Xtyzj8xI1jhyDz6K8N6SceJKf6ha/dw4sTLDMwTvsw== X-Gm-Gg: ASbGncu1tM5iMZaUlx+z9SIC2Qysqvhhtej8sEBy7OWuoNQ5gwG1y4rWfErf98VguN5 sfgHUQVLcVB2nafdYg4NSw/WjcNh2A1Q91VqZr9042OLYsoOMPwGvct23AyDcuQ/QViYZ7dwxNt 8HWr3hqQZbO5ZjQKNW7cw3ove+yMOd62Zc9+BrN4p+hFhPfDZos7JW83Pu6ppxXEMXLxDEfYJ8B roP3QimT+2Fz2KG5HLQHTfc9PsTJ2/KAkUyEmBlo6ZEBy/taQp18PHHy0x4YKsPYvYBRZKU9Kmn MCeZNvvcsxG3pBU4qSg= X-Received: by 2002:a05:6512:1323:b0:553:accf:d75 with SMTP id 2adb3069b0e04-553e3cfdb6bmr549358e87.26.1750405761124; Fri, 20 Jun 2025 00:49:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGLy5SMi0UipUNre443G7f4CTQNRiybWOKExd4GM5/+BAIumn05sVzdmmKiq+TDs10cab3gRg== X-Received: by 2002:a05:6512:1323:b0:553:accf:d75 with SMTP id 2adb3069b0e04-553e3cfdb6bmr549341e87.26.1750405760660; Fri, 20 Jun 2025 00:49:20 -0700 (PDT) Received: from alrua-x1.borgediget.toke.dk ([2a0c:4d80:42:443::2]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-553e41bbdcesm187600e87.116.2025.06.20.00.49.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jun 2025 00:49:19 -0700 (PDT) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id A6FAA1B372DF; Fri, 20 Jun 2025 09:49:18 +0200 (CEST) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Mina Almasry , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: Jesper Dangaard Brouer , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Shuah Khan , Ilias Apalodimas , Mina Almasry Subject: Re: [PATCH net-next v5] page_pool: import Jesper's page_pool benchmark In-Reply-To: <20250619181519.3102426-1-almasrymina@google.com> References: <20250619181519.3102426-1-almasrymina@google.com> X-Clacks-Overhead: GNU Terry Pratchett Date: Fri, 20 Jun 2025 09:49:18 +0200 Message-ID: <87ecvezwch.fsf@toke.dk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mina Almasry writes: > From: Jesper Dangaard Brouer > > We frequently consult with Jesper's out-of-tree page_pool benchmark to > evaluate page_pool changes. > > Import the benchmark into the upstream linux kernel tree so that (a) > we're all running the same version, (b) pave the way for shared > improvements, and (c) maybe one day integrate it with nipa, if possible. > > Import bench_page_pool_simple from commit 35b1716d0c30 ("Add > page_bench06_walk_all"), from this repository: > https://github.com/netoptimizer/prototype-kernel.git > > Changes done during upstreaming: > - Fix checkpatch issues. > - Remove the tasklet logic not needed. > - Move under tools/testing > - Create ksft for the benchmark. > - Changed slightly how the benchmark gets build. Out of tree, time_bench > is built as an independent .ko. Here it is included in > bench_page_pool.ko > > Steps to run: > > ``` > mkdir -p /tmp/run-pp-bench > make -C ./tools/testing/selftests/net/bench > make -C ./tools/testing/selftests/net/bench install INSTALL_PATH=3D/tmp/r= un-pp-bench > rsync --delete -avz --progress /tmp/run-pp-bench mina@$SERVER:~/ > ssh mina@$SERVER << EOF > cd ~/run-pp-bench && sudo ./test_bench_page_pool.sh > EOF > ``` > > Note that by default, the Makefile will build the benchmark for the > currently installed kernel in /lib/modules/$(shell uname -r)/build. To > build against the current tree, do: > > make KDIR=3D$(pwd) -C ./tools/testing/selftests/net/bench > > Output (from Jesper): > > ``` > sudo ./test_bench_page_pool.sh > (benchmark dmesg logs snipped) > > Fast path results: > no-softirq-page_pool01 Per elem: 23 cycles(tsc) 6.571 ns > > ptr_ring results: > no-softirq-page_pool02 Per elem: 60 cycles(tsc) 16.862 ns > > slow path results: > no-softirq-page_pool03 Per elem: 265 cycles(tsc) 73.739 ns > ``` > > Output (from me): > > ``` > sudo ./test_bench_page_pool.sh > (benchmark dmesg logs snipped) > > Fast path results: > no-softirq-page_pool01 Per elem: 11 cycles(tsc) 4.177 ns > > ptr_ring results: > no-softirq-page_pool02 Per elem: 51 cycles(tsc) 19.117 ns > > slow path results: > no-softirq-page_pool03 Per elem: 168 cycles(tsc) 62.469 ns > ``` > > Results of course will vary based on hardware/kernel/configs, and some > variance may be there from run to run due to some noise. > > Cc: Jesper Dangaard Brouer > Cc: Ilias Apalodimas > Cc: Jakub Kicinski > Cc: Toke H=C3=B8iland-J=C3=B8rgensen > > Signed-off-by: Mina Almasry > Acked-by: Ilias Apalodimas > Signed-off-by: Jesper Dangaard Brouer Acked-by: Toke H=C3=B8iland-J=C3=B8rgensen