Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3454447imb; Tue, 5 Mar 2019 09:41:42 -0800 (PST) X-Google-Smtp-Source: APXvYqwnroXNl9JK1ViegEvjCVvY11D0Xwqp3A2iiC1Telb2tbQI3myclxHuL6t/AE8IQgh1V6ai X-Received: by 2002:a63:1105:: with SMTP id g5mr2418868pgl.322.1551807702352; Tue, 05 Mar 2019 09:41:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551807702; cv=none; d=google.com; s=arc-20160816; b=eK1bsSdpP9Hs2EGTAXa5LHHOx66Iy/YEYsROauIeERUPsJei4d+/hBoA/RBMYh21xc VuMB73mFU0+4EfuPau7zjsnp+hJMN3qEXxWvXLGR78hX9jCK32gHqAWxSQJukRtAiiJi ZgHm7SndSY2XcqFhX/FFiWPfCzOZXWOaFUNrpTJ90aP95+tFkpjI07nsQfMUBeNamcyk 3lJTjS8q4mOzVHJLNlH07rmvX+pVXiJbnwZmS/aTviI8Ja4OJzvD3falb+JCcHDWqAMg xW1ts9Fh4BM6yafCGKHmwUOlelrOKa4WLLEuHQjFe2n4+v+WJG2W0O2gL8RIB0suWpUn w2ug== 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:dkim-signature; bh=mNi2wcs42w6UeX4ek2kNcWvb2MWYPhhWXQr+BTcHWzA=; b=duX/Ed02lBpAgAstogbU6WxwRazbDMthZyinmWULULFIKuoGCGj+5N/b4ZqcEC+1Tf uOBoWJQJocedwKOw9VxvSK6cIY6Pys8HE31lNGpxHDNNqxFl4qTPxeOnm4fVqdcgy/Y2 MuK4yJrXeL7DIa8FOGLtxP66FoEdikP6JhXvt+W7UjBGRfMWO0LwyRNZHnM7AUZcKSR/ zuTLxPEvKAz4RXuRb68XCHerq2D2jgdlyJwr8sSdVsUp9emaZA7iMnJmHH0gW52OfePP tUahygNHIMAEwPmWrM8F8Rs1i7ppSq57EcIM3nKMcWwwfz5TtQW8RaZ32pKztA6QTVRf AmMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=WGvmDns+; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cs11si9567500plb.248.2019.03.05.09.41.27; Tue, 05 Mar 2019 09:41:42 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=WGvmDns+; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728159AbfCER1h (ORCPT + 99 others); Tue, 5 Mar 2019 12:27:37 -0500 Received: from mail-yw1-f67.google.com ([209.85.161.67]:42397 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727334AbfCER1g (ORCPT ); Tue, 5 Mar 2019 12:27:36 -0500 Received: by mail-yw1-f67.google.com with SMTP id v201so7572661ywa.9; Tue, 05 Mar 2019 09:27:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mNi2wcs42w6UeX4ek2kNcWvb2MWYPhhWXQr+BTcHWzA=; b=WGvmDns+blbuyso53uWHKhRtDGSCgonJqeV/qv36MQf+5wzAILLS9xN/7V1A5oKJYC 5p2rYbnI4yHmrwWtXSCzWvVUjtSsgAk1eZUUcKbS3rJO0Bpeb22uLSBw3duLCHZTcc9d VyIkNTGwR7bzeBkNy66nBFRpn2AQzDpNvkjKGdKTDBM9NAiA8b5sjPmjIFOdK370b7tB O7OmjnWOa2zPniVkNA/bUUFr+WTIktjJiaO2YksyzzTjxaoutu1ToFUOngyifduCGHqi umCHTuczoamZ7P4KTFESx8p6VeI3ZGh3TOAGrPl2SvLVfWxCaIhCm/85udUMsIcaYnKh wV4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=mNi2wcs42w6UeX4ek2kNcWvb2MWYPhhWXQr+BTcHWzA=; b=KpbguuTnMZHNyEjymVpV0xs6CSHGNd+COM8Sj+1kFjm4XApVBrh6fYFEz86zSjR+sr +BY+6uMtBL7jPBDNXKCMJnOH9Ar5+8QTQmDfAq2C4Fus8XVmCUD4XjwV9a31pN8aN4ZF tWKJ6+tFlm2+FmqkyMQDyiqtTqKXgb631ZjXrobB1VWDlOp/Q5HOryG/yIeZBqJq9ZPU KT/zaxdNQT086tFDpAfa9g0tY62JHYfUymxFVQj/upU24gcZdwvB2kJLwYelGLDcRzIu rA+kwoaSnq1V9Y+uLyuJbqpvic6g15CZm+8BzUMcC/xclAPWwqaScW4fu4QD40w2A8rm 8jgw== X-Gm-Message-State: APjAAAWprz7hCLIxGEOK+FHevlPybUC45t1o/gCy2UYCP8RwjRYxskLX r1IuTkrwi0oG1maxv4niHD4= X-Received: by 2002:a0d:e105:: with SMTP id k5mr1883870ywe.196.1551806855057; Tue, 05 Mar 2019 09:27:35 -0800 (PST) Received: from localhost ([2620:10d:c091:200::1676]) by smtp.gmail.com with ESMTPSA id w127sm1858621ywf.97.2019.03.05.09.27.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Mar 2019 09:27:34 -0800 (PST) Date: Tue, 5 Mar 2019 09:27:32 -0800 From: Tejun Heo To: Oleg Nesterov Cc: Roman Gushchin , Roman Gushchin , Kernel Team , "cgroups@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v8 0/7] freezer for cgroup v2 Message-ID: <20190305172711.GE50184@devbig004.ftw2.facebook.com> References: <20190219220252.4906-1-guro@fb.com> <20190220143748.GA9477@redhat.com> <20190220220020.GA16335@castle.DHCP.thefacebook.com> <20190221162923.GA26064@redhat.com> <20190221173422.GY50184@devbig004.ftw2.facebook.com> <20190222163441.GA5596@redhat.com> <20190222181740.GZ50184@devbig004.ftw2.facebook.com> <20190225155725.GA8096@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190225155725.GA8096@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Oleg. Sorry about the delay. On Mon, Feb 25, 2019 at 04:57:25PM +0100, Oleg Nesterov wrote: > > As long as the task is > > guaranteed to be trapped by signal stop afterwards (and they are), we > > likely can use them the same way. The only thing to be careful about > > would be ensuring that we don't end up flipping group level frozen > > state inbetween. Would something like that work? > > I have no idea because I do not understand what exactly do you mean ;) Heh, sorry about that. What I meant was that we can consider a task which is blocked in vfork wait as already frozen and that if we do so we need to be careful so that frozen state doesn't do a flip between vfork wait ending and the task getting parked again in a jobctl stop. > However. Thinking more about this, I am not sure my concerns were valid. > Yes, cg freezer can "hang" if it races with vfork(). But probably we should > blame vfork(), not freezer. I think we'd need to cover that ground regardless of where blame lies. It's weird if freezing doesn't complete cuz one of the tasks messed up while vforking. > The problem is, even ^Z can "hang" if the foreground process does vfork() > and the new child stops before exit/exec. Now I recall that I even tried > to make a patch to fix this using ERESTART_RESTARTBLOCK, but had some nasty > problems with blocked signals... Ugh... yeah, these wait non-interruptible wait sites which can be exposed to userspace are nasty. They end up adding a unique wait state visible to userspace which comes with a bunch of corner cases. > de_thread() should use freezable_schedule() in TASK_KILLABLE too. Currently > it doesn't, but only because we have other (much more serious) problems with > cred_guard_mutex/exec. However, this is is fine wrt cg freezer, other threads > can't be frozen exactly because it is killable. > > Anything else does freezer_do_not_count() in TASK_KILLABLE and waits for > another freezable process? Can't find any. Hopefully, that was it? > So it seems I have to take my words back, perhaps we can forget about > freezable_schedule/etc. I think it'd be great to be able to handle these if at all possible. Thanks. -- tejun