Commit Graph

12 Commits

Author SHA1 Message Date
Bin Lai 92e026f5b5 sli: fix rq_clock warning caused by sli
In order to reduce the critical section, we invoke sli_update_tick()
to do sli statistics after release the rq lock. But there is a race
condition that could led the rq_clock warning.

Warning generates like following:
CPU0				CPU1
rq_lock()
update_rq_clock()
rq_unlock()
				rq_lock()
sli_update_tick()		load balance

Although, CPU0 had updated the rq_clock(). But CPU1 may concurrently
do the load balance and acquire CPU0's rq lock, and the CPU0's
clock_update_flags would be cleared. It means that caller should
update the rq clock before actually use it. Unfortunately, CPU0
cann't observed it. So the warning was produced by sli when it
invoke rq_clock().

Therefore, we must move the sli_check_longsys() in the front of
rq_unlock().

Signed-off-by: Bin Lai <robinlai@tencent.com>
2022-07-05 15:19:38 +08:00
Bin Lai 36ce5bdb96 sli/kabi: add the kabi reserve space for sli structure
In order to avoid breaking system kabi, we add the reserve space
for sli structure. Then we can use the reserved space to fix bug
by hotpatch.

Signed-off-by: Bin Lai <robinlai@tencent.com>
Reviewed-by: Bauerchen <bauerchen@tencent.com>
2022-04-18 21:10:23 +08:00
bauerchen 34961244de sli: add sli_monitor notify mechanism
Sli can collect much information such as cpu stall and memory stall, but
now this key info only exported to userspace by cgroupfs interface, so
if user app want to feel the resource load, it have to monitor the
cgroupfs file periodly  which have some latency and more resource
consumpetion.

Sli montior notify mechanism can solve this issue. It prides interface
which can be monitored by use app using poll or epoll. So User app can  get
informed at the first time the resource load reaches threshold.

Signed-off-by: bauerchen <bauerchen@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
2022-04-18 21:08:43 +08:00
Bin Lai 549d03b9bf sli: remove the page_alloc trace item
Page_alloc is may be a hot spot in the system, the overhead of
trace will increase with the number of page alloc operations.
And we only focus on the page alloc latency caused by memory
compaction or reclaim. So we remove the useless page alloc item
to reduce the overhead of trace.

Signed-off-by: Bin Lai <robinlai@tencent.com>
Reviewed-by: Bauerchen <bauerchen@tencent.com>
2022-04-18 21:07:19 +08:00
Bin Lai 9a47b6193b sli: check cgroup's proactive monitoring statistics and report
the event if necessary

If there is not any task of cgroup running on the cpu, there is
no necessary to do the monitoring event check for cgroup. So we
put the checkpoint in the tick process to reduce the overhead
of system(if tasks of cgroup are not running, the tick interrupt
will not hit the task).

Signed-off-by: Bin Lai <robinlai@tencent.com>
Reviewed-by: Bauerchen <bauerchen@tencent.com>
2022-04-18 21:06:46 +08:00
Bin Lai a3b305afa3 sli: add sli event monitoring for cgroup
Sli proactive monitoring framework provid the separated event
monitoring control parameters for each cgroup. So we add the
sli event monitoring for each cgroup, then We can tune the
parameters for specified cgroup by related interface.

Signed-off-by: Bin Lai <robinlai@tencent.com>
Reviewed-by: Bauerchen <bauerchen@tencent.com>
2022-04-18 21:06:25 +08:00
Bin Lai 7b5a1444a3 sli: introduce sli event monitoring framework
In order to support proactive event monitoring, we introduce the
new sli_event_monitor framework and combine mbuf threshold tracing
with the proactive event monitoring framework. Then we can handle
these tracing event in the same framework, and it could help workloads
easily use these features.

Through the proactive event monitoring, workloads don't need to do
the periodic sampling and calculation. It only need to set the
monitoring rules according to defined format(for a specified cgroup
or all cgroups), then the sli event monitoring framework will trace
the related latency event and report the event when needed. It could
help system reduce the cost of sampling and make the interference
detection to be faster.

Signed-off-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: bauerchen <bauerchen@tencent.com>
2022-04-18 21:05:16 +08:00
Bin Lai 08f6af622c sli: introuce the interrupt time metric for cgroup
The original sli_max is used for showing max value during the sampling.
But the workloads had not used it, so we intend to reuse this interface.
The sli_max will be applied to store the accumulated value for every
metric, then we can easily get the all interference information
during the samping.

Some workloads(such as ngix) are io-bound tasks(network), and the handler
may run in the softirq(take a lot of time). The VM is usually rps enabled,
so the network soft-interrupt will be fairly dispatched to the CPUs in the
system. The soft-interrupt is a high-priortity handler, it will interrupt
other cgroup's task and make some performance jitter. So we need the
interrupt time metric to indicate the interrupt interference from other
cgroups.

Signed-off-by: Bin Lai <robinlai@tencent.com>
Reviewed-by: Bauerchen <bauerchen@tencent.com>
2022-04-18 21:03:48 +08:00
Bin Lai f91939a5b3 sli/cpu: introduce sli max latency metrics
Sli max latency is lightweight latency monitor metrics, the monitor
tool could get the data with a little overhead. And the accuracy of
the metrics is controlled by the sampling frequency of the monitor
tool. When the performance jitter was occurred in the system, we can
get some help from these lateny metris.

Signed-off-by: Bin Lai <robinlai@tencent.com>
Reviewed-by: benbjiang<benbjiang@tencent.com>
Reviewed-by: Mengmeng Chen <bauerchen@tencent.com>
Reviewed-by: mungerjiang <mungerjiang@tencent.com>
2021-10-29 06:51:52 +00:00
mungerjiang 95a8c85b7f sli/cpu: introduce longsys check
When a process is running in the system space, it cann't be preempted until
it return to userspace, even if the process should be reschedule and other
process was ready to run(because the server system close the kernel preempt
by default). This schedule delay may impact the performance of waiting process,
therefor we introduce the longsys check to collect the schedule delay information
of process. The longsys indication could help us spot the possible performance
jitter in the system.

Signed-off-by: Munger jiang <mungerjiang@tencent.com>
Signed-off-by: Bin Lai <robinlai@tencent.com>
Reviewed-by: benbjiang<benbjiang@tencent.com>
Reviewed-by: Bauerchen <bauerchen@tencent.com>
2021-10-29 06:51:52 +00:00
mungerjiang a76d37e2f4 sli: enable sli in cgroup v1
Signed-off-by: Munger jiang <mungerjiang@tencent.com>
Reviewed-by: Bauerchen <bauerchen@tencent.com>
2021-10-29 06:51:52 +00:00
Bin Lai b879b1b64b sli: Introduce memory and sched latency stat infrastructure
Signed-off-by: Munger jiang <mungerjiang@tencent.com>
2021-10-29 06:51:52 +00:00