From: Glauber Costa <glommer-bzQdu9zFT3WakBO8gow8eQ@public•gmane.org>
To: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public•gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public•gmane.org,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public•gmane.org
Subject: Re: [PATCH] netns: correctly use per-netns ipv4 sysctl_tcp_mem
Date: Fri, 20 Jul 2012 19:22:02 -0300 [thread overview]
Message-ID: <5009DA0A.4010401@parallels.com> (raw)
In-Reply-To: <20120709.152100.571089964662155300.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
On 07/09/2012 07:21 PM, David Miller wrote:
> From: Huang Qiang <h.huangqiang-hv44wF8Li93QT0dZR+AlfA@public•gmane.org>
> Date: Mon, 9 Jul 2012 14:05:09 +0800
>
>> From: Yang Zhenzhang <yangzhenzhang-hv44wF8Li93QT0dZR+AlfA@public•gmane.org>
>>
>> Now, kernel allows each net namespace to independently set up its levels
>> for tcp memory pressure thresholds.
>>
>> But it seems there is a bug, as using the following steps:
>>
>> [root@host socket]# lxc-start -n test -f config /bin/bash
>> [root@net-test socket]# ip route add default via 192.168.58.2
>> [root@net-test socket]# echo 0 0 0 > /proc/sys/net/ipv4/tcp_mem
>> [root@net-test socket]# scp root-Q0ErXNX1RuabR28l3DCWlg@public•gmane.org:/home/tcp_mem_test .
>>
>> and it still can transport the "tcp_mem_test" file which we hope it
>> would not.
>>
>> It's because inet_init() (net/ipv4/af_inet.c)initialize the
>> tcp_prot.sysctl_mem:
>> tcp_prot.sysctl_mem = init_net.ipv4.sysctl_tcp_mem;
>>
>> So when the protocal is TCP, sk->sk_prot->sysctl_mem(following code)
>> always use the ipv4 sysctl_tcp_mem of init_net namespace rather than
>> it's own net namespace.
>> This patch simply set "prot" equal to net->ipv4.sysctl_tcp_mem when
>> the protocol type is TCP.
>>
>> Signed-off-by: Yang Zhenzhang <yangzhenzhang-hv44wF8Li93QT0dZR+AlfA@public•gmane.org>
>
> Another regression added by the socket memory cgroup code, BIG
> SURPRISE.
>
Back from vacations: If I understand the submission correctly, this is
not a regression, since it seems to be only happening when those values
are set inside the network namespace - which was not possible before.
In any case, I believe from what I can see that the fix is already in
the way (haven't seen the whole backlog yet)
prev parent reply other threads:[~2012-07-20 22:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-09 6:05 [PATCH] netns: correctly use per-netns ipv4 sysctl_tcp_mem Huang Qiang
[not found] ` <4FFA7495.5070702-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2012-07-09 22:21 ` David Miller
[not found] ` <20120709.152100.571089964662155300.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-07-20 22:22 ` Glauber Costa [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=5009DA0A.4010401@parallels.com \
--to=glommer-bzqdu9zft3wakbo8gow8eq@public$(echo .)gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public$(echo .)gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public$(echo .)gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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