Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp856456imu; Tue, 20 Nov 2018 08:00:55 -0800 (PST) X-Google-Smtp-Source: AJdET5fdpvOY7RPjRnXw1a+DFluB+yF64x5JpJj2gNdXHTswrDpMdplv70kKsWxoXKrzzlNggbsM X-Received: by 2002:a62:f54f:: with SMTP id n76mr2742094pfh.59.1542729655023; Tue, 20 Nov 2018 08:00:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542729654; cv=none; d=google.com; s=arc-20160816; b=v5/9yscO5O/HzEpfKK9HhOQve6J0ytCpxg1GabLv+REdVr+R2pkd9ObU+2YKfwo5zz 0XDzQEKiSu5JHPrzdlCqk8aE5NL2K1ok7ybB9fxzKd9OTB/PSD7ckkpCxjkeTgcsu0RT yHQK4af5Zcrp8ogEu7YsGrFNhtnq6AEt7vTddtumq/97CqSx/KvWs/Vn7Jb3E9+KDC1j 52vx/B8I/h5l1tHXzOOBDbluPx94gLTlLLYX6HD015snBM5FAD4OpjHyaxht85Gw6mYd W3hhQQTDxxSc/qHm/2Sh283Hf8iM6HuASq/SwRH8M9TdcAS9AqY3KCtSirS+r2gCBhE7 bR5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date; bh=zyeaRL3U8VqSwLSxNXPAHR4WHUWa3Gp20lC08YtB650=; b=O+/FMpLeT0Y3qRaF8rgaDyALDcuvgI2/GOqef8qtH6QhpbYvL6xx9pb9MyO2gxIl4S 0mKL+qEXZYFWKS0dog10/j+v5NfqpvHfTosxBuAGVs5UEt1nd6fqDfH2m+javLP6j1tB iSGYtkaEzbiXYjmTJMwAavM1RBfHHbbkhI2R81YuExXTLq7jN6/1tP5WrY+nrft4qH6L 4wIKGWqp0Tl/awjm6tFKIlQ1LrMkwNu3CSw4GYbIl4N9ItlKvjbVyLPR61Iwichsr+cB hblZPJKNV+FZlqFzc5EAEh9yAehSsSpr6OD5P9h0A2SF5Wp9DssCX3/ardKRApb1X5zb zb5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6si26535810pll.384.2018.11.20.08.00.39; Tue, 20 Nov 2018 08:00:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729341AbeKUAfz (ORCPT + 99 others); Tue, 20 Nov 2018 19:35:55 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:33048 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729179AbeKUAfz (ORCPT ); Tue, 20 Nov 2018 19:35:55 -0500 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wAKDtehA130336 for ; Tue, 20 Nov 2018 09:06:35 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 2nvj59vthc-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 20 Nov 2018 09:06:34 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 20 Nov 2018 14:06:30 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 20 Nov 2018 14:06:27 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wAKE6QDK57344198 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 20 Nov 2018 14:06:26 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A135CAE04D; Tue, 20 Nov 2018 14:06:26 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A51D7AE055; Tue, 20 Nov 2018 14:06:24 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.207.151]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 20 Nov 2018 14:06:24 +0000 (GMT) Date: Tue, 20 Nov 2018 15:06:21 +0100 From: Mike Rapoport To: Roman Gushchin Cc: Roman Gushchin , Tejun Heo , Oleg Nesterov , "cgroups@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Kernel Team , "linux-doc@vger.kernel.org" Subject: Re: [PATCH v3 7/7] cgroup: document cgroup v2 freezer interface References: <20181117003830.15344-1-guro@fb.com> <20181117003830.15344-8-guro@fb.com> <20181117080227.GA22672@rapoport-lnx> <20181119174241.GA7273@tower.DHCP.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181119174241.GA7273@tower.DHCP.thefacebook.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 18112014-0012-0000-0000-000002CD65AD X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18112014-0013-0000-0000-000021028EAE Message-Id: <20181120140621.GC24627@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-11-20_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811200126 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 19, 2018 at 05:42:48PM +0000, Roman Gushchin wrote: > On Sat, Nov 17, 2018 at 12:02:28AM -0800, Mike Rapoport wrote: > > Hi, > > > > On Fri, Nov 16, 2018 at 04:38:30PM -0800, Roman Gushchin wrote: > > > Describe cgroup v2 freezer interface in the cgroup v2 admin guide. > > > > > > Signed-off-by: Roman Gushchin > > > Cc: Tejun Heo > > > Cc: linux-doc@vger.kernel.org > > > Cc: kernel-team@fb.com > > > --- > > > Documentation/admin-guide/cgroup-v2.rst | 26 +++++++++++++++++++++++++ > > > 1 file changed, 26 insertions(+) > > > > > > diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst > > > index 184193bcb262..a065c0bed88c 100644 > > > --- a/Documentation/admin-guide/cgroup-v2.rst > > > +++ b/Documentation/admin-guide/cgroup-v2.rst > > > @@ -862,6 +862,8 @@ All cgroup core files are prefixed with "cgroup." > > > populated > > > 1 if the cgroup or its descendants contains any live > > > processes; otherwise, 0. > > > + frozen > > > + 1 if the cgroup is frozen; otherwise, 0. > > > > > > cgroup.max.descendants > > > A read-write single value files. The default is "max". > > > @@ -895,6 +897,30 @@ All cgroup core files are prefixed with "cgroup." > > > A dying cgroup can consume system resources not exceeding > > > limits, which were active at the moment of cgroup deletion. > > > > > > + cgroup.freeze > > > + A read-write single value file which exists on non-root cgroups. > > > + Allowed values are "0" and "1". The default is "0". > > > + > > > + Writing "1" to the file causes freezing of the cgroup and all > > > + descendant cgroups. This means that all belonging processes will > > > + be stopped and will not run until the cgroup will be explicitly > > > + unfrozen. Freezing of the cgroup may take some time; when the process > > > > "when the process is complete" sounds somewhat ambiguous, it's unclear > > whether freezing is complete or the process that's being frozen is > > complete. > > > > Maybe "when this action is completed"? > > > > > + is complete, the "frozen" value in the cgroup.events control file > > > + will be updated and the corresponding notification will be issued. > > > > Can you please clarify how exactly cgroup.events would be updated? > > > > > + Cgroup can be frozen either by its own settings, either by settings > > > > ^ A cgroup ... and maybe there are more "a" and "the" that should be > > fixed, it's hard for me to tell. > > > > Also, I believe "either ..., or ..." sounds better than "either ..., > > either ..." > > > > > + of any ancestor cgroups. If any of ancestor cgroups is frozen, the > > > + cgroup will remain frozen. > > > + > > > + Processes in the frozen cgroup can be killed by a fatal signal. > > > + They also can enter and leave a frozen cgroup: either by an explicit > > > + move by a user, either if freezing of the cgroup races with fork(). > > > > ditto > > > > > + If a cgroup is moved to a frozen cgroup, it stops. If a process is > > > > ^ process? > > > > > + moving out of a frozen cgroup, it becomes running. > > > > ^ moved > > Hello, Mike! > > Thanks for the review! I agree with all comments above; fixes queued for v4. > > > > > > + Frozen status of a cgroup doesn't affect any cgroup tree operations: > > > + it's possible to delete a frozen (and empty) cgroup, as well as > > > + create new sub-cgroups. > > > > Maybe it's also worth adding that freezing a process has no effect on its > > memory consumption, at least directly. > > Hm, isn't it the expected behavior? You'd be surprised ;-) Just recently I had a couple of questions about the memory consumption of the frozen processes. > In any case, I assume that cgroup.freeze knob description is not the best place > for a such explanations. Maybe it's better to add a standalone paragraph with > the description of the frozen process state, what's expected to work, what's > not, etc. I'd return to this question a bit later, when we'll agree on the user > interface and the implementation. Sure. > Thanks! > -- Sincerely yours, Mike.