Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751558AbaDOVxi (ORCPT ); Tue, 15 Apr 2014 17:53:38 -0400 Received: from mail-la0-f42.google.com ([209.85.215.42]:34385 "EHLO mail-la0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751177AbaDOVxe (ORCPT ); Tue, 15 Apr 2014 17:53:34 -0400 MIME-Version: 1.0 In-Reply-To: <1397596546-10153-3-git-send-email-vgoyal@redhat.com> References: <1397596546-10153-1-git-send-email-vgoyal@redhat.com> <1397596546-10153-3-git-send-email-vgoyal@redhat.com> From: Andy Lutomirski Date: Tue, 15 Apr 2014 14:53:13 -0700 Message-ID: Subject: Re: [PATCH 2/2] net: Implement SO_PASSCGROUP to enable passing cgroup path To: Vivek Goyal Cc: "linux-kernel@vger.kernel.org" , cgroups@vger.kernel.org, Network Development , "David S. Miller" , Tejun Heo , Simo Sorce , lpoetter@redhat.com, kay@redhat.com, dwalsh@redhat.com Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 15, 2014 at 2:15 PM, Vivek Goyal wrote: > This patch implements socket option SO_PASSCGROUP along the lines of > SO_PASSCRED. > > If SO_PASSCGROUP is set, then recvmsg() will get a control message > SCM_CGROUP which will contain the cgroup path of sender. This cgroup > belongs to first mounted hierarchy in the sytem. > > SCM_CGROUP control message can only be received and sender can not send > a SCM_CGROUP message. Kernel automatically generates one if receiver > chooses to receive one. > > This works both for unix stream and datagram sockets. > > cgroup information is passed only if either the sender or receiver has > SO_PASSCGROUP option set. This means for existing workloads they should > not see any significant performance impact of this change. This is odd. Shouldn't an SCM_CGROUP cmsg be generated when the receiver has SO_PASSCGROUP set and the sender passes SCM_CGROUP to sendmsg? --Andy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/