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 6377A13D503 for ; Thu, 20 Nov 2025 09:26:31 +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=1763630791; cv=none; b=PYCPS8bMReQ/g86e6m1at0SLL/lySdEPc9SzwLDtBbiIHp94dAgSw0DdlIytjcDUctU72663wT2SJQIFfkO0bzwc+yu5bISheT0HrbcLT0UZSCH0ziC8UiupvJfOaFg1qnIdvFkCUJmPamurXGm5W2ygl/uUL9DRQwi1iQgn+3Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763630791; c=relaxed/simple; bh=O8ppzezBVngh9p2neSkJwi7IKljaPCF/ARYNeHVOvFg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=Fsd/qEmcvdGbVz0TCSAk4XmpzX2l06hl6hhnkn6KTEo7WJIPhRZbJcZ8sTk/5K0cOU30ixohhR42iRAFxgMPubVWUNeCV+00i0nlPDT7NAP2ZlP/zhALPUThYn3p2CrCiKLorj4ZLltV1rpM4663L0t1ti7JVCpqzdun6ZKz7ik= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nyE0zf7+; 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="nyE0zf7+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0F8EC19422; Thu, 20 Nov 2025 09:26:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763630791; bh=O8ppzezBVngh9p2neSkJwi7IKljaPCF/ARYNeHVOvFg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=nyE0zf7+Zm3qEjzxMy+D6jswoaBimOO39W356YHTZBNMo8zH0aeaxEbym99oYc6gy wLqFIQc4dMFf7rbeeKyEhc5kdWQw6tC/hLcd70clP1tOj3ei8D7BJXc45z1RbBOV7s BgCYKBFbX4iMq8jb/TvSO6gJbQc+Gg36FiHawDAe9k3i26hPvZb3W+gEHATFDqjSNL LVgCVSqbUBOCrmwJdsk4jNUtHGgnlJZwZD0IyIm444iBFesnMNFlH6yCvSWC2f69jg jLoMOC2QlXaBHleNVdIQyjCt+4aWkfdZr+aT4MGJrDmD+3IYR2LJIjQj7JZ0xWybEt R7hLK7DWFIE/w== From: Pratyush Yadav To: Pasha Tatashin Cc: Pratyush Yadav , Andrew Morton , Alexander Graf , Mike Rapoport , kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kho: free already restored pages when kho_restore_vmalloc() fails In-Reply-To: (Pasha Tatashin's message of "Tue, 18 Nov 2025 13:43:32 -0500") References: <20251118181811.47336-1-pratyush@kernel.org> Date: Thu, 20 Nov 2025 10:26:28 +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 Tue, Nov 18 2025, Pasha Tatashin wrote: >> When kho_restore_vmalloc() fails, it frees up the pages array, but not >> the pages it contains. These are the pages that were successfully >> restored using kho_restore_pages(). If the failure happens when >> restoring the pages, the ones successfully restored are leaked. If the >> failure happens when allocating the vm_area or when mapping the pages, >> all the pages of the preserved vmalloc buffer are leaked. > > Hm, I am not sure if KHO should be responsible for freeing the > restored pages. We don't know the content of those pages, and what > they are used for. They could be used by a hypervisor or a device. > Therefore, it may be better to keep them leaked, and let the caller > decide what to do next: i.e., boot into a maintenance mode, crash the > kernel, or allow the leak until the next reboot. Hmm, fair point. This patch can be ignored then. -- Regards, Pratyush Yadav