Hi,

Recently, I had difficulty understanding the meaning of the barrier()
in the slab_alloc_node().

The comments are written like this.

/*
* Irqless object alloc/free algorithm used here depends on sequence
* of fetching cpu_slab's data. tid should be fetched before anything
* on c to guarantee that object and page associated with previous tid
* won't be used with current tid. If we fetch tid first, object and
* page could be one associated with next tid and our alloc/free
* request will be failed. In this case, we will retry. So, no problem.
*/
barrier();

Even if we don't fetch tid first, don't we try again by this_cpu_cmpxchg_double?
I'd really appreciate it if you let me know what I missed!

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to