答复: [PATCH] KVM: Consider SMT idle status when halt polling

From: Li,Rongqing
Date: Thu Jul 22 2021 - 01:22:55 EST


> > diff --git a/include/linux/sched.h b/include/linux/sched.h index
> > ec8d07d..c333218 100644
> > --- a/include/linux/sched.h
> > +++ b/include/linux/sched.h
> > @@ -34,6 +34,7 @@
> > #include <linux/rseq.h>
> > #include <linux/seqlock.h>
> > #include <linux/kcsan.h>
> > +#include <linux/topology.h>
> > #include <asm/kmap_size.h>
> >
> > /* task_struct member predeclarations (sorted alphabetically): */ @@
> > -2191,6 +2192,22 @@ int sched_trace_rq_nr_running(struct rq *rq);
> >
> > const struct cpumask *sched_trace_rd_span(struct root_domain *rd);
> >
> > +static inline bool is_core_idle(int cpu) { #ifdef CONFIG_SCHED_SMT
> > + int sibling;
> > +
> > + for_each_cpu(sibling, cpu_smt_mask(cpu)) {
> > + if (cpu == sibling)
> > + continue;
> > +
> > + if (!idle_cpu(cpu))
> > + return false;
>
> if (!idle_cpu(sibling))  instead, now it returns always false.
>

Good Catch. this is history bug.

Do you like to submit by yourself, or I submit on behalf you

Thanks

-Li