On Mon, Mar 10, 2025 at 10:59:30AM -0700, JP Kobryn <inwardvessel@xxxxxxxxx> wrote: > > DEFINE_PER_CPU(raw_spinlock_t, cgroup_rstat_base_cpu_lock) = > > __RAW_SPIN_LOCK_INITIALIZER(cgroup_rstat_base_cpu_lock); > > > > (I see other places in kernel that assign into the per-cpu definition > > but I have no idea whether that does expands and links to what's > > expected. Neglecting the fact that the lock initializer is apparently > > not for external use.) > > I gave this a try. Using lockdep fields to verify, it expanded as > intended: > [ 1.442498] [ss_rstat_init] cpu:0, lock.magic:dead4ead, > lock.owner_cpu:-1, lock.owner:ffffffffffffffff > [ 1.443027] [ss_rstat_init] cpu:1, lock.magic:dead4ead, > lock.owner_cpu:-1, lock.owner:ffffffffffffffff > ... > > Unless anyone has objections on using the double under macro, I will use > this in v3. Actually, I have the objection (to the underscored macro). It may be work today but it may break subtly in the future. Maybe add a separate patch that introduces a proper (non-underscore) initializer (or percpu wrapped initializer) macro and people Cc'd on that may evaluate wiseness of that. Michal
Attachment:
signature.asc
Description: PGP signature