Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752003AbbESBSn (ORCPT ); Mon, 18 May 2015 21:18:43 -0400 Received: from mail-ie0-f169.google.com ([209.85.223.169]:36364 "EHLO mail-ie0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751073AbbESBSm (ORCPT ); Mon, 18 May 2015 21:18:42 -0400 MIME-Version: 1.0 X-Originating-IP: [5.101.106.105] In-Reply-To: <20150518213423.GI24861@htj.duckdns.org> References: <1431960667-26593-1-git-send-email-cyphar@cyphar.com> <1431960667-26593-8-git-send-email-cyphar@cyphar.com> <20150518213423.GI24861@htj.duckdns.org> Date: Tue, 19 May 2015 11:18:41 +1000 Message-ID: Subject: Re: [PATCH v12 7/8] cgroup: add a tset_get_css macro From: Aleksa Sarai To: Tejun Heo Cc: lizefan@huawei.com, mingo@redhat.com, Peter Zijlstra , richard@nod.at, =?UTF-8?B?RnLDqWTDqXJpYyBXZWlzYmVja2Vy?= , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1260 Lines: 32 Hi Tejun, >> +/** >> + * tset_get_css - obtain and get css for (tset, subsys_id) >> + * @tset: target taskset >> + * @subsys_id: target subsystem id >> + * >> + * Since all of the tasks in a taskset are guaranteed to have the same css, it's >> + * safe to grab the ref of just the first task's css and treat it as though you >> + * have a ref on the taskset's "collective" css. >> + */ >> +#define tset_get_css(tset, subsys_id) \ >> + task_get_css(cgroup_taskset_first(tset), subsys_id) > > They aren't tho. It depends on the hierarchy configuration. csses > belonging to hierarchies which aren't the current migration target may > differ. Okay, I was confused by what you said earlier. In this case, we might as well just move all of the attach accounting to ->attach() and not deal with reverting it (unless we're guaranteed that the css of each task in the tset doesn't change between ->can_attach() and ->cancel_attach()). -- Aleksa Sarai (cyphar) www.cyphar.com -- 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/