Skip to content

Add Process Affinity Presets (resolves #2644) - #3009

Open
NotEnsoul wants to merge 1 commit into
winsiderss:masterfrom
NotEnsoul:feature/affinity-presets
Open

Add Process Affinity Presets (resolves #2644)#3009
NotEnsoul wants to merge 1 commit into
winsiderss:masterfrom
NotEnsoul:feature/affinity-presets

Conversation

@NotEnsoul

Copy link
Copy Markdown
Contributor

Description

Summary

This PR resolves issue #2644 by adding CPU Affinity Presets to process context menus (process tree view & process properties options menu) and directly within the Affinity dialog window.

Features

  1. Hybrid Architecture Auto-Detection (P-Cores vs. E-Cores)

    • Automatically detects hybrid CPUs and provides 1-click Performance cores (P-Cores) and Efficiency cores (E-Cores) presets.
  2. CCD / L3 Cache Cluster Auto-Detection (AMD Ryzen / EPYC / Threadripper)

    • Automatically detects Core Complex Dies (CCDs) and provides 1-click presets per CCD (CCD 0, CCD 1, etc.).
  3. NUMA Node Auto-Detection

    • Automatically detects NUMA nodes on multi-socket and NUMA systems (NUMA Node 0, NUMA Node 1, etc.).
  4. Standard Core Presets

    • 1-click core selection presets: All cores, Even cores, Odd cores, First half of cores, and Second half of cores.
  5. Custom User Presets (Save & Clear)

    • Save custom CPU core combinations as user presets (Preset 1 through Preset 4), persisted across app restarts.
    • Includes a Clear preset... menu to clear individual or all custom presets.
  6. UI Integration

    • Converts the Affinity item in process context menus into a rich submenu with Custom... and all presets.
    • Adds a Presets... button to the Affinity dialog box for easy preset selection inside the dialog.

Key File Changes

  • SystemInformer/resource.h & SystemInformer.rc: Added preset resource IDs and Presets... button to the Affinity dialog.
  • SystemInformer/include/phsettings.h & settings.c: Registered custom preset mask and name settings.
  • SystemInformer/include/phapp.h: Declared preset helper functions.
  • SystemInformer/affinity.c: Implemented CPU topology detection, preset mask resolution, dynamic menu generation, and preset saving/clearing.
  • SystemInformer/mwpgproc.c, procprp.c, mainwnd.c: Integrated Affinity submenu into process tree view and properties options menu.

@NotEnsoul
NotEnsoul requested review from dmex and jxy-s as code owners July 25, 2026 18:48
@dmex dmex self-assigned this Aug 1, 2026
@dmex dmex added the enhancement New feature or request label Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants