lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z9sOVsMtaZ9n02MZ@google.com>
Date: Wed, 19 Mar 2025 18:35:02 +0000
From: Yosry Ahmed <yosry.ahmed@...ux.dev>
To: Johannes Weiner <hannes@...xchg.org>
Cc: Greg Thelen <gthelen@...gle.com>, Tejun Heo <tj@...nel.org>,
	Michal Koutný <mkoutny@...e.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Eric Dumazet <edumzaet@...gle.com>, cgroups@...r.kernel.org,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH] cgroup/rstat: avoid disabling irqs for O(num_cpu)

On Wed, Mar 19, 2025 at 02:06:43PM -0400, Johannes Weiner wrote:
> On Wed, Mar 19, 2025 at 05:16:02PM +0000, Yosry Ahmed wrote:
> > @@ -365,9 +352,8 @@ __bpf_kfunc void cgroup_rstat_flush(struct cgroup *cgrp)
> >  void cgroup_rstat_flush_hold(struct cgroup *cgrp)
> >  	__acquires(&cgroup_rstat_lock)
> >  {
> > -	might_sleep();
> > +	cgroup_rstat_flush(cgrp);
> >  	__cgroup_rstat_lock(cgrp, -1);
> > -	cgroup_rstat_flush_locked(cgrp);
> >  }
> 
> Might as well remove cgroup_rstat_flush_hold/release entirely? There
> are no external users, and the concept seems moot when the lock is
> dropped per default. cgroup_base_stat_cputime_show() can open-code the
> lock/unlock to stabilize the counts while reading.
 
Yeah I missed the fact that the users are internal because the functions
are not static. I also don't see the point of keeping them.

Tejun/Greg, should I send a patch on top of this one or do you prefer
sending a new version?


> (btw, why do we not have any locking around the root stats in
> cgroup_base_stat_cputime_show()? There isn't anything preventing a
> reader from seeing all zeroes if another reader runs the memset() on
> cgrp->bstat, is there? Or double times...)


(I think root_cgroup_cputime() operates on a stack allocated bstat, not
cgrp->bstat)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ