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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YfPgRU7Swo0VczUd@dhcp22.suse.cz>
Date:   Fri, 28 Jan 2022 13:23:33 +0100
From:   Michal Hocko <mhocko@...e.com>
To:     Shakeel Butt <shakeelb@...gle.com>
Cc:     Vasily Averin <vvs@...tuozzo.com>,
        Johannes Weiner <hannes@...xchg.org>,
        Roman Gushchin <guro@...com>,
        Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] memcg: replace in_interrupt() with !in_task()

On Thu 27-01-22 08:26:36, Shakeel Butt wrote:
> Replace the deprecated in_interrupt() with !in_task() because
> in_interrupt() returns true for BH disabled even if the call happens in
> the task context. in_task() is the right interface to differentiate
> task context from NMI, hard IRQ and softirq contexts.

Makes sense. I do not think this will have any visible effect. Except
for removing a deprecated call, right?

> Signed-off-by: Shakeel Butt <shakeelb@...gle.com>

Acked-by: Michal Hocko <mhocko@...e.com>

Thanks!

> ---
>  mm/memcontrol.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index d067366002e6..215dfe325e9d 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -2688,7 +2688,7 @@ static int try_charge_memcg(struct mem_cgroup *memcg, gfp_t gfp_mask,
>  			READ_ONCE(memcg->swap.high);
>  
>  		/* Don't bother a random interrupted task */
> -		if (in_interrupt()) {
> +		if (!in_task()) {
>  			if (mem_high) {
>  				schedule_work(&memcg->high_work);
>  				break;
> @@ -6968,7 +6968,7 @@ void mem_cgroup_sk_alloc(struct sock *sk)
>  		return;
>  
>  	/* Do not associate the sock with unrelated interrupted task's memcg. */
> -	if (in_interrupt())
> +	if (!in_task())
>  		return;
>  
>  	rcu_read_lock();
> -- 
> 2.35.0.rc0.227.g00780c9af4-goog

-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ