Page MenuHomeFreeBSD

coredirector - Intel TD/HFI driver - Part4: Add coredirector driver's source-code & Makefile.
Needs ReviewPublic

Authored by koinec_yahoo.co.jp on Mar 21 2024, 12:33 PM.
Referenced Files
Unknown Object (File)
Sat, Jan 10, 10:23 AM
Unknown Object (File)
Sat, Jan 10, 10:23 AM
Unknown Object (File)
Sat, Jan 10, 1:39 AM
Unknown Object (File)
Fri, Jan 9, 11:20 PM
Unknown Object (File)
Fri, Jan 9, 4:03 PM
Unknown Object (File)
Fri, Jan 9, 12:47 PM
Unknown Object (File)
Mon, Jan 5, 2:07 PM
Unknown Object (File)
Mon, Jan 5, 4:40 AM

Details

Reviewers
None
Group Reviewers
Contributor Reviews (src)
Summary

I developed the Intel Thread Director (ITD) / Hardware Feedback Interfce (HFI) device driver to obtain performance/efficiency information for each CPU core, which was implemented to improve the performance of Intel hybrid architecture CPUs. (e.g. Raptor Lake (refresh), Alder Lake, LakeField processors)

This driver simply obtains performance/efficiency information from the CPU and stores it in the "cpu_group" struct data referenced by the ULE scheduler.
However, since the ULE scheduler side is not yet supported, performance/efficiency cannot be improved by installing this driver at this time.

I will try to modify the ULE scheduler side in the future, but I posted this driver first because it can be implemented independently of this driver and it is difficult to modify the ULE scheduler.

There are seven patches, and this is the Part 4.
This patch is the source code and Makefile of the coredirector driver that I developed this time.

This patch depends on the following patches:

Test Plan

With the remaining patches to be submitted later, I ran the tests listed below.

  • FreeBSD 15-current: Be able to apply patches and build to the latest source tree as of 2024/03/20.
  • FreeBSD 14.0-Release: The source tree can be patched and built. After building, it is possible to load the driver and correctly obtain performance values from the CPU.

Due to my development environment, I developed it on FreeBSD 14.0-RELEASE and ported it to FreeBSD 15-current on a virtual environment.
However, I have also confirmed that the parts related to the code modified this time have hardly changed between 14.0-RELEASE and 15-current.
For this reason, I believe that it will probably work with 15-current, but if you are able to test it, please help confirm that it works.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

koinec_yahoo.co.jp created this revision.

Attach the full context patch file.
{F79836034}

Fix CPUID Leaf6 define strings.

Attach the patch file created with the git format-patch command.

minsoochoo0122_proton.me added inline comments.
sys/dev/coredirector/coredirector.c
60

device_printf(9)

65

What stops from using __builtin_popcount()?

73

Could be bitwise: (n + 7) & (~7)

162

M_COREDIR matches the name.

351

Support for LP-E?

sys/dev/coredirector/coredirector.c
351

I searched the internet for LP-E, and it looks like CPUID_HF_EFFICIENCY is applied for both E and LP-E cores. Linux has cache info in their topology, but since FreeBSD seems to lack this, we need to manually query cpuid leaf 4.