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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1696C4332F for ; Wed, 16 Nov 2022 20:09:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232680AbiKPUJq (ORCPT ); Wed, 16 Nov 2022 15:09:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232804AbiKPUJp (ORCPT ); Wed, 16 Nov 2022 15:09:45 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAB9D627FE; Wed, 16 Nov 2022 12:09:44 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7E027B81D80; Wed, 16 Nov 2022 20:09:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 058F5C433C1; Wed, 16 Nov 2022 20:09:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668629382; bh=i3qMamg1MCRCzeZi7pLK6qAH3/XpIXsR5L7QAJr2ICQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tgRm0C9CB8Nj6O8Inf7ruu03IgfZOo/s7u10Nc/LD7axiFC7cVbMP+ZyxHgC5ZorR kbEgkM3kh43Ny+jfyTQMXb6dnpPm+6xBwSea9ctopLmqLNO5kXZz9gMqNbxJmhDvcD Jp0o+qSOFFehvpQQp1rEsIKsk5wpxAXeQCBWptfbStp5qbqEib9u9LNbM/pT9kzro8 xkZ7rs2r3tLzCu8Ex6aOxvINt39bM8ur+EkK0u2wLNkofMhhP7+AA5LDXthghTmhOI ZaqYZAK9Erj0TMSffWTBoMEuRtkwpEd2Lf+jlKKEtmVZ8s+RWTqKWMzId7fjfPGpbw uN5aWTZFzulYA== Date: Wed, 16 Nov 2022 12:09:41 -0800 From: Jakub Kicinski To: Jens Axboe Cc: Stefan Roesch , kernel-team@fb.com, olivier@trillion01.com, netdev@vger.kernel.org, io-uring@vger.kernel.org Subject: Re: [RFC PATCH v3 0/3] io_uring: add napi busy polling support Message-ID: <20221116120941.2d7cffcd@kernel.org> In-Reply-To: <44c2f431-6fd0-13c7-7b53-59237e24380a@kernel.dk> References: <20221115070900.1788837-1-shr@devkernel.io> <20221116103117.6b82e982@kernel.org> <44c2f431-6fd0-13c7-7b53-59237e24380a@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On Wed, 16 Nov 2022 11:44:38 -0700 Jens Axboe wrote: > Thanks Jakub! Question on the need for patch 3, which I think came about > because of comments from you. Can you expand on why we need both an > enable and timeout setting? Are there cases where timeout == 0 and > enabled == true make sense? The enable is for the "prefer busy poll" mode, rather that just busy polling. The prefer busy poll mode disables interrupts and arms a (hopefully long enough) fail safe timer, and expects user to come back and busy poll before the timer fires. The timer length is set thru sysfs params for NAPI/queue. Because the Rx traffic is fully async and not in control of the local app, this gives the local app the ability to postpone the Rx IRQ. No interruptions means lower response latency. With the expectation that the app will read/"busy poll" next batch of packets once its done servicing the previous batch. We don't have to implement this bit from the start, "normal" busy poll is already functional with patches 1 and 2.