Re: [Question] The necessity of transaction ID in SLUB.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 23, 2021 at 6:38 PM Christoph Lameter <cl@xxxxxxxxxx> wrote:

>
> > Do you mean that without TID, multiple cpu can race on one
> > cpu_slab->freelist?
> >
> > How is it possible? As you know, cpu_slab is per-cpu variable and
> > cpu_slab->freelist is accessed via "this_cpu_cmpxchg" in the area
> > where preemption is enabled.
>
> That is the problem. Preemption is enabled. This means that slab_alloc can
> be preempted at any time and continue to run on an arbitrary other
> processor and also continue at an arbitrary time. It may also be
> rescheduled on the processor it ran before after executing just one
> instruction or so on another processor.

Yes, that's why transaction id is made up of two part CPU id and event id
(To guarantee there are no other events and migrations).
And the guarantee is ultimately to protect cpu_slab->freelist.

My point is, we can protect cpu_slab->freelist using only cpu_slab->freelist
with less overhead. That's why I'm asking if there's any other reason for TID.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux