lkml.org 
[lkml]   [2021]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] hotfix: make sysfs of unbound kworker cpumask more clever
Date
From: Mengen Sun <mengensun@tencent.com>

some unfriendly component eg, dpdk, write the same mask to unbound
kworker cpumask again and agin. every time it write to this interface
some work is queue to cpu, by rr evenly the mask is same with the
original mask.

so, fix it, if the writing cpumask is equal with the old cpumask
just return success and do nothing.

Signed-off-by: Mengen Sun <mengensun@tencent.com>
---
kernel/workqueue.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 1b3eb1e9531f..8216fc45c77b 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -5394,6 +5394,11 @@ int workqueue_set_unbound_cpumask(cpumask_var_t cpumask)
cpumask_and(cpumask, cpumask, cpu_possible_mask);
if (!cpumask_empty(cpumask)) {
apply_wqattrs_lock();
+ if (cpumask_equal(cpumask, wq_unbound_cpumask)) {
+ apply_wqattrs_unlock();
+ free_cpumask_var(saved_cpumask);
+ return 0;
+ }

/* save the old wq_unbound_cpumask. */
cpumask_copy(saved_cpumask, wq_unbound_cpumask);
--
2.27.0
\
 
 \ /
  Last update: 2021-10-14 05:07    [W:0.047 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site