2005-09-27 17:29:22

by Blaisorblade

[permalink] [raw]
Subject: [2.6.14] Cpufreq_ondemand sysfs names change (was: Re: CPUFreq_ondemand: misnamed ignore_nice attribute)

On Saturday 10 September 2005 16:01, Alexander Clouter wrote:
> Hi,
Summary for Andrew Morton:

ondemand's ignore_nice attribute has a reversed meaning, and fixing this
requires changing the API for the user playing with sysfs. Thus, it should be
fixed ASAP, i.e. 2.6.14.

echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice
Then ondemand ignores nice tasks when calculating CPU load.
echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice
Then ondemand considers nice tasks when calculating CPU load.

It's the reverse of the expected behaviour, even Alexander Clouter got
confused on it when I first reported this bug.

So I suggest:
*) to flip the flag's behaviour, as discussed with Alexander

*) to rename the flag to ignore_nice_load or ignore_nice_tasks, to avoid
burning the user too much. Very few people use it now, but let's help them.

*) Alexander had a piece of doc he wrote about all this and sent me, it'd be
nice to have this merged too.

Alexander (quoted near the end) said to have rolled the patches, but they're
lost somewhere, don't know if he forgot or they're in some staging tree
in-the-middle. I guess I could roll up the patches if needed, but this week
I'm really busy, so probably not. I've also forwarded the original docco
patch to Andrew Morton and LKML (which didn't receive them in first place).

> Blaisorblade <[email protected]> [20050910 15:36:10 +0200]:
> > On Saturday 10 September 2005 14:59, Alexander Clouter wrote:
> > > Hi,
[About the flag behaviour]
> > > I'm all for this to be changed, its a feature that is ment to be for
> > > Joe Public to be used, it would be silly of us to not make it easier;
> > > it is confusing as it stands.

> > Ok - hope there's no so much people workarounding for the new behaviour,
> > but they're smart enough to fix their scripts up. Just shout a bit on
> > LKML to say this and we should be ok.

> My thinking too, its a relatively new feature and when I have looked around
> very few userland tools even tinker with ondemand so either we do it now or
> not at all...or rather we do it later and listen to everyone complain :)

> > > Flipping the behaviour of the flag gets my vote. Do you want to roll
> > > the patch and I fix up the documentation or do you want to do both, or
> > > should do both?

> > I think it's better that you do that - I'd already so many patches spread
> > in my trees that I'd lose this patch somewhere.

> Not a problem. I'll roll them off right now.

> Cheers

--
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade






___________________________________
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB
http://mail.yahoo.it


2005-09-28 21:59:04

by Alexander Clouter

[permalink] [raw]
Subject: Re: [2.6.14] Cpufreq_ondemand sysfs names change (was: Re: CPUFreq_ondemand: misnamed ignore_nice attribute)

Hi All,

Blaisorblade <[email protected]> [20050927 18:51:36 +0200]:
>
> On Saturday 10 September 2005 16:01, Alexander Clouter wrote:
> > Hi,
> Summary for Andrew Morton:
>
> ondemand's ignore_nice attribute has a reversed meaning, and fixing this
> requires changing the API for the user playing with sysfs. Thus, it should be
> fixed ASAP, i.e. 2.6.14.
>
> echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice
> Then ondemand ignores nice tasks when calculating CPU load.
> echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice
> Then ondemand considers nice tasks when calculating CPU load.
>
> It's the reverse of the expected behaviour, even Alexander Clouter got
> confused on it when I first reported this bug.
>
> So I suggest:
> *) to flip the flag's behaviour, as discussed with Alexander
>
> *) to rename the flag to ignore_nice_load or ignore_nice_tasks, to avoid
> burning the user too much. Very few people use it now, but let's help them.
>
> *) Alexander had a piece of doc he wrote about all this and sent me, it'd be
> nice to have this merged too.
>
> Alexander (quoted near the end) said to have rolled the patches, but they're
> lost somewhere, don't know if he forgot or they're in some staging tree
> in-the-middle. I guess I could roll up the patches if needed, but this week
> I'm really busy, so probably not. I've also forwarded the original docco
> patch to Andrew Morton and LKML (which didn't receive them in first place).
>
completely my fault, I rolled them at the weekend whilst on a train, lived in
effectively a Farraday cage for the weekend (a rural part of England for
those who are curious :) and forgot....DOH!

The patches are attached. If everyone likes the look of them, either one of
you guys can 'signed off by' or I can to the mailing list.

Cheers

Alex

> > Blaisorblade <[email protected]> [20050910 15:36:10 +0200]:
> > > On Saturday 10 September 2005 14:59, Alexander Clouter wrote:
> > > > Hi,
> [About the flag behaviour]
> > > > I'm all for this to be changed, its a feature that is ment to be for
> > > > Joe Public to be used, it would be silly of us to not make it easier;
> > > > it is confusing as it stands.
>
> > > Ok - hope there's no so much people workarounding for the new behaviour,
> > > but they're smart enough to fix their scripts up. Just shout a bit on
> > > LKML to say this and we should be ok.
>
> > My thinking too, its a relatively new feature and when I have looked around
> > very few userland tools even tinker with ondemand so either we do it now or
> > not at all...or rather we do it later and listen to everyone complain :)
>
> > > > Flipping the behaviour of the flag gets my vote. Do you want to roll
> > > > the patch and I fix up the documentation or do you want to do both, or
> > > > should do both?
>
> > > I think it's better that you do that - I'd already so many patches spread
> > > in my trees that I'd lose this patch somewhere.
>
> > Not a problem. I'll roll them off right now.
>
> > Cheers
>
> --
> Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
> Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
> http://www.user-mode-linux.org/~blaisorblade
>
>
>
>
>
>
> ___________________________________
> Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB
> http://mail.yahoo.it

--
______________________________________
/ We have seen the light at the end of \
\ the tunnel, and it's out. /
--------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||


Attachments:
(No filename) (0.00 B)
signature.asc (189.00 B)
Digital signature
Download all attachments

2005-09-29 08:54:10

by Stefan Seyfried

[permalink] [raw]
Subject: Re: [2.6.14] Cpufreq_ondemand sysfs names change

Blaisorblade wrote:

> *) to rename the flag to ignore_nice_load or ignore_nice_tasks, to avoid
> burning the user too much. Very few people use it now, but let's help them.

I use it and i have even "fixed" my applications to use the "wrong" flag.

>> My thinking too, its a relatively new feature and when I have looked around
>> very few userland tools even tinker with ondemand so either we do it now or
>> not at all...or rather we do it later and listen to everyone complain :)

so the early birds are doomed? ;-)
I'll bite the bullet if this "flip the meaning" gets in, but i don't
like it. I'll have to check for the kernel version in my userspace code,
then which is generally a bad idea IMO.
--
Stefan Seyfried \ "I didn't want to write for pay. I
QA / R&D Team Mobile Devices \ wanted to be paid for what I write."
SUSE LINUX Products GmbH, N?rnberg \ -- Leonard Cohen

2005-09-29 09:47:04

by Alexander Clouter

[permalink] [raw]
Subject: Re: [2.6.14] Cpufreq_ondemand sysfs names change

Stefan Seyfried <[email protected]> [20050929 10:54:01 +0200]:
>
> >> My thinking too, its a relatively new feature and when I have looked around
> >> very few userland tools even tinker with ondemand so either we do it now or
> >> not at all...or rather we do it later and listen to everyone complain :)
>
> so the early birds are doomed? ;-)
>
they don't call it *bleeding* edge for no reason ;) I'll promise not to flip
it back again, deal?

> I'll bite the bullet if this "flip the meaning" gets in, but i don't
> like it. I'll have to check for the kernel version in my userspace code,
> then which is generally a bad idea IMO.
>
I agree, its messy that this was not dealt with on day one before the code
was even merged but the meaning is logically the other way round to what you
would expect it to mean from reading the sysfs name. Joe Public is going to
get confused on this one, rightly so too.

Cheers

Alex

> --
> Stefan Seyfried \ "I didn't want to write for pay. I
> QA / R&D Team Mobile Devices \ wanted to be paid for what I write."
> SUSE LINUX Products GmbH, N?rnberg \ -- Leonard Cohen

--
______________________________________
/ A day without sunshine is like a day \
\ without Anita Bryant. /
--------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||


Attachments:
(No filename) (1.41 kB)
signature.asc (189.00 B)
Digital signature
Download all attachments

2005-09-29 19:21:56

by Blaisorblade

[permalink] [raw]
Subject: Re: [2.6.14] Cpufreq_ondemand sysfs names change

On Thursday 29 September 2005 10:54, Stefan Seyfried wrote:
> Blaisorblade wrote:
> > *) to rename the flag to ignore_nice_load or ignore_nice_tasks, to avoid
> > burning the user too much. Very few people use it now, but let's help
> > them.

> I use it and i have even "fixed" my applications to use the "wrong" flag.
Me too, but it's a trivial script in my case.
> >> My thinking too, its a relatively new feature and when I have looked
> >> around very few userland tools even tinker with ondemand so either we do
> >> it now or not at all...or rather we do it later and listen to everyone
> >> complain :)

> so the early birds are doomed? ;-)
> I'll bite the bullet if this "flip the meaning" gets in, but i don't
> like it. I'll have to check for the kernel version in my userspace code,
> then which is generally a bad idea IMO.

That's why I proposed renaming the sysfs file, and then you can test with
"test -f" (in bash).
--
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade






___________________________________
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB
http://mail.yahoo.it