From patchwork Mon Nov 5 18:02:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 1699961 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 79FBCDF2AB for ; Mon, 5 Nov 2012 18:02:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932180Ab2KESCU (ORCPT ); Mon, 5 Nov 2012 13:02:20 -0500 Received: from mail-pb0-f46.google.com ([209.85.160.46]:42505 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754647Ab2KESCS (ORCPT ); Mon, 5 Nov 2012 13:02:18 -0500 Received: by mail-pb0-f46.google.com with SMTP id rr4so4091744pbb.19 for ; Mon, 05 Nov 2012 10:02:17 -0800 (PST) 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=5kIOMyfjN+5gV8f53RlQUGiyR1MhCQdaK03PwUwH7Hc=; b=htWwLHmLBblNYYJ3BlXxgpaFFIAe9x/Zy7ZSS9VVePr9qUSM+iNoU7D7dr4ojtjFtu yUgira0/Lda1F2JGdVkUlMZ3vLNK1jDlr6yZJ1XI38LovSvqlPjUuX4JDwr28fvMSn+L 7+pAuk66VDjzVKYCk+3Itxv9VoRxy/wJ0oSCgWyXnNcgIGbGWoQiu5pqAhCE78KIggHC ONA+orsBMPLJNR8omavdqsfDkjhoyEjna+fSI/7yKJRCxvakoy1hpoN236hYHyq544/i hamHF/13R39X2SKPXNiwwtJzAFeSxF1RC9hnQf7RhngcaTg+do6tiF+q6Ze076+3B5ms Ia2g== Received: by 10.68.189.102 with SMTP id gh6mr32490848pbc.37.1352138537489; Mon, 05 Nov 2012 10:02:17 -0800 (PST) Received: from mtj.dyndns.org (50-78-106-165-static.hfc.comcastbusiness.net. [50.78.106.165]) by mx.google.com with ESMTPS id pq9sm10017198pbc.1.2012.11.05.10.02.15 (version=SSLv3 cipher=OTHER); Mon, 05 Nov 2012 10:02:16 -0800 (PST) Date: Mon, 5 Nov 2012 10:02:13 -0800 From: Tejun Heo To: Glauber Costa Cc: lizefan@huawei.com, mhocko@suse.cz, rjw@sisk.pl, containers@lists.linux-foundation.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, fweisbec@gmail.com, Peter Zijlstra Subject: [RFC] cgroup: deprecate clone_children Message-ID: <20121105180213.GB19354@mtj.dyndns.org> References: <1351931915-1701-1-git-send-email-tj@kernel.org> <1351931915-1701-2-git-send-email-tj@kernel.org> <5097C23B.3040808@parallels.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5097C23B.3040808@parallels.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org clone_children makes cgroup invoke ->post_clone() callback if it exists and sets CGRP_CLONE_CHILDREN. ->post_clone(), while being named generically, is only supposed to copy configuration from its parent. This is an entirely convenience feature which is only used by cpuset to alter its configuration propagation. As the mount option and cgroupfs knobs are cgroup-wide and different controllers differ in their configuration propagations, it's awkward to use for multiple controllers especially if they're co-mounted. At this point, we can't use this flag for any other controller anyway as it would implicitly change the behavior. As this is unnecessary feature with very limited use and awkward in co-mounted use cases, let's try to deprecate it. Whine on the mount option and accesses to cgroupfs knobs. Signed-off-by: Tejun Heo Cc: Glauber Costa Cc: Peter Zijlstra --- Glauber, I think this is more befitting change for .post_clone(). If people aren't depending on this, I'd much prefer to just remove it. Thanks. kernel/cgroup.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -1162,6 +1162,8 @@ static int parse_cgroupfs_options(char * continue; } if (!strcmp(token, "clone_children")) { + pr_warning("cgroup: mount option clone_children is deprecated (pid=%d comm=%s)\n", + task_tgid_nr(current), current->comm); opts->clone_children = true; continue; } @@ -3837,6 +3839,9 @@ fail: static u64 cgroup_clone_children_read(struct cgroup *cgrp, struct cftype *cft) { + printk_ratelimited(KERN_WARNING "cgroup: clone_children is deprecated (pid=%d comm=%s)\n", + task_tgid_nr(current), current->comm); + return clone_children(cgrp); } @@ -3844,6 +3849,9 @@ static int cgroup_clone_children_write(s struct cftype *cft, u64 val) { + printk_ratelimited(KERN_WARNING "cgroup: clone_children is deprecated (pid=%d comm=%s)\n", + task_tgid_nr(current), current->comm); + if (val) set_bit(CGRP_CLONE_CHILDREN, &cgrp->flags); else