Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6559676imu; Wed, 14 Nov 2018 03:32:58 -0800 (PST) X-Google-Smtp-Source: AJdET5dw7W1Qt34IakFv7CsGNG2uPuGEyJMgJ2e+KhQO3TMYSf4spxsY4PPXJDzvbUA6+gW/4d+H X-Received: by 2002:a17:902:4827:: with SMTP id s36-v6mr1495947pld.226.1542195178653; Wed, 14 Nov 2018 03:32:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542195178; cv=none; d=google.com; s=arc-20160816; b=wZ/PJkOHMQ+EQ//2FONX0cR8zb3P6UB8H4cTmLy1pGfmh2cwIhrfuwN5WWK64HChx+ 3pEnnjEkFAw6f73ynE6piRsStnCfTmrD0RFKQsPaZljCRiAe4rRC46WYNbUztZiNqzR6 YfQvNS4ZK+QAySQsfv9t0kmreX+rwKCNAkuCxvcff5xm3ebDNBGJ6srtVjXTfpHqwDRv lTTQkqp3o0LHoEKVIVnhS/udl5qOvBS0IIaqEoZjjajKKjGxKkF1iOf1FSp5SVKBNWW3 Yal1+hMxGq2Px2nEOVVQsu1tl6M6qbDoxMaKDLI2v/Td36UFlwQTH10zYhwWh+PkV68q KpKQ== 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=qNtE+JekB6XDAPK107EsIsJf0t02FBWTLY4+IKQzwB0=; b=Ci0b+J5dKN9e+f9h1mfB9bdAz159X9igLYYMhGejzMScMeA1N+0l8xBbAC4BFzdqLi aGUwlMTnma4CPlATlA2h4hTfmAe9iHerGdwXwxSKD78+vhpCZ7pOIudY7fuvT1dSwVZh 5psRQ9UDQgUeKH51bA8R+k67fpWBzmyOVB14IKUYwvAC6dGblH+q4hOq2Km3m8Q16tS6 Dpqekwd1SDksV9SmV1GIrd7dwKhoQbaAP3oCgmk0ELmvGkE+7vd42Hwl9iASVBmuJzUB 0xbK7htYNaztCFXhfz4nKAqSSuoFvmYGjE9gTPVM29JxeuThX3QW9Br4SsLxV7Mm4Dfu Sh3Q== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j29si22358604pgm.554.2018.11.14.03.32.26; Wed, 14 Nov 2018 03:32:58 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731899AbeKNVez (ORCPT + 99 others); Wed, 14 Nov 2018 16:34:55 -0500 Received: from mx2.suse.de ([195.135.220.15]:56350 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727598AbeKNVez (ORCPT ); Wed, 14 Nov 2018 16:34:55 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 76B1AAF76; Wed, 14 Nov 2018 11:32:01 +0000 (UTC) Date: Wed, 14 Nov 2018 12:31:59 +0100 From: Michal Hocko To: Chanho Min Cc: "Rafael J. Wysocki" , Pavel Machek , Len Brown , Andrew Morton , "Eric W. Biederman" , Christian Brauner , Oleg Nesterov , Anna-Maria Gleixner , Alexander Viro , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Seungho Park , Inkyu Hwang , Donghwan Jung , Jongsung Kim Subject: Re: [PATCH v2] exec: make de_thread() freezable Message-ID: <20181114113159.GR23419@dhcp22.suse.cz> References: <1541994885-20059-1-git-send-email-chanho.min@lge.com> <20181113145339.GD16182@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181113145339.GD16182@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 13-11-18 15:53:39, Michal Hocko wrote: > On Mon 12-11-18 12:54:45, Chanho Min wrote: > > Suspend fails due to the exec family of functions blocking the freezer. > > 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. > > This also can occur with the schedule() waiting for the group thread leader > > to exit if it is frozen. > > > > In our machine, 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, make de_thread() freezable. It looks safe and works fine. > > 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 when it is not sleeping in the freezer. > I can see how other threads need to be zapped and TASK_WAKEKILL doesn't > do that but shouldn't we fix that instead? > > Or maybe I am missing something important here. Just to not distract from the quick fix. This will silence the freezer but I believe that we need a better fix to not block exec by freezer long term. It seems much more complicated though so a quick fix makes some sense for now. Acked-by: Michal Hocko -- Michal Hocko SUSE Labs