Giter Club home page Giter Club logo

ntoskrnl_ht_fix's Introduction

ntoskrnl_HT_FIX

fixes hyperthreading for windows 2003 when running on newer cpus

When windows 2003 is installed on newer multicore cpus such as the i7-4790 the kernel does not correctly detect the core topology. In the case of i7-4790 the cpu is detected as having a single core with 8 hyperthreads. Threads are not scheduled efficiently when the core topology is wrong. In the example case the kernel makes no effort to keep a thread on the same core, the thread jumps randomly between cores on every context switch, this murders the cache resulting in somewhat lower performance.

The kernel detects the core topology by way of the instruction cpuid. On older cpus the number of logical cores per physical core is returned in Bits 23-16, of Ebx, when Eax=1. For some reason, intel, at some point changed the meaning of these bits, they no longer reflect the number of logical cores per pysical and instead return some value of unknown meaning which in my case the kernel interprets as as 16 logical cores per pysical cpu.

This problem is corrected by patching the cpuid function in ntoskrnl.exe. The new function replaces Bits 23-16, of Ebx, when Eax=1, With the expected value for an older hyperthreaded cpu. With this patch threads are now scheduled correctly.

ntoskrnl_ht_fix's People

Contributors

thedeadfish avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.