Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp488465imm; Wed, 23 May 2018 00:00:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqzfChsFn1ePRi2T9Q8Z+72Er+mnFcSDdj1d1npTAwspKWUnFdBjrYnLX/emzKuwXzlgM2D X-Received: by 2002:a63:788e:: with SMTP id t136-v6mr1376890pgc.424.1527058833633; Wed, 23 May 2018 00:00:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527058833; cv=none; d=google.com; s=arc-20160816; b=FVHmuHk20sKfecahgiClSUrOpVYt8/vEFeDMQhQWoV8fWwoCnsDciFwznEXRMSrJR/ KCIpjHLSl6MmGCywSueBjjLmww3ZxUxYsliDlCYY7IuNs8gosbchkCtxSHrsUMGfngqW hMv3DB/N2g5AqRZy2V8zk1NqjyHNzB0JEtCg4DnHbmVRJ3FrkibwzWNe7YC4DOsuoaBr eXXWPWP/eBPaabmXArBmOld5CeXxOhsCJrqELYSF7W+QQ/PLEPGtm7dfi4i/Ij/tP8Av PYV3hHFdrCZ9fs7JyCXYW2EhcCsTLlp5nejesYno0TivbHhMY0K5GNXNa8+4jPAp90jz VRSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references:dkim-signature :arc-authentication-results; bh=BC+Pof5Nka4iD0461s3ZJlU6b7H0dJrBeUT3shbM8nI=; b=jsK4ujuGC6fB9fFXj6F2QDzQALqph67+XTKLS4yjicwTwCoQbmG7jsnXjILakgQfHM 1otcC6pfsBHj6Qoavdp0G1BdwPbSJflrd1wloAx25iZ5UkhumspMX7WsITJjhyJtq2do oSk73F0mRIt4CnngP9TQqf2wcDbD54lRdvhBo914d7u9WYLQyYxwRo7b7iyXaP+Obi4m JwRDQS1srXE+a5YobkrUyQhO8wPlqX5saa/mwpIlA8YBcMEwHlbriZNAvmGaYByBK2mU VZJsqXIxnky2X5vOiZ+jtZcd3fmFJjnl19C/3r7mNfUgUvgzyahfssLL1GxI84IgagBL lS2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Mellanox.com header.s=selector1 header.b=L9lUufrC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5-v6si18531658ple.417.2018.05.23.00.00.18; Wed, 23 May 2018 00:00:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@Mellanox.com header.s=selector1 header.b=L9lUufrC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754124AbeEWHAG (ORCPT + 99 others); Wed, 23 May 2018 03:00:06 -0400 Received: from mail-eopbgr40061.outbound.protection.outlook.com ([40.107.4.61]:61440 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754005AbeEWHAB (ORCPT ); Wed, 23 May 2018 03:00:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BC+Pof5Nka4iD0461s3ZJlU6b7H0dJrBeUT3shbM8nI=; b=L9lUufrC9WDUFD/5R2ZjpprgkxHmR3mWvE4MiJSEnAMC0ESyrnLLfWMOVQ00QSdB6FIlYlVTCfm4i6gsiDPweuDfqYA4IUTyO0Ov+KC/901PGICxOAGvIHlPBLHMLuqbaFk1wfbiFALOzw6RWtXEmicx55Dyt4MeIL0nSlBmWKg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=vladbu@mellanox.com; Received: from reg-r-vrt-018-180.mtr.labs.mlnx.mellanox.com (37.142.13.130) by HE1PR05MB4700.eurprd05.prod.outlook.com (2603:10a6:7:9a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.776.11; Wed, 23 May 2018 06:59:56 +0000 References: <20180519.230258.1374885458106197707.davem@davemloft.net> <1526932984-11544-1-git-send-email-vladbu@mellanox.com> User-agent: mu4e 0.9.16; emacs 25.3.50.2 From: Vlad Buslov To: Cong Wang Cc: David Miller , Linux Kernel Network Developers , Jamal Hadi Salim , Jiri Pirko , LKML Subject: Re: [PATCH net-next v2] net: sched: don't disable bh when accessing action idr In-reply-to: Date: Wed, 23 May 2018 09:57:34 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR0102CA0073.eurprd01.prod.exchangelabs.com (2603:10a6:803:15::14) To HE1PR05MB4700.eurprd05.prod.outlook.com (2603:10a6:7:9a::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:HE1PR05MB4700; X-Microsoft-Exchange-Diagnostics: 1;HE1PR05MB4700;3:4n7UYmDxIhQ82DJcnhIg3PdxaN2O3XPIFXL7MDbgYg4eSP5wHMP0iMeHV8y3nFiVgMLJHaLisgiLnI9PYRw3cs4H+69RiioxX2tzUDFkDMFzY1I7Rx3MO5P5VB8m/c1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5sZHDzNyEiffAl36VhXzb00VwhlqJkdQih8ayyUot9NZumZQlz8Nk5zNF980bCm6igmor08mRWmktDk5Sb6wzxHLc3W9V2jSCpwvcu0zHDdmLJaV7oPAZHhQvJdM6ugR0gO6dunxHxNtPCUeLyjYCkmJbAfRdBkQUrMhbJIkuL/iENPLax9bAsPzEUviY0y2i4A1fgYqDKY4M7XPiDqN3I04;4:MBiKFFtGAA0BYPAR2ke4i9OVIPEdFeGTUjmhazRLN90vsF7e4xtTMD32hxOYFDV4F79h4L//BfiqOcY4mh9xw6zaokh6a6s/xbQRPBnEa+2pVFacXsZc1GyMQaALtpE76BDMAMhl3jtHo0vom+qOX+j6wwuJGcxLuwKOWLJ7AgL8ZUtpTCcQ3fNi0pXPIGQFj6rzDdBrLzUzlx5OnO8HeHeFoVlf3xS/1eCi0tOiGQppZ665YJims3jUVd764MQwL/O0Z56D3G9PWkXZQR0/CZ92NfKuVLUN8sODg4KP0FBQSu9QxYaXN1fPEIFcs4gmxm4gzuFTo2IfdgDdUHuE8/ZX3ylPLJChPdGoeEVXd10= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85827821059158)(788757137089); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231254)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:HE1PR05MB4700;BCL:0;PCL:0;RULEID:;SRVR:HE1PR05MB4700; X-Forefront-PRVS: 06818431B9 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(366004)(396003)(346002)(376002)(39380400002)(39860400002)(199004)(189003)(76176011)(3846002)(53936002)(52116002)(2906002)(39060400002)(7696005)(6666003)(305945005)(229853002)(6246003)(59450400001)(66066001)(6486002)(53546011)(7736002)(386003)(4326008)(26005)(51416003)(6116002)(106356001)(81156014)(105586002)(9686003)(81166006)(186003)(47776003)(6916009)(16526019)(6512007)(8676002)(8936002)(50466002)(5660300001)(956004)(486006)(478600001)(16586007)(68736007)(97736004)(476003)(58126008)(316002)(446003)(86362001)(25786009)(54906003)(11346002)(48376002);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR05MB4700;H:reg-r-vrt-018-180.mtr.labs.mlnx.mellanox.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;HE1PR05MB4700;23:ok4ymQDBQPUFNGaSsF72zF3W3a/BV7vtytQs4NoD1?= =?us-ascii?Q?NPzqdkqg7qoiwJzZ5TP2LadR9SSlOEj4RUXkqW9qtT5J8XBK+preC+OIiq9x?= =?us-ascii?Q?8gMkOJNO7R6HKTfQFxeNaPNlCkQ8528jYsLPCXUD6k8eaWz0csbxGJt01AtY?= =?us-ascii?Q?pEz39rfx1CeYU5OMGyjZRKrRr6Y6wkf9zbUO25ResC0Qlx9U/GoCgQkUDn73?= =?us-ascii?Q?pCDq+Er1o3oqRWi3yAc748+gEWim1LI0qMsGQ6jHvCQPMuh7KWYgH3AK223w?= =?us-ascii?Q?zPopLiSyz+zX82N5+odMqnLeEFx2B3fXb0kGMPcCbeiFHF67jAFhkgYI4OoE?= =?us-ascii?Q?fEr+6Kq2egg0s0YIzfzJTBiHQqkJqbHuzO2CD7LNai9TFsfXg1biAlSTLwJC?= =?us-ascii?Q?KqqUQtzxmj2ig1eLVMDXat3Nmsg0o8sv1e5hYiGz7HXTzzyrFo5NK+6l+bfU?= =?us-ascii?Q?8nKTe8tpZZJ/6YEX0lMzA/mozEJTaAFtqP+KrigXrGsQ2BlAJjgvF4u/lDHa?= =?us-ascii?Q?SkpboK1tVAyjlmLj6SPub715bnimMTmhvSPttqrRHYbdJh6PZz7M3mH0+VFF?= =?us-ascii?Q?mLFEYJdVcQ4R7TtPSprVR+QyZfc816g8J2mq/cxn44bJeEuMv7UnSvSaiPJE?= =?us-ascii?Q?1iE44aTamp5zPeX70CbBW633CbRT9hmOZzf6ObfuxnlLt9qkHz1GsU+AFprm?= =?us-ascii?Q?kjuoKdWiInoPAqnkBwl12+55xvjefgUsiwRMZ323TjirprKlnJqTNxn0aUQU?= =?us-ascii?Q?PQtZNOXhWX+yPq9cd5CBaT6FRn7G4MaehKbu+ZDfpMA+gx2TgwsfJ7j4JQ6x?= =?us-ascii?Q?FeyH1KfKvMRRvdIrtXJGkuebU3ck/KZ38SMRFXXf5VF867WF+QlWZ48hFCBf?= =?us-ascii?Q?sKtgP8SoxAqmhoz3gWr6nrBbLAebespAipEAZa9ktxdXp6U0eLRaI9yP7jJb?= =?us-ascii?Q?/wlxKMaM7FtgUtSytPyBvbW2jBBAIFcYSutyDYNb7MWDC8Sv9NFbL5G/gSsx?= =?us-ascii?Q?majce3U6NDzfpKzuF4Oyjiyc2Cbv77j1shmvk4umYQQ/v2RF2YSZIlLV3pWH?= =?us-ascii?Q?PtUEPQaq98yaKM7noV8xCZSNTXpscCK5nMuS5XgmRGeK9yGuMnhTW8vsv26z?= =?us-ascii?Q?1FgUEC6XNJqsobDWqTE1dKF5M0SJkV3yEqRvT+mywRvVEmebWO8Ig+UzBp2I?= =?us-ascii?Q?s0O9HswB+xUjKxB2xl5xTAshHkcTL2AIwZ5K+oZZFkpuOeJxtEmvr1qOzcG3?= =?us-ascii?Q?DADSrOxHI/T4FN2q61sTpjf1agKvApYNtUwHNcvjk9dIwgg0SpXP+XimKphe?= =?us-ascii?B?UT09?= X-Microsoft-Antispam-Message-Info: CWDZZsObZbL/grsPbeFosdWG3U+jxuW8Ih/wsjpMM4BSLy46GmfHEbh8ACqQ0FPYahUzlXv2VMEWXgHOqznaHi9iQVgiPCChVeILcGBRzMNaRvvJ2C83Ns572bvYIHZOidts+4lSH7o0XlcZqw2HSfSW4KcEudDduZjqRFBI9iSIpMh0fMpVG5drMqIFCTMM X-Microsoft-Exchange-Diagnostics: 1;HE1PR05MB4700;6:36gm8V2pVW3znIGlF9/m8nMxH6RDy8KKnMclj43p3SVEUD0GbeB+IFjLAG5saYe9V+lu3UK+Yq8XZPhyTEJcNiFptj92aKTSvmz+USYHNqalz8HwztRmRDHmbk7W917+y8gJ7FhPUm0uyUblPyfwCv5ZiSuVkf4so4QV/If3LefaqBNqx+N5GU+vjAKNCrh0G5XgG71TY/vaSXtfpaVIf9hGG0pd3mqpEoLzpgjHedYGbtP8n9awPMCSu9sweBGpraz7SGDNK2nCIjd7tB7LTaMSvTrB/1XsGe+B14yq2RK/RjcBcbeE/UZ4qAkWDClqvtKuShnT8PbD2g4iJKiwT5t/+KbaP9kiPH6zQuha20tLIcQADUI2FMuJGDWrxN+CSen/wf+h9q+SUrq6mg3BKgfEfAR0ujD5HVwcmgBebYgoUJOLOo8ViSqZLgl2FLg+NOIIgwfycWNLdnYlaXgiWQ==;5:puDdzAstX7r9y0WrY5pE/Ptc3KNlZoAgxymiJY8Yccd3N+wH38ofW5kvE4kDi3EIEjvikEro/8jExb48buSxDUjk3jWzm9fR/l+YbWc0uQQwyWGLve6GwzTRjWPlE/6GSt18KFAxeV8MF0dz3VBBr4mFu/r7tVcCH3whrds3f98=;24:NU5XYJMP7xGGHTFj1Po13z21Fx5YcmL96tCQmB1zn0aNQx2fHmAmHDauBCaKSO4lpsQ1MfDtylHtcRpe5c7FkPrswCgOIKVAbImexj+e/HA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;HE1PR05MB4700;7:yPmipzpsWu4bqs4x2uAab4SCpcqVjM3bOj91LrBtwuCbmJN9+xP5rhHP+piRRALqsp+3c9fFOwbysxfZ1eHm86KMzADRp455JR2JVjRzOtYZ/KKKAHQDLfE1dSeC6cz1Hyf1lg3d8jthUmX5yZsbSIyqZWDAE/1q5IoUP/NxhBDsYybXYLtiqFNrX5gvEHpRF/ZbfWN69cbVvgLAt00CkStcr0qJyV0aLSAvvm+TBgRlrvzMCNKWkGmh8+S1mHSR X-MS-Office365-Filtering-Correlation-Id: cc65ce38-ff59-4885-ea37-08d5c07acb62 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2018 06:59:56.0780 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cc65ce38-ff59-4885-ea37-08d5c07acb62 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB4700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 23 May 2018 at 01:10, Cong Wang wrote: > On Mon, May 21, 2018 at 1:03 PM, Vlad Buslov wrote: >> Initial net_device implementation used ingress_lock spinlock to synchronize >> ingress path of device. This lock was used in both process and bh context. >> In some code paths action map lock was obtained while holding ingress_lock. >> Commit e1e992e52faa ("[NET_SCHED] protect action config/dump from irqs") >> modified actions to always disable bh, while using action map lock, in >> order to prevent deadlock on ingress_lock in softirq. This lock was removed >> from net_device, so disabling bh, while accessing action map, is no longer >> necessary. >> >> Replace all action idr spinlock usage with regular calls that do not >> disable bh. > > While your patch is probably fine, the above justification seems not. Sorry if I missed something. My justification is based on commit description that added bh disable in subject code. > > In the past, tc actions could be released in BH context because tc > filters use call_rcu(). However, I moved them to a workqueue recently. > So before my change I don't think you can remove the BH protection, > otherwise race with idr_remove()... Found commit series that you described. Will modify commit message accordingly. Thanks, Vlad