From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: [RFC] cgroup TODOs Date: Fri, 14 Sep 2012 13:39:25 -0700 Message-ID: <20120914203925.GR17747@google.com> References: <20120913205827.GO7677@google.com> <20120914180754.GF6221@redhat.com> <20120914185324.GI17747@google.com> <20120914192840.GG6221@redhat.com> <20120914194439.GP17747@google.com> <20120914194950.GQ17747@google.com> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=5CeHuIL5WKJASV/8EWE8Zw0K/vWKd9eRWEP7xMRlMaM=; b=tTUef727TKIRX31jq8t3YgoyFSCuM6MDq3aJde0dQFVwlJfDOzJ3NmtMIwDhRrR9qp RIsSqmPD3dQUzxveAorgjBLmGAV/1lSy2VjqRF1gXfikMBQCB+Ogixi4OS/xdFLyW5vP m0SiMqz5SZP+NHlfnEvaX0O1dvvPpTU1KCu5RsBb7Vn3I7UDVCdwhWXahRb+zwvEWoQ4 FsRLsq3n01CRuxomia8QUkbRXEDVS4spwqiQyGodadf4iS3VCL8+ewPNclI74yqQeNtc be7Mgol6wjTszhg8fG7n2qCPDd2tLYUUFATKnkpg57kUzmFinkMd5lJ2icLBJxuBg8E5 T+FA== Content-Disposition: inline In-Reply-To: <20120914194950.GQ17747-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Vivek Goyal Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Li Zefan , Michal Hocko , Glauber Costa , Peter Zijlstra , Paul Turner , Johannes Weiner , Thomas Graf , Paul Mackerras , Ingo Molnar , Arnaldo Carvalho de Melo , Neil Horman , "Aneesh Kumar K.V" , Serge Hallyn Hello, again. On Fri, Sep 14, 2012 at 12:49:50PM -0700, Tejun Heo wrote: > That said, if someone can think of a better solution, I'm all ears. > One thing that *has* to be maintained is that it should be able to tag > a resource in such way that its associated controllers are > identifiable regardless of which task is looking at it. So, I thought about it more. How about we do "consider / ignore this node" instead of "(don't) nest beyond this level". For example, let's assume a tree like the following. R / | \ A B C / \ AA AB If we want to differentiate between AA and AB, we'll have to consider the whole tree with the previous sheme - A needs to nest, so R needs to nest and we end up with the whole tree. Instead, if we have honor / ignore this node. We can set the honor bit on A, AA and AB and see the tree as R / A / \ AA AB We still see the intermediate A node but can ignore the other branches. Implementation and concept-wise, it's fairly simple too. For any given node and controller, you travel upwards until you meet a node which has the controller enabled and that's the cgroup the controller considers. Thanks. -- tejun From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753554Ab2INUjd (ORCPT ); Fri, 14 Sep 2012 16:39:33 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:62164 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751836Ab2INUjb (ORCPT ); Fri, 14 Sep 2012 16:39:31 -0400 Date: Fri, 14 Sep 2012 13:39:25 -0700 From: Tejun Heo To: Vivek Goyal Cc: containers@lists.linux-foundation.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Li Zefan , Michal Hocko , Glauber Costa , Peter Zijlstra , Paul Turner , Johannes Weiner , Thomas Graf , Paul Mackerras , Ingo Molnar , Arnaldo Carvalho de Melo , Neil Horman , "Aneesh Kumar K.V" , Serge Hallyn Subject: Re: [RFC] cgroup TODOs Message-ID: <20120914203925.GR17747@google.com> References: <20120913205827.GO7677@google.com> <20120914180754.GF6221@redhat.com> <20120914185324.GI17747@google.com> <20120914192840.GG6221@redhat.com> <20120914194439.GP17747@google.com> <20120914194950.GQ17747@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120914194950.GQ17747@google.com> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, again. On Fri, Sep 14, 2012 at 12:49:50PM -0700, Tejun Heo wrote: > That said, if someone can think of a better solution, I'm all ears. > One thing that *has* to be maintained is that it should be able to tag > a resource in such way that its associated controllers are > identifiable regardless of which task is looking at it. So, I thought about it more. How about we do "consider / ignore this node" instead of "(don't) nest beyond this level". For example, let's assume a tree like the following. R / | \ A B C / \ AA AB If we want to differentiate between AA and AB, we'll have to consider the whole tree with the previous sheme - A needs to nest, so R needs to nest and we end up with the whole tree. Instead, if we have honor / ignore this node. We can set the honor bit on A, AA and AB and see the tree as R / A / \ AA AB We still see the intermediate A node but can ignore the other branches. Implementation and concept-wise, it's fairly simple too. For any given node and controller, you travel upwards until you meet a node which has the controller enabled and that's the cgroup the controller considers. Thanks. -- tejun