Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6492783imu; Wed, 14 Nov 2018 02:19:20 -0800 (PST) X-Google-Smtp-Source: AJdET5enPmYMKW5REO3CXwiRKuDbu5u+TpaxzwDA3JB6pRJDK1HTKCbKCOC6m2ccsZmbhUMsCPlS X-Received: by 2002:a17:902:aa0a:: with SMTP id be10mr1303107plb.266.1542190760526; Wed, 14 Nov 2018 02:19:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542190760; cv=none; d=google.com; s=arc-20160816; b=Uanf1Mk7q7qlT9cR/RdePgjSexQxEu2SkEQPYiyMZfcVkYslp+ZsJ54vCywbQOXPSf cHs0BxDAJiyiY5ixMGqc3WCM19Z8GvEliLhco5zElDrFr3F3OQ0v9kYj/kxfhWG8DdJI 2OTNirTq00L1S1R3whnsKq1uq2trr5cfrfYCC2TSl/h8ceLm9/zI7/FlLm2sExdPDIw+ kFdLplhIctOOtEUKsqwAOI9DzWR93jLOIVn5blbzWdjet0X4hwN1eaRNGg/B5ftYHd2n RHPT601SoSGS/WPwWfiS1frm+iAq/GWFyq4GCbGu0wlio+KUkwHyrPZZEjpCzGeci9Mr 2Q7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:content-language :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from; bh=xMRS7PB2vm1t5PYpsUOC79taZUBFlQCwBvAB+AYj9r4=; b=hq+0gOmpMUDl1zZ/tF0GNABQkNhwC3xZK3f4rVmXXsxMhpz/eAneN2M0+1Cgf+6Gg3 OqkvddN2iwaUqnEsqb0183Jv6xUwDVXkGt556bbvd4cUc6nuEc8RU8Hhd//ladou1H+A Z3l4Vua80gdHw/pCCqctjfzsOb/zbj7ssERokmYJcuJAiTzw5DgwV+Uhh6VduaSROB28 LMWGwnUY+urkv2XO0vMZ80H2+39EcA8yC46tbViIKOeZPlDKlHWAP3lPrJmoiEshivdu YYLe77VVQiJ4jUCccaimuYRC+hFFoXpYotRCfExTSOGEAEaB/QtiYxnVpySKI6hW7qW1 9Gwg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x16si22402103pga.407.2018.11.14.02.19.05; Wed, 14 Nov 2018 02:19:20 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732670AbeKNUVW (ORCPT + 99 others); Wed, 14 Nov 2018 15:21:22 -0500 Received: from lgeamrelo12.lge.com ([156.147.23.52]:37780 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732174AbeKNUVW (ORCPT ); Wed, 14 Nov 2018 15:21:22 -0500 Received: from unknown (HELO lgemrelse7q.lge.com) (156.147.1.151) by 156.147.23.52 with ESMTP; 14 Nov 2018 19:18:43 +0900 X-Original-SENDERIP: 156.147.1.151 X-Original-MAILFROM: chanho.min@lge.com Received: from unknown (HELO WMRRD11NA101CK) (10.178.32.163) by 156.147.1.151 with ESMTP; 14 Nov 2018 19:18:42 +0900 X-Original-SENDERIP: 10.178.32.163 X-Original-MAILFROM: chanho.min@lge.com From: "Chanho Min" To: "'Michal Hocko'" , "'Oleg Nesterov'" Cc: "'Rafael J. Wysocki'" , "'Pavel Machek'" , "'Len Brown'" , "'Andrew Morton'" , "'Eric W. Biederman'" , "'Christian Brauner'" , "'Anna-Maria Gleixner'" , "'Alexander Viro'" , , , , "'Seungho Park'" , "'Inkyu Hwang'" , "'Donghwan Jung'" , "'Jongsung Kim'" References: <1541994885-20059-1-git-send-email-chanho.min@lge.com> <20181113145339.GD16182@dhcp22.suse.cz> <20181113161858.GE30990@redhat.com> <20181113180058.GT15120@dhcp22.suse.cz> In-Reply-To: <20181113180058.GT15120@dhcp22.suse.cz> Subject: RE: [PATCH v2] exec: make de_thread() freezable Date: Wed, 14 Nov 2018 19:18:42 +0900 Message-ID: <014a01d47c03$6b64eef0$422eccd0$@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Content-Language: ko Thread-Index: AQGdrXejb3mhWLilCUV2n+PDMH4KYQHwmWNoAcYaTEcCNNFgq6WMwWxg Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > It's been some time since I have looked into this code so bear with me. > > > One thing is not really clear to me. Why does it help to exclude this > > > particular task from the freezer > > > > we don't exclude it, > > > > > when it is not sleeping in the freezer. > > > > Yes, it is not sleeping in __refrigerator(), but it does > > > > schedule(); > > freezer_count(); > > > > so it will enter __refrigerator() right after wakeup. If it won't be > woken > > up we do not care, we can consider it "frozen". > > Right, but this is just silencing the freezing code to exclude this > task, right? > > > > I can see how other threads need to be zapped and TASK_WAKEKILL > doesn't > > > do that but shouldn't we fix that instead? > > > > Not sure I understand, but unlikely we can (or want) to make > __refrigerator() > > killable. > > Why would that be a problem. If the kill is fatal then why to keep the > killed task in the fridge? > Is it different between 'the killed task is frozen' and '__refrigerator() is killable'? From a general '__refrigerator()' implementation point of view I know that it should not be killable. > > Otherwise, how can we fix that? > > We can mark all threads PF_NOFREEZE and wake them up. This would require > some more changes of course but wouldn't that be a more appropriate > solution? Do we want to block exec for ever just because some threads > are in the fridge? > IMHO, It seems to be difficult and buggy to control with PF_NOFREEZE. Because, The sub-thread can freeze and receive SIG_KILL before the marking of PF_NOFREEZE and it should be freezable in other cases. I don't understand why it isn't appropriate for exec to block. The exec can freeze. When tasks are thawed, the killed sub-thread will die and wake de_thread(). The exec will continue to work from resume. Chanho