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 X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D965CC64E75 for ; Mon, 23 Nov 2020 13:32:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8544020782 for ; Mon, 23 Nov 2020 13:32:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="p3hPzFrD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730292AbgKWNbo (ORCPT ); Mon, 23 Nov 2020 08:31:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731864AbgKWNb2 (ORCPT ); Mon, 23 Nov 2020 08:31:28 -0500 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1635C0613CF; Mon, 23 Nov 2020 05:31:27 -0800 (PST) Received: by mail-wr1-x441.google.com with SMTP id r17so18655743wrw.1; Mon, 23 Nov 2020 05:31:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=6VjVsILSsDd5SInux6/cPvrLq3EX5hfYBfnNEoH8afc=; b=p3hPzFrD8yTk9+Gx4YckDx35JRnq+e6c0hSMGloeC/toffjNM/LrzjXcNTcdTTPFUh UpENDkd8Cabeebm20HEr2p3HAfjLKzHjtWCw71w85vNXLp/v6TmQSXg6vMIqZ3hsjqgM cbXHXSyHvUUnJhL0DQQnMvvenDqPnO5LRqTbHADqUj2IlXtwe1bt6kwvZDeHzDUie5ne GiBxdItO6teTxK1KPCKTLzujQMKjR/sjfwb4LfTl0WSPan7YhkLrAsqgTsLemLlqLQz7 4K/hEUkLxPoDBn6SCIZfmBFUpngYscaQQWSYKjftNF2pLBM6vJTHzfbDwTT9pRee3aQ/ 1W1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=6VjVsILSsDd5SInux6/cPvrLq3EX5hfYBfnNEoH8afc=; b=gXtxHEGadMmCMpGFBUWwFA4P9nbzkrOXC/WDrUo/XgWISt0wY2DDnzEnLYx6q4nSS1 CUbHzr2tCKptifFD2YsPhsQaIxCa5SMjVqwFG2eUSTPpPNhV2WJG/JkGxhOrfjhZVsgD 6sAX3/r8g8Xd1Te1Ep49ajyoKrbfn04b/AVn+SU8WaOu/YnjRY83q06lwRKN5iOSxwqD CL8GVWSMBpdwtf1F9sIK70pipyjei84JSpYQLUitk0hW4JuWreBPPj7hkoqgc6UgLxY2 4clNC32huc5/yIisYy5z3/5vB9U2Q0AksW6X9tV9LFOHWAszZh+VwZ+B6tg5lqQL+HR7 cyrw== X-Gm-Message-State: AOAM533pFIfK0epNNxQziOiKtH4P7ojz68Tms1sv+NQCmVoZ0Gop6IrK 2OLmjm9/EBD86S5cznBhaWPPykDN70/Zztc5mHg= X-Google-Smtp-Source: ABdhPJxHjYOYrucIemLufVB68BJFElUQ078uhX2AV6WAjHWd+fVmVZV/gI+EsM1L9UvKZOVEKQYr9iP1U/rL89E2NDk= X-Received: by 2002:adf:f241:: with SMTP id b1mr30710060wrp.248.1606138286688; Mon, 23 Nov 2020 05:31:26 -0800 (PST) MIME-Version: 1.0 References: <20201119083024.119566-1-bjorn.topel@gmail.com> In-Reply-To: <20201119083024.119566-1-bjorn.topel@gmail.com> From: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= Date: Mon, 23 Nov 2020 14:31:14 +0100 Message-ID: Subject: Re: [PATCH bpf-next v3 00/10] Introduce preferred busy-polling To: Eric Dumazet , Jakub Kicinski Cc: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Netdev , "Karlsson, Magnus" , bpf , Alexei Starovoitov , Daniel Borkmann , "Fijalkowski, Maciej" , "Samudrala, Sridhar" , "Brandeburg, Jesse" , "Zhang, Qi Z" , Jonathan Lemon , maximmi@nvidia.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, 19 Nov 2020 at 09:30, Bj=C3=B6rn T=C3=B6pel = wrote: > > This series introduces three new features: > > 1. A new "heavy traffic" busy-polling variant that works in concert > with the existing napi_defer_hard_irqs and gro_flush_timeout knobs. > > 2. A new socket option that let a user change the busy-polling NAPI > budget. > > 3. Allow busy-polling to be performed on XDP sockets. > > The existing busy-polling mode, enabled by the SO_BUSY_POLL socket > option or system-wide using the /proc/sys/net/core/busy_read knob, is > an opportunistic. That means that if the NAPI context is not > scheduled, it will poll it. If, after busy-polling, the budget is > exceeded the busy-polling logic will schedule the NAPI onto the > regular softirq handling. > > One implication of the behavior above is that a busy/heavy loaded NAPI > context will never enter/allow for busy-polling. Some applications > prefer that most NAPI processing would be done by busy-polling. > > This series adds a new socket option, SO_PREFER_BUSY_POLL, that works > in concert with the napi_defer_hard_irqs and gro_flush_timeout > knobs. The napi_defer_hard_irqs and gro_flush_timeout knobs were > introduced in commit 6f8b12d661d0 ("net: napi: add hard irqs deferral > feature"), and allows for a user to defer interrupts to be enabled and > instead schedule the NAPI context from a watchdog timer. When a user > enables the SO_PREFER_BUSY_POLL, again with the other knobs enabled, > and the NAPI context is being processed by a softirq, the softirq NAPI > processing will exit early to allow the busy-polling to be performed. > > If the application stops performing busy-polling via a system call, > the watchdog timer defined by gro_flush_timeout will timeout, and > regular softirq handling will resume. > > In summary; Heavy traffic applications that prefer busy-polling over > softirq processing should use this option. > Eric/Jakub, any more thoughts/input? Tomatoes? :-P Thank you, Bj=C3=B6rn