* + maple_tree-reorder-mas-store_type-case-statements.patch added to mm-unstable branch
@ 2025-02-27 22:23 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-02-27 22:23 UTC (permalink / raw)
To: mm-commits, richard.weiyang, Liam.Howlett, liam.howlett,
sidhartha.kumar, akpm
The patch titled
Subject: maple_tree: reorder mas->store_type case statements
has been added to the -mm mm-unstable branch. Its filename is
maple_tree-reorder-mas-store_type-case-statements.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/maple_tree-reorder-mas-store_type-case-statements.patch
This patch will later appear in the mm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Subject: maple_tree: reorder mas->store_type case statements
Date: Thu, 27 Feb 2025 20:48:23 +0000
Move the unlikely case that mas->store_type is invalid to be the last
evaluated case and put liklier cases higher up.
Link: https://lkml.kernel.org/r/20250227204823.758784-7-sidhartha.kumar@oracle.com
Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Suggested-by: Liam R. Howlett <liam.howlett@oracle.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Cc: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
lib/maple_tree.c | 51 ++++++++++++++++++++++-----------------------
1 file changed, 25 insertions(+), 26 deletions(-)
--- a/lib/maple_tree.c~maple_tree-reorder-mas-store_type-case-statements
+++ a/lib/maple_tree.c
@@ -4089,15 +4089,6 @@ static inline void mas_wr_store_entry(st
unsigned char new_end = mas_wr_new_end(wr_mas);
switch (mas->store_type) {
- case wr_invalid:
- MT_BUG_ON(mas->tree, 1);
- return;
- case wr_new_root:
- mas_new_root(mas, wr_mas->entry);
- break;
- case wr_store_root:
- mas_store_root(mas, wr_mas->entry);
- break;
case wr_exact_fit:
rcu_assign_pointer(wr_mas->slots[mas->offset], wr_mas->entry);
if (!!wr_mas->entry ^ !!wr_mas->content)
@@ -4119,6 +4110,14 @@ static inline void mas_wr_store_entry(st
case wr_rebalance:
mas_wr_bnode(wr_mas);
break;
+ case wr_new_root:
+ mas_new_root(mas, wr_mas->entry);
+ break;
+ case wr_store_root:
+ mas_store_root(mas, wr_mas->entry);
+ break;
+ case wr_invalid:
+ MT_BUG_ON(mas->tree, 1);
}
return;
@@ -4183,19 +4182,10 @@ static inline int mas_prealloc_calc(stru
unsigned char delta = height - wr_mas->vacant_height;
switch (mas->store_type) {
- case wr_invalid:
- WARN_ON_ONCE(1);
- break;
- case wr_new_root:
- ret = 1;
- break;
- case wr_store_root:
- if (likely((mas->last != 0) || (mas->index != 0)))
- ret = 1;
- else if (((unsigned long) (entry) & 3) == 2)
- ret = 1;
- else
- ret = 0;
+ case wr_exact_fit:
+ case wr_append:
+ case wr_slot_store:
+ ret = 0;
break;
case wr_spanning_store:
if (wr_mas->sufficient_height < wr_mas->vacant_height)
@@ -4215,10 +4205,19 @@ static inline int mas_prealloc_calc(stru
case wr_node_store:
ret = mt_in_rcu(mas->tree) ? 1 : 0;
break;
- case wr_append:
- case wr_exact_fit:
- case wr_slot_store:
- ret = 0;
+ case wr_new_root:
+ ret = 1;
+ break;
+ case wr_store_root:
+ if (likely((mas->last != 0) || (mas->index != 0)))
+ ret = 1;
+ else if (((unsigned long) (entry) & 3) == 2)
+ ret = 1;
+ else
+ ret = 0;
+ break;
+ case wr_invalid:
+ WARN_ON_ONCE(1);
}
return ret;
_
Patches currently in -mm which might be from sidhartha.kumar@oracle.com are
maple_tree-convert-mas_prealloc_calc-to-take-in-a-maple-write-state.patch
maple_tree-use-height-and-depth-consistently.patch
maple_tree-use-vacant-nodes-to-reduce-worst-case-allocations.patch
maple_tree-break-on-convergence-in-mas_spanning_rebalance.patch
maple_tree-add-sufficient-height.patch
maple_tree-reorder-mas-store_type-case-statements.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-02-27 22:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-27 22:23 + maple_tree-reorder-mas-store_type-case-statements.patch added to mm-unstable branch Andrew Morton
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.