From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05248C32789 for ; Thu, 8 Nov 2018 10:50:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C12DC2086C for ; Thu, 8 Nov 2018 10:50:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C12DC2086C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726931AbeKHUZ2 (ORCPT ); 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.