Linux wireless drivers development
 help / color / mirror / Atom feed
From: "Rosen Penev" <rosenp@gmail.com>
To: "Johannes Berg" <johannes@sipsolutions.net>,
	"Rosen Penev" <rosenp@gmail.com>,
	<linux-wireless@vger.kernel.org>
Cc: "open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH wireless-next] wifi: mac80211: fold tid_ampdu_rx allocations into a flexible array
Date: Thu, 04 Jun 2026 17:47:06 -0700	[thread overview]
Message-ID: <DJ0P9FDV1BW8.1LKRTVDOTEFGW@gmail.com> (raw)
In-Reply-To: <64823ef6ba20312cf81eae281740873f5ae6e6f5.camel@sipsolutions.net>

On Thu Jun 4, 2026 at 5:20 AM PDT, Johannes Berg wrote:
> On Wed, 2026-06-03 at 17:14 -0700, Rosen Penev wrote:
>> Convert the separately-allocated reorder_buf pointer to a C99 flexible
>> array member at the end of struct tid_ampdu_rx, and place reorder_time
>> in the same allocation immediately after it. This collapses three
>> allocations into one and removes the corresponding kfree() pairs from
>> the error and free paths.
>
> As I pointed out before, I'm not a huge fan of these "doing a minor
> improvement for the sake of it" contributions ...
You say that but these have resulted in missing kfrees being discovered
throughout the tree.
>
>> @@ -241,7 +241,6 @@ struct tid_ampdu_rx {
>>  	struct rcu_head rcu_head;
>>  	spinlock_t reorder_lock;
>>  	u64 reorder_buf_filtered;
>> -	struct sk_buff_head *reorder_buf;
>>  	unsigned long *reorder_time;
>>  	struct sta_info *sta;
>>  	struct timer_list session_timer;
>> @@ -256,6 +255,7 @@ struct tid_ampdu_rx {
>>  	u8 auto_seq:1,
>>  	   removed:1,
>>  	   started:1;
>> +	struct sk_buff_head reorder_buf[];
>
> Given that sizeof(unsigned long) == sizeof(void *), that would probably
> be far simpler as
>
> 	struct {
> 		struct sk_buf_head buf;
> 		unsigned long time;
> 	} reorder[];
>
> or so.
This is indeed much better. Will make the change.
>
> johannes


      reply	other threads:[~2026-06-05  0:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-04  0:14 [PATCH wireless-next] wifi: mac80211: fold tid_ampdu_rx allocations into a flexible array Rosen Penev
2026-06-04 12:20 ` Johannes Berg
2026-06-05  0:47   ` Rosen Penev [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DJ0P9FDV1BW8.1LKRTVDOTEFGW@gmail.com \
    --to=rosenp@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox