From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16214C4829E for ; Thu, 15 Feb 2024 12:34:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9C29C8D0006; Thu, 15 Feb 2024 07:34:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 94B468D0001; Thu, 15 Feb 2024 07:34:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 813C58D0006; Thu, 15 Feb 2024 07:34:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 6FF5B8D0001 for ; Thu, 15 Feb 2024 07:34:16 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 3FCC9141028 for ; Thu, 15 Feb 2024 12:34:16 +0000 (UTC) X-FDA: 81793980912.13.E7DA96D Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by imf19.hostedemail.com (Postfix) with ESMTP id 0B8661A0011 for ; Thu, 15 Feb 2024 12:34:13 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of jonathan.cameron@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=jonathan.cameron@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708000454; a=rsa-sha256; cv=none; b=iSvbJg9WrcPXJ6gLCfFNP6jzDV9Y8zMi7bYuXsi4wECP12K9QUT9EtBmK6Ka3fg3m9+0Zs qesKksmGdGPB+Ceb56n6mxAhigX3jlfiMyQYMIsGiq/M+aeQkroGBwcWFsq0ZI6fyxFSSq xMw0vAeNDQO8Y8cvzj+ZmJfieNh5m4k= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of jonathan.cameron@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=jonathan.cameron@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708000454; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=40fU8rN8/6KnSwU5Y70iSWFRDof5G1nFRe0ebl09j+c=; b=G6+1DgW68dx0VtXwFpymj3sV9x1ooAiSIiAJEgQcQ3YRunvPEgvtDTvEf7J8Lg/3xIOPwR DlH8ef5+WqENHV0c417y//7f2EbpUnwVawlvvF5rhrLhrTy7OQOgLI1cfhslJjKl6IaQvH FeSGgBZA3pOhX7pjxkShIJN5tGqkVPs= Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4TbDss548Sz6J9pr; Thu, 15 Feb 2024 20:30:09 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 0EB091400D3; Thu, 15 Feb 2024 20:34:12 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 15 Feb 2024 12:34:11 +0000 Date: Thu, 15 Feb 2024 12:34:10 +0000 From: Jonathan Cameron To: Dan Williams CC: , , , , , , , Subject: Re: [RFC PATCH] cxl/pci: Set default timeout for background operations Message-ID: <20240215123410.00003b8c@Huawei.com> In-Reply-To: <65cd858b3e5bc_5c76294dc@dwillia2-mobl3.amr.corp.intel.com.notmuch> References: <20240207105349.301-1-sthanneeru.opensrc@micron.com> <65cd858b3e5bc_5c76294dc@dwillia2-mobl3.amr.corp.intel.com.notmuch> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml500006.china.huawei.com (7.191.161.198) To lhrpeml500005.china.huawei.com (7.191.163.240) X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 0B8661A0011 X-Stat-Signature: buw97s7ygfmfwnybncg76cibzt94zgsx X-HE-Tag: 1708000453-709822 X-HE-Meta: U2FsdGVkX1+YncOlP/cQXYEE5W7xGxY8TRv9YP7NiHJj/eACaPjCTTpe38NrfPpXp+U+CP20hTSYd6ihjMc8uXNuxNCNoj6clC8IwlpNBxFJw1RgcRqW0ja++4APV90QjvOPqqRVf62D8O/DlI5epK2QHKh1HE72gOZE8k8NYUegOB9328naClWTGaYvHHCM89ilhJeD1P4Oc7/1jiAnTbSunwkKEusXPkQKwli05eAk9+3DYKg/vFZ3BtW9hdqLCC3sTLnYV95/3QruS3yKNq9nOuY/ZPfjvdKxcv1Fv5qEbg1BHnDwX0f7eJEveq/30278OnksYMi1SZfIOUbDVSZLb+wUfMYO56SmA9f52Delpzx6H+0XjEL7GgyX4zPIWgVCnjjv1Yt/x67ckmUkaCyFpYoIN5yhxNCwvzCzg3+nnmwyTGyDbZrpqPfEMjpwjHOn7XX1GqauIRwh96IeYQtQadZFmskIXD2nc6hwmRyrSvbdCKeAmv5oX18JmHpurQm5plrNw5DOOkcIAnpfCA4yp3epsAWLwjPvx5zjjS+k43IN7FEFlbZZLJHrjsY6knZ6rfJw/zn6uBP6w3EKjh2gtKcD44R3Vf1oXAxlueMtxk79Hbgri9iSSo40/Px66/oPeG7qJ4oJxrcKlExFn8PT60UA2mGfmBrJU5kE41DWVLjYu5ijvTmHz4umuqi/mMYpSKXBjzGhyl/NbBclfeolAceiygTcNYe6OwMJZkDelc4L/quiKnbtzY4Okq6jtdqr4iBs+9KDVhfm60IZG8DHP4/Y4241XK1mFb4bTimkh/6KhyMg++2gBolyTE+PB+Wujd24YpCYR+5T3abMwvqAuVJkR5BojGfyDehv5MekD66PdZC+FYZDJirKLkem X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Wed, 14 Feb 2024 19:31:23 -0800 Dan Williams wrote: > sthanneeru.opensrc@ wrote: > > From: Srinivasulu Thanneeru > >=20 > > The CXL 3.0 specification outlines background operations, > > and support for handling these operations was added in following patch. > >=20 > > Link: https://lore.kernel.org/all/20230523170927.20685-5-dave@stgolabs.= net/ > >=20 > > Mailbox commands like =E2=80=98Log Populate=E2=80=99 use background ope= rations > > to complete the execution of the command. > > This can lead to a timeout, since there is currently no option > > in the ioctl cxl_send_command structure to specify > > a timeout value. The default values being zero can lead > > to the driver reporting false negatives to the application. > >=20 > > This patch aims to establish default values, enabling mailbox commands > > that operate in the background to continue functioning even > > if a timeout is not set in the userspace application. =20 >=20 > The reason there are no defaults is because userspace is not allowed to > issue background commands. The CXL background command definition is > awkward in that it allows a single command to monopolize the mailbox for > an indefinite amount of time. >=20 > Instead, the approach taken with Firmware Update and Sanitize is that a > kernel sysfs ABI mediates access to the mailbox and facilitates bounded=20 > timeslices between command submissions. It effectively allows the kernel > to manage fairness and more importantly preempt userspace if it needs to > issue its own commands. >=20 > I assume you are only seeing this lack of a default due to building with > CONFIG_CXL_MEM_RAW_COMMANDS=3Dy? If yes, "raw" means "raw" and the kernel > is mostly taken out of the loop of saving userspace from itself. >=20 > All that said, ugh, "Log Populate" has no facility to time bound the > population of the log. I do not think it is tenable for Linux to > surrender mailbox access for an indefinite uninterruptible amount of > time... unless you want to handle "Log Populate" like Sanitize where the > unbounded background operation is tolerated because the device is taken > offline? It may be pointless to do a component state dump only on an offline device. My assumption is this one is hardware debug only. Patches out of tree or behind a really scary sounding config variable perhaps? Other than vendor log I don't think populate log applies to the other log types yet (they don't mention it anyway!) Jonathan