Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp140819imu; Thu, 8 Nov 2018 16:30:24 -0800 (PST) X-Google-Smtp-Source: AJdET5ellbsCqDNHwY3wKutzrKK0YhnAsA9w8kIHx/44SX/Tj/eRzKLdT6wSg0MbPiy0WDn0vYmr X-Received: by 2002:a63:484c:: with SMTP id x12mr5560760pgk.375.1541723424256; Thu, 08 Nov 2018 16:30:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541723424; cv=none; d=google.com; s=arc-20160816; b=ClTM34jetLfPBTnGK3RtFLL5eVC/Siy3JyLMsZBgMMCh4yaA4AmMv0YNh0u3x0aGaH KCifB1ly2pvnfAlbU0DT4pGM8Tez5Q7lLdVNrzK642gJu0LL8xbD99hKQuw9+kTb4bvs cBcb1Y0zJXMY+AIfVU98UBubHowNKOQyy1mghBBar4Uxi8zIHvJ9XlGgJWrrNVyNrmvp XSI7KjYyrlVPUgIas8DBRJoj/XAlI2CJO9ZSpReaF2R7vsOe2NMQdgfVx4JII8g8a2f0 wJr50+Ptqrif8Yic5MP1GmTQ/tcmdjQUsQxyDflyzKTgIOzLXSu6uBG53eSJi23ciZlj BM/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language:thread-index :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from; bh=bTgIdyEY6XZVG1Tve90zUw+FYMfu/LdyN2bS21emPDI=; b=WmY4sf+TUAgMl4OlzeXn883ka0VEtrcO+RrAs4oASwp4DlfL9iIWEOeZxqjk+jHQ0y yiclrOHG42KRkQBPVetZ1WCJ+RT8b8T62s6F3u/e8jXM/+ujLHzZOJbHtcIjkJtjnBDu Ofm6gCkJf3ExnPcxQRnyufc1h2+XSkfVKbLNdI/2ezxj0nmsMtkhIQGWaOQlLg5P2TJb RwfN7v3qdxu84IgJXVvCub/ZhlGgSCdStLMr0QSsoe/ElkQlAMW4144f96Vhxe5FPcaL 5sUaeJJv0zSx12i5BYLPSEfCBTc6/qmeytwl9jpgcSLpKp53oTm7LndGwJgW47lSqeQl eo2A== 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 u30si5301527pgn.170.2018.11.08.16.30.07; Thu, 08 Nov 2018 16:30:24 -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 S1727336AbeKIKHu (ORCPT + 99 others); Fri, 9 Nov 2018 05:07:50 -0500 Received: from lgeamrelo13.lge.com ([156.147.23.53]:36600 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726915AbeKIKHu (ORCPT ); Fri, 9 Nov 2018 05:07:50 -0500 Received: from unknown (HELO lgemrelse6q.lge.com) (156.147.1.121) by 156.147.23.53 with ESMTP; 9 Nov 2018 09:29:42 +0900 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: chanho.min@lge.com Received: from unknown (HELO WMRRD11NA101CK) (10.178.32.163) by 156.147.1.121 with ESMTP; 9 Nov 2018 09:29:42 +0900 X-Original-SENDERIP: 10.178.32.163 X-Original-MAILFROM: chanho.min@lge.com From: "Chanho Min" To: "'Oleg Nesterov'" Cc: "'Rafael J. Wysocki'" , "'Pavel Machek'" , "'Len Brown'" , "'Andrew Morton'" , "'Eric W. Biederman'" , "'Christian Brauner'" , "'Anna-Maria Gleixner'" , , , "'Seungho Park'" , "'Jongsung Kim'" , "'Inkyu Hwang'" , "'donghwan.jung'" References: <1541671796-8725-1-git-send-email-chanho.min@lge.com> <20181108105030.GB9939@redhat.com> In-Reply-To: <20181108105030.GB9939@redhat.com> Subject: RE: [PATCH] freezer: fix freeze timeout on exec Date: Fri, 9 Nov 2018 09:29:42 +0900 Message-ID: <02ce01d477c3$4ebec440$ec3c4cc0$@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQDMxpYjKJ+WuoJrEZbXJl5GJ1YyTAISrvFpp0VR2WA= Content-Language: ko Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > > To fix this, I suggest a patch by emboding the mentioned solution. > > First, revive and rework cancel_freezing_and_thaw() function whitch > > stops the task from sleeping in refrigirator reliably. And, The task > > to be killed does not allow to freeze. > > Can't we simply change de_thread() to use freezable_schedule() ? > > Oleg. We need to change freezable_schedule_timeout() instead. freezable_schedule also can't be frozen if sub-threads can't stop schedule(). Furthermore, I'm not sure if it is safe to freeze it at de_thread(). diff --git a/fs/exec.c b/fs/exec.c index 9c5ee2a..291cbd6 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -942,7 +942,7 @@ static int de_thread(struct task_struct *tsk) while (sig->notify_count) { __set_current_state(TASK_KILLABLE); spin_unlock_irq(lock); - schedule(); + while (!freezable_schedule_timeout(HZ)); if (unlikely(__fatal_signal_pending(tsk))) goto killed; spin_lock_irq(lock); Chanho