Hello. On Wed, Mar 19, 2025 at 12:13:30AM -0700, Greg Thelen <gthelen@xxxxxxxxxx> wrote: > cgroup_rstat_flush_locked() grabs the irq safe cgroup_rstat_lock while > iterating all possible cpus. It only drops the lock if there is > scheduler or spin lock contention. If neither, then interrupts can be > disabled for a long time. On large machines this can disable interrupts > for a long enough time to drop network packets. On 400+ CPU machines > I've seen interrupt disabled for over 40 msec. This is peanuts, watchdog_thresh defaults to 10000 msec. (Tongue-in-cheek, to put that threshold into relation but I see the problem.) > The mode of memory.stat access latency after grouping by of 2 buckets: power > - without memory hogs: 64 usec => 16 usec > - with memory hogs: 64 usec => 8 usec > The memory.stat latency improves. > > Signed-off-by: Eric Dumazet <edumazet@xxxxxxxxxx> > Signed-off-by: Greg Thelen <gthelen@xxxxxxxxxx> > Tested-by: Greg Thelen <gthelen@xxxxxxxxxx> > --- > kernel/cgroup/rstat.c | 12 +++++------- > 1 file changed, 5 insertions(+), 7 deletions(-) FTR, the lock may end up split per-subsys [1] but this would still make sense for memcg's one. (I wonder if Tejun would consider it small enough then to avoid interrupt disabling. Then this could be converted to more widely used cond_resched_lock().) [1] https://lore.kernel.org/r/20250227215543.49928-4-inwardvessel@xxxxxxxxx/ But all in all, thanks for this and Acked-by: Michal Koutný <mkoutny@xxxxxxxx>
Attachment:
signature.asc
Description: PGP signature