Re: [PATCH v4 4/8] per-cgroup tcp buffers control

From: KAMEZAWA Hiroyuki
Date: Mon Oct 03 2011 - 21:17:28 EST


On Mon, 3 Oct 2011 14:18:39 +0400
Glauber Costa <glommer@xxxxxxxxxxxxx> wrote:

> With all the infrastructure in place, this patch implements
> per-cgroup control for tcp memory pressure handling.
>
> Signed-off-by: Glauber Costa <glommer@xxxxxxxxxxxxx>
> CC: David S. Miller <davem@xxxxxxxxxxxxx>
> CC: Hiroyouki Kamezawa <kamezawa.hiroyu@xxxxxxxxxxxxxx>
> CC: Eric W. Biederman <ebiederm@xxxxxxxxxxxx>

Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>

One question.
> +void tcp_enter_memory_pressure(struct sock *sk)
> +{
> + struct mem_cgroup *memcg = sk->sk_cgrp;
> + if (!memcg->tcp.tcp_memory_pressure) {
> + NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPMEMORYPRESSURES);
> + memcg->tcp.tcp_memory_pressure = 1;
> + }
> +}

It seems memcg->tcp.tcp_memory_pressure has no locks and not atomic.

no problematic race ?

Thanks,
-Kame

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/