From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 56BAA41B37D for ; Thu, 30 Jul 2026 12:05:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785413127; cv=none; b=iZsLDkjLHvvoDzOg/WTTQQzIP++pEswvjzz2P+qrUdNrBk7kVvi9j0lgdSpLUDhYcyLnYOXNqnWpOTinLdtoTLW6mv7j5ts8REoO3/xOFk9l+F1NKWh68x2Sx30AWCcqV8SxS/hl5Zm/uAwq47zEoabQgBhVr4RwmTNGldcXtYQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785413127; c=relaxed/simple; bh=iosFZneG7mxQxQe7HBUm4X6dfom0oIMsr3LR3XkVJU4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JOS5TglqNVKzSa1kY9i4v3rNNx9OfOrD3VQdsXTEMNkyYr7sgjhq5K6CC1qgURVJz0GmBKtX9ZV4+njaKpMpH/+ZAyJKtrmgflIoLKVWXi2capAAwQeUfu34uYboT28HyeMY0COvzKhXqMPuvMCCYSRr36/vJ671S6wXB88UmJo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=XfihJiGh; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="XfihJiGh" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2cede6375caso95995ad.0 for ; Thu, 30 Jul 2026 05:05:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1785413126; x=1786017926; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=jtRpHwnpz9cpARPetnCI9M1YK2PZpdz9An3dyVypqLg=; b=XfihJiGh2lG6ZaYwOTgtMFKEbTHUXgXih5iVHBBOqYGTI4XFg8uaKXyFjkB82nlT3H i1Mki/Gi9d5c5fZSqSeJVCB/61eb34+tJjj6WMClKkrj5Se69sChGMfoS639rqq34/DG ezf68Hl3T63F4xIUy8nq+HPXNWNyU+17pOBkDrEHT6DYfz8pvHNNb0vMD1JuKDpbj/Vn jgNEOT6eyxT8L32b3qPtZLmMNRiboc2BMetrNyeKXr2MTxAdT3qqncdvG10/heMe2cML kN5nhOtGXUvhrbIQtaQhNAMw6rKj5ab4+p0RfYOT9leWbrI/tLac40Jt4p1j9w9d8XFl tabA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785413126; x=1786017926; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=jtRpHwnpz9cpARPetnCI9M1YK2PZpdz9An3dyVypqLg=; b=FV+/FmqtZ8aXjRP7I9w+9XuAveO1FZN81qfNUSaZM2f+DBeliuyxGGYyJNpQh5ZLT9 /eN9r2DVRR7Pjva34tJGGKQ5eVOsTGTirsspfSTHdWMp35Wh/XXxiUx96bmGDcRLvmM9 OGyPaXjhasAapOfUME2Tobg6YTjYHRURfXBWA5TGuX6OwTHJSeIOQsLd/xl25l93itpR oEKJ3fn3ROVlM9g59GK4ZO0NbgZjRwQQvmSq5rl+b39xHwx5czNwHkP2wVXcX4aS3fOO TsVU8hQL1/1yc1cr2vWkdDAPHQzD1abXnn2vj5LRBBsyN/Vgg9gG2dpGWV0u9+VY/sou Dk2w== X-Forwarded-Encrypted: i=1; AHgh+RrkpMxkxt5NLHvaACWsvDqR7QhvE0kb3xtO/59O8WJQvrTsUC4IsytkXGjh1gFh/xs97j5vWb90UIlEZSk=@vger.kernel.org X-Gm-Message-State: AOJu0YyA7DPyph7JhvivuZ2yhrIAWBRcVbZDre0Z8qXY/MGGaZLZhYp1 U6gHMbF4ECsUYtHsaMQMAJn4h/SD0FmPkm4KVzSA7/RQZhmp0ICPzCCZqpvlY0sOJA== X-Gm-Gg: AR+sD11D4iilZQvZqMiCv6Fi4K9LGQ4V4Oi649MdV0L0b2THMJTbZJDkulZB6Joh7fQ wb/8Ve+9u7u/JM6K6yUnI1fWnaziLpNYN51V7c1x0NYEbGNSKXcQ3Eyz6lnh4caOSGQxC2+9C1A 4nxQoW9pGPJjsjw6nb7NRVMvxxWM2rd5DfYB/7E7IZH+AgYxK8qvOnie6Ojhwi8Lz7TMt1az9ZW siS/b/mHqbpHoGdKh8blLK61ie+98tnfK3b/K5KXsUp/ao4ym/fa78MsnIcKtAaKQhb243PiD98 VT/Y/kIYFU8dvd+QUVJmeXayltoPtVXqlQcEDV+VNuQqX6CicajlxqStY5xAseLYQfQGBRDXmll BmqL5kD1kS5Epsq04KPM/YudBKepmihvKLB7f/b7q0LkByLhSeFs7nYO1XnqzNL7NZlXGk7eHJW RTJ9I4UH1aee/F0U4bTOKfmMcJWU9unK0D3s6cY5e6RuB5SCPOcIq+zrKkMWqcRSFaAuZxhivzl axTK1EHhue9tA+NVdlcR58= X-Received: by 2002:a17:902:f2d1:b0:2bd:3bfd:74f1 with SMTP id d9443c01a7336-2d03e47005bmr23875ad.2.1785413125046; Thu, 30 Jul 2026 05:05:25 -0700 (PDT) Received: from google.com (21.168.124.34.bc.googleusercontent.com. [34.124.168.21]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d022bc6d70sm26178725ad.39.2026.07.30.05.05.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2026 05:05:24 -0700 (PDT) Date: Thu, 30 Jul 2026 12:05:18 +0000 From: Pranjal Shrivastava To: Mike Rapoport Cc: Pasha Tatashin , Pratyush Yadav , Alexander Graf , Samiullah Khawaja , David Matlack , kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/2] kho: Introduce preserve/restore APIs for high-order pages Message-ID: References: <20260723204203.2997395-1-praan@google.com> <20260723204203.2997395-3-praan@google.com> <178539640188.2151126.10266644348178621151.b4-review@b4> 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-Disposition: inline In-Reply-To: <178539640188.2151126.10266644348178621151.b4-review@b4> On Thu, Jul 30, 2026 at 10:26:41AM +0300, Mike Rapoport wrote: > Hi Pranjal, > > > The current KHO page preservation APIs (e.g. kho_preserve_pages) assume > > that multi-page blocks are split into independent 4KB pages during > > restoration. This is incompatible with high-order non-compound pages, > > such as DMA buffers, which must be restored with tail pages having a > > zero reference count. > > > > Introduce explicit preserve and restore APIs for high-order pages, > > which preserve and restore a high-order page block as a single unit, > > applying a refcount of 1 to the head page while leaving tail pages at 0. > > Rename the existing internal helper to __kho_restore_page() and > > consolidate the common restoration code into it. > > > > Signed-off-by: Pranjal Shrivastava > > > > @@ -457,10 +482,14 @@ struct page *kho_restore_pages(phys_addr_t phys, unsigned long nr_pages) > > while (pfn < end_pfn) { > > const unsigned int order = > > min(count_trailing_zeros(pfn), ilog2(end_pfn - pfn)); > > - struct page *page = kho_restore_page(PFN_PHYS(pfn), false); > > + unsigned int info_order; > > + struct page *page = __kho_restore_page(PFN_PHYS(pfn), &info_order); > > > > if (!page) > > return NULL; > > + > > + kho_init_pages(page, 1UL << info_order); > > + adjust_managed_page_count(page, 1UL << info_order); > > Seeing > > + adjust_managed_page_count(page, 1UL << info_order); > > for the third time hinted that something is off ;-) > Ack. I'll fold it into the __kho_restore_page() helper Thanks, Praan