2006-08-22 12:22:39

by Sharyathi Nagesh

[permalink] [raw]
Subject: Re: [patch] pi-futex: missing pi_waiters plist initialization

On Mon, 2006-07-24 at 13:21 +0200, Heiko Carstens wrote:
> From: Heiko Carstens <[email protected]>
>
> Initialize init task's pi_waiters plist. Otherwise cpu hotplug of cpu 0
> might crash, since rt_mutex_getprio() accesses an uninitialized list head.
>
> call chain which led to crash:
>
> take_cpu_down
> sched_idle_next
> __setscheduler
> rt_mutex_getprio
>
> Using PLIST_HEAD_INIT in the INIT_TASK macro doesn't work unfortunately, since
> the pi_waiters member is only conditionally present.

Hi
I felt it would be more appropriate to put initialization of
pi_waiters in fork_init function rather than in sched_init function as
other init_task related initialization or happening in fork_init(). As
well we have rt_mutex_init_task() function in fork.c which can be reused
for initializing pi_waiters field of init_task.
Please go through the patch and let me know of your opinion.
Thanks
Sharyathi Nagesh


Attachments:
pi_waiters.patch (1.26 kB)