Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp339078imu; Thu, 8 Nov 2018 02:51:15 -0800 (PST) X-Google-Smtp-Source: AJdET5eg71rwpOaBqdG41PIX4UvZrowGztaAp6WZRPtfYKT+KPbsexHK49L5AMvnZon/MUhhSqzd X-Received: by 2002:aa7:8254:: with SMTP id e20-v6mr4085170pfn.164.1541674275254; Thu, 08 Nov 2018 02:51:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541674275; cv=none; d=google.com; s=arc-20160816; b=p4MuA4fZZa/VQWs4dGU2YKmzlEzVDcyiOw7KSLizIvhuga4erkmE7KAdK8fkO/o9Ib t18rSTTjrVT8w6wA/ZUdmCvfcNVVOKGp+AfriG7ba422XddyPv68ehJ/sRGubDQZBmUl Dml80QIg8b7a1yW0LnmPfuvA4qsEO+vtli1Q76ceLwz3Zi9OQy7McZa2mtrm2ZtiaSBG 1iIAagbrmvRCGrhmo562GuQRmpl4FETpHf0pVbFjFZR9l/W1bNWjMKgw7LQK5p8ExdyA xHUvbE150vZT7D8tKEZ/2puvzv0VescibhCL/hj1UgEBkazPEhVf0yeoIl4TV98aNqVD /HSQ== 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=+GXba7ULYum6cgyxxjEWMwwVAo2xpq3XMnx0hJMLz7c=; b=jA4Cp7Pqfnb9/Hs+0KdwvIFhJve0Rf7Ex6wIRSQ6LLeIdkge9kQ5MJgcGayzvTz+/Q m7mN4a+CK1CnwuPKswTicKfK/ZZuw4O2H7V/JVibLgkupMFitcW8nf3y9NmvLQUjoU5A G/N8VX6DUtI9HkOZseK2sXM96OCFKsQ2mlRqlct1PHEOs/rdGt9kl4O4ZEgEvpaBNGjq K9hCjTx3FVcUHPiAC0+w0YdgSfbax0WFSY2nY/SengOOXZOAZlQPkD+TpFdy77P/0cRR cbUOCWxMZX516ca1ECVg9XBS8/C5Is5bkxPq7v9OK3W8nvfKQ9Puvw8zajrBoNGJVw3X JRog== 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 q20si3534630pgl.268.2018.11.08.02.50.59; Thu, 08 Nov 2018 02:51: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 S1726847AbeKHUZ2 (ORCPT + 99 others); Thu, 8 Nov 2018 15:25:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36686 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726252AbeKHUZ2 (ORCPT ); Thu, 8 Nov 2018 15:25:28 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 769B358E24; Thu, 8 Nov 2018 10:50:34 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.31]) by smtp.corp.redhat.com (Postfix) with SMTP id F116F19498; Thu, 8 Nov 2018 10:50:31 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 8 Nov 2018 11:50:34 +0100 (CET) Date: Thu, 8 Nov 2018 11:50:30 +0100 From: Oleg Nesterov To: Chanho Min Cc: "Rafael J. Wysocki" , Pavel Machek , Len Brown , Andrew Morton , "Eric W. Biederman" , Christian Brauner , Anna-Maria Gleixner , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Seungho Park Subject: Re: [PATCH] freezer: fix freeze timeout on exec Message-ID: <20181108105030.GB9939@redhat.com> References: <1541671796-8725-1-git-send-email-chanho.min@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1541671796-8725-1-git-send-email-chanho.min@lge.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 08 Nov 2018 10:50:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/08, Chanho Min wrote: > > Suspend fails due to the exec family of fuctnions blocking the freezer. > This issue has been found that it is mentioned in the ancient mail thread. > The casue is that de_thread() sleeps in TASK_UNINTERRUPTIBLE waiting for all > sub-threads to die, and we have the "deadlock" if one of them is frozen. > It causes freeze timeout as bellows. > > Freezing of tasks failed after 20.010 seconds (1 tasks refusing to freeze, wq_busy=0): > setcpushares-ls D ffffffc00008ed70 0 5817 1483 0x0040000d > Call trace: > [] __switch_to+0x88/0xa0 > [] __schedule+0x1bc/0x720 > [] schedule+0x40/0xa8 > [] flush_old_exec+0xdc/0x640 > [] load_elf_binary+0x2a8/0x1090 > [] search_binary_handler+0x9c/0x240 > [] load_script+0x20c/0x228 > [] search_binary_handler+0x9c/0x240 > [] do_execveat_common.isra.14+0x4f8/0x6e8 > [] compat_SyS_execve+0x38/0x48 > [] el0_svc_naked+0x24/0x28 > > 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.