Re: [PATCH V7 1/2] cgroup/rstat: Avoid thundering herd problem by kswapd across NUMA nodes

From: Jesper Dangaard Brouer
Date: Fri Jul 19 2024 - 03:54:55 EST




On 19/07/2024 02.40, Shakeel Butt wrote:
Hi Jesper,

On Wed, Jul 17, 2024 at 06:36:28PM GMT, Jesper Dangaard Brouer wrote:

[...]


Looking at the production numbers for the time the lock is held for level 0:

@locked_time_level[0]:
[4M, 8M) 623 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
[8M, 16M) 860 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[16M, 32M) 295 |@@@@@@@@@@@@@@@@@ |
[32M, 64M) 275 |@@@@@@@@@@@@@@@@ |


Is it possible to get the above histogram for other levels as well?

Data from other levels available in [1]:
[1] https://lore.kernel.org/all/8c123882-a5c5-409a-938b-cb5aec9b9ab5@xxxxxxxxxx/

IMHO the data shows we will get most out of skipping level-0 root-cgroup flushes.

Copy-pasted here (adj whitespaces hoping it better fit email):

Time below is in nanosec:
- M -> ms
- K -> usec

@locked_time_level[0]:
[4M, 8M) 623 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
[8M, 16M) 860 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[16M, 32M) 295 |@@@@@@@@@@@@@@@@@ |
[32M, 64M) 275 |@@@@@@@@@@@@@@@@ |

@locked_time_level[1]:
[4K, 8K) 6 |@@@@ |
[8K, 16K) 65 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[16K, 32K) 52 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
[32K, 64K) 23 |@@@@@@@@@@@@@@@@@@ |
[64K, 128K) 15 |@@@@@@@@@@@@ |
[128K, 256K) 10 |@@@@@@@@ |
[256K, 512K) 6 |@@@@ |
[512K, 1M) 15 |@@@@@@@@@@@@ |
[1M, 2M) 2 |@ |
[2M, 4M) 14 |@@@@@@@@@@@ |
[4M, 8M) 6 |@@@@ |
[8M, 16M) 7 |@@@@@ |
[16M, 32M) 1 | |

@locked_time_level[2]:
[2K, 4K) 1 | |
[4K, 8K) 160 |@@@@@@@@@ |
[8K, 16K) 733 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
[16K, 32K) 901 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[32K, 64K) 191 |@@@@@@@@@@@ |
[64K, 128K) 115 |@@@@@@ |
[128K, 256K) 61 |@@@ |
[256K, 512K) 70 |@@@@ |
[512K, 1M) 59 |@@@ |
[1M, 2M) 27 |@ |
[2M, 4M) 9 | |

@locked_time_level[3]:
[1K, 2K) 3 | |
[2K, 4K) 2 | |
[4K, 8K) 5 | |
[8K, 16K) 147 |@@@@@@ |
[16K, 32K) 1222 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[32K, 64K) 266 |@@@@@@@@@@@ |
[64K, 128K) 199 |@@@@@@@@ |
[128K, 256K) 146 |@@@@@@ |
[256K, 512K) 124 |@@@@@ |
[512K, 1M) 17 | |
[1M, 2M) 0 | |
[2M, 4M) 0 | |
[4M, 8M) 1 | |

@locked_time_level[4]:
[4K, 8K) 2 |@@ |
[8K, 16K) 17 |@@@@@@@@@@@@@@@@@@@@@@ |
[16K, 32K) 40 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[32K, 64K) 4 |@@@@@ |


I know this is 12 numa node machine, how many total CPUs are there?

192 CPU cores (incl HyperThreaded).

--Jesper