Linux-mm Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/2] some cleanups related to RB_DECLARE_CALLBACKS_MAX
@ 2019-08-11 18:46 Uladzislau Rezki (Sony)
  2019-08-11 18:46 ` [PATCH 1/2] augmented rbtree: use max3() in the *_compute_max() function Uladzislau Rezki (Sony)
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Uladzislau Rezki (Sony) @ 2019-08-11 18:46 UTC (permalink / raw)
  To: Andrew Morton, Michel Lespinasse
  Cc: linux-mm, LKML, Peter Zijlstra, Roman Gushchin, Uladzislau Rezki,
	Hillf Danton, Michal Hocko, Matthew Wilcox, Oleksiy Avramchenko,
	Steven Rostedt

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(-)

-- 
2.11.0



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

end of thread, back to index

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-11 18:46 [PATCH 0/2] some cleanups related to RB_DECLARE_CALLBACKS_MAX Uladzislau Rezki (Sony)
2019-08-11 18:46 ` [PATCH 1/2] augmented rbtree: use max3() in the *_compute_max() function Uladzislau Rezki (Sony)
2019-08-12  1:37   ` Michel Lespinasse
2019-08-13  9:00     ` Uladzislau Rezki
2019-08-11 18:46 ` [PATCH 2/2] mm/vmalloc: use generated callback to populate subtree_max_size Uladzislau Rezki (Sony)
2019-08-12  0:39   ` Michel Lespinasse
2019-08-13  9:02     ` Uladzislau Rezki
2019-08-12  7:12 ` [PATCH 0/2] some cleanups related to RB_DECLARE_CALLBACKS_MAX Michel Lespinasse
2019-08-13  9:29   ` Uladzislau Rezki

Linux-mm Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mm/0 linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ https://lore.kernel.org/linux-mm \
		linux-mm@kvack.org
	public-inbox-index linux-mm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kvack.linux-mm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git