From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754878AbbKQVbd (ORCPT ); Tue, 17 Nov 2015 16:31:33 -0500 Received: from mail-yk0-f169.google.com ([209.85.160.169]:35961 "EHLO mail-yk0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754700AbbKQVbb (ORCPT ); Tue, 17 Nov 2015 16:31:31 -0500 Date: Tue, 17 Nov 2015 16:31:26 -0500 From: Tejun Heo To: David Miller Cc: pablo@netfilter.org, kaber@trash.net, kadlec@blackhole.kfki.hu, lizefan@huawei.com, hannes@cmpxchg.org, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, daniel@iogearbox.net, daniel.wagner@bmw-carit.de, nhorman@tuxdriver.com Subject: Re: [PATCH 4/5] sock, cgroup: add sock->sk_cgroup Message-ID: <20151117213126.GH22864@mtj.duckdns.org> References: <1447789240-29394-1-git-send-email-tj@kernel.org> <1447789240-29394-5-git-send-email-tj@kernel.org> <20151117.162554.314531574043190960.davem@davemloft.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151117.162554.314531574043190960.davem@davemloft.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, David. On Tue, Nov 17, 2015 at 04:25:54PM -0500, David Miller wrote: > > In preparation, this patch adds sock->sk_cgroup which points to the > > associated cgroup. A sock is associated on creation and stays > > associated to the same cgroup until freed; unfortunately, this ends up > > adding another cgroup field to struct sock on top of sk_cgrp_prioidx > > and sk_classid. I tried to think of a way to somehow overload the > > existing fields but couldn't come up with a reasonable one. > > sk->sk_cgrp_prioidx is simply sk->sk_cgroup->id, is it not? Unfortunately, sk->sk_cgrp_prioidx is an arbitrary value which can be configured through "net_cls.classid". :( > We really need to consolidate this before we stuff even more members > into the socket for control group support, sorry. Yeah, it is messy. I'll see if I can come up with a non-crazy way to combine the other two fields with ->sk_cgroup. Thanks. -- tejun