Whamcloud - gitweb
LU-16566 sptlrpc: remove rq_sepol from ptlrpc_request
authorEtienne AUJAMES <etienne.aujames@cea.fr>
Thu, 26 Oct 2023 19:28:55 +0000 (21:28 +0200)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 30 May 2024 00:40:06 +0000 (00:40 +0000)
commit031f1e8db5d31c6887b094ca8c2825620be34071
tree7a09caa5bf99ef60c258edcc4741b77da97cf4e4
parent251e627b764d0223e66fcedf040c93c7dce8921c
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.

Lustre-change: https://review.whamcloud.com/52845
Lustre-commit: 3f70481c93dcabbb30267608a0054f4d7092e0db

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 <etienne.aujames@cea.fr>
Change-Id: I80fb76c97885c4b2987eb7f91a9bfe6e0e6e6c70
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/55211
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@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