From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78088C02180 for ; Wed, 15 Jan 2025 17:40:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D18DC6B007B; Wed, 15 Jan 2025 12:40:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CCA006B0082; Wed, 15 Jan 2025 12:40:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B9049280001; Wed, 15 Jan 2025 12:40:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 9AC806B007B for ; Wed, 15 Jan 2025 12:40:29 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 1F30FB0AE7 for ; Wed, 15 Jan 2025 17:40:29 +0000 (UTC) X-FDA: 83010400578.25.F49DF3E Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf18.hostedemail.com (Postfix) with ESMTP id 459B01C0019 for ; Wed, 15 Jan 2025 17:40:27 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=svJ45p4O; spf=pass (imf18.hostedemail.com: domain of hawk@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=hawk@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736962827; h=from:from:sender: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:dkim-signature; bh=BCCjPypjfkl2FIovsFFHVjB/BzI3nlgvwJz5/NwbXsw=; b=a7IQsRcYUQC0KQyx2Zx0XtGCBeqq7CllgTNOq4XLKpYT4WPaHzd6y23a211RNI/zRQ7j7h zKaTn9eOV23RDCCRenJeRMcWaWtBf3BhzteoP7HJx4uckYOX4q4REU6dk4qSDMvRk1UG5G iZ23dAcCNag+baT/8DHco76hhmnMOkw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736962827; a=rsa-sha256; cv=none; b=kog0dEJlnLDKT8daCp9X3gmRKLKJOSF1i/nvXEjbaP+r67KQQqPHnbhYTeSu7oLgvdJUhO kBG7AuYKvV9bH5ca9+EQyNyg7ObQSjId63bXYtOaXtFDsw5wtr9IddJsKey66AmB6LeKZu v0pXDz/6Ry5wAy9RFDoH1DhWuYeGVMA= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=svJ45p4O; spf=pass (imf18.hostedemail.com: domain of hawk@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=hawk@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 4B4575C5DA8; Wed, 15 Jan 2025 17:39:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48597C4CEE0; Wed, 15 Jan 2025 17:40:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736962825; bh=MnSQMXREVVBMVqqG4DNkPoiFHSbXoUAQ7+YSxlu2cok=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=svJ45p4OZzWwWOCVuCmsBOLH/Sb0FwOy4O6Wp/nYfGoUPPMIu4eZ5AeCKRw09uHlp EvOQeh7YceB+VBH+j4VkwK6PCfrLADM0+kATjPLjH7aCrzR0PAMZpFDYT80+5rN/KI PnsupXJ14Gkmz1GrEPVem0zwAxnL1TuB7n4nFvfuDjEqXhzeC/ujVDdr2lQV1Y4Krq c5zmA3nAPBk25FZ7Mu0Zv4qFKeQNdCCQrsNUzOhg17VhdcEwcC5/s9KNK8G1BbWH5e QEVGA5UezKKiGKayItoNcXhtg6FCRgXsglzQd6JOrixy3ENiUZAh6D0jRRsWRcPnhA wzQYoGNu+WDCA== Message-ID: <3a853e1b-b5bf-4709-b8f6-e466e3e7375e@kernel.org> Date: Wed, 15 Jan 2025 18:40:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v7 0/8] fix two bugs related to page_pool To: Yunsheng Lin , davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com Cc: zhangkun09@huawei.com, liuyonglong@huawei.com, fanghaiqing@huawei.com, Alexander Lobakin , Robin Murphy , Alexander Duyck , Andrew Morton , IOMMU , MM , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Matthias Brugger , AngeloGioacchino Del Regno , netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <20250110130703.3814407-1-linyunsheng@huawei.com> <3c8e4f86-87e2-470d-84d8-86c70b3e2fcc@kernel.org> Content-Language: en-US From: Jesper Dangaard Brouer In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 459B01C0019 X-Stat-Signature: na3e6szq54aand3ndrpfr781634mxgtq X-Rspam-User: X-HE-Tag: 1736962827-632553 X-HE-Meta: U2FsdGVkX1+j7BTtQeGgi02jKl+jIl1EGwTk8MdbAkykVIZA2T6tP1fPH/u14b/MFokYGNYpJD0K1MJnxp1F+WcT7XR+zqqzVQtFk7lzazpJQuP9zH5m1VgFRfvcvcUAdQ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mJT8KuY0o8cgaRLM48AAJOFXShCJHQt5tGcwXP/L0Ndh0hOOgoJEE8+z4+5+aN1FyLWU6W5mC2wPW6TfROjihr7LkYb3z/jPC6fQcLWuO34oXyAleuHQ53ycRgvrfA5R69Ro3eageKHprN8YhKin3WTSrFz8DBTviI0FJKoCljGwDmxj+ZlJ22TOrnh7OQMV8mZaK1LQUlrBD5kkVdReaQafhEa1AVzv475/nhuWc0siypdD9RlkCvnwItKXLPjkq64D+OhTbiKcE3R2isYeZPr9wY8FHqsiy/DnUw= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 15/01/2025 12.33, Yunsheng Lin wrote: > On 2025/1/14 22:31, Jesper Dangaard Brouer wrote: >> >> >> On 10/01/2025 14.06, Yunsheng Lin wrote: >>> This patchset fix a possible time window problem for page_pool and >>> the dma API misuse problem as mentioned in [1], and try to avoid the >>> overhead of the fixing using some optimization. >>> >>>  From the below performance data, the overhead is not so obvious >>> due to performance variations for time_bench_page_pool01_fast_path() >>> and time_bench_page_pool02_ptr_ring, and there is about 20ns overhead >>> for time_bench_page_pool03_slow() for fixing the bug. >>> >> >> My benchmarking on x86_64 CPUs looks significantly different. >>  - CPU: Intel(R) Xeon(R) CPU E5-1650 v4 @ 3.60GHz >> >> Benchmark (bench_page_pool_simple) results from before and after patchset: >> >> | Test name  | Cycles |       |    |Nanosec |        |       |      % | >> | (tasklet_*)| Before | After |diff| Before |  After |  diff | change | >> |------------+--------+-------+----+--------+--------+-------+--------| >> | fast_path  |     19 |    24 |   5|  5.399 |  6.928 | 1.529 |   28.3 | >> | ptr_ring   |     54 |    79 |  25| 15.090 | 21.976 | 6.886 |   45.6 | >> | slow       |    238 |   299 |  61| 66.134 | 83.298 |17.164 |   26.0 | >> #+TBLFM: $4=$3-$2::$7=$6-$5::$8=(($7/$5)*100);%.1f >> >> My above testing show a clear performance regressions across three >> different page_pool operating modes. > > I retested it on arm64 server patch by patch as the raw performance > data in the attachment, it seems the result seemed similar as before. > > Before this patchset: > fast_path ptr_ring slow > 1. 31.171 ns 60.980 ns 164.917 ns > 2. 28.824 ns 60.891 ns 170.241 ns > 3. 14.236 ns 60.583 ns 164.355 ns > > With patch 1-4: > 4. 31.443 ns 53.242 ns 210.148 ns > 5. 31.406 ns 53.270 ns 210.189 ns > > With patch 1-5: > 6. 26.163 ns 53.781 ns 189.450 ns > 7. 26.189 ns 53.798 ns 189.466 ns > > With patch 1-8: > 8. 28.108 ns 68.199 ns 202.516 ns > 9. 16.128 ns 55.904 ns 202.711 ns > > I am not able to get hold of a x86 server yet, I might be able > to get one during weekend. > > Theoretically, patch 1-4 or 1-5 should not have much performance > impact for fast_path and ptr_ring except for the rcu_lock mentioned > in page_pool_napi_local(), so it would be good if patch 1-5 is also > tested in your testlab with the rcu_lock removing in > page_pool_napi_local(). > What are you saying? - (1) test patch 1-5 - or (2) test patch 1-5 but revert patch 2 with page_pool_napi_local() --Jesper >> >> >> Data also available in: >>  - https://github.com/xdp-project/xdp-project/blob/main/areas/mem/page_pool07_bench_DMA_fix.org >>