From: Roman Gushchin <guro@fb.com>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<kernel-team@fb.com>, <edumazet@google.com>, <hannes@cmpxchg.org>,
<tj@kernel.org>
Subject: Re: [PATCH net] net: memcontrol: charge allocated memory after mem_cgroup_sk_alloc()
Date: Thu, 25 Jan 2018 17:15:55 +0000 [thread overview]
Message-ID: <20180125171549.GA21946@castle.DHCP.thefacebook.com> (raw)
In-Reply-To: <20180125.120302.1117695034222616751.davem@davemloft.net>
On Thu, Jan 25, 2018 at 12:03:02PM -0500, David Miller wrote:
> From: Roman Gushchin <guro@fb.com>
> Date: Thu, 25 Jan 2018 00:19:11 +0000
>
> > @@ -476,6 +477,10 @@ struct sock *inet_csk_accept(struct sock *sk, int flags, int *err, bool kern)
> > spin_unlock_bh(&queue->fastopenq.lock);
> > }
> > mem_cgroup_sk_alloc(newsk);
> > + amt = sk_memory_allocated(newsk);
> > + if (amt && newsk->sk_memcg)
> > + mem_cgroup_charge_skmem(newsk->sk_memcg, amt);
> > +
>
> This looks confusing to me.
>
> sk_memory_allocated() is the total amount of memory used by all
> sockets for a particular "struct proto", not just for that specific
> socket.
Oh, I see...
>
> Maybe I don't understand how this socket memcg stuff works, but it
> seems like you should be looking instead at how much memory is
> allocated to this specific socket.
Yes, this is what I wanted to do originally.
Let me find a proper way to do this.
Thank you!
Roman
next prev parent reply other threads:[~2018-01-25 17:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-25 0:19 Roman Gushchin
2018-01-25 17:03 ` David Miller
2018-01-25 17:15 ` Roman Gushchin [this message]
2018-01-31 21:54 ` Roman Gushchin
2018-02-01 15:16 ` David Miller
2018-02-01 20:22 ` Roman Gushchin
2018-02-01 21:17 ` Eric Dumazet
2018-02-01 22:55 ` Roman Gushchin
2018-02-01 23:27 ` Eric Dumazet
2018-02-01 23:42 ` Roman Gushchin
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=20180125171549.GA21946@castle.DHCP.thefacebook.com \
--to=guro@fb.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tj@kernel.org \
/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
all inboxes | Powered by JetHome®