lkml.org 
[lkml]   [2024]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 3/4] mm/slub: simplify get_partial_node()
From
On 4/3/24 2:37 AM, Song, Xiongwei wrote:
>>
>>
>> It could be tempting to use >= instead of > to achieve the same effect but
>> that would have unintended performance effects that would best be evaluated
>> separately.
>
> I can run a test to measure Amean changes. But in terms of x86 assembly, there
> should not be extra instructions with ">=".
>
> Did a simple test, for ">=" it uses "jle" instruction, while "jl" instruction is used for ">".
> No more instructions involved. So there should not be performance effects on x86.

Right, I didn't mean the code of the test, but how the difference of the
comparison affects how many cpu partial slabs would be put on the cpu
partial list here.

> Thanks,
> Xiongwei
>
>>
>> >
>> > + put_cpu_partial(s, slab, 0);
>> > + stat(s, CPU_PARTIAL_NODE);
>> > + partial_slabs++;
>> > +
>> > + if (partial_slabs > slub_get_cpu_partial(s) / 2)
>> > + break;
>> > }
>> > spin_unlock_irqrestore(&n->list_lock, flags);
>> > return partial;
>


\
 
 \ /
  Last update: 2024-05-27 16:20    [W:0.078 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site