From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (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 073333ED3C8 for ; Tue, 19 May 2026 14:13:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779199989; cv=none; b=At6GncLjfOV0RbnIfnGnQnyY+Pc/RHcknYZtB4ZiQWD0GIfNWF/mgVpGwreqa5jCA86W6UL2iHWkNOGr6ORhlEiRmHYcdLBLxw3XaMF/GTRPqSXCG28uIOUpSmODn0Adv5FQKU4De8+AU4lSoBoYRj6K1jfbFxr5aMcp9VlU4JQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779199989; c=relaxed/simple; bh=OCcqg1BGOlEZ4cGMnfxKFeTqP9wIJtR2x1vwkwbYYcg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XClpSEpxO9jauqIvsGvICTrdQCSse9MQV9Ta/9hj0de7yFmzxn96gphSVpacefeGA/2v6dF1OX7ZfW3hLunuoDC26ik3waM4W6mpkn7S4KQV4wPaPDPQsq2oSS2zsX8KXN1ffbYFmAiob8LezpoUUpfYQdwiKu+ocUzHYyWbFGg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com; spf=pass smtp.mailfrom=soleen.com; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b=CppU7T38; arc=none smtp.client-ip=209.85.219.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="CppU7T38" Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-8b6ea7716bfso46217296d6.0 for ; Tue, 19 May 2026 07:13:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1779199987; x=1779804787; 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=0sGtfsMt+NWWfWgP1GuryhPZenTz+43P15Viqh/cz5I=; b=CppU7T38mmEoWp84ksK0BtMrb274d8HsLH1m5dbqycunnZcChcQxhuB4/PqteH/s0W bAs8FTT3DSw8AEEUTcmykUV1iXd/MoQIwV2m7SblaswCJZETFsHg7PnwF0zMdrrv8dzU dcyRBdGfCKVl/YyxHSZBZ/oYRN2d5EQfv51wBFbiTAsmCdZWgJLo7ZnzH6tbl/PYXPRZ xpagnbRWo0rPcxQfzAqK13Z8JIDvQueWzzyyls1RZXn8NZA1q4jdCFW6mcCkLjKJruXD qxK+Y94GyJTG4eYoQfuL191zXCvdrq4I6xq3VNTyvz4lT5KwSRzL1Yc3b4BmTdgAoArk Q5mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779199987; x=1779804787; 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=0sGtfsMt+NWWfWgP1GuryhPZenTz+43P15Viqh/cz5I=; b=nQaWxLZrU9fjftNp5Sn0JJHbzot2VNl4RFWHJn6WPRt5InJFupTaY05MaysfLcIDj3 m6aTxepna0k1N5DT8Qcq1MwjUpGbLK742KhfSbSea1AI4282oMWOdrBTxGVG7rsNvbfR R+n68tfKh73cBRQX2lFMPD/IlarLNFdNqdrnkP6xzEpBiG4Rl7zMtkE1v2fowJ5AuorP T/rScTNG3sfcg5UxuT3zgH7nUZi+CBSrz4thepKMakDYFxQuLPluCBg2PC6sdOzPquAO HiOZzBUNFXkf2tvbeAWBbqC8eZ0g74Kl+sAObsCDZLRR9q8DKdqRUhfDepIMWFbvaMXb SBJw== X-Forwarded-Encrypted: i=1; AFNElJ+Cd8yYwmXRmZRW70mNTqQlJVj58ugBIHqBc4gbvSkconZhozMFNuI0Cy3X+hRj6tWs2boWeWFqYLlQ4tY=@vger.kernel.org X-Gm-Message-State: AOJu0Yx1UH0uDeAfGvtWLhzpz9gr/kzrv9RfhH++hZofX4E6bxGUOmdM ledwe2Pnf7zptr75/909yvgGDU9tjZYWCrxYnQobn8KgY9yLkGwjrrREfEHYuyWPoUrjWi4oCFr A/Spe X-Gm-Gg: Acq92OEIMSgFkjT11Hv+6QrhAMMaJC3UGnFxNzAIEllpKnZf4vmqz4tPgOrM9U3fTdh QCMPc51pEfBAq+PrAz70SPh7EthRRZK/9cqGTSmZnPjROY0HALoxmymM3/zOLFaq3B8oJ/1fNHC 5b2jGEC16kwe8kanfQyTVegCZgCUnOqxYKCMxOslpnI8AG99xYbYdoNl8yPk228xNDJqhKadklk 6pZuo2D25aKqeQQrjPLvdYwJYqGObaGI3/SJrdjzZcGrkFpelTeGtzBf0DvHVh+j/Y8GG6aKV9L NmKg5Eim55CfNFGqTmyy2On9pMm3gAW4xnmNpOJAP9clVGhcbkeabCJpoGWnH4szSUviQ4YukQ6 0op8ao08tnEh4Lw7EyWuwIgbFAs+KppTVlUNxe6u9z6H1+RY8gO5rGgsxSniWd1KhFivi9qdkef aIanOcKYfMFarJ8QnEjaoO0QToKeJQSNfuQZ7GxTEbxEKe8JSgBv4= X-Received: by 2002:a05:6214:590a:b0:8ae:5fcc:8069 with SMTP id 6a1803df08f44-8ca0f62bc61mr376033696d6.22.1779199986811; Tue, 19 May 2026 07:13:06 -0700 (PDT) Received: from plex ([71.181.43.54]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8ca3608c424sm92013666d6.3.2026.05.19.07.13.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 07:13:06 -0700 (PDT) Date: Tue, 19 May 2026 14:13:05 +0000 From: Pasha Tatashin To: Pratyush Yadav Cc: Mike Rapoport , Pasha Tatashin , Alexander Graf , Samiullah Khawaja , 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 Content-Disposition: inline In-Reply-To: <20260519133332.2498092-1-pratyush@kernel.org> On 05-19 15:33, 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) Reviewed-by: Pasha Tatashin Pasha