Skip to content

Commit 6f73d3b

Browse files
ying-xuedavem330
authored andcommitted
rhashtable: add a note for grow and shrink decision functions
As commit c0c09bf ("rhashtable: avoid unnecessary wakeup for worker queue") moves condition statements of verifying whether hash table size exceeds its maximum threshold or reaches its minimum threshold from resizing functions to resizing decision functions, we should add a note in rhashtable.h to indicate the implementation of what the grow and shrink decision function must enforce min/max shift, otherwise, it's failed to take min/max shift's set watermarks into effect. Signed-off-by: Ying Xue <[email protected]> Cc: Thomas Graf <[email protected]> Acked-by: Thomas Graf <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c5adde9 commit 6f73d3b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/linux/rhashtable.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ struct rhashtable;
7979
* @obj_hashfn: Function to hash object
8080
* @grow_decision: If defined, may return true if table should expand
8181
* @shrink_decision: If defined, may return true if table should shrink
82+
*
83+
* Note: when implementing the grow and shrink decision function, min/max
84+
* shift must be enforced, otherwise, resizing watermarks they set may be
85+
* useless.
8286
*/
8387
struct rhashtable_params {
8488
size_t nelem_hint;

0 commit comments

Comments
 (0)