All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] sched: Fix priority inversion of cookied task with sibling
@ 2021-05-15 10:39 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2021-05-15 10:39 UTC (permalink / raw)
  To: joel; +Cc: kernel-janitors

Hello Joel Fernandes (Google),

This is a semi-automatic email about new static checker warnings.

The patch 7afbba119f0d: "sched: Fix priority inversion of cookied 
task with sibling" from Nov 17, 2020, leads to the following Smatch 
complaint:

    kernel/sched/core.c:5492 pick_next_task()
    error: we previously assumed 'next' could be null (see line 5488)

kernel/sched/core.c
  5481          /*
  5482           * Optimize for common case where this CPU has no cookies
  5483           * and there are no cookied tasks running on siblings.
  5484           */
  5485          if (!need_sync) {
  5486                  for_each_class(class) {
  5487                          next = class->pick_task(rq);
  5488                          if (next)
  5489                                  break;

Is it possible to go through the whole loop withint finding a next?

  5490                  }
  5491  
  5492                  if (!next->core_cookie) {
                             ^^^^^^^^^^^^^^^^^
I assume not, but I don't read the code, I just forward the warnings
on.  I am a bot.  Beep Boop!

  5493                          rq->core_pick = NULL;
  5494                          /*
  5495                           * For robustness, update the min_vruntime_fi for
  5496                           * unconstrained picks as well.
  5497                           */
  5498                          WARN_ON_ONCE(fi_before);
  5499                          task_vruntime_update(rq, next, false);
  5500                          goto done;
  5501                  }
  5502          }
  5503  
  5504          for_each_cpu(i, smt_mask) {
  5505                  struct rq *rq_i = cpu_rq(i);
  5506  

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-15 10:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-15 10:39 [bug report] sched: Fix priority inversion of cookied task with sibling Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.