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

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

 



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.

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