[PATCH] sched: mc/smt power savings sched policy

S.Çağlar Onur caglar at pardus.org.tr
Mon Jul 2 04:58:45 PDT 2007


02 Tem 2007 Pts tarihinde, Danny Kukawka şunları yazmıştı: 
> On Sonntag, 1. Juli 2007, S.Çağlar Onur wrote:
> > Further investigation shows CPU topology already exported to sysfs with
> > different way :). And LKML has that discussion before (Ulrich Drepper
> > wants to export that information for some glibc/openMPI optimizations
> > which ends up with nothing)
> >
> > So, /sys/devices/system/cpu/cpu*/topology/core_id already exports CPU
> > core id's to userspace, for all CPU's if they all 0 that means machine is
> > smt capable else its mc capable one.
>
> That's somehow in inefficient. Why do they not export this information to a
> sysfs attribute under /sys/devices/system/cpu/ which show if the system is
> MC/SMT ? Check each CPU is really ... no comment.

Yes it is (glibc currently parses /proc/cpuinfo for this information) :( also 
i realized "detect_topology" is also has some over-engineering in it :), i 
woke up this morning and start to think are we really want to detect the 
topology or find the needed filename? 

smt/mc_capable() functions in kernel seems will not exported to userspace in 
near future cause they are really kernel space code dependent. And i think if 
somehow this information exported through sysfs nothing will be changed for 
this chunk of code, cause one must have to check that sysfs file existence, 
read that file and decide which filename will be used or something like that.

So attached one corrects some whitespace issues and simplyfies the logic of 
previous patch with Danny's additions. It basically tests 
SYSFS_SCHED_*_POWER_SAVINGS_FILE files existence instead of iterating over 
sysfs and reading core_id files for each CPU's exists on the system.

Cheers
-- 
S.Çağlar Onur <caglar at pardus.org.tr>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SchedPowerSavings
Type: text/x-diff
Size: 8362 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20070702/c6b8688f/attachment.diff 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freedesktop.org/archives/hal/attachments/20070702/c6b8688f/attachment.pgp 


More information about the hal mailing list