Lines Matching defs:tid

121  *   the transaction id (tid) field to detect being preempted or moved to
2428 static inline unsigned long next_tid(unsigned long tid)
2430 return tid + TID_STEP;
2434 static inline unsigned int tid_to_cpu(unsigned long tid)
2436 return tid % TID_STEP;
2439 static inline unsigned long tid_to_event(unsigned long tid)
2441 return tid / TID_STEP;
2451 const struct kmem_cache *s, unsigned long tid)
2454 unsigned long actual_tid = __this_cpu_read(s->cpu_slab->tid);
2459 if (tid_to_cpu(tid) != tid_to_cpu(actual_tid))
2461 tid_to_cpu(tid), tid_to_cpu(actual_tid));
2464 if (tid_to_event(tid) != tid_to_event(actual_tid))
2466 tid_to_event(tid), tid_to_event(actual_tid));
2469 actual_tid, tid, next_tid(tid));
2482 c->tid = init_tid(cpu);
2757 c->tid = next_tid(c->tid);
2775 c->tid = next_tid(c->tid);
3033 unsigned long tid)
3035 freelist_aba_t old = { .freelist = freelist_old, .counter = tid };
3036 freelist_aba_t new = { .freelist = freelist_new, .counter = next_tid(tid) };
3155 c->tid = next_tid(c->tid);
3174 c->tid = next_tid(c->tid);
3188 c->tid = next_tid(c->tid);
3288 c->tid = next_tid(c->tid);
3334 unsigned long tid;
3344 * We must guarantee that tid and kmem_cache_cpu are retrieved on the
3346 * the tid. If we are preempted and switched to another cpu between the
3351 tid = READ_ONCE(c->tid);
3355 * of fetching cpu_slab's data. tid should be fetched before anything
3356 * on c to guarantee that object and slab associated with previous tid
3357 * won't be used with current tid. If we fetch tid first, object and
3358 * slab could be one associated with next tid and our alloc/free
3386 * 2. Verify that tid and freelist have not been changed
3387 * 3. If they were not changed replace tid and freelist
3393 if (unlikely(!__update_cpu_freelist_fast(s, object, next_object, tid))) {
3394 note_cmpxchg_failure("slab_alloc", s, tid);
3740 unsigned long tid;
3751 tid = READ_ONCE(c->tid);
3766 if (unlikely(!__update_cpu_freelist_fast(s, freelist, head, tid))) {
3767 note_cmpxchg_failure("slab_free", s, tid);
3778 tid = c->tid;
3783 c->tid = next_tid(tid);
3962 * c->tid has not been bumped yet.
3964 * allocating memory, we should bump c->tid now.
3966 c->tid = next_tid(c->tid);
3990 c->tid = next_tid(c->tid);