lkml.org 
[lkml]   [2009]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH/RFC] sched: Remove SYSTEM_RUNNING checks from cond_resched*()
On 07/08, Anton Vorontsov wrote:
>
> but I'm curious if removing the checks makes sense
> nowadays.
...
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -6560,8 +6560,7 @@ static void __cond_resched(void)
>
> int __sched _cond_resched(void)
> {
> - if (need_resched() && !(preempt_count() & PREEMPT_ACTIVE) &&
> - system_state == SYSTEM_RUNNING) {
> + if (need_resched() && !(preempt_count() & PREEMPT_ACTIVE)) {
> __cond_resched();
> return 1;
> }

and, with CONFIG_PREEMPT preempt_schedule() does not check system_state,
so it looks really strange cond_resched() does check SYSTEM_RUNNING.



debug_smp_processor_id() looks strange too:

/*
* It is valid to assume CPU-locality during early bootup:
*/
if (system_state != SYSTEM_RUNNING)
goto out;
this doesn't look right, smp_init() is called before we set
SYSTEM_RUNNING.

Hmm, and

/*
* Kernel threads bound to a single CPU can safely use
* smp_processor_id():
*/
if (cpumask_equal(&current->cpus_allowed, cpumask_of(this_cpu)))
goto out;
perhaps this should use PF_THREAD_BOUND ?

Oleg.



\
 
 \ /
  Last update: 2009-07-08 02:55    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site