* lockdep: access percpu variable too early
@ 2013-02-28 15:48 Ming Lei
2013-03-06 10:20 ` Ingo Molnar
0 siblings, 1 reply; 5+ messages in thread
From: Ming Lei @ 2013-02-28 15:48 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar; +Cc: Linux Kernel Mailing List
Hi,
The percpu variables of 'lockdep_stats' and 'cpu_lock_stat'
may be accessed before percpu area is brought up in case of
CONFIG_DEBUG_LOCKDEP/CONFIG_LOCK_STAT, so these variables
in non-boot CPUs will be initialized incorrectly.
As far as I think of, there are several solutions for the
problem:
1, just enable 'debug_locks' until percpu area is built
2, define the two percpu variables in a simple/stupid
percpu way inside lockdep
3, clear these two percpu variables of non-boot CPUs
just after percpu area is built.
4, ignore the problem
Looks each approache have its own disadvantage, so what
is your opinion on the problem? or better approach?
Thanks,
--
Ming Lei
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: lockdep: access percpu variable too early
2013-02-28 15:48 lockdep: access percpu variable too early Ming Lei
@ 2013-03-06 10:20 ` Ingo Molnar
2013-03-06 10:30 ` Ming Lei
0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2013-03-06 10:20 UTC (permalink / raw)
To: Ming Lei; +Cc: Peter Zijlstra, Ingo Molnar, Linux Kernel Mailing List
* Ming Lei <ming.lei@canonical.com> wrote:
> Hi,
>
> The percpu variables of 'lockdep_stats' and 'cpu_lock_stat' may be accessed before
> percpu area is brought up in case of CONFIG_DEBUG_LOCKDEP/CONFIG_LOCK_STAT, so
> these variables in non-boot CPUs will be initialized incorrectly.
What's the practical effect of it? Do we copy the value from the boot CPU and thus
the secondary CPUs start with slightly increased stats?
Thanks,
Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: lockdep: access percpu variable too early
2013-03-06 10:20 ` Ingo Molnar
@ 2013-03-06 10:30 ` Ming Lei
2013-03-06 10:34 ` Ingo Molnar
0 siblings, 1 reply; 5+ messages in thread
From: Ming Lei @ 2013-03-06 10:30 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Peter Zijlstra, Ingo Molnar, Linux Kernel Mailing List
On Wed, Mar 6, 2013 at 6:20 PM, Ingo Molnar <mingo@kernel.org> wrote:
>
> What's the practical effect of it? Do we copy the value from the boot CPU and thus
> the secondary CPUs start with slightly increased stats?
Yes, it is the major effect.
Also the arch dependent __my_cpu_offset might be initialized a bit late.
Thanks,
--
Ming Lei
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: lockdep: access percpu variable too early
2013-03-06 10:30 ` Ming Lei
@ 2013-03-06 10:34 ` Ingo Molnar
2013-03-06 13:37 ` Ming Lei
0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2013-03-06 10:34 UTC (permalink / raw)
To: Ming Lei; +Cc: Peter Zijlstra, Ingo Molnar, Linux Kernel Mailing List
* Ming Lei <ming.lei@canonical.com> wrote:
> On Wed, Mar 6, 2013 at 6:20 PM, Ingo Molnar <mingo@kernel.org> wrote:
> >
> > What's the practical effect of it? Do we copy the value from the boot CPU and
> > thus the secondary CPUs start with slightly increased stats?
>
> Yes, it is the major effect.
>
> Also the arch dependent __my_cpu_offset might be initialized a bit late.
I suspect we could try to fix it - post-initializing it after percpu setup sounds
like a viable option, if it does not get too ugly.
Thanks,
Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: lockdep: access percpu variable too early
2013-03-06 10:34 ` Ingo Molnar
@ 2013-03-06 13:37 ` Ming Lei
0 siblings, 0 replies; 5+ messages in thread
From: Ming Lei @ 2013-03-06 13:37 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Peter Zijlstra, Ingo Molnar, Linux Kernel Mailing List
On Wed, Mar 6, 2013 at 6:34 PM, Ingo Molnar <mingo@kernel.org> wrote:
>
> * Ming Lei <ming.lei@canonical.com> wrote:
>
>> On Wed, Mar 6, 2013 at 6:20 PM, Ingo Molnar <mingo@kernel.org> wrote:
>> >
>> > What's the practical effect of it? Do we copy the value from the boot CPU and
>> > thus the secondary CPUs start with slightly increased stats?
>>
>> Yes, it is the major effect.
>>
>> Also the arch dependent __my_cpu_offset might be initialized a bit late.
>
> I suspect we could try to fix it - post-initializing it after percpu setup sounds
> like a viable option, if it does not get too ugly.
OK, I may post a patch for review, but the arch dependent __my_cpu_offset
still need to be initialized very early.
Thanks,
--
Ming Lei
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-03-06 13:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-28 15:48 lockdep: access percpu variable too early Ming Lei
2013-03-06 10:20 ` Ingo Molnar
2013-03-06 10:30 ` Ming Lei
2013-03-06 10:34 ` Ingo Molnar
2013-03-06 13:37 ` Ming Lei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox