Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp253579imm; Tue, 22 May 2018 18:11:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpFDOI4cpi4mkdy0rlDQmpiUuPtjlcAh/nG3N/U0LNI12r37ClymHrKXw3dgfTktYlnS1YU X-Received: by 2002:a17:902:aa98:: with SMTP id d24-v6mr744670plr.185.1527037891597; Tue, 22 May 2018 18:11:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527037891; cv=none; d=google.com; s=arc-20160816; b=drtFGbS6fVfOW2/DHTwb2kdD4w/vA19UaBnc3Sx/OOMkZjWF82VzeHjZMEqS4oICt+ B7jh7g/V6BeajL7a63QLgZ64konpm9/qKylXVGZUNwirZMAuS1m9MdXWdy/7U4NLNRIa vNkWZF4CAuFZV5HDnr17G3Qhk09aBMXKYPUyWhH7Nd3kNlAgYlU/Cs+bC7P5gz2SO81C a4Gaf8uUCHkkHR0UQU/Q1h8/dSM88USGgPEiw1D4Etf9rsZbwgp5P2wWQKiSxpiSA/NL H4QzQwlIhEhku2EFQroNr8YHF3HTJuH6vTUpZiT34+lBZXuZRRHuj0Sp0VjdQWP0QYiG DWKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=SrGAh2FP8RMeSNL72mzVCkcHz65iN0691iuqjdfMce4=; b=f8RLcO34lV7GSSCvj1a5jDFKW0Y5i4oYyDawLhUaU9QD86LVmBUqU4jLug2pDh6uaW QssdFwWxeuAWe75vo5vmWpoRpJ0vcOx54jiMaON7S1reXk1Ji2swCvUV1l71kIL7T1kF ctJX8QmY1sD8O+qGlpzlVdcbO4xNlXYxE1d8u+ezkACWTdkJQKlaZ1o/tvBfTGzvxJKO OF+fZ/AkrOpg5aO6gqAe4016Dl+qfEwqlwaYgpTDq9AKuWloc+bYwfRdKRyIhE3iFeR+ nwWabKkXN74NvnGAltijeo1vHKkXi5zVeS97guIuUWrYjtaL0XBj2kBl36LIWLe54SRv kl4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HiotTHmB; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s14-v6si13550198pgf.263.2018.05.22.18.11.01; Tue, 22 May 2018 18:11:31 -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=@gmail.com header.s=20161025 header.b=HiotTHmB; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753654AbeEWBKu (ORCPT + 99 others); Tue, 22 May 2018 21:10:50 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:34278 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752654AbeEWBKt (ORCPT ); Tue, 22 May 2018 21:10:49 -0400 Received: by mail-pl0-f65.google.com with SMTP id ay10-v6so11942737plb.1; Tue, 22 May 2018 18:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=SrGAh2FP8RMeSNL72mzVCkcHz65iN0691iuqjdfMce4=; b=HiotTHmBZzf5GRUqrYPEbdfS9cUZtignwAlfILyk6I+C+WltDz7DT4dXedtbowdcRW XCisajmpone4ES+t5/uQXEMBP1uATSqatzESWYQA6KoM0+s7kSVM73jhLqvnScEgBdyC kuegJWBUFxHF5TwrYm0cCfz3jsGTYaNivVIit9ofRsLvYEDr6c5QA5yHvitQg5pO+qb6 XzeGjhAdnJBdWSMqk4iuAZ5r1LwArBW/yJSlntYGAqCunfjAG1kvjAtALPp7oBqta+CP kQYGF0Eqm6ti+NxMM6OnJsSYvBd/bv4XIW1dRHXT1S6LLW+MPJZpzofHxJNGLzIS/Clj FFmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=SrGAh2FP8RMeSNL72mzVCkcHz65iN0691iuqjdfMce4=; b=dvJpxoZXx0PEtuxJMCMnxOli6FLE2HxBYNi1vJTwsLSYiRUL/7WvlZc+nuMI8DmCaz K6RkLP1erOwVMAWJEHzAmqXMRMR72w0zKe379nGqcaBUuOcAd2j02BcOLX/nIm84o65v petv9oOM4Aa9dTM+UYYcfDL2EsAFWpiowZT5vqczjGEaXqGbFH0WzXw4rRoKOoHBa3CD jdjF5EZEQTRyW4wQQ2jtIcd26dMpkC8Oi2/JJ+jpzsCQZ9fXyvsoIMy4ftiSt4VZrdJk /aWMQLGTT4SyotmoxDPJ63A3WG8nUXo/fOqSjkQ6ubgjljVVAIUTW56moV3Y2LioDbdP h4pw== X-Gm-Message-State: ALKqPwexl7FG6iC1YLvEmDWuF7Vj/t/CkxRtxgURyEAEPdCovcbnFz6a pB/xcy+Z/qKXVQ0gRaRl0cGHIWiFoSb/lws1K28= X-Received: by 2002:a17:902:20e8:: with SMTP id v37-v6mr744474plg.354.1527037848812; Tue, 22 May 2018 18:10:48 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:90a:b398:0:0:0:0 with HTTP; Tue, 22 May 2018 18:10:28 -0700 (PDT) In-Reply-To: <1526932984-11544-1-git-send-email-vladbu@mellanox.com> References: <20180519.230258.1374885458106197707.davem@davemloft.net> <1526932984-11544-1-git-send-email-vladbu@mellanox.com> From: Cong Wang Date: Tue, 22 May 2018 18:10:28 -0700 Message-ID: Subject: Re: [PATCH net-next v2] net: sched: don't disable bh when accessing action idr To: Vlad Buslov Cc: David Miller , Linux Kernel Network Developers , Jamal Hadi Salim , Jiri Pirko , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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()...