Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5534185imu; Tue, 13 Nov 2018 08:01:15 -0800 (PST) X-Google-Smtp-Source: AJdET5d2mKPApnv6+v0Hpov0rtREbxqBXEn+QZdWoa7jgduWmcXEqKnzdS3XzAh8ruyCdVnBsuzi X-Received: by 2002:a63:7a5b:: with SMTP id j27mr5303776pgn.112.1542124875612; Tue, 13 Nov 2018 08:01:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542124875; cv=none; d=google.com; s=arc-20160816; b=gTgrhu9NwJpU6AZ+SJCftW02KJfpfIVrYv7E5xI8g7pkjszAqX/2AA6zZNT0BLoOBi 1nzfiinI8OAb6gpQC8UyS2X0+Dderh2gUVJ6D5DlkV+qwuG2Y/oaWzqPlzpGP4p45tCu mFaqlU+cxrs/jzqYiMOz9EFkeRr4NlgdLCpqtQDdnrPZHQnZEveMrHGROcqQwvt9Yj5r 2+iLLHP36FTs0bSn+qtZlW4GkoS6+eFHl9uH+dkhyOz2VJewNs9ZFcUQx5BHNIWFdwxK 7USBNoE0TKIez9VhuQP4gZNBKyGKIVF0QRR/lWOm+c+SmGUOIxye7WQ5FY2YdzoWfbTH Ghrg== 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=8TYxVx0DB/o1jWAwXKhnnASNwR8cltpwDHyLCiLd2HY=; b=Imz20nCa025zZu3EZsj7AGHy7YfIBwoYPlPx+12cP2biL8YXi1FjKpQuxY/go59a1W Je5ND0Yy7ZNRD4uP1Ztaf/2MNrp+9dHI+hIC+LVeV31Wv6dsZhrQvdiQfoGQi3kfY1Lb i6PoOozI73duJcl8BySI86tTV1B2dO2n5vW/LqbJ2njT9wm9PgvwuNPrQhowmmXs7VA9 KwMLMj/8wp5K57MVC1Ae/Of4YaaF/wo6IaFGLg8jHKd8GPgLAeU711RYzgeMtgm4SdC4 LD5dE77hNyI1dZMT20kiObrKpXFMsfOEDgPBz2siODOo+XfXKh3klIuXF8QViDpF5ewe XtaQ== 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 w61-v6si21557808plb.95.2018.11.13.08.00.39; Tue, 13 Nov 2018 08:01:15 -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 S2387841AbeKNB6s (ORCPT + 99 others); Tue, 13 Nov 2018 20:58:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57832 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726856AbeKNB6s (ORCPT ); Tue, 13 Nov 2018 20:58:48 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BE39F312E9F6; Tue, 13 Nov 2018 16:00:06 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.31]) by smtp.corp.redhat.com (Postfix) with SMTP id 45F08600D7; Tue, 13 Nov 2018 16:00:05 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 13 Nov 2018 17:00:06 +0100 (CET) Date: Tue, 13 Nov 2018 17:00:04 +0100 From: Oleg Nesterov To: Tejun Heo Cc: Roman Gushchin , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, Roman Gushchin Subject: Re: [PATCH v2 3/6] cgroup: cgroup v2 freezer Message-ID: <20181113160003.GD30990@redhat.com> References: <20181112230422.5911-1-guro@fb.com> <20181112230422.5911-5-guro@fb.com> <20181113153700.GB30990@redhat.com> <20181113154349.GF2509588@devbig004.ftw2.facebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181113154349.GF2509588@devbig004.ftw2.facebook.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 13 Nov 2018 16:00:06 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tejun, On 11/13, Tejun Heo wrote: > > > OK, please forget for now, but perhaps it would be more clean to add > > JOBCTL_TRAP_FREEZE to the JOBCTL_PENDING_MASK check in recalc_sigpending() > > and change get_signal to check JOBCTL_TRAP_MASK | JOBCTL_TRAP_FREEZE; and > > I am not even sure cgroup_freezer_enter() should live in do_jobctl_trap(). > > I'm sure you're aware of the context but just to refresh - one thing > which was really broken about cgroup1 freezer was that it piggybacked > on hibernation freezer and put frozen tasks in a state which is > undefined when seen from userspace - they're just stuck in D sleep > somewhere in the kernel. That's fine when the whole system is not > gonna be running, but not when only a subportion is being frozen. Thanks, I see. > So, the primary goal of cgroup2 freezer is putting the tasks in an > equivalent state as jobctl stop. It's a jobctl stop but controlled by > cgroup frozen state, meaning that they can be killed, PTRACE_SEIZE'd > and INTERRUPT'ed (PTRACE_ATTACH doesn't work as signal delivery should > be blocked but that's fine) and so on. And I agree, JOBCTL_TRAP_FREEZE looks fine. Just somehow I _feel_ that we can improve this logic a bit, but let me repeat that of course I can be easily wrong and I didn't even read the patch yet. Oleg.