Skip to content

Kernel Extension allows to pin thread on a certain cpu core on Apple Silicon machines

License

Notifications You must be signed in to change notification settings

junjie1475/MacOS_CoreBinder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MacOS_CoreBinder

Kernel Extension to pin thread on a certain cpu core on Apple Silicon machines.(Also have the side effect to boost the frequecy to the max for that core). The pre-compiled kext is for T6000/T6000. If you want to use it on T8112, compile it with -DT8112 flag.

NOTE: USE AT YOUR OWN RISK

Unless you know what you are doing, otherwise don't use it.

How to install?

  1. You need to disable SIP first(unless you codesign the kext).
  2. Switch to reduce security mode(https://softraid.com/faq/step-by-step-instructions-for-changing-the-security-settings-for-a-mac-with-apple-silicon/).
  3. Move .kext folder under /Library/Extensions/. There will be a window pops up, follow the instrucion from there.
  4. Run the command sudo kextload /Library/Extensions/MacOS_CoreBinder.kext.

How to use?

Two ways:

  1. Pin the current thread via sysctlbyname("kern.pin_core", NULL, NULL, &core, sizeof(core))
  2. Pin all the threads in a process using pid you had specified via syscall sysctlbyname("kern.pin_core_pid", NULL, NULL, &pid_core, sizeof(pid_core)) Note: pid_core top 32 bits for pid(-1 for all processes) bottom 32 bits for cpuid.

Acknowledgement

Thanks for the help from jht5132(https://tieba.baidu.com/home/main?fr=home&id=tb.1.7a7e3dba.vu9oHFoN6nhDwEfbdVfrrw&un=Jht5132) for testing the kext, without him this project won't be possible. Screenshot provided by him. image

About

Kernel Extension allows to pin thread on a certain cpu core on Apple Silicon machines

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages