All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Yang <richard.weiyang@gmail.com>
To: "Liam R. Howlett" <Liam.Howlett@oracle.com>,
	Wei Yang <richard.weiyang@gmail.com>,
	akpm@linux-foundation.org, maple-tree@lists.infradead.org,
	linux-mm@kvack.org
Subject: Re: [PATCH] maple_tree: root node could be handled by !p_slot too
Date: Sun, 13 Oct 2024 14:41:59 +0000	[thread overview]
Message-ID: <20241013144159.327jcs2inubxtdme@master> (raw)
In-Reply-To: <uprpkh6q4dnvqip73ayafcmpwxk73puhfw3y6tm6f3pt5epxqh@nczf53ftvymb>

On Fri, Sep 13, 2024 at 10:17:07AM -0400, Liam R. Howlett wrote:
>* Wei Yang <richard.weiyang@gmail.com> [240913 02:31]:
>> For a root node, mte_parent_slot() return 0, this exactly fits the
>> following !p_slot check.
>
>This sounds right, I will have to look deeper at it though.
>

Hi, Liam

I guess you are back?

>Thanks,
>Liam
>
>> 
>> So we can remove the special handling for root node.
>> 
>> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>> CC: Liam R. Howlett <Liam.Howlett@Oracle.com>
>> ---
>>  lib/maple_tree.c | 4 +---
>>  1 file changed, 1 insertion(+), 3 deletions(-)
>> 
>> diff --git a/lib/maple_tree.c b/lib/maple_tree.c
>> index 85bd651e7770..b5dde94cc7a9 100644
>> --- a/lib/maple_tree.c
>> +++ b/lib/maple_tree.c
>> @@ -2100,9 +2100,7 @@ static inline bool mas_prev_sibling(struct ma_state *mas)
>>  {
>>  	unsigned int p_slot = mte_parent_slot(mas->node);
>>  
>> -	if (mte_is_root(mas->node))
>> -		return false;
>> -
>> +	/* For root node, p_slot is set to 0 by mte_parent_slot(). */
>>  	if (!p_slot)
>>  		return false;
>>  
>> -- 
>> 2.34.1
>> 

-- 
Wei Yang
Help you, Help me


  reply	other threads:[~2024-10-13 14:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-13  6:31 [PATCH] maple_tree: root node could be handled by !p_slot too Wei Yang
2024-09-13 14:17 ` Liam R. Howlett
2024-10-13 14:41   ` Wei Yang [this message]
2024-10-14  2:06     ` Liam R. Howlett
2024-10-14  2:49       ` Wei Yang
2024-10-15  1:13 ` Liam R. Howlett

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=20241013144159.327jcs2inubxtdme@master \
    --to=richard.weiyang@gmail.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=maple-tree@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.