some cleanups related to RB_DECLARE_CALLBACKS_MAX
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 6 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | augmented rbtree: use max3() in the *_compute_max() functioninclude/ tools/ | +40 | 2 replies | |
| 2/2 | mm/vmalloc: use generated callback to populate subtree_max_sizemm/ | +1 | 2 replies |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | Michel Lespinasse |
|---|---|
| 1/2 | |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/2] some cleanups related to RB_DECLARE_CALLBACKS_MAX
Recently we have got RB_DECLARE_CALLBACKS_MAX template that is supposed to be used in case of having an augmented value as scalar value. First patch just simplifies the *_compute_max() callback by using max3() macro that makes the code more transparent, i think. No functional changes.
Second patch reuses RB_DECLARE_CALLBACKS_MAX template's internal functionality, that is generated to manage augment red-black tree instead of using our own and the same logic in vmalloc. Just get rid of duplication. No functional changes.
Also i have open question related to validating of the augment tree, i mean in case of debugging to check that nodes are maintained correctly. Please have a look here: https://lkml.org/lkml/2019/7/29/304
Basically we can add one more function under RB_DECLARE_CALLBACKS_MAX template making it public that checks a tree and its augmented nodes. At least i see two users where it can be used: vmalloc and lib/rbtree_test.c.
Appreciate for any comments.
Uladzislau Rezki (Sony) (2):
augmented rbtree: use max3() in the *_compute_max() function mm/vmalloc: use generated callback to populate subtree_max_size
include/linux/rbtree_augmented.h | 40 +++++++++++++++++----------------- mm/vmalloc.c | 31 +------------------------- tools/include/linux/rbtree_augmented.h | 40 +++++++++++++++++----------------- 3 files changed, 41 insertions(+), 70 deletions(-)
Signature · 1 line
2.11.0