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.129.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 529F0215782 for ; Thu, 9 Jan 2025 10:09:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736417351; cv=none; b=BUqo6M0L/v3nl9w9tuyyJpgfyN4rJLepM2syVBuzazvEqcPEfwj01OKRVjUbUtcriMmUdyQNvg1Jk0gMJ2NN+MhxtG8epfk+mEZRSv+2/McAdu5e/U1FnhEfCD3BhOPlGULGHHp2PjveoowGN4BmYlfXJ0cAkdQvprJKVCCuuaM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736417351; c=relaxed/simple; bh=MGOqvgCMMqB4CiOIclpLXZcXuiS7g7yW1cgotaTi84I=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=eyr3oLHpoS4mHqOmDUIT1roXxDW9vmTbz3xnkHZBhjRSnU7JLmamnNaBYuE+rFt40QAz/jH8xOuhUgsmPkD06JCb0D3Ep4gTAw3MPAyIYx1BOdUAlYvLL2n3qy30Im2lzObjOYYIvNBfcVt67XyIazBeKa8zyE5kMIn50IT5mus= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=LRClaXeA; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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="LRClaXeA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736417348; 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=0GQJaa0rnxulvwHWTT5/nSo9UoN71EPOBQMB5Lxp+kA=; b=LRClaXeAEUvhu+zAtYtZ9YVn6rTtFrpyY/bCFiXa04JXded3pEg9ueztiAycUJZO/R0BLn jr1xI5eFLYiF0URxBQ1/ihtDRpxHPo4Ct8v21s7/FZNYiJbk1xsUFIZ+AdbzhBeqmxmHHt B3ytro3JE+Z7MMWrAsxlDrI+o4J66T4= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-489-xtqx3sjyM4yutC5iXf5Wvg-1; Thu, 09 Jan 2025 05:09:06 -0500 X-MC-Unique: xtqx3sjyM4yutC5iXf5Wvg-1 X-Mimecast-MFC-AGG-ID: xtqx3sjyM4yutC5iXf5Wvg Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-6d8f4a0df93so19384636d6.1 for ; Thu, 09 Jan 2025 02:09:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736417346; x=1737022146; 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=0GQJaa0rnxulvwHWTT5/nSo9UoN71EPOBQMB5Lxp+kA=; b=SRUINuhzPu3rUz/NGou0P/Dk8Gf+3f/FcE1TAdaA4oV2oPf265QfILD/vWwvrxvLM0 z5xX832pjNF+K1C/naE4vksQzNzE+bAUurtyB46o5DPfcLNMiej8iMuKeEOc8G4klURR lvih4joy72xEBQyBMBgRzXJVKGWn5BCf28ROIZ3BkMyjT2LRTyU+lqW+wvjrI6hfAQR+ aGPvYodpYbjg2xNGxlybVW6Yi+BeSolaOhcJfMffcOxfVplzGlNB/ykxlNsWE39Yk6qo 2ya2Aps7NFCp7BLMZMChmVUBfWQ9hBW4HHJOlSQri0I1H52mnE9G2r313WND39ttvhsn ZsQQ== X-Forwarded-Encrypted: i=1; AJvYcCX1wFuNxIgEHf83lRGPwJMyP1Ohr2ECUed4F9zA4Aj9+Alhw18S3KFUlbJIqL5gwgJAiVmlIDK8O44u6xU=@vger.kernel.org X-Gm-Message-State: AOJu0YxGdb7uuCI9Cg0ggtABqxxw40sWZI5OFeL4TeBIdDeKvgP0r7kZ XBPHPlxE5e5ikpYTvb/cZfcg8cVfx2xNz2QKzYLzqESprINkwCW/K36dy5SYdqsAEvWVh+X05lE 3phopVLTc3rufAL9VnhjuC5LbcDvhQ91si1xzzeVmAR4x9grRvbplcty0ytQTnA== X-Gm-Gg: ASbGnctzdyIPKaqNdFipcvuyOiadO7UO/yISiJrntM3BhNLkAZYYdVPhJKvX2FH+l4N FEu/2nJln+9XWa/SCukOsPh+14yPVBWFsF2meTqhxfX1jZbaThSYTiqnTTxYt8CcSlwcz5VRx6L H7/b8dxk+HHNyv6spyC2/+QufYYVrsbyXl03ZKprrHoyerKmvZwA8pv8NX7zMtblqT2GCnc0yzr XYfiKKwHo69ZiXjsZI7i9FTFlaqMYfCFwg9WJDRA0ABUFU455y/xHZJ0phU+qTpJ6JnucIpLGwk qvefdyVb X-Received: by 2002:a05:6214:3386:b0:6d8:8874:2127 with SMTP id 6a1803df08f44-6df9b1ce252mr101036646d6.5.1736417345865; Thu, 09 Jan 2025 02:09:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGtJLUeZRNR8S6rjtijwq4ZYVawXsnNI4bNczTbzYYMZXyt3xn6XoA8n4AVAIoAeZz6TqG3hg== X-Received: by 2002:a05:6214:3386:b0:6d8:8874:2127 with SMTP id 6a1803df08f44-6df9b1ce252mr101036106d6.5.1736417345215; Thu, 09 Jan 2025 02:09:05 -0800 (PST) Received: from [192.168.88.253] (146-241-2-244.dyn.eolo.it. [146.241.2.244]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6dd18134babsm197276376d6.53.2025.01.09.02.09.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Jan 2025 02:09:04 -0800 (PST) Message-ID: <362d84f1-5adf-4fae-a826-01c39f891f1e@redhat.com> Date: Thu, 9 Jan 2025 11:09:02 +0100 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: [PATCH net-next v3] page_pool: check for dma_sync_size earlier To: Furong Xu <0x1207@gmail.com>, Jason Xing Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jesper Dangaard Brouer , Ilias Apalodimas , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Simon Horman References: <20250106030225.3901305-1-0x1207@gmail.com> <20250106113123.0000384b@gmail.com> Content-Language: en-US From: Paolo Abeni In-Reply-To: <20250106113123.0000384b@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 1/6/25 4:31 AM, Furong Xu wrote: > On Mon, 6 Jan 2025 11:15:45 +0800, Jason Xing wrote: > >> On Mon, Jan 6, 2025 at 11:02 AM Furong Xu <0x1207@gmail.com> wrote: >>> >>> Setting dma_sync_size to 0 is not illegal, fec_main.c and ravb_main.c >>> already did. >>> We can save a couple of function calls if check for dma_sync_size earlier. >>> >>> This is a micro optimization, about 0.6% PPS performance improvement >>> has been observed on a single Cortex-A53 CPU core with 64 bytes UDP RX >>> traffic test. >>> >>> Before this patch: >>> The average of packets per second is 234026 in one minute. >>> >>> After this patch: >>> The average of packets per second is 235537 in one minute. >> >> Sorry, I keep skeptical that this small improvement can be statically >> observed? What exact tool or benchmark are you using, I wonder? > > A x86 PC send out UDP packet and the sar cmd from Sysstat package to report > the PPS on RX side: > sar -n DEV 60 1 I agree with Jason: in my experience this kind of delta on UDP pps tests is quite below the noise level. I suggest to do a micro-benchmarking, measuring the CPU cycles required for whole page_pool_dma_sync_for_device() call via get_cycles(), on vanilla and with your patch - assuming the arch you have handy supports it. The delta in such testing should be significant. Thanks, Paolo