hamadmarri / TT-CPU-Scheduler

Task Type (TT) is an alternative CPU Scheduler for linux.
107 stars 12 forks source link

Heterogeneous CPU Topology Support (Intel Alder Lake) #13

Open andylenzwx opened 2 years ago

andylenzwx commented 2 years ago

Hi, Hamad

As a user of the Xanmod kernel with your CacULE CPU scheduler and now presently your TT CPU scheduler, I really appreciate your work. I am not 100% sure if this would be the correct place to inquire about the following, but I wanted ask you about the feasibility of integrating better and more consistent performance into your TT CPU scheduler for the newly released Intel Alder Lake chips that use heterogeneous CPU topology with their P-cores and E-cores designed for different types of tasks/workloads. Based on my understanding, much of this depends on the kernel being able to communicate with Intel's new hardware-based "Thread Director" technology, which is currently only supported in the Windows 11 scheduler (not even Windows 10 as of now). I extracted the following quote describing in a basic, high-level sense how the new Thread Director works from a Tom's Hardware overview/review article on Alder Lake that I will provide the link to at the bottom.

"This technology works by feeding the Windows 11 operating system with low-level telemetry data collected from within the processor itself, thus informing the scheduler about the state of the cores, be it power, thermal, or otherwise, and the type of workload being executed by any given thread. The Windows scheduler then uses this additional information to make real-time intelligent decisions about thread placement."

Long story short, Alder Lake performance in Linux (and Windows 10 for that matter too) is significantly poorer and far more inconsistent than Windows 11 at the moment. So I guess my questions are as follows: What are the prerequisites for implementing support for Intel's new heterogeneous CPU topology in the TT CPU scheduler to achieve better performance/parity with Windows 11 on Alder Lake chips? Correct me if I'm wrong, but my assumption would be that first, patches must be made to the mainline Linux kernel that allow the kernel to interface with Intel's new hardware-based "Thread Director". I would imagine that such patches would be at least in part Intel's responsibility to contribute. And then once these patches are implemented upstream, what are the implications for your TT CPU scheduler project? Will accommodating this new "hybrid" Intel architecture be trivial given the current state and functionality of your TT CPU scheduler? Or will exploiting the full performance of Intel's Alder Lake chips require extensive/complex work on your part?

Lastly, I am strongly considering an purchasing Intel Alder Lake chip (the i9-12900K) as an upgrade from my Intel i7-8700K for my machine in the coming weeks. Assuming I end up going thru with that, could I be of any assistance to you/your TT CPU scheduler project by providing some sort of debugging data/feedback while using the processor, perhaps by running tests/benchmarks and collecting data?

My apologies if this post seems misdirected or uninformed. I am very proficient in general Linux stuff like systems administration, configuration, Bash, Python programming, etc, but understanding the lower-level workings of the OS, such as CPU schedulers is a new horizon for me, so to speak, because I am not as familiar things of that nature. I'm just very appreciative of your work and interested in helping with your project's development once I get my hands on a new Alder Lake chip, if that would be worthwhile to you.

Many thanks for your time and consideration,

Andy

BTW, here is the link to the Tom's Hardware article, along with another link to a Phoronix article that discusses the Alder Lake performance disparity and provides some benchmarks as well:

https://www.tomshardware.com/news/intel-core-i9-12900k-and-core-i5-12600k-review-retaking-the-gaming-crown https://www.phoronix.com/scan.php?page=article&item=alderlake-windows-linux

raykzhao commented 2 years ago

Hi @andylenzwx @hamadmarri

From what I know, there are some patches in the Clearlinux which seems to address issues with Adlerlake on Linux, notably: https://github.com/clearlinux-pkgs/linux/commit/943b6bacd75c6b31eb544a0007cbdc1d518febca https://github.com/clearlinux-pkgs/linux/commit/3438130fd8607eeba86f8f8e1daa3b6bb8b7d9f8

hamadmarri commented 2 years ago

Hi @andylenzwx

Yes, you are right. I believe that Intel needs to have their arch. updated for Alder Lake features. I am not sure if they already had though.

For the scheduler part, I usually follow the linux guys conventions. I am not going to step ahead in case of Alder Lake because of the lack of knowledge about the details. Another thing is that linux people have better understanding and better communication channels with Intel people which help to make this integrates well in the correct way. From my side, all what I can do is studying and porting the CFS adjustments regarding this manner to TT. I might adjust their implementation slightly in case of any possible enhancement for the desktop usage.

I would be happy to upload some patches in future related to this topic, and of course your tests are highly appreciated.

Thank you so much for the sharing and the encouragement.

KubiRemPL commented 1 year ago

any update?