Skip to content

Commit c0aac59

Browse files
mjguzikbrauner
authored andcommitted
ns: pad refcount
Note no effort is made to make sure structs embedding the namespace are themselves aligned, so this is not guaranteed to eliminate cacheline bouncing due to refcount management. Signed-off-by: Mateusz Guzik <mjguzik@gmail.com> Link: https://patch.msgid.link/20251203092851.287617-2-mjguzik@gmail.com Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 887e977 commit c0aac59

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/linux/ns/ns_common_types.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,13 @@ extern const struct proc_ns_operations utsns_operations;
108108
* @ns_tree: namespace tree nodes and active reference count
109109
*/
110110
struct ns_common {
111+
struct {
112+
refcount_t __ns_ref; /* do not use directly */
113+
} ____cacheline_aligned_in_smp;
111114
u32 ns_type;
112115
struct dentry *stashed;
113116
const struct proc_ns_operations *ops;
114117
unsigned int inum;
115-
refcount_t __ns_ref; /* do not use directly */
116118
union {
117119
struct ns_tree;
118120
struct rcu_head ns_rcu;

0 commit comments

Comments
 (0)