From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A397233943 for ; Mon, 20 Jul 2026 06:15:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784528150; cv=none; b=KZ1UqijxiOaqEUODZHkrO3QYMaXmi7BIfLk4K7UAJGFCsa3I/1hEvv8GVkiLKJ+Dhu1VpEyrjmlzVCTMdyWVNmcqVlmDptu06R5GYtjc/isiA3si0i7zzmz+3a27XrMxY1Uk6pwt4URC09lDdH0LDPwZKwVVnYwqrOYTbCOcs5w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784528150; c=relaxed/simple; bh=HzgTKOY4eM8Ya/cZ0+tBaJOZfnm/icqSv2aSzewWuU8=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=NMmUtzaF5YUAbzpMcQlfSmWWQzODW2KCKTKLPXyCRlQRtQpO4a+jwi7+wvsQDvDrexHE5I5vVyxjQz+cOzy5FT738R8uHgeaspnY7+luE0MLaHaZFy/IELSctLgt0kJUDT8jCQYA8ke1eWFeIAzvsHY8Q6QIdr9sjXGRqHFoZM8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=YeZPA8Na; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="YeZPA8Na" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AC741F000E9; Mon, 20 Jul 2026 06:15:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1784528141; bh=8ukJ3BSMnbUu/MhDZMBvtFTh9r1r3zn9qOyOXgGQ+ao=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=YeZPA8NakvElccG79AJpj4ZoHIM/lyfc3DK/BsB1PqWJTrI/m/38DMNNSVLkFL9Qd LvkuwFaU3CF+MCFc/rTUtEfhNX7INxEKr7J7ywafwTpdHoywaBYSr6DZG8AjZws+TX qp7uqeqhcnJfjTb2g0kO4lDOt9AntqfUiWVo34yo= Date: Sun, 19 Jul 2026 23:15:40 -0700 From: Andrew Morton To: Bradley Morgan Cc: Kees Cook , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] reboot: log the task that requested a reboot or shutdown Message-Id: <20260719231540.455bd5c3eac842686c05bd7f@linux-foundation.org> In-Reply-To: <20260719160938.3692-1-include@grrlz.net> References: <20260719160938.3692-1-include@grrlz.net> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sun, 19 Jul 2026 16:09:38 +0000 Bradley Morgan wrote: > When a machine reboots or powers off, the kernel log records what > happened but not who asked for it. The reboot syscall throws the > caller identity away, and reconstructing it afterwards from userspace > logs is unreliable and more likely than not impossible. > "What made this reboot?" is a question every fleet operator has had to > answer with guesswork. There's a need for this? May I ask your source for this information? > Log the comm and pid of the calling task in the reboot syscall, once > the requested command is committed and can no longer fail, e.g: > > reboot: initiated by systemd-shutdow[1] > reboot: Restarting system I can see it might be useful. > The existing "Restarting system", "System halted" and "Power down" > lines are left untouched, so anything parsing dmesg today keeps > working. The two ctrl alt del toggle commands are excluded so init > setting the mode does not add a line to dmesg on every boot. Perhaps kexec and swsusp would benefit from the same treatment. Perhaps add the relevant maintainers to cc and seek their input?