From nobody Thu Apr 2 14:07:32 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7BB753161BA for ; Tue, 10 Feb 2026 10:35:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770719734; cv=none; b=ioeb25TGOpF/+PgxdBjNpcRZuYztpZdw1utcvarl8hdiSGw2FHjgc9RXA5m9vyr4EI979LTt07vmIUcqAkmRCEtFqFuVy0iKRH+gQ3pBeoCVCSnQsiszxgO+ELjYcj6JYI3Oggq/WjdLC2RGfSn6rkaU2DV36uqzrCEH5kNAtJ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770719734; c=relaxed/simple; bh=hDC09oPAay5szzle/jEtOSBuhkapHj3YlkKxN6KU0n0=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=uoim7mbgOtJAtfJrX1QwF1F/+mali9l7v+NlG/Ol90Lf5IDQSkinUdUa015TXfq/h1nznvxpAKLn/ntFguHh75qDOeCC2urzqdClmV4EDoJFwK5HAEV3XB79DTMmLZWN7/kWKBRmFa2qnhNTVigBI6mWJouJoTtHX9Eb4qL2gaw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Utw3XW8m; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Utw3XW8m" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53EA6C116C6; Tue, 10 Feb 2026 10:35:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770719734; bh=hDC09oPAay5szzle/jEtOSBuhkapHj3YlkKxN6KU0n0=; h=From:To:Cc:Subject:Date:From; b=Utw3XW8mPDXyZ1bk1xaj70HXoE40pa+qrwSW6zgkSSHxT9DIJX8V+r0pYpfYFDtOU HUX9bm3ud2Fd9afysT3Si4RHcoQKUMGQ8iZq/IxI9J1ppAsQQktQX8Zr9vTxixn1l0 2Mlbf2qAq+BQoZ+vniAo5kBJ7u8UfaKfC/xVGzV7Sev3EPMfwjYn17tkhdggNiLDIB LUwxrtMCcPd0JXn232StE8aMstPVdngeKZ7oCkTjH0I2bXPotWCaV86ekYlQYqHKxA a0GRg5QCYFQvSVWZZ4dZEYj4O0OMQCYPrq+LCexnT6UYMOsZWzfmNYTSbm7dZhnQhp X9ynAdnCg2AjQ== From: Arnd Bergmann To: Matt Wu Cc: Arnd Bergmann , Yury Norov , linux-kernel@vger.kernel.org Subject: [PATCH] objpool: fix minimum alignment of 'struct objpool_slot' Date: Tue, 10 Feb 2026 11:35:24 +0100 Message-Id: <20260210103530.3028454-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 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" From: Arnd Bergmann Members of objpool_slot get passed into try_cmpxchg_release(), which does not work on most architectures unless they are naturally aligned. Marking the structure as packed makes it only byte-aligned, as shown by this (normally disabled) warning: include/linux/objpool.h:156:56: warning: taking address of packed member of= 'struct objpool_slot' may result in an unaligned pointer value [-Waddress-= of-packed-member] 156 | if (try_cmpxchg_release(&slot->head, &head, head + = 1)) | ~^~~~~~~~~~~~ As the struct members are all tightly packed on all architectures, Just remove the '__packed annotation to give it the required alignment of the native word size. Signed-off-by: Arnd Bergmann Reviewed-by: Yury Norov Reviewed-by: wuqiang.matt --- include/linux/objpool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/objpool.h b/include/linux/objpool.h index b713a1fe7521..f678b35b20b1 100644 --- a/include/linux/objpool.h +++ b/include/linux/objpool.h @@ -56,7 +56,7 @@ struct objpool_slot { uint32_t last; uint32_t mask; void *entries[]; -} __packed; +}; =20 struct objpool_head; =20 --=20 2.39.5