Whamcloud - gitweb
LU-18357 ptlrpc: Use dynamic memory allocation for filesets 23/57523/6
authorMarc Vef <mvef@whamcloud.com>
Thu, 19 Dec 2024 10:09:24 +0000 (11:09 +0100)
committerOleg Drokin <green@whamcloud.com>
Fri, 28 Feb 2025 08:11:33 +0000 (08:11 +0000)
commit3277457b898c3eed62e3be3fb00970e49baaf445
treee9ccdadfda3a2789203aa8a9370fe309fa45cd0b
parentda3536da22aba6b61da2c82b71e4eec423425446
LU-18357 ptlrpc: Use dynamic memory allocation for filesets

Currently, a nodemap's fileset uses a static-sized array which may be
much larger than needed. This patch adds dynamic memory allocation for
a nodemap's fileset to reduce the future memory footprint when
multiple filesets per nodemap are specified.

Note, when reading fileset fragments from the nodemap IAM, the needed
size is not known yet. Therefore, each fileset is initially
preallocated with "PATH_MAX + 1" and then shrunk when the actual size
is know. This is done on the last step, when a nodemap is set active,
e.g., after reading all IAM idx pages.

The nodemap's fileset is further renamed as future "lctl
nodemap_set_fileset" commands can only modify the primary fileset.

Test-Parameters: trivial testlist=sanity-sec
Signed-off-by: Marc Vef <mvef@whamcloud.com>
Change-Id: I39bd3355c96fcf3938aaa52c8e5ff1eb70617378
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57523
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_nodemap.h
lustre/ptlrpc/nodemap_handler.c
lustre/ptlrpc/nodemap_lproc.c
lustre/ptlrpc/nodemap_storage.c