From patchwork Fri Dec 10 19:35:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yannick Vignon X-Patchwork-Id: 12670899 X-Patchwork-Delegate: kuba@kernel.org 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 1F270C433FE for ; Fri, 10 Dec 2021 19:56:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229736AbhLJUAb (ORCPT ); Fri, 10 Dec 2021 15:00:31 -0500 Received: from mail-am6eur05on2051.outbound.protection.outlook.com ([40.107.22.51]:17409 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S243533AbhLJUAa (ORCPT ); Fri, 10 Dec 2021 15:00:30 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L+7KPfolRG62C69aFBesIR2ye+IUYeQXjKOode/wB7Q3+tnoywQeJjPAIjVIBggRS/8STwY+7goarzcPUgXFgDIQ/OkrjGoCS3ZLtn4k0Ki8gougj1rwj3h5Kyc7vsOsv/fdQH/Bei+34CUs7OoyXZaXZYPKN0HX0LFhQDBa+oGH1F6sGacOwmXq9HIuMBY1ymyAgzcK5sdUA1N1e3CjEoia+wZK3g4miuwuGVfuHkK5MthOLMitMsnvU/5LZmcwQC9pqm2ppv3zyKmnwQoa4v9lSCYvRXRxYuqrAUAtC99GhEsJYqdG0QRCpRDyqjt+BQiZDMgVlxFCZJKrZdKE8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7dFiGDMGs5F5cassm7niXUFHzYDlU8RiOfoHPNyOdac=; b=J237X0IcvtWi8oRKVN8VKoBhjBsMtzi2qpXmAqDRTejQ/0z5QgQL1L3KVkeFDIleBNwx1FZKlUEzhxX2kPhC0Ek8xLjCAZsxRi+qkK1wH7HCB2MsTwLbYYIYW4m8e5NGLcvL5PdBXUmoFpUVFhCv2EIPBjraiDjmlgq6D4coY/tjvmzw2tj/DLGw5L7KMwiV2zShmDU+N9KwjQ0pCM/Kp1qn6k/UbyhNyHoyySldfImvRV3S/Vbh8IbZv7wlT0vDR9YzWMWNMWRHukIw2Eb9clrVket8HsQGPHqxUTcGJ1axaRxeHC67HhRzXSu6iRMMmlIvdNjNMCQkCxi0AD26oQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7dFiGDMGs5F5cassm7niXUFHzYDlU8RiOfoHPNyOdac=; b=F11R/rY/ttwusmj4U595t0bdNNQQ48qQ/qBoouA7ZWx1uluxJAdtlTXeW7o2Op7X8DXXv6C+ckKNqq9r55lrH1klzk8zA5Yju446Pf8EmE91WCqWlbUaIAgCmRkyhs1YuODNgKuCyVHb/hskOmqvV3vmHFIgDPqR93kgKTxCcME= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU2PR04MB8807.eurprd04.prod.outlook.com (2603:10a6:10:2e2::23) by DU2PR04MB8887.eurprd04.prod.outlook.com (2603:10a6:10:2e2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.20; Fri, 10 Dec 2021 19:56:47 +0000 Received: from DU2PR04MB8807.eurprd04.prod.outlook.com ([fe80::59d5:83c8:cb6a:a115]) by DU2PR04MB8807.eurprd04.prod.outlook.com ([fe80::59d5:83c8:cb6a:a115%6]) with mapi id 15.20.4755.022; Fri, 10 Dec 2021 19:56:47 +0000 From: Yannick Vignon To: Giuseppe Cavallaro , Alexandre Torgue , netdev@vger.kernel.org, Ong Boon Leong , "David S. Miller" , Jakub Kicinski , Jose Abreu , Eric Dumazet , Wei Wang , Alexander Lobakin , Vladimir Oltean , Xiaoliang Yang , mingkai.hu@nxp.com, Joakim Zhang , sebastien.laveze@nxp.com Cc: Yannick Vignon Subject: [RFC net-next 1/4] net: napi threaded: remove unnecessary locking Date: Fri, 10 Dec 2021 20:35:53 +0100 Message-Id: <20211210193556.1349090-2-yannick.vignon@oss.nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211210193556.1349090-1-yannick.vignon@oss.nxp.com> References: <20211210193556.1349090-1-yannick.vignon@oss.nxp.com> X-ClientProxiedBy: AM0PR02CA0153.eurprd02.prod.outlook.com (2603:10a6:20b:28d::20) To DU2PR04MB8807.eurprd04.prod.outlook.com (2603:10a6:10:2e2::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sopdpuats09.ea.freescale.net (81.1.10.98) by AM0PR02CA0153.eurprd02.prod.outlook.com (2603:10a6:20b:28d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=) via Frontend Transport; Fri, 10 Dec 2021 19:56:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f2f7dc36-2d0b-4470-a75c-08d9bc1732ae X-MS-TrafficTypeDiagnostic: DU2PR04MB8887:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AAp/NsxA81xwkEicc+O5W9CE2NAKA3V/OHk2W3lhPdT0u15bqUfa0F1pHsrd2CaaMkqHTJWT51LoPYGIEW+l1n/uBw54GdB+n8u3N64lUb38TngdxupxacDo5C+Au4xPim/H/9/EWDPrS6V+ocCiZAUdf1btfJzcFwfwmhpdt3ozmnR+nN2swgSvvb47C16p4x/yVZSMBVhwSVxD9ob9FGrTDp1roJFTP0FAL7ajUNsRftYK7E7Rhr9JoU8LD533N9bCqlYrZXRhzzU9V63zcZ5BdMp4ETsVyKGCqX/7YAQKPMEhX5X9f66AWD/6noiJjpDNrAA/ZHuRGHGOLorp7gfHMpksGs8tEOfpHm/SNMy1qXF6iHSjC44A5AXaJxezyrq6mdezWJjgFg/gA9S62N/wOBNSbArkPmUaaQYyZv5t/wuIS5uwl5S1NFylzxRm+1aJ1GNRn+V/eun/e7JMy8FnD68X8F/hIcvIXegMgM6ff5XCc25Ta4YlFc68NmltwTsgxOBu35+zwQWPqsbnKlcw1ikt5XFo6L3p03PW1no/OuDHUj0SALzSpkmJyxaqM9sWeXw2x4gelArttRJUBkp/QDS737XhjFe+3iHIAkE2Rms3maDHGs4q5q7+QKlr0iC9HtTWF/C39w+C55EsKDlLZRnDRHtlPqs9f5vR0n6kfduZRpSJjwLgV3rRkKCGE1RbwgU2AZKP1koNVLJL8fuGj8avOfAaBwjDfuLYDes= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8807.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(4326008)(44832011)(316002)(186003)(6512007)(110136005)(921005)(38100700002)(1076003)(6506007)(8676002)(5660300002)(8936002)(6666004)(66476007)(52116002)(83380400001)(66556008)(66946007)(86362001)(508600001)(6486002)(26005)(2906002)(2616005)(7416002)(38350700002)(956004);DIR:OUT;S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sVu6pjKfTgvELcYUSybklu2w9w01pX5WF/ZBmMlnJzYJc23NCa+kUaxU+MzXnuB6ZeJU71qmnXyP0V4IYd1icdgA/fyGA9D4W6eiyxEhiabpw08mn7iMzeaYM7PE1Uq5VrutsgkRRZeyrJ0NgwSpWxcNesrFItgerLwu1C5bYMUEOJ+3H27+S71h+Pu6SlEzNGXXqbSXmj5/5Xc/ZryRdcupHDlxz7ivCsaYE02OKyP7+NAOkajqcMKksJrfxlw/M0qSQ5ifxmlTbdkeSvfEyudMuMHZzq++8v9ILCjPSGTk+yKw0OSTYhvRAo2+9wb9Zr3EfYjcdGXy5N0dt0nUWRHeJgRdRstdx1OH9mXX7R1LIr/PjxoxMUnmhDZj9dt3vGxxSEmC9GJ9eBEYVAvZYniHBuS96GXORXmvT2kY8UL4U1QhpWj5uK9ILApk4HVbpFiYUwph8MzVvW1ZVbilHHx+2rEW/XQh8Gp5u6D3k0LxWrIpq8NC6Wqbrh6bY7oAVDqnpB00R6xlsC9TCyxveUlIqLY1Y98WlVWWi2LKjPfhvboPnw0ROg11e3s+T8k74TF4f4ZWZBhHvQDaXcGNRY+EoiS4FMxQDvN8Z1vHzxifF8= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2f7dc36-2d0b-4470-a75c-08d9bc1732ae X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8807.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Dec 2021 19:56:47.2014 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: w1jjZLscxr2XVFyiNPwLo9sjNC8g44bIF+upmpcopvpfEBwPtF0HXzafee7f6k3qcY4TSQJrA6UBpfGodCRI9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8887 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC From: Yannick Vignon NAPI polling is normally protected by local_bh_disable()/local_bh_enable() calls, to avoid that code from being executed concurrently due to the softirq design. When NAPI instances are assigned their own dedicated kernel thread however, that concurrent code execution can no longer happen. Removing the lock helps lower latencies when handling real-time traffic (whose processing could still be delayed because of on-going processing of best-effort traffic), and should also have a positive effect on overall performance. Signed-off-by: Yannick Vignon --- net/core/dev.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index 15ac064b5562..e35d90e70c75 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -7131,13 +7131,11 @@ static int napi_threaded_poll(void *data) for (;;) { bool repoll = false; - local_bh_disable(); have = netpoll_poll_lock(napi); __napi_poll(napi, &repoll); netpoll_poll_unlock(have); - local_bh_enable(); if (!repoll) break;