Re: [PATCH 08/13] Thermal: Introduce fair_share thermal governor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello,

On Tue, Aug 21, 2012 at 05:59:00AM +0000, R, Durgadoss wrote:
> Hi Eduardo,
> 
> > > +static long get_target_state(struct thermal_zone_device *tz,
> > > +		struct thermal_cooling_device *cdev, int weight, int level)
> > > +{
> > > +	unsigned long max_state;
> > > +
> > > +	cdev->ops->get_max_state(cdev, &max_state);
> > > +
> > > +	return (long)(weight * level * max_state) / (100 * tz->trips);
> > > +}
> > > +
> > > +static void thermal_cdev_update(struct thermal_cooling_device *cdev)
> > > +{
> > > +	struct thermal_instance *instance;
> > > +	unsigned long target = 0;
> > > +
> > > +	mutex_lock(&cdev->lock);
> > > +
> > > +	/* Make sure cdev enters the deepest cooling state */
> > > +	list_for_each_entry(instance, &cdev->thermal_instances,
> > cdev_node) {
> > > +		if (instance->target > target)
> > > +			target = instance->target;
> > > +	}
> > > +
> > > +	mutex_unlock(&cdev->lock);
> > > +
> > > +	cdev->ops->set_cur_state(cdev, target);
> > > +}
> > 
> > I believe Rui has already provided an arbitrator, can we reuse it here as well?
> 
> I thought about this. I was of the opinion a governor can choose to do arbitration
> in its own specific way. For example, The fair_share does not check 'cdev->updated'
> value whenever it tries to update the state of a cooling device.

I see. the arbitration starts to get more and more complex. not to talk about constraints
coming from performance domain and not thermal.

I'd still try to find a central point for doing the arbitration, this way we grow the code
in a scalable way...

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


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux