linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Liam R. Howlett" <Liam.Howlett@oracle.com>
To: I Hsin Cheng <richard120310@gmail.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	maple-tree@lists.infradead.org, linux-mm@kvack.org,
	jserv@ccns.ncku.edu.tw, skhan@linuxfoundation.org
Subject: Re: [PATCH] maple_tree: Use ma_dead_node() in mte_dead_node()
Date: Tue, 11 Feb 2025 10:34:25 -0500	[thread overview]
Message-ID: <6d2e6cecbstwvy7h3beplud3fvzyyje5v6iurhl34pr6nlne6z@dt7gl3omst63> (raw)
In-Reply-To: <20250211071850.330632-1-richard120310@gmail.com>

* I Hsin Cheng <richard120310@gmail.com> [250211 02:19]:
> Utilize ma_dead_node() in mte_dead_node(). It can prevent decoding the
> maple enode for a second time. Use the "node" to find parent for
> comparison.

This is much better, thanks.

> 
> Signed-off-by: I Hsin Cheng <richard120310@gmail.com>


Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com>

> ---
>  lib/maple_tree.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)

In the future, please include a link and changes to v1 here.  This is
instead of a cover letter for a single patch.

v1: https://lore.kernel.org/linux-mm/20250210083526.252955-1-richard120310@gmail.com/

Also, the subject should have v2.

> 
> diff --git a/lib/maple_tree.c b/lib/maple_tree.c
> index f7153ade1be5..362f85c62678 100644
> --- a/lib/maple_tree.c
> +++ b/lib/maple_tree.c
> @@ -584,13 +584,10 @@ static __always_inline bool ma_dead_node(const struct maple_node *node)
>   */
>  static __always_inline bool mte_dead_node(const struct maple_enode *enode)
>  {
> -	struct maple_node *parent, *node;
> +	struct maple_node *node;
>  
>  	node = mte_to_node(enode);
> -	/* Do not reorder reads from the node prior to the parent check */
> -	smp_rmb();
> -	parent = mte_parent(enode);
> -	return (parent == node);
> +	return ma_dead_node(node);
>  }
>  
>  /*
> -- 
> 2.43.0
> 


      reply	other threads:[~2025-02-11 15:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11  7:18 I Hsin Cheng
2025-02-11 15:34 ` Liam R. Howlett [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=6d2e6cecbstwvy7h3beplud3fvzyyje5v6iurhl34pr6nlne6z@dt7gl3omst63 \
    --to=liam.howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=jserv@ccns.ncku.edu.tw \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=maple-tree@lists.infradead.org \
    --cc=richard120310@gmail.com \
    --cc=skhan@linuxfoundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox