Whamcloud - gitweb
LU-5134 utils: Add parallel option to lctl set_param 55/10555/33
authorRyan Haasken <haasken@cray.com>
Tue, 3 May 2016 19:49:57 +0000 (15:49 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 25 Oct 2023 18:03:58 +0000 (18:03 +0000)
commit345a2497d08f6b9afd74ed0188a70489f7a43e5d
tree874ca45a47bcfb7baa4533afae48b4f747496ac5
parent687941952df1a495cc36f0cae342386572c5ab85
LU-5134 utils: Add parallel option to lctl set_param

Add a "-t" option to lctl set_param to enable setting multiple matched
parameters in parallel. When called with "-t", lctl will set up a work
queue of matched file names and spawn a fixed number of threads per
CPU. Each thread will pull items off the work queue, write to the file
associated with each work item, and return when there are no more
items on the work queue.

A field called po_parallel_threads is added to struct param_opts to
indicate the number of threads set_param should run in parallel. If in
parallel, jt_lcfg_setparam initializes a work queue and passes it to
do_param_op, which adds each matched item to the work queue. Once
jt_lcfg_setparam has called do_param_op for each param-value pair, it
passes the work queue to sp_run_threads, which creates threads, each
of which call write_param to set the parameter. If not in parallel,
jt_lcfg_setparam does not pass a work queue to do_param_op, and
do_param_op directly calls write_param on each matched param.

param_display was renamed to do_param_op to more accurately reflect
what it does.

If lctl is compiled without pthread support, "lctl set_param" will
still accept the "-t" option, but it will print a warning message, and
it will set the parameters in series.

The new "-t" option to set_param was documented in the lctl usage and
in the man page.

HPE-bug-id: LUS-2592
Signed-off-by: Ryan Haasken <haasken@cray.com>
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Change-Id: I3f96a6f06c50d4ba2ce97050c35f46b976dfc005
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/10555
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/doc/lctl-set_param.8
lustre/tests/sanity.sh
lustre/tests/test-framework.sh
lustre/utils/Makefile.am
lustre/utils/lctl.c
lustre/utils/lctl_thread.c [new file with mode: 0644]
lustre/utils/lctl_thread.h [new file with mode: 0644]
lustre/utils/lustre_cfg.c