linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wifi: cfg80211: use system_unbound_wq for wiphy work
@ 2023-10-09  8:18 Johannes Berg
  2023-10-09  9:18 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2023-10-09  8:18 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, Kalle Valo

From: Johannes Berg <johannes.berg@intel.com>

Since wiphy work items can run pretty much arbitrary
code in the stack/driver, it can take longer to run
all of this, so we shouldn't be using system_wq via
schedule_work(). Also, we lock the wiphy (which is
the reason this exists), so use system_unbound_wq.

Reported-by: Kalle Valo <kvalo@kernel.org>
Fixes: a3ee4dc84c4e ("wifi: cfg80211: add a work abstraction with special semantics")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/wireless/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/wireless/core.c b/net/wireless/core.c
index 7df8ffcfa0c4..758c9a2a12c0 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -1613,7 +1613,7 @@ void wiphy_work_queue(struct wiphy *wiphy, struct wiphy_work *work)
 		list_add_tail(&work->entry, &rdev->wiphy_work_list);
 	spin_unlock_irqrestore(&rdev->wiphy_work_lock, flags);
 
-	schedule_work(&rdev->wiphy_work);
+	queue_work(system_unbound_wq, &rdev->wiphy_work);
 }
 EXPORT_SYMBOL_GPL(wiphy_work_queue);
 
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] wifi: cfg80211: use system_unbound_wq for wiphy work
  2023-10-09  8:18 [PATCH] wifi: cfg80211: use system_unbound_wq for wiphy work Johannes Berg
@ 2023-10-09  9:18 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2023-10-09  9:18 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

Johannes Berg <johannes@sipsolutions.net> writes:

> From: Johannes Berg <johannes.berg@intel.com>
>
> Since wiphy work items can run pretty much arbitrary
> code in the stack/driver, it can take longer to run
> all of this, so we shouldn't be using system_wq via
> schedule_work(). Also, we lock the wiphy (which is
> the reason this exists), so use system_unbound_wq.
>
> Reported-by: Kalle Valo <kvalo@kernel.org>
> Fixes: a3ee4dc84c4e ("wifi: cfg80211: add a work abstraction with special semantics")
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Thanks!

So the background of this is that I enabled
CONFIG_WQ_CPU_INTENSIVE_REPORT on my ath11k test box and saw:

[  290.475631] workqueue: cfg80211_wiphy_work [cfg80211] hogged CPU for >10000us 4 times, consider switching to WQ_UNBOUND

With Johannes' patch I don't see it anymore so:

Tested-by: Kalle Valo <kvalo@kernel.org>

I do see one other warning about gc_worker but that's from netfilter and
nothing to do with wireless:

[  440.486683] workqueue: gc_worker hogged CPU for >10000us 128 times, consider switching to WQ_UNBOUND

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-09  9:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-09  8:18 [PATCH] wifi: cfg80211: use system_unbound_wq for wiphy work Johannes Berg
2023-10-09  9:18 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).