linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yunsheng Lin <linyunsheng@huawei.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Jakub Kicinski <kuba@kernel.org>, <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 20:29:26 +0800	[thread overview]
Message-ID: <75dbd476-2e0b-f4e6-4cb0-fff6f659ac8e@huawei.com> (raw)
In-Reply-To: <20201119114149.GI3121392@hirez.programming.kicks-ass.net>

On 2020/11/19 19:41, Peter Zijlstra wrote:
> On Thu, Nov 19, 2020 at 05:19:44PM +0800, Yunsheng Lin wrote:
>> 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?
> 
> Very close, for more regular code they should be the same.

Thanks for clarifying.
So I assmue the lockdep_assert_in_softirq() interface we want to add
is regular code, right?

> .
> 

      reply	other threads:[~2020-11-19 12:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29 11:34 [PATCH net-next] net: add in_softirq() debug checking in napi_consume_skb() 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
2020-11-19 11:41                 ` Peter Zijlstra
2020-11-19 12:29                   ` Yunsheng Lin [this message]

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=75dbd476-2e0b-f4e6-4cb0-fff6f659ac8e@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;
as well as URLs for NNTP newsgroup(s).