Re: [RFC PATCH 17/23] thermal: intel: hfi: Enable the Intel Thread Director

Ricardo Neri
2022-10-06T01:44:07Z

On Tue, Sep 27, 2022 at 02:00:39PM +0200, Peter Zijlstra wrote:
> On Fri, Sep 09, 2022 at 04:11:59PM -0700, Ricardo Neri wrote:
>
> > +config INTEL_THREAD_DIRECTOR
> > + bool "Intel Thread Director"
> > + depends on INTEL_HFI_THERMAL
> > + depends on SMP
> > + select SCHED_TASK_CLASSES
> > + help
> > + Select this option to enable the Intel Thread Director. If selected,
> > + hardware classifies tasks based on the type of instructions they
> > + execute. It also provides performance capabilities for each class of
> > + task. On hybrid processors, the scheduler uses this data to place
> > + tasks of classes of higher performance on higher-performnance CPUs.
>
> Do we really need yet another CONFIG symbol for all this!? AFAICT this
> Thread Director crud simply extends the HFI table and doesn't actually
> carry that much code with it.
>
> Best to always have it on when HFI is on, no?

I decided to add CONFIG_INTEL_THREAD_DIRECTOR mainly to select CONFIG_IPC_
CLASS and have the needed members of task_struct only when needed. Legacy,
classless, HFI can work with the Thread Director part on some processors
(e.g., Sapphire Rapids or, FWIW, Lakefield).

I could get rid of CONFIG_INTEL_THREAD_DIRECTOR and instead wrap the Thread
Director code in an #ifdef(CONFIG_IPC_CLASS) block instead.

Thanks and BR,
Ricardo