Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2263316pxu; Sat, 17 Oct 2020 18:25:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDKnaDjKXhdKm7b+m5ArO857hiNbc1NOjnO/IT7eTkGwahaCzYGPobSg2OArfwM39B59hG X-Received: by 2002:a17:906:280a:: with SMTP id r10mr10604475ejc.58.1602984349325; Sat, 17 Oct 2020 18:25:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602984349; cv=none; d=google.com; s=arc-20160816; b=Zwtd/0ZxfKx2l8/Y4VcDDgauWA/cFQU60EWTlp4Hn1RULToX+hlE2XAjmHEr0lWOh7 AGKAIlQXuBmvGtnva6QHRGPMPlw6uC2RODEx82PRWGQzWLKz0K4xHrN6FhiTYyGHL07Y 6y3D1yMJKWFj/fbBBbQ96FK+aXn/WeYImxqps0Ds32hwH81TZAo54pOLI0bRiVc8VitM 5PxFpL4+VrbIn9cn87kSGfnmO4aWbgSbKVZ14A3Y0TKi1/HTVvzc2omXwUnEqFrpdC9R 2jOGvIpOrByK9WOtf1qCrs0z1yun220E/gG765n99grZre4BncAQKUTfy31AiumDgw3+ SQqA== 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=xEO6IouQb5KpwYoEWBOTD/62M2WlZl/Y7WO5z86GWTI=; b=YADiyr5biGX+jo+Yy1ZjsNIIvoBrbpq01Eg1VSnQbzEIQp98Y4LMP4ludrbusQMWVO xYZxCpn/ecTy8RbeMFf2wtu67CRvcDpDqnmQDV6Ybv+G4aY8veHFhEvbk8uxFSXyhudo Iy3+slt0OkZiLBORCsBP7+bqGowaapBI8prlYbjs+1YSsxiooAgG3qrPbDs1YDxHyWYW Tef24tSlC5Gk3VzJHGl/vFdLeCDF1ncCejrosmqkj2UEtQXgr2AbfahMb5RNab9oGZpS bk2hqVYmY4p2bv6FAHjvDggJswTyftUwUMorwqFXwnA95bntD6B9lxxKqN77yEp+9dfI bLYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vFKn1O7n; 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 b16si4972665ejv.583.2020.10.17.18.24.52; Sat, 17 Oct 2020 18:25:49 -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=vFKn1O7n; 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 S2439899AbgJQX3l (ORCPT + 99 others); Sat, 17 Oct 2020 19:29:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:52064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727380AbgJQX3g (ORCPT ); Sat, 17 Oct 2020 19:29:36 -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 C2FA120878; Sat, 17 Oct 2020 23:29:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602977391; bh=PS7Jyely9I5EQo7o9XDjmMzSliznkYY025UjvCTWy1s=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=vFKn1O7nF82ARW/QwyVHB/4OAEDGAQ6EwVA7u5R37A8O9r6Kt1aLtNCu6D2TtbeIz 2hZxl7SDK0psca9x5xlqaVaBsb3L4TCcjcTNerN7ojapqP8pI2n3Il81IMOGWfDL+v bZ/FhVZlZhc7S59H/nIIRS6q5zesU1jlkI9yiCuY= Date: Sat, 17 Oct 2020 16:29:49 -0700 From: Jakub Kicinski To: Heiner Kallweit , Thomas Gleixner Cc: Eric Dumazet , Eric Dumazet , David Miller , "netdev@vger.kernel.org" , linux-kernel@vger.kernel.org Subject: Re: Remove __napi_schedule_irqoff? Message-ID: <20201017162949.0a6dd37a@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <01af7f4f-bd05-b93e-57ad-c2e9b8726e90@gmail.com> References: <01af7f4f-bd05-b93e-57ad-c2e9b8726e90@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 Sat, 17 Oct 2020 15:45:57 +0200 Heiner Kallweit wrote: > When __napi_schedule_irqoff was added with bc9ad166e38a > ("net: introduce napi_schedule_irqoff()") the commit message stated: > "Many NIC drivers can use it from their hard IRQ handler instead of > generic variant." Eric, do you think it still matters? Does it matter on x86? > It turned out that this most of the time isn't safe in certain > configurations: > - if CONFIG_PREEMPT_RT is set > - if command line parameter threadirqs is set > > Having said that drivers are being switched back to __napi_schedule(), > see e.g. patch in [0] and related discussion. I thought about a > __napi_schedule version checking dynamically whether interrupts are > disabled. But checking e.g. variable force_irqthreads also comes at > a cost, so that we may not see a benefit compared to calling > local_irq_save/local_irq_restore. > > If more or less all users have to switch back, then the question is > whether we should remove __napi_schedule_irqoff. > Instead of touching all users we could make __napi_schedule_irqoff > an alias for __napi_schedule for now. > > [0] https://lkml.org/lkml/2020/10/8/706 We're effectively calling raise_softirq_irqoff() from IRQ handlers, with force_irqthreads == true that's no longer legal. Thomas - is the expectation that IRQ handlers never assume they have IRQs disabled going forward? We don't have any performance numbers but if I'm reading Agner's tables right POPF is 18 cycles on Broadwell. Is PUSHF/POPF too cheap to bother? Otherwise a non-solution could be to make IRQ_FORCED_THREADING configurable.