linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wifi: mac80211: use kvcalloc() for codel vars
@ 2024-03-25 14:05 Johannes Berg
  2024-03-25 16:07 ` Toke Høiland-Jørgensen
  2024-03-25 22:44 ` Jeff Johnson
  0 siblings, 2 replies; 3+ messages in thread
From: Johannes Berg @ 2024-03-25 14:05 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, Miriam Rachel Korenblit

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

This is a big array, but it's only used by software and
need not be contiguous in memory. Use kvcalloc() since
it's so big (order 5 allocation).

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/tx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 6bf223e6cd1a..ac5ae7c05e36 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1604,8 +1604,8 @@ int ieee80211_txq_setup_flows(struct ieee80211_local *local)
 	local->cparams.target = MS2TIME(20);
 	local->cparams.ecn = true;
 
-	local->cvars = kcalloc(fq->flows_cnt, sizeof(local->cvars[0]),
-			       GFP_KERNEL);
+	local->cvars = kvcalloc(fq->flows_cnt, sizeof(local->cvars[0]),
+				GFP_KERNEL);
 	if (!local->cvars) {
 		spin_lock_bh(&fq->lock);
 		fq_reset(fq, fq_skb_free_func);
@@ -1625,7 +1625,7 @@ void ieee80211_txq_teardown_flows(struct ieee80211_local *local)
 {
 	struct fq *fq = &local->fq;
 
-	kfree(local->cvars);
+	kvfree(local->cvars);
 	local->cvars = NULL;
 
 	spin_lock_bh(&fq->lock);
-- 
2.44.0


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

* Re: [PATCH] wifi: mac80211: use kvcalloc() for codel vars
  2024-03-25 14:05 [PATCH] wifi: mac80211: use kvcalloc() for codel vars Johannes Berg
@ 2024-03-25 16:07 ` Toke Høiland-Jørgensen
  2024-03-25 22:44 ` Jeff Johnson
  1 sibling, 0 replies; 3+ messages in thread
From: Toke Høiland-Jørgensen @ 2024-03-25 16:07 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless; +Cc: Johannes Berg, Miriam Rachel Korenblit

Johannes Berg <johannes@sipsolutions.net> writes:

> From: Johannes Berg <johannes.berg@intel.com>
>
> This is a big array, but it's only used by software and
> need not be contiguous in memory. Use kvcalloc() since
> it's so big (order 5 allocation).
>
> Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Reviewed-by: Toke Høiland-Jørgensen <toke@kernel.org>

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

* Re: [PATCH] wifi: mac80211: use kvcalloc() for codel vars
  2024-03-25 14:05 [PATCH] wifi: mac80211: use kvcalloc() for codel vars Johannes Berg
  2024-03-25 16:07 ` Toke Høiland-Jørgensen
@ 2024-03-25 22:44 ` Jeff Johnson
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Johnson @ 2024-03-25 22:44 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless; +Cc: Johannes Berg, Miriam Rachel Korenblit

On 3/25/2024 7:05 AM, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> This is a big array, but it's only used by software and
> need not be contiguous in memory. Use kvcalloc() since
> it's so big (order 5 allocation).
> 
> Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>


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

end of thread, other threads:[~2024-03-25 22:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-25 14:05 [PATCH] wifi: mac80211: use kvcalloc() for codel vars Johannes Berg
2024-03-25 16:07 ` Toke Høiland-Jørgensen
2024-03-25 22:44 ` Jeff Johnson

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).