linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Paolo Abeni <pabeni@redhat.com>,
	Shakeel Butt <shakeel.butt@linux.dev>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@kernel.org>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Muchun Song <muchun.song@linux.dev>,
	David Rientjes <rientjes@google.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	Eric Dumazet <edumazet@google.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Meta kernel team <kernel-team@meta.com>,
	cgroups@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v4] memcg: add charging of already allocated slab objects
Date: Tue, 10 Sep 2024 11:19:29 +0200	[thread overview]
Message-ID: <e8756edc-1c85-4a03-9c6b-663a9e7d46eb@suse.cz> (raw)
In-Reply-To: <5d48fe26-1e18-4941-99d4-8c03e83f5e76@redhat.com>

On 9/10/24 10:26, Paolo Abeni wrote:
> On 9/5/24 19:34, Shakeel Butt wrote:
>>    * kmem_cache_alloc_node - Allocate an object on the specified node
>>    * @s: The cache to allocate from.
>> diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
>> index 64d07b842e73..3c13ca8c11fb 100644
>> --- a/net/ipv4/inet_connection_sock.c
>> +++ b/net/ipv4/inet_connection_sock.c
>> @@ -715,6 +715,7 @@ struct sock *inet_csk_accept(struct sock *sk, struct proto_accept_arg *arg)
>>   	release_sock(sk);
>>   	if (newsk && mem_cgroup_sockets_enabled) {
>>   		int amt = 0;
>> +		gfp_t gfp = GFP_KERNEL | __GFP_NOFAIL;
>>   
>>   		/* atomically get the memory usage, set and charge the
>>   		 * newsk->sk_memcg.
>> @@ -731,8 +732,8 @@ struct sock *inet_csk_accept(struct sock *sk, struct proto_accept_arg *arg)
>>   		}
>>   
>>   		if (amt)
>> -			mem_cgroup_charge_skmem(newsk->sk_memcg, amt,
>> -						GFP_KERNEL | __GFP_NOFAIL);
>> +			mem_cgroup_charge_skmem(newsk->sk_memcg, amt, gfp);
>> +		kmem_cache_charge(newsk, gfp);
>>   
>>   		release_sock(newsk);
>>   	}
> 
> The networking bits looks sane to me - with a very minor nit about the 
> reverse xmas tree order in variables declaration above.
> 
> Acked-by: Paolo Abeni <pabeni@redhat.com>

Great, thanks, I will adjust the ordering.




      reply	other threads:[~2024-09-10  9:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-05 17:34 Shakeel Butt
2024-09-05 17:48 ` Yosry Ahmed
2024-09-05 18:48   ` Shakeel Butt
2024-09-06  8:52     ` Vlastimil Babka
2024-09-06 16:03       ` Shakeel Butt
2024-09-06 17:19       ` Yosry Ahmed
2024-09-06 17:28         ` Vlastimil Babka
2024-09-06 17:38           ` Yosry Ahmed
2024-09-09  7:59             ` Vlastimil Babka
2024-09-09 17:20               ` Yosry Ahmed
2024-09-06 19:04           ` Shakeel Butt
2024-09-10  8:26 ` Paolo Abeni
2024-09-10  9:19   ` Vlastimil Babka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e8756edc-1c85-4a03-9c6b-663a9e7d46eb@suse.cz \
    --to=vbabka@suse.cz \
    --cc=42.hyeyoo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@meta.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=muchun.song@linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeel.butt@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox