Whamcloud - gitweb
LU-16724 ptlrpc: refactor page pools patch 2 45/52645/10
authorPatrick Farrell <paf0187@gmail.com>
Wed, 27 Mar 2024 21:24:18 +0000 (17:24 -0400)
committerOleg Drokin <green@whamcloud.com>
Mon, 15 Apr 2024 16:51:46 +0000 (16:51 +0000)
commit94b04d47d7b71dc84868dda6db7cd97fc27b1ed0
treed1d42b5d8d200605e924c2a8a5670067bd5461fe
parentc987469d510a8edf2bad5c28239337b47015c82e
LU-16724 ptlrpc: refactor page pools patch 2

This is a combined series that refactors the page pools
code to make it more readable.  It used to be many
separate patches but has been combined in to just three,
and this is the second.

LU-16724 ptlrpc: stop passing around pool_index

We pass pool_index around from function to function over
and over, but it's easier to just pass the pool around.

This does require the pool to know its own index, but
that seems better anyway.

LU-16724 ptlrpc: convert to void

Convert functions without meaningful return to void.

Change-Id-Was: I81f0baefd5b77b60ba699fa8749eaa83acadd8dd

LU-16724 ptlrpc: refactor pool growing code

This refactors the pool growing code, combining two
separate instances of it in to a single function.

Change-Id-Was: I175abc7e61d55563e989f87207a8c59da852f5f9

LU-16724 ptlrpc: replace ELEMENT_SIZE

The ELEMENT_SIZE macro is fine, but it takes a pool index
and doesn't handle the pool of order 0.  Change it to a
function.  (This is marginally less efficient in one spot,
since it replaces a shift with a divide, but it should be
just fine.)

Change-Id-Was: I322037e50bbdb8e0274b37f82618b6907b6d2906

LU-16724 ptlrpc: simplify pool arrays

Currently, we do a fancy trick where we have a pool of
order 0, then subsequent pools start at
PPOOL_MIN_CHUNK_BITS (which is actually the minimum
compresison size).

So pool index 1 isn't a pool of order 1 (2 pages), it's a
pool of order PPOOL_MIN_CHUNK_BITS.

All this saves us is the cost of the empty pools below
PPOOL_MIN_CHUNK_BITS, but it makes the code notably harder
to read.

With this change, the order of the pool and the pool index
are the same.  This simplification will be embraced more
in subsequent patches.

Change-Id-Was: I650e05d25727f10b0ca2d556cba17e9c4fccc309

LU-16724 ptlrpc: begin renaming pool_index to order

Replace local variables for pool_index with pool_order.

Other renames will be in a subsequent patch, to keep these
as simple as possible.

Change-Id-Was: If347ff39776f9a75c0f7d9d9981d01e19bc2cbc9

LU-16724 ptlrpc: rename ppp_index to ppp_order

Rename ppp_index to ppp_order.

Other renames will be in a subsequent patch, to keep these
as simple as possible.

Change-Id-Was: I96559e27a67b7cc4e56e06378e5686370438850c

LU-16724 ptlrpc: rename INDEX macros

Rename INDEX macros to ORDER.

Change-Id-Was: Ic1123d25bc855dc7671c9cb587a0d6680662b729

LU-16724 ptlrpc: remove PAGES_POOL macro

PAGES_POOL is just the order 0 pool now, so remove the
special naming, and adjust a few associated functions.

Change-Id-Was: I09e1debeadecbce33c7be43a8859815084623358

Signed-off-by: Patrick Farrell <patrick.farrell@oracle.com>
Change-Id: I42dc8b8094212c69b7a29cc3766bd0a10860f7af
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52645
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Artem Blagodarenko <ablagodarenko@ddn.com>
lustre/include/lustre_sec.h
lustre/ptlrpc/client.c
lustre/ptlrpc/sec_bulk.c