Special thanks and credits to Mark Kogan for profiling
ceph-osd under the RGW list workload.
In this particular workload the change is worth around 4.2%
of CPU cycles [1]. However, it's not restricted to RGW's
bucket listing nor `cls_rgw`; I think it affects every single
cls plugin in the system.
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
[1]: https://github.com/ceph/ceph/pull/60278#issuecomment-
2416582108
// crimson-osd, it's different b/c of how the dout macro expands.
int cls_log(int level, const char *format, ...)
{
+ if (!ClassHandler::get_instance().cct->_conf->subsys.should_gather(dout_subsys, level)) {
+ // if this early exit becomes visible in profiling, switch to
+ // the static, compile-time check as the dout does.
+ return 0;
+ }
size_t size = 256;
va_list ap;
while (1) {