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: <3f4c0d70-8689-40a9-b051-13d013c4f09c@kernel.org>
Date: Tue, 28 May 2024 16:19:14 +0200
From: "Vlastimil Babka (SUSE)" <vbabka@...nel.org>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: Shakeel Butt <shakeel.butt@...ux.dev>,
 Andrew Morton <akpm@...ux-foundation.org>,
 Johannes Weiner <hannes@...xchg.org>, Michal Hocko <mhocko@...nel.org>,
 Roman Gushchin <roman.gushchin@...ux.dev>,
 Muchun Song <muchun.song@...ux.dev>, linux-mm@...ck.org,
 linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH v2] memcg: Remove the lockdep assert from
 __mod_objcg_mlstate().

On 5/28/24 4:13 PM, Sebastian Andrzej Siewior wrote:
> The assert was introduced in the commit cited below as an insurance that
> the semantic is the same after the local_irq_save() has been removed and
> the function has been made static.
> 
> The original requirement to disable interrupt was due the modification
> of per-CPU counters which require interrupts to be disabled because the
> counter update operation is not atomic and some of the counters are
> updated from interrupt context.
> 
> All callers of __mod_objcg_mlstate() acquire a lock
> (memcg_stock.stock_lock) which disables interrupts on !PREEMPT_RT and
> the lockdep assert is satisfied. On PREEMPT_RT the interrupts are not
> disabled and the assert triggers.
> 
> The safety of the counter update is already ensured by
> VM_WARN_ON_IRQS_ENABLED() which is part of __mod_memcg_lruvec_state() and
> does not require yet another check.
> 
> Remove the lockdep assert from __mod_objcg_mlstate().
> 
> Fixes: 91882c1617c15 ("memcg: simple cleanup of stats update functions")
> Link: https://lore.kernel.org/r/20240528121928.i-Gu7Jvg@linutronix.de
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>

Acked-by: Vlastimil Babka <vbabka@...e.cz>

mm-hotfixes as it's a rc1 regression

> ---
> On 2024-05-28 15:44:51 [+0200], Vlastimil Babka (SUSE) wrote:
>> I think just s/memcg_stats_lock()/__mod_memcg_lruvec_state()/ in your
>> phrasing, since we are removing the lockdep assert from path that calls
>> __mod_memcg_lruvec_state() and not memcg_stats_lock()?
>> Or am I missing something?
> 
> Yeah, makes sense.
> 
>  mm/memcontrol.c |    2 --
>  1 file changed, 2 deletions(-)
> 
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -3147,8 +3147,6 @@ static inline void __mod_objcg_mlstate(s
>  	struct mem_cgroup *memcg;
>  	struct lruvec *lruvec;
>  
> -	lockdep_assert_irqs_disabled();
> -
>  	rcu_read_lock();
>  	memcg = obj_cgroup_memcg(objcg);
>  	lruvec = mem_cgroup_lruvec(memcg, pgdat);


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ