Bill Davidsen | 5 May 15:55 2006

Re: [PATCH] -mm: i386 apm.c optimization

Andreas Mohr wrote:

>Hello all,
>
>- avoid expensive modulo (integer division) which happened
>  since APM_MAX_EVENTS is 20 (non-power-of-2)
>- kill compiler warnings by initializing two variables
>- add __read_mostly to some important static variables that are read often
>  (by idle loop etc.)
>- constify several structures
>
>Patch tested on 2.6.16-ck5, rediffed against 2.6.17-rc1-mm2. 
> <at>  <at>  -1104,7 +1105,8  <at>  <at> 
> 
> static apm_event_t get_queued_event(struct apm_user *as)
> {
>-	as->event_tail = (as->event_tail + 1) % APM_MAX_EVENTS;
>+	if (++as->event_tail >= APM_MAX_EVENTS)
>+		as->event_tail = 0;
> 	return as->events[as->event_tail];
> }
> 
>  
>
Either event_tail can never be > APM_MAX_EVENTS (I believe that's true) 
and you should use ==, or you should do a proper mod function:
  ++as->event_tail;
  while (as->event_tail >= APM_MAX_EVENTS) as->event_tail -= APM_MAX_EVENTS;

In the unlikely even that the event_tail is already too large you want a 
(Continue reading)

Brown, Len | 17 May 06:20 2006
Picon

RE: kernel vs user power management


>> >> I'm happy to see that clock throttling is not enabled by
>> >> default in recent SuSE release, at least on my laptop
>> >> which supports P-states.
>> >> 
>> >> I'd like to see no option to enable clock-throttling on
>> >> systems that support real p-states.
>> >
>> >Yes, this is reasonable, indeen. Will do that. With p-states in this
>> >context, you mean cpufreq here?
>> 
>> throttling is always T-states.
>> cpufreq is usually p-states, but in the case of p4clockmod,
>> it is T-states also.  As I mentioned above, cpufreq is doing
>> you a dis-service by hiding the difference from you
>> and really need to be enhanced to know (and export)
>> the difference.
>
>Yes, this would be good, indeed. But what else drivers are currently
>affected? It's only p4clockmod I know of.
>
>> 
>> >> It is useful only for workloads which have an infinite
>> >> amount of non-idle computing which you don't care how
>> >> slow it computes.  For the vast majority of workloads
>> >> it just slows down the machine and delays the processor
>> >> from getting into idle where it can save a non-linear
>> >> amount of power.  Further, there exist today systems which
>> >> will consume MORE power in deep C-states when throttled
>> >> vs. when not throttled.
(Continue reading)

Holger Macht | 17 May 11:14 2006
Picon

Re: kernel vs user power management

On Wed 17. May - 00:20:12, Brown, Len wrote:
>  
> >> >> I'm happy to see that clock throttling is not enabled by
> >> >> default in recent SuSE release, at least on my laptop
> >> >> which supports P-states.
> >> >> 
> >> >> I'd like to see no option to enable clock-throttling on
> >> >> systems that support real p-states.
> >> >
> >> >Yes, this is reasonable, indeen. Will do that. With p-states in this
> >> >context, you mean cpufreq here?
> >> 
> >> throttling is always T-states.
> >> cpufreq is usually p-states, but in the case of p4clockmod,
> >> it is T-states also.  As I mentioned above, cpufreq is doing
> >> you a dis-service by hiding the difference from you
> >> and really need to be enhanced to know (and export)
> >> the difference.
> >
> >Yes, this would be good, indeed. But what else drivers are currently
> >affected? It's only p4clockmod I know of.
> >
> >> 
> >> >> It is useful only for workloads which have an infinite
> >> >> amount of non-idle computing which you don't care how
> >> >> slow it computes.  For the vast majority of workloads
> >> >> it just slows down the machine and delays the processor
> >> >> from getting into idle where it can save a non-linear
> >> >> amount of power.  Further, there exist today systems which
> >> >> will consume MORE power in deep C-states when throttled
(Continue reading)

Brown, Len | 17 May 17:41 2006
Picon

RE: kernel vs user power management


>> I installed SL10.1 today on a P3M laptop (Dell D600)
>> and it defaults to the "Powersave" scheme which includes
>> "Dynamic Frequency Scaling" (ondemand), so that is good.
>> 
>> However, by defaulit "Allow Throttling" is CHECKED
>> and Max %  is set to 50%.
>> 
>> Exactly what does this mean?
>> I looked in /proc/acpi/processor/*/throttling and the
>> laptop is still in T0.
>
>It means that the powersaved throttles your CPU if there is no load and
>dethrottles if there is load. It's that way already for 
>several years and
>I only got a report about performance loss on SMP systems, so 
>we don't do
>throttling by default on those systems.

I see -- my test platform changed from dual-core to single-core,
so I didn't see this issue before.

>> Is there an easy way for me to modify the kernel to
>> convince the powersaved application that the system
>> does not support throttling?  I'm thinking that we've
>> given user-space too much rope and it has proceeded
>> to hang itself.
>
>I'm currently working on a solution to allow throttling only on systems
>which don't support CPUfreq. At the point this thread came up, or a few
(Continue reading)

Holger Macht | 17 May 19:41 2006
Picon

Re: kernel vs user power management

On Wed 17. May - 11:41:16, Brown, Len wrote:
>  
> >> I installed SL10.1 today on a P3M laptop (Dell D600)
> >> and it defaults to the "Powersave" scheme which includes
> >> "Dynamic Frequency Scaling" (ondemand), so that is good.
> >> 
> >> However, by defaulit "Allow Throttling" is CHECKED
> >> and Max %  is set to 50%.
> >> 
> >> Exactly what does this mean?
> >> I looked in /proc/acpi/processor/*/throttling and the
> >> laptop is still in T0.
> >
> >It means that the powersaved throttles your CPU if there is no load and
> >dethrottles if there is load. It's that way already for 
> >several years and
> >I only got a report about performance loss on SMP systems, so 
> >we don't do
> >throttling by default on those systems.
> 
> I see -- my test platform changed from dual-core to single-core,
> so I didn't see this issue before.
> 
> >> Is there an easy way for me to modify the kernel to
> >> convince the powersaved application that the system
> >> does not support throttling?  I'm thinking that we've
> >> given user-space too much rope and it has proceeded
> >> to hang itself.
> >
> >I'm currently working on a solution to allow throttling only on systems
(Continue reading)

Brown, Len | 17 May 20:25 2006
Picon

RE: kernel vs user power management


>If you can reproduce that it switches to T2 when you do a rcpowersaved
>restart or on every unplug, it would actually be a bug which is worth
>to be reported.

happens on every un-plug event.

/etc/init.d/powersaved stop

didn't make it stop happening, so it is probably an ACPI bug.

thanks,
-Len
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane