Received: by 2002:a05:7208:13ca:b0:7f:395a:35b6 with SMTP id r10csp13248rbe; Wed, 28 Feb 2024 09:06:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXSlpm5ezIIuEFzDo6nAX7ZtX8rN6IyKA0jIkvrdNoZDQrBdWKxCtwFLikvOcfGC9Le+2lmdz3astERBPfXSik6RQrYEIRQk/pCKV+vHQ== X-Google-Smtp-Source: AGHT+IErbilj12IbE6PI8dXssyawU6+plZKBN+D4p0mwW/gkgEIQaysxTH2Gux3CaFSvqdhotTp9 X-Received: by 2002:ac8:5b8e:0:b0:42e:80ba:691b with SMTP id a14-20020ac85b8e000000b0042e80ba691bmr12848501qta.64.1709139997548; Wed, 28 Feb 2024 09:06:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709139997; cv=pass; d=google.com; s=arc-20160816; b=Sdby5LqwOnPO64DSRS68fD3w3kU+ly10/kXcd3L/gXUyXV2HFXFzXsIWB9WKzCv0W2 eRQgxIH6CoMy3oxuML2cWICUF1cls0VVQRpvxHk6LYAo6e5fM3nXnRNaaSqLQXhdJfvz oTTWIxC6YhZ0ug73jVn3KX+kqGYNmBKrvBf+RZAGHLSgIa1bz47MLaXjiB2nVwHKR0LZ D39x/2MPVoysySXq0DlaLgpwWC/yM4ZTU88J8Y9q/sIh/XELFwUN5pLhiqLvt3Wy58w2 pYfZKqXrOd8ccZFl/PrpwsiGzYwuvpXZg8P7u5bZw02FVBhIp11AkYhm5LRGJS+6c9I1 mdcA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=mBC3pgi3Jdc2YKejyvmMgNdf8EHNn5L2lgfo9Ko6DEA=; fh=o9FDWiZXhnH2tHHjX4IWyeiBnN6s8t9KBCkjGHeSNmI=; b=UL/VbkDWWki9dtLk/4RZOgB5VIAAgT9xYZIqUXwI/Y85f/awes266HZAvBhmBVwPWF smatR+YLrN8+/YQOCpNdO+VH4jzpv/i7iXr+iRzzcr1gKn/1UNo87HIEoanw36IfJ5hZ K+Hgd12ZgkGAUAuZq8trnllZQ3XEwyUH7BqUDNWmXqRfrNCpIhQCXkCHX/xByJ3kgJoa 2DLY3SeFTQUVZ5FYolOS7FCD0bKRRgdw3SbRExtI+xhQQdKkW5fWHl9Ca9BsyegI6Lbs LJU3i/mFh//GWdxI03D20KfJQyIa8zdYpLhnfTLt2QsuQBIAmqIr18nCJzhD/hjfEJNz cZhg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=sZl8QxOi; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-kernel+bounces-85411-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85411-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id if10-20020a0562141c4a00b0068f34f6c1b8si9906147qvb.14.2024.02.28.09.06.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 09:06:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85411-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=sZl8QxOi; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-kernel+bounces-85411-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85411-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D808B1C22A57 for ; Wed, 28 Feb 2024 17:06:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D76BA15D5C8; Wed, 28 Feb 2024 17:06:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="sZl8QxOi" Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (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 7104915D5AE for ; Wed, 28 Feb 2024 17:05:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709139959; cv=none; b=H/Kr1zqLKqXgeKMJkryUAfJPFQNeThg7uWN/J9MXW4ZRea2Kln68bJdH9UgGiycmi5qEPIoEVghrF6jj6MN/xwOyBq1EBKKksszPCXaKJN3OuvKPvjpyLoqOo6LOA+xHB7YcMg5QgyjwGjwyQ5a9vpyIMLUsIzICDLNgM27YNZc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709139959; c=relaxed/simple; bh=xsjOnfV9ueS/E2C/cSWGm39SXO3D/7ApeGNI6RuZo9g=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=sI0y1MoOueHOKFI1Kg3TJpTythxbM6vcP2yT0LMARRj0kKiPrVy7hypzSWqEaT1Z2HS2uf7ExbixO6TsMvGYXQCQ5X4bqiixzmJxKXsBO38nYLJPTVlCuCHYqYXbGc4pNkc1GVBo3kaEedpJEZENvmEkpO4isv+15uMK34KC4Wg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=sZl8QxOi; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=mBC3pgi3Jdc2YKejyvmMgNdf8EHNn5L2lgfo9Ko6DEA=; t=1709139956; x=1710349556; b=sZl8QxOiLktsZggT9NnLdc473yvUOYZ7hjLq9kqBwuuZyd8 dOMANhSSttAk6bAuQv24zBuM7rvv0OHIOexmxLgUc1dPZUT2D3XG1ww//xhDn+YOgYFhkqpXU6eUd J1b/4u+U0yrDnCfqGFNMIpJVM4j0Ljyjvy58Ohta45PYGlHlsE9R4jfXcZS8sv9rF6Xu1LC91Bg7Q Tjw0ljh1HWiioic+YZP3PXmykSetIHn/vOGpMbl3n1ERSoh75Y6bFW5Ww48Vzs5UUw/6dp0axoZO1 q88ZDduEg9qrxfsHDSJrtCS98z7Tl4hoZl3/LHI+3d07IiJbBWGa6A3JiYGhmuAQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rfNNQ-0000000CIq1-2nGv; Wed, 28 Feb 2024 18:05:52 +0100 Message-ID: <84e4f0d70c5552dd7fa350c61c28de9637628ee6.camel@sipsolutions.net> Subject: Re: [PATCH v2 2/4] devcoredump: Add dev_coredumpm_timeout() From: Johannes Berg To: =?ISO-8859-1?Q?Jos=E9?= Roberto de Souza , linux-kernel@vger.kernel.org, intel-xe@lists.freedesktop.org Cc: Rodrigo Vivi , Mukesh Ojha , Jonathan Cavitt Date: Wed, 28 Feb 2024 18:05:51 +0100 In-Reply-To: <20240228165709.82089-2-jose.souza@intel.com> References: <20240228165709.82089-1-jose.souza@intel.com> <20240228165709.82089-2-jose.souza@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-malware-bazaar: not-scanned > Current 5-minute timeout may be too short for users to search and > understand what needs to be done to capture coredump to report bugs. Conceptually, I'm not sure I understand this. Users should probably have a script to capture coredumps to a file in the filesystem, possibly with additional data such as 'dmesg' at the time of the dump. Having this stick around longer in core kernel memory (not even swappable) seems like a bad idea? What kind of timeout were you thinking? Maybe you'd want 10 minutes? An hour? Also, then, why should the timeout be device-specific? If the user is going to need time to find stuff, then surely that applies regardless of the device? So ... I guess I don't really like this, and don't really see how it makes sense. Arguably, 5 minutes even is too long, not too short, because you should have scripting that captures it, writes it to disk, and all that can happen in the space of seconds, rather than minutes. It's trivial to write such a script with a udev trigger or similar. If we wanted to, we could even have a script that not only captures it to disk, but also deletes it again from disk after a day or something, so if you didn't care you don't get things accumulating. But I don't see why the kernel should need to hang on to all the (possibly big) core dump in RAM, for whatever time. And I also don't like the device- dependency very much, TBH. But if we do go there eventually: > +void dev_coredumpm(struct device *dev, struct module *owner, > + void *data, size_t datalen, gfp_t gfp, > + ssize_t (*read)(char *buffer, loff_t offset, size_t count, > + void *data, size_t datalen), > + void (*free)(void *data)) > +{ > + dev_coredumpm_timeout(dev, owner, data, datalen, gfp, read, free, > + DEVCD_TIMEOUT); > +} > EXPORT_SYMBOL_GPL(dev_coredumpm); This could be a trivial static inline now, if you just put DEVCD_TIMEOUT into the header file. Seems better than exporting another whole function for it. Then you also don't need the no-op version of it. johannes