Commit df77430
psi: Reduce calls to sched_clock() in psi
We noticed that the cost of psi increases with the increase in the
levels of the cgroups. Particularly the cost of cpu_clock() sticks out
as the kernel calls it multiple times as it traverses up the cgroup
tree. This patch reduces the calls to cpu_clock().
Performed perf bench on Intel Broadwell with 3 levels of cgroup.
Before the patch:
$ perf bench sched all
# Running sched/messaging benchmark...
# 20 sender and receiver processes per group
# 10 groups == 400 processes run
Total time: 0.747 [sec]
# Running sched/pipe benchmark...
# Executed 1000000 pipe operations between two processes
Total time: 3.516 [sec]
3.516689 usecs/op
284358 ops/sec
After the patch:
$ perf bench sched all
# Running sched/messaging benchmark...
# 20 sender and receiver processes per group
# 10 groups == 400 processes run
Total time: 0.640 [sec]
# Running sched/pipe benchmark...
# Executed 1000000 pipe operations between two processes
Total time: 3.329 [sec]
3.329820 usecs/op
300316 ops/sec
Signed-off-by: Shakeel Butt <shakeelb@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Link: https://lkml.kernel.org/r/20210321205156.4186483-1-shakeelb@google.com1 parent 2a2f80f commit df77430
1 file changed
+10
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
644 | 644 | | |
645 | 645 | | |
646 | 646 | | |
647 | | - | |
| 647 | + | |
648 | 648 | | |
649 | 649 | | |
650 | | - | |
651 | 650 | | |
652 | | - | |
653 | 651 | | |
654 | 652 | | |
655 | 653 | | |
| |||
676 | 674 | | |
677 | 675 | | |
678 | 676 | | |
679 | | - | |
| 677 | + | |
680 | 678 | | |
681 | 679 | | |
682 | 680 | | |
| |||
696 | 694 | | |
697 | 695 | | |
698 | 696 | | |
699 | | - | |
| 697 | + | |
700 | 698 | | |
701 | 699 | | |
702 | 700 | | |
| |||
788 | 786 | | |
789 | 787 | | |
790 | 788 | | |
| 789 | + | |
791 | 790 | | |
792 | 791 | | |
793 | 792 | | |
794 | 793 | | |
795 | 794 | | |
796 | 795 | | |
| 796 | + | |
797 | 797 | | |
798 | 798 | | |
799 | 799 | | |
| |||
806 | 806 | | |
807 | 807 | | |
808 | 808 | | |
809 | | - | |
| 809 | + | |
810 | 810 | | |
811 | 811 | | |
812 | 812 | | |
| |||
815 | 815 | | |
816 | 816 | | |
817 | 817 | | |
| 818 | + | |
818 | 819 | | |
819 | 820 | | |
820 | 821 | | |
| |||
836 | 837 | | |
837 | 838 | | |
838 | 839 | | |
839 | | - | |
| 840 | + | |
840 | 841 | | |
841 | 842 | | |
842 | 843 | | |
| |||
858 | 859 | | |
859 | 860 | | |
860 | 861 | | |
861 | | - | |
| 862 | + | |
862 | 863 | | |
863 | 864 | | |
864 | 865 | | |
| |||
867 | 868 | | |
868 | 869 | | |
869 | 870 | | |
870 | | - | |
| 871 | + | |
871 | 872 | | |
872 | 873 | | |
873 | 874 | | |
| |||
0 commit comments