On Thu, 3 Apr 2025 at 22:23, Bernd Schubert <bschubert@xxxxxxx> wrote: > +/** > + * Get the next unique ID for a request > + */ > +static inline u64 fuse_get_unique(struct fuse_iqueue *fiq) > +{ > + int step = FUSE_REQ_ID_STEP * (task_cpu(current)); > + u64 cntr = this_cpu_inc_return(*fiq->reqctr); > + > + return cntr * FUSE_REQ_ID_STEP * NR_CPUS + step; Thinking a bit... this looks wrong. The reason is that the task could be migrated to a different CPU between the task_cpu() and the this_cpu_inc_return(), resulting in a possibly duplicated value. This could be fixed with a preempt_disable()/preempt_enable() pair, but I think it would be cleaner to go with my original idea and initialize the percpu counters to CPUID and increment by NR_CPU * FUSE_REQ_ID_STEP when fetching a new value. Thanks, Miklos