Re: [PATCH RESEND 0/3] tracing/mm: Fix suspicious rcu_dereference_check() usage warnings

From: Shreyas B Prabhu
Date: Wed May 13 2015 - 03:47:35 EST




On Wednesday 13 May 2015 02:24 AM, Steven Rostedt wrote:
> On Tue, 12 May 2015 13:36:01 -0700
> Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
>
>> On Tue, 12 May 2015 16:03:51 -0400 Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>>
>>> On Tue, 12 May 2015 12:59:26 +0530
>>> Shreyas B Prabhu <shreyas@xxxxxxxxxxxxxxxxxx> wrote:
>>>
>>>> Hi Steven,
>>>> On closer look, there is no particular maintainer who picks changes to
>>>> this file. Can you please pick these up?
>>>
>>> Perhaps Andrew Morton?
>>>
>>> No problem, I can take these too.
>>>
>>
>> I grabbed them, thanks.
>>

Thanks Andrew.

>>> + TP_CONDITION(cpu_online(smp_processor_id())),
>>
>> Are we sure these can't generate check_preemption_disabled() warnings?
>> Is there some reason why all these calls always occur with preemption
>> disabled?
>
> Good catch. I don't think the code does.
>
> Now, I'm not sure if we should just add a raw_smp_processor_id(). The
> idea is just to make sure that the CPU we are running on is online,
> because it is possible to call theses trace points when the CPU is
> going offline. If that happens, then there's a race with RCU.
>
> Since a task can not be migrated to an offline CPU, we don't need to
> worry about the cpu_online(smp_processor_id()) returning a false
> positive. A false negative would just skip a tracepoint, but I'm not
> sure that is possible either.
>
> In any case, comments should also be added to why the condition is
> there.
>
I'll send a patch adding the comments.

Thanks,
Shreyas

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/