lkml.org 
[lkml]   [2013]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 6/7] sched, x86: Provide a per-cpu preempt_count implementation
From
Date
On Tue, 2013-09-10 at 15:08 +0200, Peter Zijlstra wrote:

> +static __always_inline int preempt_count(void)
> +{
> + return __this_cpu_read_4(__preempt_count) & ~PREEMPT_NEED_RESCHED;
> +}

Not sure why you used the _4 prefix on all accessors ?

>
> +#ifdef CONFIG_PREEMPT_COUNT
> + /*
> + * If it were not for PREEMPT_ACTIVE we could guarantee that the
> + * preempt_count of all tasks was equal here and this would not be
> + * needed.
> + */
> + task_thread_info(prev_p)->saved_preempt_count = __raw_get_cpu_var(__preempt_count);

this_cpu_read(__preempt_count) ?

> + __raw_get_cpu_var(__preempt_count) = task_thread_info(next_p)->saved_preempt_count;

this_cpu_write(__preempt_count,
task_thread_info(next_p)->saved_preempt_count;

> +#endif
> +
> this_cpu_write(kernel_stack,
> (unsigned long)task_stack_page(next_p) +
> THREAD_SIZE - KERNEL_STACK_OFFSET);
>
>




\
 
 \ /
  Last update: 2013-09-10 16:21    [W:0.448 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site