mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yunsheng Lin <linyunsheng@huawei.com>
To: Jakub Kicinski <kuba@kernel.org>, Peter Zijlstra <peterz@infradead.org>
Cc: <davem@davemloft.net>, <linmiaohe@huawei.com>,
	<martin.varghese@nokia.com>, <pabeni@redhat.com>,
	<pshelar@ovn.org>, <fw@strlen.de>, <gnault@redhat.com>,
	<steffen.klassert@secunet.com>, <kyk.segfault@gmail.com>,
	<viro@zeniv.linux.org.uk>, <vladimir.oltean@nxp.com>,
	<edumazet@google.com>, <saeed@kernel.org>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linuxarm@huawei.com>
Subject: Re: [PATCH net-next] net: add in_softirq() debug checking in napi_consume_skb()
Date: Thu, 19 Nov 2020 17:19:44 +0800	[thread overview]
Message-ID: <b00f1c28-668c-ecdb-6aa7-282e57475e25@huawei.com> (raw)
In-Reply-To: <20201118082658.2aa41190@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net>

On 2020/11/19 0:26, Jakub Kicinski wrote:
> On Wed, 18 Nov 2020 16:57:57 +0100 Peter Zijlstra wrote:
>> On Wed, Nov 18, 2020 at 07:43:48AM -0800, Jakub Kicinski wrote:
>>
>>> TBH the last sentence I wrote isn't clear even to me at this point ;D
>>>
>>> Maybe using just the macros from preempt.h - like this?
>>>
>>> #define lockdep_assert_in_softirq()                                    \
>>> do {                                                                   \
>>>        WARN_ON_ONCE(__lockdep_enabled                  &&              \
>>>                     (!in_softirq() || in_irq() || in_nmi())	\
>>> } while (0)

One thing I am not so sure about is the different irq context indicator
in preempt.h and lockdep.h, for example lockdep_assert_in_irq() uses
this_cpu_read(hardirq_context) in lockdep.h, and in_irq() uses
current_thread_info()->preempt_count in preempt.h, if they are the same
thing?

>>>
>>> We know what we're doing so in_softirq() should be fine (famous last
>>> words).  
>>
>> So that's not actually using any lockdep state. But if that's what you
>> need, I don't have any real complaints.
> 
> Great, thanks! 
> 
> The motivation was to piggy back on lockdep rather than adding a
> one-off Kconfig knob for a check in the fast path in networking.
> .
> 

  reply	other threads:[~2020-11-19  9:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29 11:34 Yunsheng Lin
2020-10-31 22:38 ` Jakub Kicinski
2020-11-02  3:14   ` Yunsheng Lin
2020-11-02 19:41     ` Jakub Kicinski
2020-11-18  1:57       ` Yunsheng Lin
2020-11-18 15:43         ` Jakub Kicinski
2020-11-18 15:57           ` Peter Zijlstra
2020-11-18 16:26             ` Jakub Kicinski
2020-11-19  9:19               ` Yunsheng Lin [this message]
2020-11-19 11:41                 ` Peter Zijlstra
2020-11-19 12:29                   ` Yunsheng Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b00f1c28-668c-ecdb-6aa7-282e57475e25@huawei.com \
    --to=linyunsheng@huawei.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=gnault@redhat.com \
    --cc=kuba@kernel.org \
    --cc=kyk.segfault@gmail.com \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=martin.varghese@nokia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pshelar@ovn.org \
    --cc=saeed@kernel.org \
    --cc=steffen.klassert@secunet.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=vladimir.oltean@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®