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


Groups > linux.kernel > #1415654 > unrolled thread

[PATCH] acpi: thermal: Remove create_workqueue

Started byBhaktipriya Shridhar <bhaktipriya96@gmail.com>
First post2016-06-07 05:20 +0200
Last post2016-06-07 16:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] acpi: thermal: Remove create_workqueue Bhaktipriya Shridhar <bhaktipriya96@gmail.com> - 2016-06-07 05:20 +0200
    Re: [PATCH] acpi: thermal: Remove create_workqueue Tejun Heo <tj@kernel.org> - 2016-06-07 16:20 +0200

#1415654 — [PATCH] acpi: thermal: Remove create_workqueue

FromBhaktipriya Shridhar <bhaktipriya96@gmail.com>
Date2016-06-07 05:20 +0200
Subject[PATCH] acpi: thermal: Remove create_workqueue
Message-ID<rHfIC-5zJ-9@gated-at.bofh.it>
alloc_workqueue replaces deprecated create_workqueue().

A dedicated workqueue has been used since the workqueue
acpi_thermal_pm_queue with workitem &tz->thermal_check_work
(maps to acpi_thermal_check_fn), is involved in thermal zone polling.
Wallclock time is actually important and getting delayed in handling
critical temperature event can actually lead to unnecessary hardware
damage. So while this is not used during memory reclaim, we still want
forward progress guarantee and be generally snappy in servicing it.
Hence, WQ_MEM_RECLAIM and WQ_HIGHPRI have been used here.

Since there are only a fixed number of work items, explicit concurrency
limit is unnecessary here.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
---
 drivers/acpi/thermal.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 82707f9..f4ebe39 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -1259,7 +1259,8 @@ static int __init acpi_thermal_init(void)
 		return -ENODEV;
 	}

-	acpi_thermal_pm_queue = create_workqueue("acpi_thermal_pm");
+	acpi_thermal_pm_queue = alloc_workqueue("acpi_thermal_pm",
+						WQ_HIGHPRI | WQ_MEM_RECLAIM, 0);
 	if (!acpi_thermal_pm_queue)
 		return -ENODEV;

--
2.1.4

[toc] | [next] | [standalone]


#1416258

FromTejun Heo <tj@kernel.org>
Date2016-06-07 16:20 +0200
Message-ID<rHq1k-3KB-33@gated-at.bofh.it>
In reply to#1415654
On Tue, Jun 07, 2016 at 08:45:40AM +0530, Bhaktipriya Shridhar wrote:
> alloc_workqueue replaces deprecated create_workqueue().
> 
> A dedicated workqueue has been used since the workqueue
> acpi_thermal_pm_queue with workitem &tz->thermal_check_work
> (maps to acpi_thermal_check_fn), is involved in thermal zone polling.
> Wallclock time is actually important and getting delayed in handling
> critical temperature event can actually lead to unnecessary hardware
> damage. So while this is not used during memory reclaim, we still want
> forward progress guarantee and be generally snappy in servicing it.
> Hence, WQ_MEM_RECLAIM and WQ_HIGHPRI have been used here.
> 
> Since there are only a fixed number of work items, explicit concurrency
> limit is unnecessary here.
> 
> Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web