lkml.org 
[lkml]   [2015]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 01/11] sched: Simplify INIT_PREEMPT_COUNT

[ Resend with a "Reply-all" this time! ]

On Tue, 29 Sep 2015 11:28:26 +0200
Peter Zijlstra <peterz@infradead.org> wrote:

> As per commit d86ee4809d03 ("sched: optimize cond_resched()") we need
> PREEMPT_ACTIVE to avoid cond_resched() from working before the
> scheduler is setup.
>
> However, keeping preemption disabled should do the same thing already,
> making the PREEMPT_ACTIVE part entirely redundant.

Thus PREEMPT_ACTIVE wasn't needed at that commit either, or was it?

>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
> include/linux/sched.h | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -608,17 +608,14 @@ struct task_cputime_atomic {
> /*
> * Disable preemption until the scheduler is running.
> * Reset by start_kernel()->sched_init()->init_idle().
> - *
> - * We include PREEMPT_ACTIVE to avoid cond_resched() from working
> - * before the scheduler is active -- see should_resched().
> */
> -#define INIT_PREEMPT_COUNT (PREEMPT_DISABLED + PREEMPT_ACTIVE)
> +#define INIT_PREEMPT_COUNT PREEMPT_DISABLED

I can't find anything wrong with this.

Reviewed-by: Steven Rostedt <rostedt@goodmis.org>

-- Steve

>
> /**
> * struct thread_group_cputimer - thread group interval timer counts
> * @cputime_atomic: atomic thread group interval timers.
> * @running: non-zero when there are timers running and
> - * @cputime receives updates.
> + * @cputime receives updates.
> *
> * This structure contains the version of task_cputime, above, that is
> * used for thread group CPU timer calculations.
>



\
 
 \ /
  Last update: 2015-09-29 17:01    [W:0.348 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site