lkml.org 
[lkml]   [2024]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] mm/zsmalloc: don't need to save tag bit in handle
From
On 2024/2/27 15:52, Sergey Senozhatsky wrote:
> On (24/02/27 03:00), chengming.zhou@linux.dev wrote:
>>
>> We only need to save the position (pfn + obj_idx) in the handle, don't
>> need to save tag bit in handle. So one more bit can be used as obj_idx.
>
> [..]
>
>> mm/zsmalloc: don't need to save tag bit in handle
>
> Does this mean "don't need to reserve LSB for tag"?
The head of object still need to reverve LSB, to save (handle | OBJ_ALLOCATED_TAG),
only the handle doesn't need to reserve LSB, which save (pfn | obj_idx).

> We still save allocated tag in the handle, that's what
>
> handle |= OBJ_ALLOCATED_TAG;

Yes, this result will be saved in the head of each allocated object.

>
> does.
>
>> Actually, the tag bit is only useful in zspage's memory space, to tell
>> if an object is allocated or not.
>
> I'm not completely sure if I follow this sentence.

What I mean is that only the head of each allocated object need to reverve LSB,
which is used to check if allocated or not.

handle address -> handle (pfn + obj_idx) -> object: (handle | tag), real_object start

I'm not sure if this makes it clearer?

Thanks.

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