Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2659070pxu; Sun, 18 Oct 2020 10:23:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4yUIYF40UiJh3/uc9WT/00ER5Lke5MHOzMkT6mokGJtTyBrQSVSjwOIL93l6XWpVBSs3E X-Received: by 2002:a17:906:7157:: with SMTP id z23mr14099261ejj.474.1603041819235; Sun, 18 Oct 2020 10:23:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603041819; cv=none; d=google.com; s=arc-20160816; b=w8OeoD/und/riQd+PrB7aC0PP4HoSRE6td1ourlrIizbDGEILlgRAT8nyNuzMzG7S2 QzsL7swzrGFn8jvt/VfJW9U1bx3dkUnBJWEoAvRXYfNh5xq8JIlfVkrC8hjOxOWE3h5h /fIsPYCYFzZXQin87lY/WuWcDICTPfOxC5tA/chfexR6AFkT+m8iPx2rulNunSCna+Kz 6LdcNVF0zYRYsiKVH4A2kkiwowp1gadSfTwa/Myah9wBwvRICPdruRTbJVXI38U0U3Wo znag5GuZ8ZEQvr8IDqmGjANeiLZDXqcoXeinrK6ZcE5GJIOwm17MfZVtAVl7p+QG3uVE 5tEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=nVS/FbaAxHeCYm9vAKz+h9twQja9mhXTQWS0aIdTLK0=; b=0WY3FpSGB9txUw23CTjNMa0tja7b+H0410R1DjrC8N9+poi73xS2OQ5gisJiUowgEd C96nHnD0x7QbGfgokHZuDVxVvjx5QkWU5gCI7sgkLv3NtA0DhAohI1hAmho7e6B2g2O9 i0y/ecKqbz1Nin2QkjzchJkxpo7vHbFtAZehD0Cv65Cr4CDbonw42/4BOcNqpvR+tlK/ WuiRP+RwUmwZW5hpQW2sgX9037uG1jaL1qpI8chvW44LpAly+ax2xNLo6smFuuXBeRMp F51z7PxZcmvO00jzCRJA7DlAWJwfkEgUmr/bFKreY5prPi7TPu4+TJnDv2r2KbZViu/L dC6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0PFgeBKp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w22si6590583edi.294.2020.10.18.10.23.15; Sun, 18 Oct 2020 10:23:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0PFgeBKp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726803AbgJRRTu (ORCPT + 99 others); Sun, 18 Oct 2020 13:19:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:56364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725904AbgJRRTu (ORCPT ); Sun, 18 Oct 2020 13:19:50 -0400 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (c-67-180-217-166.hsd1.ca.comcast.net [67.180.217.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3DF1A2223F; Sun, 18 Oct 2020 17:19:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603041589; bh=3Q5FHZplMB5Vfvn4zxpHhyQoeHMO5TrTcAto1Ahhweo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=0PFgeBKpDbmQRxHwLbzW4/LDVC8WzgEIT+QXQIiLbN+g0Nm0puFPIB0gxxjIpxT9l 61EkJ03t09AmdhR0wZzA064BbYcIXV+U4dppmgC9VVTy/AUCdxJd5qTKm2J6knD9Ev SvGDPzX4DY0yVvOc2BUoNl21/k/Rqp06PF5JZtDA= Date: Sun, 18 Oct 2020 10:19:47 -0700 From: Jakub Kicinski To: Heiner Kallweit Cc: Eric Dumazet , Thomas Gleixner , Eric Dumazet , David Miller , "netdev@vger.kernel.org" , LKML Subject: Re: Remove __napi_schedule_irqoff? Message-ID: <20201018101947.419802df@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <668a1291-e7f0-ef71-c921-e173d4767a14@gmail.com> References: <01af7f4f-bd05-b93e-57ad-c2e9b8726e90@gmail.com> <20201017162949.0a6dd37a@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <668a1291-e7f0-ef71-c921-e173d4767a14@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 18 Oct 2020 10:20:41 +0200 Heiner Kallweit wrote: > >> Otherwise a non-solution could be to make IRQ_FORCED_THREADING > >> configurable. > > > > I have to say I do not understand why we want to defer to a thread the > > hard IRQ that we use in NAPI model. > > > Seems like the current forced threading comes with the big hammer and > thread-ifies all hard irq's. To avoid this all NAPI network drivers > would have to request the interrupt with IRQF_NO_THREAD. Right, it'd work for some drivers. Other drivers try to take spin locks in their IRQ handlers. What gave me a pause was that we have a busy loop in napi_schedule_prep: bool napi_schedule_prep(struct napi_struct *n) { unsigned long val, new; do { val = READ_ONCE(n->state); if (unlikely(val & NAPIF_STATE_DISABLE)) return false; new = val | NAPIF_STATE_SCHED; /* Sets STATE_MISSED bit if STATE_SCHED was already set * This was suggested by Alexander Duyck, as compiler * emits better code than : * if (val & NAPIF_STATE_SCHED) * new |= NAPIF_STATE_MISSED; */ new |= (val & NAPIF_STATE_SCHED) / NAPIF_STATE_SCHED * NAPIF_STATE_MISSED; } while (cmpxchg(&n->state, val, new) != val); return !(val & NAPIF_STATE_SCHED); } Dunno how acceptable this is to run in an IRQ handler on RT..