From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com [209.85.128.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 911322206A7 for ; Fri, 5 Jun 2026 00:47:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780620431; cv=none; b=kborrcHpGh4icEZeIXgO/EwMKw/DoKVE2wtUt7vBZt4tLjgl42o5QRYXu7lHjNLaCNQXQ3pT8EbAqOXTLZxiqLZQ1l6826o82+Innm/OEpYoC/m4G7LRksfEnP8UyoGgIW2VfkruajceFFlvjabFV7Y08HI3r4nebv/rjIcZQ6o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780620431; c=relaxed/simple; bh=qGy24gu3vUGcBugIVlQhmer9jUs99/uS3k6G4TEPAc0=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:From:To:Cc: References:In-Reply-To; b=R80wn7IBf+vJBM1vyvmx6BeHmUddsNHT5eMAK3RjoUwVFgEjy6iQGuiUmBj6NI8s040EOU6ly622gx44fwEkzdLtUXTdH6R5CvBXWlFspHtKhwKZx0Lqh+9T4M28HCv2MfpWKejpnMzLZxVXO+Caj9fcaA+DWZwb1DImXlMhNWE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CuYou36d; arc=none smtp.client-ip=209.85.128.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CuYou36d" Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-7e1c3f47d78so15652637b3.0 for ; Thu, 04 Jun 2026 17:47:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780620429; x=1781225229; darn=vger.kernel.org; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=6rFNpR8+kRntAg2bWP6kAucMUhEw/l3UqI8+nWLYyf4=; b=CuYou36dTe+mrylf/BvffqxD3I+UJ3iXajZjNBu4udGlvMtzMYdgmJ6PdfuB3zgSDM JHoNpWbywji8iXKyc4CdajBBBDd+U4DT7IrHO+grb916LJT0PnJFSUlprRHLDKJIVfeu IzQnyUmPFscJpcQFyq10Hw0cX57f3secISO/xUc8K+tiCCUUMIKnJlRcGY8tUMG+P+ed rQQbX5KKdGcHKp8/b+7AoJ4GwlFEoKvtOu4TIRemwy2mRs4zZExGNchRQKJi7/P9aANm Xmrpv/ThH+JK16SHqC00eVgQdodGdt8f7coyKGH+CRYXXlplIXT2rk44sQtsRT1aDj23 DMZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780620429; x=1781225229; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6rFNpR8+kRntAg2bWP6kAucMUhEw/l3UqI8+nWLYyf4=; b=JRyjYwLnSvvZ36o5P+AapnR6kLg7bKnzkYBzygSkQNP1GBm7KrGEonJEb0wNimOA/M S5uqBTA6HE79HG1Aj4y7grfQaMoZ7IyFbKbvGY69O0WZgWWwdtku899grocDfBAqbhHC wx3Nd+mptPOXsuTw293jJ6EY9c1LlQHLRPU8PpEHxUA/yUNX128YjedjcDsqVA/HavVl gf6mG07AjNVqPEGRz2mQlqgRHQIUve0DXjFHxRfUdnLkaN3sUmhsj2e8f0vJTKIiqPnT FmCu9jG7QnGOesLEej7ImL7e8hH+aeLisRIa8XSFHacTCIJ75VxMQZhQfyoEuyo1PcW/ HpXQ== X-Gm-Message-State: AOJu0Yw0SKYDfiCXtHbSAp4uWWUWYkI0zL87kD4x35nfx0oB6/0+byuQ 45NkcLfyHVVPvlzr+xKX41NNMCNKypAEx+1yqnM/n/dwK6JRRTxN+JDLFyunYQ== X-Gm-Gg: Acq92OEdjiXX4TNFI6jc0jgXY6wKmcPeRNZPAWwrW+158nhM6rJ+svTyc8e4BlKF+tI h+2IqaL6zkfhY8XoHRxIKhihzHXZcN1HdT5sPhPHQcJrtZqGhNWvD1TeU7c1sVbwvRLUGkBsbjd pVZSKoRegQx1R3sMcQhHf9fzvbQBQ0V1vVCwLqsDI/dTImgpf/ARd5WiqymV99APt4LvnlE51a4 1Einp/A9j5eCNwUpglR6QNFTcic4G0LDx2huLy/FAU109lwnMw+hscmVt2HeQyNJUus8RbkCsQv zpnl0Wko8HrinCLWRUs4nLHSTl10BbJSvgFiUqeCjCpr8BjdWmKP1OhnWYtBaq6Jn4b/RNv0un+ 1q+t+jTxmafW1t+Wr+jlxkeB2C8Bfia0nBUgSrX7SLiP/41igOednazyzua+ru+tL81uSTvk15e kVSN21IXWtvyvI8qmZJtrer7GOD9GFMP1nlDOUcimc0hxWZuASKnxjHCPc4BYeXsvsI3XDEW+Mm Vt7th3l6Y6l3xucapsHOA11FBuaDpZWw2GRRayjc03IlRmWNYA= X-Received: by 2002:a05:690c:7247:b0:79b:deb2:f5ed with SMTP id 00721157ae682-7ed0c8096d9mr13170147b3.23.1780620429564; Thu, 04 Jun 2026 17:47:09 -0700 (PDT) Received: from localhost ([2601:644:8000:5b5d:7285:c2ff:fe45:8a32]) by smtp.gmail.com with ESMTPSA id 00721157ae682-7ea21968299sm44027227b3.19.2026.06.04.17.47.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Jun 2026 17:47:09 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 04 Jun 2026 17:47:06 -0700 Message-Id: Subject: Re: [PATCH wireless-next] wifi: mac80211: fold tid_ampdu_rx allocations into a flexible array From: "Rosen Penev" To: "Johannes Berg" , "Rosen Penev" , Cc: "open list" X-Mailer: aerc 0.21.0-0-g5549850facc2 References: <20260604001427.16466-1-rosenp@gmail.com> <64823ef6ba20312cf81eae281740873f5ae6e6f5.camel@sipsolutions.net> 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) =3D=3D sizeof(void *), that would probab= ly > 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