From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>
To: Levi Yun <ppbuk5246@gmail.com>
Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] maple_tree: remove mast_overflow.
Date: Sun, 12 Nov 2023 10:29:24 -0500 [thread overview]
Message-ID: <20231112152924.wzuxtcsvlwaxhf4c@revolver> (raw)
In-Reply-To: <20231111110417.38655-1-ppbuk5246@gmail.com>
* Levi Yun <ppbuk5246@gmail.com> [231111 06:04]:
> mast_overflow is used only in mas_spanning_rebalance.
> But when mast_sufficient is false, mast_overflow always returns false,
NACK
mast_sufficient checks the mt_min_slot_count() against the end while
mast_overflow checks the mt_slot_count() against the end.
> and when mast_suffictent is true, it never reaches to mast_overflow in
> mas_spanning_rebalance.
>
> Therefore, mast_overflow is dead code in mas_spanning_rebalance.
> And there is no other usage of mast_overflow execpt
> mas_spanning_rebalance, Remove mast_overflow.
>
> Signed-off-by: Levi Yun <ppbuk5246@gmail.com>
> ---
> lib/maple_tree.c | 16 ----------------
> 1 file changed, 16 deletions(-)
>
> diff --git a/lib/maple_tree.c b/lib/maple_tree.c
> index bb24d84a4922..1e591e71621e 100644
> --- a/lib/maple_tree.c
> +++ b/lib/maple_tree.c
> @@ -2767,19 +2767,6 @@ static inline bool mast_sufficient(struct maple_subtree_state *mast)
> return false;
> }
>
> -/*
> - * mast_overflow: Check if there is too much data in the subtree state for a
> - * single node.
> - * @mast: The maple subtree state
> - */
> -static inline bool mast_overflow(struct maple_subtree_state *mast)
> -{
> - if (mast->bn->b_end >= mt_slot_count(mast->orig_l->node))
> - return true;
> -
> - return false;
> -}
> -
> static inline void *mtree_range_walk(struct ma_state *mas)
> {
> unsigned long *pivots;
> @@ -2934,9 +2921,6 @@ static int mas_spanning_rebalance(struct ma_state *mas,
> if (mast_sufficient(mast))
> continue;
>
> - if (mast_overflow(mast))
> - continue;
> -
> /* May be a new root stored in mast->bn */
> if (mas_is_root_limits(mast->orig_l))
> break;
> --
> 2.41.0
>
prev parent reply other threads:[~2023-11-12 15:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-11 11:04 Levi Yun
2023-11-12 15:29 ` 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=20231112152924.wzuxtcsvlwaxhf4c@revolver \
--to=liam.howlett@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=maple-tree@lists.infradead.org \
--cc=ppbuk5246@gmail.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