From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 A835236C598 for ; Tue, 19 May 2026 18:47:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779216459; cv=none; b=nEs6PmvpnvndokEm/TD/3JUxLUyLn47VAj0ddLcVq454nQyXWGZkjICUWKLJ8G+6fg0Cpc8W6xGeLYBY4HB80yBKabMoJXJCiIX2Dgft95PSB5JeN9X7OuVJ4/qfEh1HIkFGZT/qEV3jxXauF/sQ3lN6hgWq1zENjEpqXCSWzEg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779216459; c=relaxed/simple; bh=6bDFKloV9wCzA7ym/ab7C+z4oYqNZXRFYLSn9rPO1gY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qUX2QxOlbBk7F9t2Uu6cfk9UmxjfpSpNUJZJyiDfj7qrrVfzLRS259K4Lsxn31zvtjksGdAMKWKqTylnkny0GZTrzJw4ZymoMNAYcOzDa8EOAU8enOtD8Dwb6HE4SN3q85X326xKzjpXZikUbei+YNvpRkp4zZ0GHZqUUMe+Ec8= 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=lyXaXwql; arc=none smtp.client-ip=209.85.214.172 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="lyXaXwql" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-2b46da8c48eso2535ad.1 for ; Tue, 19 May 2026 11:47:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1779216457; x=1779821257; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=6bDFKloV9wCzA7ym/ab7C+z4oYqNZXRFYLSn9rPO1gY=; b=lyXaXwqlAXVwABemtO8UbZ2EgtQYxwzyakp/pPvdcoRcM20qjfF7Jp5KKSvvSPUJQo u9RlEsZcYmQ9u6GjND4O78w0xZtPxkgUrTXQ1HkUE4mP/UswAzNFiL2bIMAi8UnUGXws WI0HDVux20yK+rSEyI5/YVuaa9+R5xfG/HcOxHV5jqr57nxZvGnY8m/1YznWfe2EnuI+ 7LFNgb2k1R01A1k1jwFNxbbHDZ2phld8gYcGZeFCKFuvXY/dazZaOMA+uaBM33U9CD/4 pkdEdpx+8Ir50wRPcmjj4wh4nVi0hclnUN12aQoXylvuB7j1vpXoR4x5e+bsk202gRqU RFdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779216457; x=1779821257; h=in-reply-to:content-disposition: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; bh=6bDFKloV9wCzA7ym/ab7C+z4oYqNZXRFYLSn9rPO1gY=; b=CZ15i7+exposyqlu4GEJazSqwC2+6E7DrOimx0AZeRdn+LQBE7WCBI4vC4OGumOso+ F/rhs1/RwLeoZRAqIT626GK1tieZcWDnABkg08lB+53NiU12c/VyQIf/40jIBGNdx3Bf 3Dgd08j4/M9s+VCEAc3LXzdlvPEQUoMfwR9TIf0jCUi+0NdRg13Tz54wYppA4eyYN8RX TJYYuc2qmutTODMv6BEAkgvlfvPSCxv9Nc0U9cukXxzMbfbNG31CHmOTfS5D7itjRkZ2 DwvaKMbPyUJw+6pBuHAR/fQYbsi2txr8Zg72DPb20hEwRnLisYaXBE0M907RdWgN69X6 LreA== X-Forwarded-Encrypted: i=1; AFNElJ+Fxst1T62huEeFR2WTSoZWxgI5rJjSwFKSiBT1RazSS+u/Zx9q8MxPcuxkjlAjjg1NwBy5ByEuULmqHww=@vger.kernel.org X-Gm-Message-State: AOJu0YwBYRzkwoVw50BagE8iVz/XP7FTMvfSw9dG++VO5hiFau3r6NdS 4I418DhIFXAJj5vBAC4nvAazf3TWFXrpZHsTrDJiS6TjADP5EDqDkiThTBCDfUM53w== X-Gm-Gg: Acq92OEcg+J1+Kbf0f1CDDd+D086e74+T6uO6p+khB6oM9/MTUovZDzLgqUNxbzaWoU 1wNvObMr7fSkh0C8g4KIi55BF4qJ73QOXRU2WF5r1UoL258nXjm2s7Fa6XCbIUsG5HIxd6La/Co CydGlhhAGV02/rptSZq5F3VEsBP+X5dXjm11ZdfxMO+EqViSCT2w25iSykABasblXcZeZWealJM DaEykfjVzreLyExNPRcdKO82FmKzmsgHVRs/jRDgT4PsbRq7kButp50lCoRhbWmUBNiwFrp/dAF 8euOZp8zb1M9rn9hlPtJal3AeuvQ49ik44CtdReoLh4/j7HGR7QWrQERpHrTJy1wZAQ5eemMsGS N72NJDwICxo9J1Lu4cY3uOmjZr/idtzNsS08oP9Pi8nMJytp9otmgSjE8aFyBHL2tTTfNcShvVc 4ZH8xbo3TKtn6SwHNu3auIZvnkegKvKwvwrIZkEjDtnOF9WP17H5QqbLH4VYEeXUkgymFixg== X-Received: by 2002:a17:903:1983:b0:2bd:6dad:3dfc with SMTP id d9443c01a7336-2bdb041156emr6226085ad.26.1779216456323; Tue, 19 May 2026 11:47:36 -0700 (PDT) Received: from google.com (153.46.83.34.bc.googleusercontent.com. [34.83.46.153]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bd5d11ce67sm198205895ad.74.2026.05.19.11.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 11:47:35 -0700 (PDT) Date: Tue, 19 May 2026 18:47:32 +0000 From: Samiullah Khawaja To: Pratyush Yadav Cc: Mike Rapoport , Pasha Tatashin , Alexander Graf , Andrew Morton , kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] kho: fix order calculation for kho_unpreserve_pages() Message-ID: References: <20260519133332.2498092-1-pratyush@kernel.org> 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; format=flowed Content-Disposition: inline In-Reply-To: <20260519133332.2498092-1-pratyush@kernel.org> On Tue, May 19, 2026 at 03:33:30PM +0200, Pratyush Yadav wrote: >From: "Pratyush Yadav (Google)" > >Commit 91e74fa8b1bc ("kho: make sure preservations do not span multiple >NUMA nodes") made sure preservations from kho_preserve_pages() do not >span multiple NUMA nodes. If they do, the order is reduced and tried >again. > >The same logic was not implemented for kho_unpreserve_pages(). This can >result in unpreserve calculating a different order than preserve, and >thus not actually unpreserving the pages. > >Fix this by moving the order calculation logic to >__kho_preserve_pages_order() and use it from both preserve and >unpreserve paths. > >Move __kho_unpreserve() down to avoid having a forward declaration. Its >users are further down in the file anyway. Also, it results in grouping >for all the page-level preservation and unpreservation functions. This >unfortunately makes the diff hard to read, but the main change in >__kho_unpreserve() is to call __kho_preserve_pages_order() instead of >open-coding the order calculation. > >Fixes: 91e74fa8b1bc ("kho: make sure preservations do not span multiple NUMA nodes") >Cc: stable@vger.kernel.org >Signed-off-by: Pratyush Yadav (Google) Nice find, sashiko was also complaining about same on my kunit series: https://sashiko.dev/#/patchset/20260512195135.804833-1-skhawaja%40google.com Reviewed-by: Samiullah Khawaja