From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C10CE18EB0; Thu, 4 Jun 2026 12:20:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780575630; cv=none; b=E9/ub6eKe2fJomRkAw5VygC0DheXxiseVnspN+JIyEIoHQiGhO4aaK9IJthYNtcnOg56j2xWa7GD73suYWxYBSwjEYyhlzA953pFQPsJRPgOecTWfl8pTxW7U8IrXV5bms8MK8ZaYHpAODgnp5xaa3X27Y4F5PpBLf5ROkdkuBo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780575630; c=relaxed/simple; bh=krSq2+uB4rUrgmlMiYugwrJtTJ3HcqQLQOaI/vb+E2U=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=uAWK+cj0NpJVQ30O71Cz4vQPo9+1pf517FCzEwucrw9cwu7yhMDkNO3J+zdyUeVll9qS4vMEZ8Zy8kJXe5gjB/H4GmHPuWJCUn6Nsj1GJxSnkYUqtwYozrXjthCi9S2JcJVNkG2wFLEnSrIw7K9Cqs0AMXONnS3ZjUbtb8zmzv0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=permerror header.from=sipsolutions.net; spf=none smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=WSBn5XQL; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=permerror header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="WSBn5XQL" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=C/MpNNM+9zhiM9ebOzU3o3ld+8lWdyy3/7LymgZkFX0=; t=1780575628; x=1781785228; b=WSBn5XQLbaNeXgFzXU5aeAQ0mIuJRvpLyFohEUeQmUxOmHJ zZq8a2iUs1QlIZfClxwHCPougG7f2XWw1JOWS+hnrIpaF2v5P/gO/32Fpn2Xk6T18r9OhGUlnGdo4 qeSaFw7t9YPi7y4eSi5F4j7zxGtazlFvbgv+xEsQz29COwHXEezUSBAK0qtBWG8riQmSR/gDp3yVs bZ9c4J5iO8upB5sZYkQSDJmJxoDp/CWQt0PNHm0xkAcQwJu1DCpAzxMXBuGU81D8MMBuowt47olMp gMYSADg6AqiNhf8u3AIDCvbRqusDMhHjat8HR6YBg2YqpBFvwCX1Gpl8Qulv6kSQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.98.2) (envelope-from ) id 1wV73i-00000000Thl-0R5i; Thu, 04 Jun 2026 14:20:26 +0200 Message-ID: <64823ef6ba20312cf81eae281740873f5ae6e6f5.camel@sipsolutions.net> Subject: Re: [PATCH wireless-next] wifi: mac80211: fold tid_ampdu_rx allocations into a flexible array From: Johannes Berg To: Rosen Penev , linux-wireless@vger.kernel.org Cc: open list Date: Thu, 04 Jun 2026 14:20:25 +0200 In-Reply-To: <20260604001427.16466-1-rosenp@gmail.com> References: <20260604001427.16466-1-rosenp@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 (3.58.3-1.fc43) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-malware-bazaar: not-scanned 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 ... > @@ -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) =3D=3D sizeof(void *), that would probably be far simpler as struct { struct sk_buf_head buf; unsigned long time; } reorder[]; or so. johannes