Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp673461ybl; Thu, 12 Dec 2019 03:06:18 -0800 (PST) X-Google-Smtp-Source: APXvYqy4oHdYftvsI+2uAnytnsmwX0PNfaIUyqvTKHX7Rcbc2uuNW+DFwOziwxYg+nqptvdB+S1/ X-Received: by 2002:a05:6830:22e6:: with SMTP id t6mr7882304otc.244.1576148778013; Thu, 12 Dec 2019 03:06:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576148778; cv=none; d=google.com; s=arc-20160816; b=tToH6HBvyCKix9hMgDKgwEMMzOa1l8PMpykeYxugjxvep3hsgNeLU2q0x97rmaSzo7 KanTdRDPQZlij2vS1XTI7pYXZ3jLy57pYtHo+OHsKoZPDtDA1zc3DxuOnx1VndsiYldf V/nBvMKkokf0c4ZSjrxJb+8sRwCnJ4mvRK8SzQnETr8m03xPgeb74IoMf+zwMzhXJBaT UKI/q7cylU3efk6KgQfNc8okcZvI9RMMv0fWxwgGd+7sItceoGiKoFRRGcLnYws1wzVe aFZFXPYzlOWfHfh42U0ysTwDPOTmZKtkmNGmaW1dy3cSXDppcAexZvvT1egz0LI9lGYf SvCw== 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=0wFFFDG2DCxGLCpWb0wnKmPjO90Xi1C3QpmglPfLDLg=; b=1IknBo5DxcmvtLYcc0v2ii37w0GBjhklyDOADWxz6cyDvfW7rF5MIttfhHLjyhZ7VY yFVvL1M4IXb5Xv40lEA5mJPLr0fc7Uo5fdFQ29Q/quCOwBUzwF8ehjz83rk8/yLoY2eS YxjuZkTan1YTdc2VCXBg3kTPeNnoEdnvduuuct0u19bY1hdfp+ZH5EqQiD4Qsr4v3Fbi F3AByr2UbsL16L34RzKNOMazw9LOAaITJa7N9Wfyw/UO3qRQDfiURs+zjAw7twXNTGkc PcJ8diZJoisMOOqedR8oD69a4yJRwcQ429lEQD9Yg8NnENErixbyoe22R20IYV3MKgkO 01LA== 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 u9si2746637otg.90.2019.12.12.03.06.04; Thu, 12 Dec 2019 03:06:17 -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 S1728885AbfLLLFX (ORCPT + 99 others); Thu, 12 Dec 2019 06:05:23 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:46575 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728613AbfLLLFW (ORCPT ); Thu, 12 Dec 2019 06:05:22 -0500 Received: from [213.220.153.21] (helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ifMHT-000766-AO; Thu, 12 Dec 2019 11:05:15 +0000 Date: Thu, 12 Dec 2019 12:05:14 +0100 From: Christian Brauner To: Oleg Nesterov , qiwuchen55@gmail.com Cc: qiwuchen55@gmail.com, peterz@infradead.org, mingo@kernel.org, kernel-team@android.com, linux-kernel@vger.kernel.org, chenqiwu Subject: Re: [PATCH] kernel/exit: do panic earlier to get coredump if global init task exit Message-ID: <20191212110513.qf2sapgggnp46voc@wittgenstein> References: <1576131255-3433-1-git-send-email-qiwuchen55@gmail.com> <20191212095127.GA5460@redhat.com> <20191212100838.GB5460@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191212100838.GB5460@redhat.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 12, 2019 at 11:08:38AM +0100, Oleg Nesterov wrote: > can't you use is_global_init() && group_dead ? Seems reasonable. Looks like we can move group_dead = atomic_dec_and_test(&tsk->signal->live); further up... (Ideally I'd like to have a test for this to ensure that this lets you capture a global init coredump but that might be tricky. But since you've seem to have run into this case maybe you even have something that could be turned into a test? (Similar to how we already have a purely opt-in test for pstore.)) Christian