Whamcloud - gitweb
LU-9658 ptlrpc: Add QoS for uid and gid in NRS-TBF 08/27608/36
authorTeddy Chan <teddy@ddn.com>
Fri, 9 Mar 2018 10:20:40 +0000 (18:20 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 9 Apr 2018 19:46:59 +0000 (19:46 +0000)
commite0cdde123c14729a340cf937cf9580be7c9dd9c1
tree7f00383c2c298154ee71814b037397696e2ec838
parent2cdcaa0dd3ba80c94558bfb95eaf79829b530acf
LU-9658 ptlrpc: Add QoS for uid and gid in NRS-TBF

This patch add a new QoS feature in TBF policy which could
limits the rate based on uid or gid. The policy is able to
limit the rate both on MDT and OSS site.

The command for this feature is like:
Start the tbf uid QoS on OST:
    lctl set_param ost.OSS.*.nrs_policies="tbf uid"
Limit the rate of ptlrpc requests of the uid 500
    lctl set_param ost.OSS.*.nrs_tbf_rule=
 "start tbf_name uid={500} rate=100"

Start the tbf gid QoS on OST:
    lctl set_param ost.OSS.*.nrs_policies="tbf gid"
Limit the rate of ptlrpc requests of the gid 500
    lctl set_param ost.OSS.*.nrs_tbf_rule=
 "start tbf_name gid={500} rate=100"

or use generic tbf rule to mix them on OST:
    lctl set_param ost.OSS.*.nrs_policies="tbf"
Limit the rate of ptlrpc requests of the uid 500 gid 500
    lctl set_param ost.OSS.*.nrs_tbf_rule=
 "start tbf_name uid={500}&gid={500} rate=100"

Also, you can use the following rule to control all reqs
to mds:
Start the tbf uid QoS on MDS:
    lctl set_param mds.MDS.*.nrs_policies="tbf uid"
Limit the rate of ptlrpc requests of the uid 500
    lctl set_param mds.MDS.*.nrs_tbf_rule=
 "start tbf_name uid={500} rate=100"

Change-Id: I440ad087dd3dbacd8b5228717b0a1724ef47e3b4
Signed-off-by: Teddy Chan <teddy@ddn.com>
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Signed-off-by: Qian Yingjin <qian@ddn.com>
Reviewed-on: https://review.whamcloud.com/27608
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/lustre_nrs_tbf.h
lustre/llite/vvp_object.c
lustre/obdclass/obdo.c
lustre/osc/osc_request.c
lustre/ptlrpc/nrs_tbf.c
lustre/tests/sanityn.sh