Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 01bb33a8 authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar Committed by Satya Durga Srinivasu Prabhala
Browse files

sched/core: fix userspace affining threads incorrectly



Certain userspace applications, to achieve max performance, affines its
threads to cpus that run the fastest. This is not always the
correct strategy. For e.g. in certain architectures all the
cores have the same max freq but few of them have a bigger
cache. Affining to the cpus that have bigger cache is advantageous
but such an application would end up affining them to all the cores.
Similarly if an architecture has just one cpu that runs at max freq,
it ends up crowding all its thread on that single core, which is
detrimental for performance.

To address this issue, we need to detect a suspicious looking affinity
request from userspace and check if it links in a particular library.
The latter can easily be detected by traversing executable vm areas
that map a file and checking for that library name.
When such a affinity request is found, change it to use a proper
affinity. The suspicious affinity request, the proper affinity request
and the library name can be configured by the userspace.

Change-Id: I6bb8c310ca54c03261cc721f28dfd6023ab5591a
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
[satyap@codeaurora.org: trivial merge conflict resolution]
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent 5826c097
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment