* [PATCH] maple_tree: fix the comment on maple_arange_64 size
@ 2024-07-17 1:41 Wei Yang
2024-07-17 2:06 ` Matthew Wilcox
0 siblings, 1 reply; 7+ messages in thread
From: Wei Yang @ 2024-07-17 1:41 UTC (permalink / raw)
To: Liam.Howlett; +Cc: maple-tree, linux-mm, Wei Yang
The comment here describe the size of struct maple_arange_64.
The value here is not correct. Fix it with the correct value.
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
CC: "Liam R. Howlett" <Liam.Howlett@oracle.com>
---
For 64BIT, value is get from kernel module.
For 32BIT, value is get from user space pseudo code.
---
include/linux/maple_tree.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h
index a53ad4dabd7e..8c87f8d0497d 100644
--- a/include/linux/maple_tree.h
+++ b/include/linux/maple_tree.h
@@ -28,13 +28,13 @@
/* 64bit sizes */
#define MAPLE_NODE_SLOTS 31 /* 256 bytes including ->parent */
#define MAPLE_RANGE64_SLOTS 16 /* 256 bytes */
-#define MAPLE_ARANGE64_SLOTS 10 /* 240 bytes */
+#define MAPLE_ARANGE64_SLOTS 10 /* 248 bytes */
#define MAPLE_ALLOC_SLOTS (MAPLE_NODE_SLOTS - 1)
#else
/* 32bit sizes */
#define MAPLE_NODE_SLOTS 63 /* 256 bytes including ->parent */
#define MAPLE_RANGE64_SLOTS 32 /* 256 bytes */
-#define MAPLE_ARANGE64_SLOTS 21 /* 240 bytes */
+#define MAPLE_ARANGE64_SLOTS 21 /* 256 bytes */
#define MAPLE_ALLOC_SLOTS (MAPLE_NODE_SLOTS - 2)
#endif /* defined(CONFIG_64BIT) || defined(BUILD_VDSO32_64) */
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] maple_tree: fix the comment on maple_arange_64 size
2024-07-17 1:41 [PATCH] maple_tree: fix the comment on maple_arange_64 size Wei Yang
@ 2024-07-17 2:06 ` Matthew Wilcox
2024-07-17 2:41 ` Wei Yang
0 siblings, 1 reply; 7+ messages in thread
From: Matthew Wilcox @ 2024-07-17 2:06 UTC (permalink / raw)
To: Wei Yang; +Cc: Liam.Howlett, maple-tree, linux-mm
On Wed, Jul 17, 2024 at 01:41:42AM +0000, Wei Yang wrote:
> The comment here describe the size of struct maple_arange_64.
>
> The value here is not correct. Fix it with the correct value.
You are wrong.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] maple_tree: fix the comment on maple_arange_64 size
2024-07-17 2:06 ` Matthew Wilcox
@ 2024-07-17 2:41 ` Wei Yang
2024-07-17 2:45 ` Matthew Wilcox
0 siblings, 1 reply; 7+ messages in thread
From: Wei Yang @ 2024-07-17 2:41 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: Wei Yang, Liam.Howlett, maple-tree, linux-mm
On Wed, Jul 17, 2024 at 03:06:01AM +0100, Matthew Wilcox wrote:
>On Wed, Jul 17, 2024 at 01:41:42AM +0000, Wei Yang wrote:
>> The comment here describe the size of struct maple_arange_64.
>>
>> The value here is not correct. Fix it with the correct value.
>
>You are wrong.
You mean the my value is wrong or my understanding is wrong?
--
Wei Yang
Help you, Help me
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] maple_tree: fix the comment on maple_arange_64 size
2024-07-17 2:41 ` Wei Yang
@ 2024-07-17 2:45 ` Matthew Wilcox
2024-07-17 3:03 ` Wei Yang
0 siblings, 1 reply; 7+ messages in thread
From: Matthew Wilcox @ 2024-07-17 2:45 UTC (permalink / raw)
To: Wei Yang; +Cc: Liam.Howlett, maple-tree, linux-mm
On Wed, Jul 17, 2024 at 02:41:26AM +0000, Wei Yang wrote:
> On Wed, Jul 17, 2024 at 03:06:01AM +0100, Matthew Wilcox wrote:
> >On Wed, Jul 17, 2024 at 01:41:42AM +0000, Wei Yang wrote:
> >> The comment here describe the size of struct maple_arange_64.
> >>
> >> The value here is not correct. Fix it with the correct value.
> >
> >You are wrong.
>
> You mean the my value is wrong or my understanding is wrong?
Yes.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] maple_tree: fix the comment on maple_arange_64 size
2024-07-17 2:45 ` Matthew Wilcox
@ 2024-07-17 3:03 ` Wei Yang
2024-07-17 3:05 ` Matthew Wilcox
0 siblings, 1 reply; 7+ messages in thread
From: Wei Yang @ 2024-07-17 3:03 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: Wei Yang, Liam.Howlett, maple-tree, linux-mm
On Wed, Jul 17, 2024 at 03:45:40AM +0100, Matthew Wilcox wrote:
>On Wed, Jul 17, 2024 at 02:41:26AM +0000, Wei Yang wrote:
>> On Wed, Jul 17, 2024 at 03:06:01AM +0100, Matthew Wilcox wrote:
>> >On Wed, Jul 17, 2024 at 01:41:42AM +0000, Wei Yang wrote:
>> >> The comment here describe the size of struct maple_arange_64.
>> >>
>> >> The value here is not correct. Fix it with the correct value.
>> >
>> >You are wrong.
>>
>> You mean the my value is wrong or my understanding is wrong?
>
>Yes.
I don't get it.
Would you mind sharing some light on what 240 bytes stands for? I don't figure
out what size it represents.
--
Wei Yang
Help you, Help me
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] maple_tree: fix the comment on maple_arange_64 size
2024-07-17 3:03 ` Wei Yang
@ 2024-07-17 3:05 ` Matthew Wilcox
2024-07-17 7:05 ` Wei Yang
0 siblings, 1 reply; 7+ messages in thread
From: Matthew Wilcox @ 2024-07-17 3:05 UTC (permalink / raw)
To: Wei Yang; +Cc: Liam.Howlett, maple-tree, linux-mm
On Wed, Jul 17, 2024 at 03:03:13AM +0000, Wei Yang wrote:
> On Wed, Jul 17, 2024 at 03:45:40AM +0100, Matthew Wilcox wrote:
> >On Wed, Jul 17, 2024 at 02:41:26AM +0000, Wei Yang wrote:
> >> On Wed, Jul 17, 2024 at 03:06:01AM +0100, Matthew Wilcox wrote:
> >> >On Wed, Jul 17, 2024 at 01:41:42AM +0000, Wei Yang wrote:
> >> >> The comment here describe the size of struct maple_arange_64.
> >> >>
> >> >> The value here is not correct. Fix it with the correct value.
> >> >
> >> >You are wrong.
> >>
> >> You mean the my value is wrong or my understanding is wrong?
> >
> >Yes.
>
> I don't get it.
>
> Would you mind sharing some light on what 240 bytes stands for? I don't figure
> out what size it represents.
You first. How did you determine the new value you used?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] maple_tree: fix the comment on maple_arange_64 size
2024-07-17 3:05 ` Matthew Wilcox
@ 2024-07-17 7:05 ` Wei Yang
0 siblings, 0 replies; 7+ messages in thread
From: Wei Yang @ 2024-07-17 7:05 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: Wei Yang, Liam.Howlett, maple-tree, linux-mm
On Wed, Jul 17, 2024 at 04:05:35AM +0100, Matthew Wilcox wrote:
>On Wed, Jul 17, 2024 at 03:03:13AM +0000, Wei Yang wrote:
>> On Wed, Jul 17, 2024 at 03:45:40AM +0100, Matthew Wilcox wrote:
>> >On Wed, Jul 17, 2024 at 02:41:26AM +0000, Wei Yang wrote:
>> >> On Wed, Jul 17, 2024 at 03:06:01AM +0100, Matthew Wilcox wrote:
>> >> >On Wed, Jul 17, 2024 at 01:41:42AM +0000, Wei Yang wrote:
>> >> >> The comment here describe the size of struct maple_arange_64.
>> >> >>
>> >> >> The value here is not correct. Fix it with the correct value.
>> >> >
>> >> >You are wrong.
>> >>
>> >> You mean the my value is wrong or my understanding is wrong?
>> >
>> >Yes.
>>
>> I don't get it.
>>
>> Would you mind sharing some light on what 240 bytes stands for? I don't figure
>> out what size it represents.
>
>You first. How did you determine the new value you used?
Sure.
My understanding of the comment is to represent the size of related data
structures, eg. maple_node, maple_range_64 and maple_arange_64.
I add following code in test to the size of those structures.
diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c
index cea050675da2..93e77dea7f0b 100644
--- a/lib/test_maple_tree.c
+++ b/lib/test_maple_tree.c
@@ -3645,6 +3645,10 @@ static int __init maple_tree_seed(void)
5003, 5002};
void *ptr = &set;
+ pr_info("\nsizeof struct maple_node %ld\n", sizeof(struct maple_node));
+ pr_info("\nsizeof struct maple_range_64 %ld\n", sizeof(struct maple_range_64));
+ pr_info("\nsizeof struct maple_arange_64 %ld\n", sizeof(struct maple_arange_64));
Then insert the test module.
$ sudo insmod lib/test_maple_tree.ko
[ 152.152382]
[ 152.152382] sizeof struct maple_node 256
[ 152.153043]
[ 152.153043] sizeof struct maple_range_64 256
[ 152.153561]
[ 152.153561] sizeof struct maple_arange_64 248
The first two is the same as in comment, while the third one is not the same.
The 248 for 64BIT comes from here.
For 32BIT, I copied structure definition to a user space source and compile
with -m32. The size of structure maple_arange_64 is 256. This is where 256
comes from.
--
Wei Yang
Help you, Help me
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-07-17 7:05 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-17 1:41 [PATCH] maple_tree: fix the comment on maple_arange_64 size Wei Yang
2024-07-17 2:06 ` Matthew Wilcox
2024-07-17 2:41 ` Wei Yang
2024-07-17 2:45 ` Matthew Wilcox
2024-07-17 3:03 ` Wei Yang
2024-07-17 3:05 ` Matthew Wilcox
2024-07-17 7:05 ` Wei Yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).