Question about "barrier()" in the SLUB's fast path
Nov. 12, 2021
7:38 a.m.
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!
1736
Age (days ago)
1736
Last active (days ago)
0 comments
1 participants
participants (1)
-
Wonhyuk Yang