Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1769917ybl; Thu, 19 Dec 2019 02:43:35 -0800 (PST) X-Google-Smtp-Source: APXvYqy+01/740Wz0Wp0UUGNTsqV630pC7i5emjxpJkwK7r7Dz5VhSyD5abSGMAwemY3uyy7qdMD X-Received: by 2002:a9d:7e8a:: with SMTP id m10mr7665474otp.27.1576752215369; Thu, 19 Dec 2019 02:43:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576752215; cv=none; d=google.com; s=arc-20160816; b=l5/1f82eYnY6KLwusA+9+5r1cNARZvNT4Qd0yGNb35rNhDiXDEAcaaGZnsZ4ZZ+D4b rs6IO6B5KSEEGOXs6+id4sLmVflJ9XNHN2YbezJiXRz7ccGIAzfm8GF9df5aw6xAorPT K07qYflfFT39POvVL1BaBgpJmHGGEcgBG0aL0DGoxFjZjOBhLGw7oGvw1XmVoFnTqbcC sEpm/BBO94Ah+6nme2CGiXwvN0VfTj6JtqAP/+I1IqNc5E7L+RyVxyrWtAEr4tfoB4p1 /rLDbXz6vxY4+BttvNEaFT75MDb7TtazqbJwzQwzw7sm3mPpV7lWPKMuBCsKSu9dnyA+ z4xA== 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=PQvuxyMJ1alj6lFgK0lM5wpwFBwT3deumJuySDLsUwE=; b=A+zpIkgWMwD2Spd8ZgxR2yOfuBP2GKsORlxZJICJS64UrG40ogUW4yftdJIcVtjLcU 85Zg1tgu8NMvhgl+Hlg5/RQDi/flHCcHiPZepQCfzDJrbrMUIftqh1VofWkpUOHnsn+7 BHReCg0eeyS2VzloqeNLoUny5cBz3HeqZOb6CPwQqMHaY/EvNgmWU826pCX1YFB7XooP Xe31f+jnavnj2dpI1Y0Sd5Bg9Dr4ykDREgp+zz1oIjZ/7HbAdJpsS4hMl6NguJleHwQ2 iysYYP7JAMIea07uTJnsWhWC0ursYZyZBh8hbqtbRO3Fko1+st9q+7WkSN0pzg+EFfkU yAVw== 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 g26si2911591otk.324.2019.12.19.02.43.23; Thu, 19 Dec 2019 02:43:35 -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 S1726709AbfLSKmh (ORCPT + 99 others); Thu, 19 Dec 2019 05:42:37 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:37663 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726633AbfLSKmh (ORCPT ); Thu, 19 Dec 2019 05:42:37 -0500 Received: from [79.140.121.60] (helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ihtGD-0001Mo-2y; Thu, 19 Dec 2019 10:42:25 +0000 Date: Thu, 19 Dec 2019 11:42:24 +0100 From: Christian Brauner To: qiwuchen55@gmail.com Cc: peterz@infradead.org, mingo@kernel.org, oleg@redhat.com, prsood@codeaurora.org, kernel-team@android.com, linux-kernel@vger.kernel.org, chenqiwu@xiaomi.com Subject: Re: [PATCH v3] kernel/exit: do panic earlier to get coredump if global init task exit Message-ID: <20191219104223.xvk6ppfogoxrgmw6@wittgenstein> References: <1576736993-10121-1-git-send-email-qiwuchen55@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1576736993-10121-1-git-send-email-qiwuchen55@gmail.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 19, 2019 at 02:29:53PM +0800, qiwuchen55@gmail.com wrote: > From: chenqiwu > > When global init task get a chance to be killed, panic will happen in > later calling steps by do_exit()->exit_notify()->forget_original_parent() > ->find_child_reaper() if all init threads have exited. > > However, it's hard to extract the coredump of init task from a kernel > crashdump, since exit_mm() has released its mm before panic. In order > to get the backtrace of init task in userspace, it's better to do panic > earlier at the beginning of exitting route. > > It's worth noting that we must take case of a multi-threaded init exitting > issue. We need the test for is_global_init() && group_dead to ensure that > it is all threads exiting and not just the current thread. > > Signed-off-by: chenqiwu Acked-by: Christian Brauner