Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3876156imu; Mon, 12 Nov 2018 01:53:20 -0800 (PST) X-Google-Smtp-Source: AJdET5dE6bMpldusjtGpPYTaj1N1N51SuVYkw0slJEdiWr79Q5fy0A3WyvCCJG7Tj5Mp6ZTkeN6d X-Received: by 2002:a17:902:24e7:: with SMTP id l36-v6mr260267plg.243.1542016400858; Mon, 12 Nov 2018 01:53:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542016400; cv=none; d=google.com; s=arc-20160816; b=CdjLp2Lma+6zIy6uEkcrPOb9E+yolhPWX/D+FPy9M+9VRTWuG/8Gbf7tQfHCO1fMgS XjFxAWeGTYAhHN+FfiaMMUEokj0wfzXK3jLwhrJG0wz7/w+ErmJjs5YZzBgeGcOWdMrC glacYUSxZZ6WbQApqMO9HqXhTu8zVjd6VCVIYM3d5FUBKWYOUwJtqOE6NUC9RIHIt1Kk 5GhPYrWf0VdE74nQl5esb3QENKNfEdvHagG11fmX+5nFQ3c/DPT0wx26Lp/X9PZcqer4 G4I4jpVBZouSUKsTAQqafmHQqCdq8TJAYpAh+zf41rd1N8YhZWbVmdQfakTuZlGIRSpp ZH1w== 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=Zew90ZF1x4nTvC57UnYw1ix85D7dWKZnkVIt0QjdhDA=; b=gxEKaO7MdspPS8R2SkzETcjn7uLtxxEgc8fL5E/8z22um/hQ0Dv7VMb1AE/R5Q5YnQ zfsIjOOBLxUUz3pFIlPR48I100yGcnm8AFYirTj3SxMEYiLdTpMR6yo1LdlwXky/LLQk jvuPkVAywGyioTqFfuT8pxTl2INaCxV1drT239wf9RwZhQdbc3L7vUtGiHmR6zjdjqh7 PNKwmf1QMp/oT4NH13NlHSlSGHd/BLanpjmQAESGqcqs34euSc43/rpSkgkD2W8QTRYJ IbFVx5YmrPJBTJFZ6LmPxLB1/UIX2mTT7TBP3mfTFbrHdiEPqKYR5gQWvLal7VqtAs7J l8GA== 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 35-v6si9921204ple.289.2018.11.12.01.53.05; Mon, 12 Nov 2018 01:53: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 S1727823AbeKLTnu (ORCPT + 99 others); Mon, 12 Nov 2018 14:43:50 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:41921 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726597AbeKLTnu (ORCPT ); Mon, 12 Nov 2018 14:43:50 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 9550F806E7; Mon, 12 Nov 2018 10:51:19 +0100 (CET) Date: Mon, 12 Nov 2018 10:51:21 +0100 From: Pavel Machek To: Chanho Min Cc: "Rafael J. Wysocki" , 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: <20181112095121.GA5695@amd> References: <1541994885-20059-1-git-send-email-chanho.min@lge.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vtzGhvizbBRQ85DL" Content-Disposition: inline In-Reply-To: <1541994885-20059-1-git-send-email-chanho.min@lge.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon 2018-11-12 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 lead= er > to exit if it is frozen. >=20 > In our machine, it causes freeze timeout as bellows. >=20 > Freezing of tasks failed after 20.010 seconds (1 tasks refusing to freeze= , wq_busy=3D0): > 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 >=20 > To fix this, make de_thread() freezable. It looks safe and works fine. >=20 > Changes in v2: > - changes for the same reason in "if (!thread_group_leader(tsk))" branch. > (reported by Oleg) >=20 > Suggested-by: Oleg Nesterov > Signed-off-by: Chanho Min Acked-by: Pavel Machek --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --vtzGhvizbBRQ85DL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlvpTRkACgkQMOfwapXb+vLcLwCeOd2jytn3uSdvAQWh2K8+RkKK UYkAnREFbYw3qGUcs0CX79xse5VLdBGU =L4si -----END PGP SIGNATURE----- --vtzGhvizbBRQ85DL--