Whamcloud - gitweb
LU-16566 sptlrpc: remove rq_sepol from ptlrpc_request 45/52845/9
authorEtienne AUJAMES <etienne.aujames@cea.fr>
Thu, 26 Oct 2023 19:28:55 +0000 (21:28 +0200)
committerOleg Drokin <green@whamcloud.com>
Sun, 4 Feb 2024 08:28:11 +0000 (08:28 +0000)
commit3f70481c93dcabbb30267608a0054f4d7092e0db
tree7b9ec6ae9b5c8ea93c92e7f437e227b350f3ddf6
parentf0534544e3e3aef280ccc5f042e37d42d33b28d3
LU-16566 sptlrpc: remove rq_sepol from ptlrpc_request

This patch remove rq_sepol from ptlrpc_request to reduce the memory
consumption on the servers.

rq_sepol field is 327 bytes long allocated for each request and this
is rarely used (it needs SELinux activated with the send_sepol
feature).

The patch store the SELinux policy status string in a separate object.
The pointer is stored in ptlrpc_sec->ps_sepol and protected by RCU
(mostly read-only, the SELinux policy should rarely change).

When the policy status needs to be packed in a request, we take a
reference to the current ps_sepol object and release it after the
packing. If the policy has changed in the meantime, the object used
will be free after.

A read operation is added to srpc_sepol parameter to return the
SELinux policy string cached in Lustre.

Test-Parameters: testlist=sanity-selinux env=ONLY=21,ONLY_REPEAT=50
Test-Parameters: testlist=sanity-selinux env=ONLY=21,ONLY_REPEAT=50
Signed-off-by: Etienne AUJAMES <eaujames@ddn.com>
Change-Id: I80fb76c97885c4b2987eb7f91a9bfe6e0e6e6c70
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52845
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
13 files changed:
lustre/include/lustre_net.h
lustre/include/lustre_sec.h
lustre/mdc/mdc_internal.h
lustre/mdc/mdc_lib.c
lustre/mdc/mdc_locks.c
lustre/mdc/mdc_reint.c
lustre/mdc/mdc_request.c
lustre/ptlrpc/gss/gss_keyring.c
lustre/ptlrpc/gss/sec_gss.c
lustre/ptlrpc/import.c
lustre/ptlrpc/sec.c
lustre/ptlrpc/sec_lproc.c
lustre/ptlrpc/sec_null.c