From: Liam R. Howlett Date: Thu, 31 Jan 2019 16:15:05 +0000 (-0500) Subject: Thoughts: Add table of bits in the parent. X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1908b980a9e4366a77a53630188c97008648842b;p=users%2Fjedix%2Flinux-maple.git Thoughts: Add table of bits in the parent. Signed-off-by: Liam R. Howlett --- diff --git a/Thoughts b/Thoughts index f18ce275c109c..08a74d91fa19b 100644 --- a/Thoughts +++ b/Thoughts @@ -13,10 +13,10 @@ Tree Root --------- If the tree contains a single entry at index 0, it is usually stored in -tree->ma_root. To optimise for the page cache, an entry which ends in -'00', '01' or '11' is stored in the root, but an entry which ends in '10' -will be stored in a node. Bit 2 is set if there are any NULL entries -in the tree. Bits 3-6 are used to store enum maple_type. +tree->ma_root. To optimise for the page cache, an entry which ends in '00', +'01' or '11' is stored in the root, but an entry which ends in '10' will be +stored in a node. Bit 2 is set if there are any NULL entries in the tree. +Bits 3-6 are used to store enum maple_type. The flags are used both to store some immutable information about this tree (set at tree creation time) and dynamic information set under the spinlock. @@ -57,6 +57,12 @@ and 21 in a range_16, so encode a range_16 as 00 (Bits 2-6 encode the slot number), encode range_32 as 010 (Bits 3-6 encode the slot number) and range_64 as 110 (Bits 3-6 encode the slot number). +Parent bits: +bit 0: 1 = root, 0 otherwise +bit 1: 0 = range 16, 1 otherwise +bit 2: 0 = range 32, 1 = range 64 + + Auxiliary Data --------------