From: Chengming Zhou <chengming.zhou@linux.dev>
To: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: minchan@kernel.org, akpm@linux-foundation.org,
hannes@cmpxchg.org, nphamcs@gmail.com, yosryahmed@google.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Chengming Zhou <zhouchengming@bytedance.com>
Subject: Re: [PATCH] mm/zsmalloc: don't need to save tag bit in handle
Date: Wed, 28 Feb 2024 10:17:02 +0800 [thread overview]
Message-ID: <d7611a8f-c266-4545-b0d9-a5e6ef3abf0e@linux.dev> (raw)
In-Reply-To: <20240228015437.GB11972@google.com>
On 2024/2/28 09:54, Sergey Senozhatsky wrote:
> On (24/02/27 16:16), Chengming Zhou wrote:
>> 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).
>
> Correct.
>
>>> 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.
>
> Right, that's what I was talking about.
>
>>>> 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?
>
> Yes, thanks. I think separating handle and object header in the commit
> message will be helpful.
Right, I will improve the commit message and send v2.
Thanks!
prev parent reply other threads:[~2024-02-28 2:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-27 3:00 chengming.zhou
2024-02-27 7:52 ` Sergey Senozhatsky
2024-02-27 8:16 ` Chengming Zhou
2024-02-28 1:54 ` Sergey Senozhatsky
2024-02-28 2:17 ` Chengming Zhou [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d7611a8f-c266-4545-b0d9-a5e6ef3abf0e@linux.dev \
--to=chengming.zhou@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=nphamcs@gmail.com \
--cc=senozhatsky@chromium.org \
--cc=yosryahmed@google.com \
--cc=zhouchengming@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox