From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 0B7012F60A5 for ; Fri, 14 Nov 2025 19:33:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763148801; cv=none; b=qVWF7h9ZXLu398Gxk2SdTec7aYQM/pdTPaRjmWKUEGbxg/Dvxpc/c0BFwG+XJFdUST3C2Yg9ne9yWIWg8pA5EqV5P/oRCP0PxZgTkXUXo/I85qKTn2M/3blN1N44SjnEav5JcbHGDE7HGXvBuhIZo3zhdi9oOERI7Q0/NfTw29Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763148801; c=relaxed/simple; bh=gNS0T+ZChKXxoN7znfwaqjXaS9x2GuQGcEUhveCqTRU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=fcLSmvLRRjam7afrZQoQC22SdYkLJ1fCosFTqR+oPHtnMCpj9RGa+OdGANsuvitMkBX2TbpCYW12bjjYoDbNq+CjsAzgu/V+GpZiPV4l2i4Sl44A8u19bPA0TUDz1D5Vs85YysmFPOP7FD9KF+39nmdXgbZjhkaTB0YpekwJuaQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=C127I7ta; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="C127I7ta" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83E7CC4CEF8; Fri, 14 Nov 2025 19:33:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763148800; bh=gNS0T+ZChKXxoN7znfwaqjXaS9x2GuQGcEUhveCqTRU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=C127I7taFpdO7ZJzL+lRCXoW7/gpoQapchCxBZs+vxjMzUV3uXhiLukMQlXHbTfa7 lv5eVOUmm9ZKYLVYR2gYR5Pb9RtP1PYHoeHQ/+PoQ61nn+DrYf1QjHTZOHrmr/ZHNH rMqQvqIKKXvV9HYwvWJnRkLwJZQa3y2ijGrTFEXjDCd1Vyex8xGD1En2pHs2Pe6LFY tX5GfMN7hn72lSz6M+u/OzT6ekbYdJjtt+TRbPlqJ/TqPnohjJl2ZwrK3FCzS8NpqX RY9UFzluM0DrFpog79S6vl3OGcz1csYlFoKB+GmQFnk47VVedGrDgvjk4lW6LfCz1r +sHCw3FtodReg== From: Pratyush Yadav To: Pasha Tatashin Cc: akpm@linux-foundation.org, bhe@redhat.com, rppt@kernel.org, jasonmiu@google.com, arnd@arndb.de, coxu@redhat.com, dave@vasilevsky.ca, ebiggers@google.com, graf@amazon.com, kees@kernel.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, linux-mm@kvack.org Subject: Re: [PATCH v2 03/13] kho: Introduce high-level memory allocation API In-Reply-To: <20251114190002.3311679-4-pasha.tatashin@soleen.com> (Pasha Tatashin's message of "Fri, 14 Nov 2025 13:59:52 -0500") References: <20251114190002.3311679-1-pasha.tatashin@soleen.com> <20251114190002.3311679-4-pasha.tatashin@soleen.com> Date: Fri, 14 Nov 2025 20:33:17 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Fri, Nov 14 2025, Pasha Tatashin wrote: > Currently, clients of KHO must manually allocate memory (e.g., via > alloc_pages), calculate the page order, and explicitly call > kho_preserve_folio(). Similarly, cleanup requires separate calls to > unpreserve and free the memory. > > Introduce a high-level API to streamline this common pattern: > > - kho_alloc_preserve(size): Allocates physically contiguous, zeroed > memory and immediately marks it for preservation. > - kho_unpreserve_free(ptr): Unpreserves and frees the memory > in the current kernel. > - kho_restore_free(ptr): Restores the struct page state of > preserved memory in the new kernel and immediately frees it to the > page allocator. > > Signed-off-by: Pasha Tatashin > Reviewed-by: Mike Rapoport (Microsoft) Reviewed-by: Pratyush Yadav [...] -- Regards, Pratyush Yadav