lkml.org 
[lkml]   [2016]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] kcov: properly check if we are in an interrupt
From
Date
On 09/27/2016 09:50 AM, Dmitry Vyukov wrote:
> On Tue, Sep 27, 2016 at 9:34 AM, Peter Zijlstra <peterz@infradead.org> wrote:
>> On Tue, Sep 27, 2016 at 08:21:32AM +0200, Dmitry Vyukov wrote:
>>>
>>> I suspect there is a bunch of places that use in_interrupt(), but mean
>>> the same as KCOV wants -- am I in interrupt? and not am I in interrupt
>>> context or in normal task context but inside local_bh_disable(). For
>>> example, why does fput handles closure asynchronously if the task
>>> called local_bh_disable?
>>
>> Agreed, but it would mean auditing all in_interrupt()/irq_count() users.
>
>
> I don't think this means auditing all users. We are not making things
> worse by introduction of a new predicate.
> It would be nice to look at some uses in core code, but the only place
> with observed harm is KCOV.
>
> Any naming suggestions? Other than really_in_interrupt or
> in_interrupt_and_not_in_bh_disabled?
>

Your patch was:

- if (!t || in_interrupt())
+ if (!t || (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_OFFSET
+ | NMI_MASK)))

But look at the definitions:

#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK \
| NMI_MASK))
#define in_interrupt() (irq_count())

So isn't the patch a no-op to start with?


Vegard

\
 
 \ /
  Last update: 2016-09-27 13:22    [W:0.602 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site