lkml.org 
[lkml]   [2020]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [tip: sched/core] sched: Fix balance_callback()
From
Date
tip-bot2 for Peter Zijlstra schreef op wo 11-11-2020 om 08:23 [+0000]:
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> [...]
> +static void do_balance_callbacks(struct rq *rq, struct callback_head *head)
> +{
> + void (*func)(struct rq *rq);
> + struct callback_head *next;
> +
> + lockdep_assert_held(&rq->lock);
> +
> + while (head) {
> + func = (void (*)(struct rq *))head->func;
> + next = head->next;
> + head->next = NULL;
> + head = next;

Naive question: is there some subtle C-issue that is evaded here by setting
head->next to NULL prior to copying over it?

(I know this piece of code only got copied around in this patch and this is
therefor not something that this patch actually introduced.)

> +
> + func(rq);
> + }
> +}

Thanks,


Paul Bolle

\
 
 \ /
  Last update: 2020-11-11 21:31    [W:0.217 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site