Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp645604imp; Wed, 20 Feb 2019 06:40:01 -0800 (PST) X-Google-Smtp-Source: AHgI3IbdcjdZat6XTPxIKrONfakY2BLN9irEfydZmsl6ZTNU4T+1lFGAw/c4g7Azq5R4OUghzsv/ X-Received: by 2002:a63:94:: with SMTP id 142mr32838094pga.74.1550673601715; Wed, 20 Feb 2019 06:40:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550673601; cv=none; d=google.com; s=arc-20160816; b=z0c7OUg+klFHm3UM5xsfpoazckM5BOt9qiqYEN3TryoFnL92oqKxpFN68dYpgHK4+9 rI2CNtLV4lRukQ9ouD9rEPj3zbmlN98ckrcy2Wlnt/DTY+CTRoWSV3uoEV0Twu+0bwM4 bABozxLi3tiMi3JWPrgC8+ttrZ3pLpvvAnhXpFp+Zh4JyD1D5IyDdRiJn94ErxOLRxy7 WiTiTsL8C3LPK3CAHGTECFPVHEwQgoucIfFghwbfKrnuqAzNhjr5saL+/RdBq3RTevp3 yywKiqtrsug4/19Yphl9zOPARl60ibhJK1dMvZe8GmPJAg/QsaVSBPNwU95qIEKgKiLd PFdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=zV//XALgDFA+/+/tqRKVAhGHlKD1RmtfaDPzG0gQ0DA=; b=Qz3c7XVOM0jnMsriUtOBtwYkUZ0hCoVxPUNRkRYkR6fumAI7bO3ltpH46eUcM2r929 jQikmnD2ErXz4xVYsHFV7JdxMnBdI7zrfJFPFiMwJuiIJT7S6Rk25D7Agu3S0WhE8oF1 1hnm4T7G1X31nJZqbXdy/THhvN775zqXrpCFMLuOuL1mQttd6ym79VEikKaeM3valtdK YgD23kft1CUjaagoq5EuosYHyqxD1Op72tRd0HDLnbUoM3mpd5VplXUhednh6XtSX6Tr 1Y9axWsZ3COJsNYqc8J91jARn+XXa6KKH1aYnEv0YKY2PIbyOBmopVGx7I/BlH6JiEfp tQIQ== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t5si18296093pgm.79.2019.02.20.06.39.45; Wed, 20 Feb 2019 06:40:01 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726766AbfBTOhv (ORCPT + 99 others); Wed, 20 Feb 2019 09:37:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54186 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726345AbfBTOhv (ORCPT ); Wed, 20 Feb 2019 09:37:51 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E6F4C1440B5; Wed, 20 Feb 2019 14:37:50 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.152]) by smtp.corp.redhat.com (Postfix) with SMTP id 842C861D06; Wed, 20 Feb 2019 14:37:49 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 20 Feb 2019 15:37:50 +0100 (CET) Date: Wed, 20 Feb 2019 15:37:48 +0100 From: Oleg Nesterov To: Roman Gushchin Cc: Tejun Heo , kernel-team@fb.com, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Roman Gushchin Subject: Re: [PATCH v8 0/7] freezer for cgroup v2 Message-ID: <20190220143748.GA9477@redhat.com> References: <20190219220252.4906-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190219220252.4906-1-guro@fb.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 20 Feb 2019 14:37:51 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/19, Roman Gushchin wrote: > > It provides similar functionality as v1 freezer, but the interface > conforms to the cgroup v2 interface design principles, and it > provides a better user experience: tasks can be killed, ptrace works, I tried to not argue with intent, but to be honest I am more and more sceptical... Lets forget about ptrace for the moment. Once again, why do we want a killable freezer? If a user wants to kill a frozen task from CGRP_FROZEN cgroup he can simply 1. send SIGKILL to that task 2. migrate it to the root cgroup. why this doesn't / can't work? Why I am starting to argue... The ability to kill a frozen task complicates the code, and since cgroup_enter_stopped() (in this version at least) doesn't properly interacts with freezable_schedule() leads to other problems. From 7/7: + 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; ^^^^^^^^^^^^^^^^^^ it may take infinite time. Just suppose that a task does vfork() and this races with cgroup_do_freeze(true). If the new child notices JOBCTL_TRAP_FREEZE before exit/exec the cgroup will be never frozen. If I read the current kernel/cgroup/freezer.c correctly, CGROUP_FREEZING should "always" work (unless a task hangs in D state) and to me this looks more important than kill/ptrace support... > there is no separate controller, which has to be enabled, etc. agreed, this is nice. Oleg.