mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] maple_tree: arange64 node is not a leaf node
@ 2024-08-26  1:24 Wei Yang
  2024-08-26  1:24 ` [PATCH 2/2] maple_tree: dump error message based on format Wei Yang
  2024-08-28  1:34 ` [PATCH 1/2] maple_tree: arange64 node is not a leaf node Andrew Morton
  0 siblings, 2 replies; 6+ messages in thread
From: Wei Yang @ 2024-08-26  1:24 UTC (permalink / raw)
  To: Liam.Howlett, akpm; +Cc: linux-kernel, maple-tree, Wei Yang

mt_dump_arange64() only applies to an entry whose type is
maple_arange_64, in which mte_is_leaf() must return false.

Since mte_is_leaf() here is always false, we can remove this condition
check.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
 lib/maple_tree.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 5dd9d9db4fdc..236b58fd9be4 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -7177,7 +7177,6 @@ static void mt_dump_arange64(const struct maple_tree *mt, void *entry,
 	enum mt_dump_format format)
 {
 	struct maple_arange_64 *node = &mte_to_node(entry)->ma64;
-	bool leaf = mte_is_leaf(entry);
 	unsigned long first = min;
 	int i;
 
@@ -7211,10 +7210,7 @@ static void mt_dump_arange64(const struct maple_tree *mt, void *entry,
 			break;
 		if (last == 0 && i > 0)
 			break;
-		if (leaf)
-			mt_dump_entry(mt_slot(mt, node->slot, i),
-					first, last, depth + 1, format);
-		else if (node->slot[i])
+		if (node->slot[i])
 			mt_dump_node(mt, mt_slot(mt, node->slot, i),
 					first, last, depth + 1, format);
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/2] maple_tree: dump error message based on format
  2024-08-26  1:24 [PATCH 1/2] maple_tree: arange64 node is not a leaf node Wei Yang
@ 2024-08-26  1:24 ` Wei Yang
  2024-08-28  1:34 ` [PATCH 1/2] maple_tree: arange64 node is not a leaf node Andrew Morton
  1 sibling, 0 replies; 6+ messages in thread
From: Wei Yang @ 2024-08-26  1:24 UTC (permalink / raw)
  To: Liam.Howlett, akpm; +Cc: linux-kernel, maple-tree, Wei Yang

Just do what mt_dump_range64() does.

Dump the error message based on format.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
 lib/maple_tree.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 236b58fd9be4..0c06a4c6d3bd 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -7217,9 +7217,15 @@ static void mt_dump_arange64(const struct maple_tree *mt, void *entry,
 		if (last == max)
 			break;
 		if (last > max) {
-			pr_err("node %p last (%lu) > max (%lu) at pivot %d!\n",
+			switch(format) {
+			case mt_dump_hex:
+				pr_err("node %p last (%lx) > max (%lx) at pivot %d!\n",
 					node, last, max, i);
-			break;
+				break;
+			case mt_dump_dec:
+				pr_err("node %p last (%lu) > max (%lu) at pivot %d!\n",
+					node, last, max, i);
+			}
 		}
 		first = last + 1;
 	}
-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] maple_tree: arange64 node is not a leaf node
  2024-08-26  1:24 [PATCH 1/2] maple_tree: arange64 node is not a leaf node Wei Yang
  2024-08-26  1:24 ` [PATCH 2/2] maple_tree: dump error message based on format Wei Yang
@ 2024-08-28  1:34 ` Andrew Morton
  2024-08-28 12:05   ` Wei Yang
  2024-08-28 18:57   ` Liam R. Howlett
  1 sibling, 2 replies; 6+ messages in thread
From: Andrew Morton @ 2024-08-28  1:34 UTC (permalink / raw)
  To: Wei Yang; +Cc: Liam.Howlett, linux-kernel, maple-tree

On Mon, 26 Aug 2024 01:24:21 +0000 Wei Yang <richard.weiyang@gmail.com> wrote:

> mt_dump_arange64() only applies to an entry whose type is
> maple_arange_64, in which mte_is_leaf() must return false.
> 
> Since mte_is_leaf() here is always false, we can remove this condition
> check.
> 

These are pretty simple so I'll say lack-of-a-nack-is-an-ack ;)

Please do cc linux-mm on maple-tree changes.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] maple_tree: arange64 node is not a leaf node
  2024-08-28  1:34 ` [PATCH 1/2] maple_tree: arange64 node is not a leaf node Andrew Morton
@ 2024-08-28 12:05   ` Wei Yang
  2024-08-28 18:57   ` Liam R. Howlett
  1 sibling, 0 replies; 6+ messages in thread
From: Wei Yang @ 2024-08-28 12:05 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Wei Yang, Liam.Howlett, linux-kernel, maple-tree

On Tue, Aug 27, 2024 at 06:34:26PM -0700, Andrew Morton wrote:
>On Mon, 26 Aug 2024 01:24:21 +0000 Wei Yang <richard.weiyang@gmail.com> wrote:
>
>> mt_dump_arange64() only applies to an entry whose type is
>> maple_arange_64, in which mte_is_leaf() must return false.
>> 
>> Since mte_is_leaf() here is always false, we can remove this condition
>> check.
>> 
>
>These are pretty simple so I'll say lack-of-a-nack-is-an-ack ;)
>
>Please do cc linux-mm on maple-tree changes.

Sure, will cc linux-mm next time.

-- 
Wei Yang
Help you, Help me

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] maple_tree: arange64 node is not a leaf node
  2024-08-28  1:34 ` [PATCH 1/2] maple_tree: arange64 node is not a leaf node Andrew Morton
  2024-08-28 12:05   ` Wei Yang
@ 2024-08-28 18:57   ` Liam R. Howlett
  2024-08-28 23:24     ` Wei Yang
  1 sibling, 1 reply; 6+ messages in thread
From: Liam R. Howlett @ 2024-08-28 18:57 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Wei Yang, linux-kernel, maple-tree

* Andrew Morton <akpm@linux-foundation.org> [240827 21:34]:
> On Mon, 26 Aug 2024 01:24:21 +0000 Wei Yang <richard.weiyang@gmail.com> wrote:
> 
> > mt_dump_arange64() only applies to an entry whose type is
> > maple_arange_64, in which mte_is_leaf() must return false.
> > 
> > Since mte_is_leaf() here is always false, we can remove this condition
> > check.
> > 
> 
> These are pretty simple so I'll say lack-of-a-nack-is-an-ack ;)
> 

Let's make it official then.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] maple_tree: arange64 node is not a leaf node
  2024-08-28 18:57   ` Liam R. Howlett
@ 2024-08-28 23:24     ` Wei Yang
  0 siblings, 0 replies; 6+ messages in thread
From: Wei Yang @ 2024-08-28 23:24 UTC (permalink / raw)
  To: Liam R. Howlett; +Cc: Andrew Morton, Wei Yang, linux-kernel, maple-tree

On Wed, Aug 28, 2024 at 02:57:45PM -0400, Liam R. Howlett wrote:
>* Andrew Morton <akpm@linux-foundation.org> [240827 21:34]:
>> On Mon, 26 Aug 2024 01:24:21 +0000 Wei Yang <richard.weiyang@gmail.com> wrote:
>> 
>> > mt_dump_arange64() only applies to an entry whose type is
>> > maple_arange_64, in which mte_is_leaf() must return false.
>> > 
>> > Since mte_is_leaf() here is always false, we can remove this condition
>> > check.
>> > 
>> 
>> These are pretty simple so I'll say lack-of-a-nack-is-an-ack ;)
>> 
>
>Let's make it official then.
>
>Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com>

Thanks

-- 
Wei Yang
Help you, Help me

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-08-28 23:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-26  1:24 [PATCH 1/2] maple_tree: arange64 node is not a leaf node Wei Yang
2024-08-26  1:24 ` [PATCH 2/2] maple_tree: dump error message based on format Wei Yang
2024-08-28  1:34 ` [PATCH 1/2] maple_tree: arange64 node is not a leaf node Andrew Morton
2024-08-28 12:05   ` Wei Yang
2024-08-28 18:57   ` Liam R. Howlett
2024-08-28 23:24     ` Wei Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®