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: <20240726230808.GD1702603@cmpxchg.org>
Date: Fri, 26 Jul 2024 19:08:08 -0400
From: Johannes Weiner <hannes@...xchg.org>
To: Roman Gushchin <roman.gushchin@...ux.dev>
Cc: Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org, Michal Hocko <mhocko@...nel.org>,
	Shakeel Butt <shakeel.butt@...ux.dev>,
	Muchun Song <muchun.song@...ux.dev>
Subject: Re: [PATCH v3 1/3] mm: memcg: don't call propagate_protected_usage()
 needlessly

On Fri, Jul 26, 2024 at 08:31:08PM +0000, Roman Gushchin wrote:
> Memory protection (min/low) requires a constant tracking of
> protected memory usage. propagate_protected_usage() is called
> on each page counters update and does a number of operations
> even in cases when the actual memory protection functionality
> is not supported (e.g. hugetlb cgroups or memcg swap counters).
> 
> It's obviously inefficient and leads to a waste of CPU cycles.
> It can be addressed by calling propagate_protected_usage() only
> for the counters which do support memory guarantees. As of now
> it's only memcg->memory - the unified memory memcg counter.
> 
> Signed-off-by: Roman Gushchin <roman.gushchin@...ux.dev>
> Acked-by: Shakeel Butt <shakeel.butt@...ux.dev>

Makes perfect sense.

Acked-by: Johannes Weiner <hannes@...xchg.org>

> @@ -13,6 +13,11 @@
>  #include <linux/bug.h>
>  #include <asm/page.h>
>  
> +static bool track_protection(struct page_counter *c)
> +{
> +	return c->protection_support;
> +}

IMO it's a bit easier to follow without this. page_counter.c should be
able to access struct page_counter members directly :)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ