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 B9D91C02181 for ; Wed, 22 Jan 2025 06:03:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3B038280005; Wed, 22 Jan 2025 01:03:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 35FF5280001; Wed, 22 Jan 2025 01:03:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2009A280005; Wed, 22 Jan 2025 01:03:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 03B39280001 for ; Wed, 22 Jan 2025 01:03:33 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id A2038141377 for ; Wed, 22 Jan 2025 06:03:33 +0000 (UTC) X-FDA: 83034045906.04.B47D14F Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by imf05.hostedemail.com (Postfix) with ESMTP id ABF09100009 for ; Wed, 22 Jan 2025 06:03:31 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ZxAhOzR1; spf=pass (imf05.hostedemail.com: domain of nifan.cxl@gmail.com designates 209.85.214.173 as permitted sender) smtp.mailfrom=nifan.cxl@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1737525811; 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:dkim-signature; bh=dV02xLcbn+l9kZ6Ag191QNsfZW3pqFE6YGpatvGLbAA=; b=306lRKX8kvhvTbWRkaqr19jT5xlnwJm+N1pS9mHkuzNK1fOW/PdXTiJZKkK2q0SO5+2aBI y3+IK35K5Co45LUmvLwFGX7kQ+2Hp+o6oIN4CU5612/viA7ctd9AB2VDS7+LGELkKaenKR S+H2wAdVdTim9bBFtEaCj0Fh9ng0t58= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ZxAhOzR1; spf=pass (imf05.hostedemail.com: domain of nifan.cxl@gmail.com designates 209.85.214.173 as permitted sender) smtp.mailfrom=nifan.cxl@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1737525811; a=rsa-sha256; cv=none; b=H2xVY5uwaMwT4ezEzdaSq5/S24y9ohHiaXC/9po/7a/EC88iuS9pbWNdKTV22VubPBiYyV Z52e29Tv5dlMDMbnwetoO8maYQoI9VZvilYC3VDuSCWH0LV60U+U3kP0WGVga6TKfv79Js PlVOnQkmVMyGMGrItj422gu5Jo7g3wI= Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-216395e151bso6918785ad.0 for ; Tue, 21 Jan 2025 22:03:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737525810; x=1738130610; darn=kvack.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from:from:to :cc:subject:date:message-id:reply-to; bh=dV02xLcbn+l9kZ6Ag191QNsfZW3pqFE6YGpatvGLbAA=; b=ZxAhOzR1ILzzWAnB0CiZcw92S4XMU8cTBj3r9YDMtcFX93atlNpJepeQB5u1R7GRCO OhQ0QDLowiRwuZn3NjP0Yp3AcZ6gYs2bxK7DZLRLHtpKh2K7YSw+SUzO9UZdsDYMzvX6 3oPPS2kQysectsgWoBNGBIFJ0VtyW8JVEdeqjxd16eVer4NpWdhfQouqpMJa83dwCDgk X1XdukBPZ8JwB3qn5wnQyscglhsWf3WxH8Ji/Gk8B/iQ/sbob2sG4dXNAQFyU6vRhzAm oZ9+Zreh5RzdS5sSo0c1+ysgsK73jTTWDvZKB/TuvN2Wquy65HjRw319gMBgBPf0QYhC iC9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737525810; x=1738130610; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dV02xLcbn+l9kZ6Ag191QNsfZW3pqFE6YGpatvGLbAA=; b=oLBLAFwzRRftw+cXcALXGs0Qaz+nd+9TXDehaLgKsBpMLF3Ad5oYVdhR7JYitdUr7v TfWxq9WTNCNCtvEOALlpfql8kZJGyPcFoD8sKZTSAA8MxPuHvmUAvLshNUDmXnXI51PF +Vq3ZkU/HP+RmWNpV6KUT9uz3gcbtlMADqMBboq/UhezN6usjnYoXuhU8AjKCtXwGxOD +GYzdrA7otbzD9fWrsJFkc5DrA+WCGe6n90z8zy0TB6dzRyXLpC2UODed80tVeosDr3p JJyQMxUq0yBFJubRYUqmnYW9mMvZ0WZ7Oio/vd+x0P5dMo9ewg6H5W+DlJkuo0/8KzIs Xbpw== X-Forwarded-Encrypted: i=1; AJvYcCXZFRPKSQ9lleFZ2pZyEjffoM9hx/EIi5oYvgeKwZHUJlWClQOlwbJ0geEy4VzeM5QB6k9ZborRWA==@kvack.org X-Gm-Message-State: AOJu0YzJooLWCuaQPYinzzHz6MfqU7b/sfX5sxLXqPFCA1Kk+FZfgZLC RmF8mLWBr4okOya8wDXhmhUsqW8wWmLdUbYgZ4+m/BxQkGlioF+eWQ3mbA== X-Gm-Gg: ASbGncufX19lT5rVNgxw6xMTvtdOn+T+pybCv/VgneyoQvtaE1lU85QchsKi3j7HrOP VlsbXxGtw0zewQS8g3rkA9M1YbIdSZYldnLc8rpPW1W58tUmUUpUFe9aXxXFvoTYW7tQi3KuU6K EbvKEKGBKr5YDk66b9M5tRoDRcIY/YCrx65BTYZOfIiNgP3LJfWxqOk86xMvCEI+ra3n5wh4HRv mWpTelBD0PEDDp8hxCIrRxmfxT0+k1WK9ST9JXDB8DtqPV6YhPbdedC6hA1 X-Google-Smtp-Source: AGHT+IF+aYq2LWO27vKKdB7RYk+WDhf+Bt/rICsEvzrS8MaRHQm64phKz2lq9nowEdm8XJRHRWSemQ== X-Received: by 2002:a17:903:2410:b0:216:2aec:2d54 with SMTP id d9443c01a7336-21bf077dbc9mr433248755ad.8.1737525810405; Tue, 21 Jan 2025 22:03:30 -0800 (PST) Received: from gpd ([2601:646:8f03:9fee:1eca:6066:421d:7396]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2cea0763sm88247105ad.9.2025.01.21.22.03.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2025 22:03:29 -0800 (PST) From: Fan Ni X-Google-Original-From: Fan Ni Date: Tue, 21 Jan 2025 22:03:35 -0800 To: "Fontenot, Nathan" Cc: David Hildenbrand , linux-cxl@vger.kernel.org, dan.j.williams@intel.com, alison.schofield@intel.com, linux-mm@kvack.org, gourry@gourry.net Subject: Re: [PATCH v2 1/4] kernel/resource: Introduce managed SOFT RESERVED resources Message-ID: References: <1800b17449d1c231292c85f59b226aff39a81552.1737046620.git.nathan.fontenot@amd.com> <4e556200-c790-4e0a-b103-2a1529c81927@redhat.com> <3c7c5b87-f241-482b-9b00-98e2e53d8e9c@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3c7c5b87-f241-482b-9b00-98e2e53d8e9c@amd.com> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: ABF09100009 X-Stat-Signature: zyp1ug16y6uj8hk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q4ce/JWUZy/W6fjn0FRJBcLR90i9c8PtBJXuVEYIiPLOl1a8cpsuezBVI0s1pzJ1pHC5pchEBMrdPSnttQcE7PYIEAHb5dxb2nPI+FpCNT3BoU1I7Q9XyzC51VjRsVHeHMoB8rzDYqy4SsOIn5uPZm0xkVIeXAwPEMGN4mVnsAj6pFRZtrPNNiQ0a47cQufM+pbKYmbzXRgNBVWC654mEpXKHLLtI8xdINf8Uqu1cPkPENFaL9t3S7g28UwTHs9IGvlI5tHfaZd1JiYWoTsgwKyqwrsiafJK1feoab+/hqZEBUyvXzjr6/H9tvEnQd4LyinSYQoQkvDsI6oN/K4IuvP6P/w5iwex18UAwKzrbK9p0mZtz5dNREP20j9QIPJ3nzz3jR71/G95661Jeh15dd4xaEHYfwaCUxf8SbaaSG2fUyYCu6wnKBaSG91YtM8eUX6Fofkg0EV0j2cSPfuHEcD2bGgqN4kA9/33rL4IZbg= X-Bogosity: Ham, tests=bogofilter, spamicity=0.048968, 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 Tue, Jan 21, 2025 at 12:57:19PM -0600, Fontenot, Nathan wrote: > > > On 1/21/2025 2:19 AM, David Hildenbrand wrote: > > On 16.01.25 18:42, Nathan Fontenot wrote: > > > > Hi, > > > >> Introduce the ability to manage SOFT RESERVED kernel resources prior to > >> these resources being  placed in the iomem resource tree. This provides > >> the ability for drivers to update SOFT RESERVED resources that intersect > >> with their memory resources. > >> > >> During boot, any resources marked as IORES_DESC_SOFT_RESERVED are placed > >> on the soft reserve resource tree. Once boot completes all resources > >> are placed on the iomem resource tree. This behavior is gated by a new > >> kernel option CONFIG_SOFT_RESERVED_MANAGED. > >> > > > > I'm missing a bit of context here. > > > > Why can't we flag these regions in the existing iomem tree, where they can be fixed up (even after boot?)? > > > > Especially, what about deferred driver loading after boot? Why is that not a concern or why can we reliably handle everything "during boot" ? > > That's a good question and one I should have addressed. > > The goal is to prevent the dax driver from creating dax devices for soft reserve > resources prior to the soft reserve resources being updated for any intersecting > cxl regions. Not an export. Can you explain a little more here? What is the problem if we only flag the resources as "soft reserved" in the iomem tree without creating a separate tree, and process the "soft reserved" resources only when needed? Fan > > During boot the dax hmem driver walks the iomem tree to save off a copy of all > soft reserve resources. The dax driver then later walks this copy to create > dax devices for the soft reserve regions. This occurs before the cxl drivers > load, create cxl regions, and update any intersecting soft reserve resources. > > To prevent this the soft reserves are set aside on a separate list during boot > so that they can be updated (if needed) and later added to the iomem resource tree. > The dax driver is then notified of any soft reserves added to the iomem tree > so that it may consume them. > > Hopefully that answers your question. I'll include this in the next version. > > -Nathan > > > > >> As part of this update two new interfaces are added for management of > >> the SOFT RESERVED resources. The release_srmem_region_adjustable() > >> routine allows for removing pieces of SOFT RESERVED resources. The > >> the merge_srmem_resources() allows drivers to merge any remaining SOFT > >> RESERVED resources into the iomem resource tree once updatea are complete. > >> > >> Signed-off-by: Nathan Fontenot > > >