Re: [PATCH 2.6.27-rc5] Fix itimer/many thread hang.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Oleg Nesterov
Date: Tuesday, September 9, 2008 - 9:01 am

On 09/09, Ingo Molnar wrote:

I'll try to read this patch on weekend. A couple of naive questions
right now.


The patch has a lot of

	rcu_read_lock();
	sig = rcu_dereference(tsk->signal);

This is bogus, task_struct->signal is not protected by RCU.

However, at first glance the code (this and other funcs) looks correct...
Either tsk == current, or the code runs under ->siglock. Or we know that
->signal can't go away (wait_task_zombie).

As for this particular function, it seems to me that ->signal == NULL
is not possible, no?

Please remove the false RCU stuff.

Btw, this function has a lot of callers, perhaps it is better to
uninline it.


So, the first CLONE_THREAD creates ->cputime.totals. After that
thread_group_cputime_account_xxx() start to use it even if the task
doesn't have the attached cpu timers.

Stupid question: can't we allocate .totals in posix_cpu_timer_create() /
set_process_cpu_timer() ?


tasklist_lock is not needed,


->siglock is enough.


Ugh. Probably I misunderstand the patch, but...

Let's suppose the task doesn't have cpu timers. Currently, in this case
run_posix_cpu_timers() quickly checks UNEXPIRED() and returns. With this
patch we call fastpath_timer_check(). The first task_cputime_expired()
returns 0, so we are doing thread_group_cputime()->for_each_possible_cpu().

Not good, this code runs every timer tick. Perhaps it makes sense
to add a fastpath check.

(again, rcu stuff is bogus)

Oleg.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 2.6.27-rc5] Fix itimer/many thread hang., Frank Mayhar, (Mon Sep 8, 1:44 pm)
Re: [PATCH 2.6.27-rc5] Fix itimer/many thread hang., Ingo Molnar, (Tue Sep 9, 12:03 am)
Re: [PATCH 2.6.27-rc5] Fix itimer/many thread hang., Oleg Nesterov, (Tue Sep 9, 9:01 am)
Re: [PATCH 2.6.27-rc5] Fix itimer/many thread hang., Oleg Nesterov, (Tue Sep 9, 9:13 am)
Re: [PATCH 2.6.27-rc5] Fix itimer/many thread hang., Frank Mayhar, (Tue Sep 9, 1:29 pm)
Re: [PATCH 2.6.27-rc5] Fix itimer/many thread hang., Roland McGrath, (Tue Sep 9, 8:59 pm)
Re: [PATCH 2.6.27-rc5] Fix itimer/many thread hang., Roland McGrath, (Tue Sep 9, 9:04 pm)
Re: [PATCH 2.6.27-rc5] Fix itimer/many thread hang., Oleg Nesterov, (Wed Sep 10, 4:44 am)
Re: [PATCH 2.6.27-rc5] Fix itimer/many thread hang., Oleg Nesterov, (Wed Sep 10, 5:12 am)
Re: [PATCH 2.6.27-rc5] Fix itimer/many thread hang., Oleg Nesterov, (Wed Sep 10, 9:32 am)
Re: [PATCH 2.6.27-rc5] Fix itimer/many thread hang., Frank Mayhar, (Wed Sep 10, 10:50 am)