Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1205027

[PATCH v2 4/4] thermal: power_allocator: exit early if there are no cooling devices

From Javi Merino <javi.merino@arm.com>
Newsgroups linux.kernel
Subject [PATCH v2 4/4] thermal: power_allocator: exit early if there are no cooling devices
Date 2015-08-11 12:30 +0200
Message-ID <pWeYG-2jf-15@gated-at.bofh.it> (permalink)
References <pVXO9-2OQ-5@gated-at.bofh.it> <pWeYF-2jf-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Don't waste cycles in the power allocator governor's throttle function
if there are no cooling devices and exit early.

This commit doesn't change any functionality, but should provide better
performance for the odd case of a thermal zone with trip points but
without cooling devices.
---
 drivers/thermal/power_allocator.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/thermal/power_allocator.c b/drivers/thermal/power_allocator.c
index 38beea721e18..05a3c2f21fa6 100644
--- a/drivers/thermal/power_allocator.c
+++ b/drivers/thermal/power_allocator.c
@@ -291,6 +291,11 @@ static int allocate_power(struct thermal_zone_device *tz,
 		}
 	}
 
+	if (!num_actors) {
+		ret = -ENODEV;
+		goto unlock;
+	}
+
 	/*
 	 * We need to allocate five arrays of the same size:
 	 * req_power, max_power, granted_power, extra_actor_power and
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] thermal: remove power allocator from list of default  governors Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2015-08-04 18:40 +0200
  Re: [PATCH] thermal: remove power allocator from list of default  governors Javi Merino <javi.merino@arm.com> - 2015-08-05 10:40 +0200
    Re: [PATCH] thermal: remove power allocator from list of default  governors Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> - 2015-08-05 18:30 +0200
    Re: [PATCH] thermal: remove power allocator from list of default  governors Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2015-08-05 18:40 +0200
      Re: [PATCH] thermal: remove power allocator from list of default  governors Eduardo Valentin <edubezval@gmail.com> - 2015-08-05 21:00 +0200
        Re: [PATCH] thermal: remove power allocator from list of default  governors Javi Merino <javi.merino@arm.com> - 2015-08-06 10:40 +0200
          [PATCH 3/3] thermal: power_allocator: exit early if there are no cooling devices Javi Merino <javi.merino@arm.com> - 2015-08-10 18:10 +0200
          [PATCH 2/3] thermal: power_allocator: relax the requirement of two passive trip points Javi Merino <javi.merino@arm.com> - 2015-08-10 18:10 +0200
          [PATCH 0/3] Let the power allocator thermal governor run on any thermal zone Javi Merino <javi.merino@arm.com> - 2015-08-10 18:10 +0200
            [PATCH 1/3] thermal: power_allocator: relax the requirement of a sustainable_power in tzp Javi Merino <javi.merino@arm.com> - 2015-08-10 18:10 +0200
            [PATCH v2 0/4] Let the power allocator thermal governor run on any thermal zone Javi Merino <javi.merino@arm.com> - 2015-08-11 12:30 +0200
              [PATCH v2 1/4] thermal: power_allocator: relax the requirement of a sustainable_power in tzp Javi Merino <javi.merino@arm.com> - 2015-08-11 12:30 +0200
                Re: [PATCH v2 1/4] thermal: power_allocator: relax the requirement of a sustainable_power in tzp Punit Agrawal <punit.agrawal@arm.com> - 2015-08-11 15:50 +0200
                Re: [PATCH v2 1/4] thermal: power_allocator: relax the requirement  of a sustainable_power in tzp Javi Merino <javi.merino@arm.com> - 2015-08-11 19:40 +0200
                Re: [PATCH v2 1/4] thermal: power_allocator: relax the requirement of  a sustainable_power in tzp Daniel Kurtz <djkurtz@chromium.org> - 2015-08-12 13:10 +0200
              [PATCH v2 3/4] thermal: power_allocator: don't require tzp to be present for the thermal zone Javi Merino <javi.merino@arm.com> - 2015-08-11 12:30 +0200
              [PATCH v2 2/4] thermal: power_allocator: relax the requirement of two passive trip points Javi Merino <javi.merino@arm.com> - 2015-08-11 12:30 +0200
                Re: [PATCH v2 2/4] thermal: power_allocator: relax the requirement of  two passive trip points Daniel Kurtz <djkurtz@chromium.org> - 2015-08-12 13:20 +0200
                Re: [PATCH v2 2/4] thermal: power_allocator: relax the requirement  of two passive trip points Javi Merino <javi.merino@arm.com> - 2015-08-12 18:50 +0200
              [PATCH v2 4/4] thermal: power_allocator: exit early if there are no cooling devices Javi Merino <javi.merino@arm.com> - 2015-08-11 12:30 +0200
              [PATCH v3 1/4] thermal: power_allocator: relax the requirement of a sustainable_power in tzp Javi Merino <javi.merino@arm.com> - 2015-08-17 19:40 +0200
              [PATCH v3 0/4] Let the power allocator thermal governor run on any thermal zone Javi Merino <javi.merino@arm.com> - 2015-08-17 19:40 +0200
                [PATCH v3 4/4] thermal: power_allocator: exit early if there are no cooling devices Javi Merino <javi.merino@arm.com> - 2015-08-17 19:40 +0200
                [PATCH v3 2/4] thermal: power_allocator: relax the requirement of two passive trip points Javi Merino <javi.merino@arm.com> - 2015-08-17 19:40 +0200
                [PATCH v3 3/4] thermal: power_allocator: don't require tzp to be present for the thermal zone Javi Merino <javi.merino@arm.com> - 2015-08-17 19:40 +0200

csiph-web