From: Mike Rapoport <rppt@kernel.org>
To: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: akpm@linux-foundation.org, brauner@kernel.org, corbet@lwn.net,
graf@amazon.com, jgg@ziepe.ca, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-mm@kvack.org,
masahiroy@kernel.org, ojeda@kernel.org, pratyush@kernel.org,
rdunlap@infradead.org, tj@kernel.org, yanjun.zhu@linux.dev
Subject: Re: [PATCH v9 4/9] memblock: Unpreserve memory in case of error
Date: Sun, 2 Nov 2025 08:51:24 +0200 [thread overview]
Message-ID: <aQb_bJ2et5rO0k5q@kernel.org> (raw)
In-Reply-To: <20251101142325.1326536-5-pasha.tatashin@soleen.com>
On Sat, Nov 01, 2025 at 10:23:20AM -0400, Pasha Tatashin wrote:
> If there is an error half way through KHO memory preservation, we should
> rollback and unpreserve everything that is partially preserved.
>
> Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
> Suggested-by: Pratyush Yadav <pratyush@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
with a small nit below.
> ---
> mm/memblock.c | 73 ++++++++++++++++++++++++++++++++++++++++-----------
> 1 file changed, 58 insertions(+), 15 deletions(-)
>
> diff --git a/mm/memblock.c b/mm/memblock.c
> index e3bef9b35d63..f527ad1ca682 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -2445,29 +2445,60 @@ int reserve_mem_release_by_name(const char *name)
...
> static int __init prepare_kho_fdt(void)
> {
> - int err = 0, i;
> struct page *fdt_page;
> void *fdt;
> + int err;
>
> fdt_page = alloc_page(GFP_KERNEL);
> - if (!fdt_page)
> - return -ENOMEM;
> + if (!fdt_page) {
> + err = -ENOMEM;
> + goto err_no_fdt_page;
Please rename the label to describe what the goto does, say, err_report.
I believe it can be a fixup on top after Andrew merges these.
...
> +err_remove_subtree:
> + kho_remove_subtree(fdt);
> +err_unpreserve_fdt:
> + kho_unpreserve_pages(fdt_page, 1);
> +err_free_fdt:
> + put_page(fdt_page);
> +err_no_fdt_page:
> + pr_err("failed to prepare memblock FDT for KHO: %d\n", err);
>
> return err;
> }
> --
> 2.51.1.930.gacf6e81ea2-goog
>
--
Sincerely yours,
Mike.
next prev parent reply other threads:[~2025-11-02 6:51 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-01 14:23 [PATCH v9 0/9] liveupdate: Rework KHO for in-kernel users Pasha Tatashin
2025-11-01 14:23 ` [PATCH v9 1/9] kho: make debugfs interface optional Pasha Tatashin
2025-11-07 6:03 ` Zhu Yanjun
2025-11-07 12:00 ` Pasha Tatashin
2025-11-07 12:02 ` Pasha Tatashin
2025-11-07 23:35 ` Yanjun.Zhu
2025-11-08 18:13 ` Pasha Tatashin
2025-11-10 0:20 ` Zhu Yanjun
2025-11-10 13:16 ` Pratyush Yadav
2025-11-10 15:26 ` Pasha Tatashin
2025-11-11 4:11 ` Zhu Yanjun
2025-11-11 15:26 ` Pasha Tatashin
2025-11-13 1:41 ` Yanjun.Zhu
2025-11-13 2:11 ` Yanjun.Zhu
2025-11-13 19:59 ` Pasha Tatashin
2025-11-13 20:07 ` Yanjun.Zhu
2025-11-13 19:55 ` Yanjun.Zhu
2025-11-13 20:10 ` Pasha Tatashin
2025-11-13 20:13 ` Pasha Tatashin
2025-11-13 20:28 ` Yanjun.Zhu
2025-11-01 14:23 ` [PATCH v9 2/9] kho: drop notifiers Pasha Tatashin
2025-11-06 8:41 ` kernel test robot
2025-11-06 21:46 ` Pasha Tatashin
2025-11-06 22:14 ` Pasha Tatashin
2025-11-01 14:23 ` [PATCH v9 3/9] kho: add interfaces to unpreserve folios, page ranges, and vmalloc Pasha Tatashin
2025-11-03 18:05 ` Pratyush Yadav
2025-11-01 14:23 ` [PATCH v9 4/9] memblock: Unpreserve memory in case of error Pasha Tatashin
2025-11-02 6:51 ` Mike Rapoport [this message]
2025-11-05 10:26 ` Pratyush Yadav
2025-11-01 14:23 ` [PATCH v9 5/9] test_kho: " Pasha Tatashin
2025-11-01 14:23 ` [PATCH v9 6/9] kho: don't unpreserve memory during abort Pasha Tatashin
2025-11-05 10:28 ` Pratyush Yadav
2025-11-01 14:23 ` [PATCH v9 7/9] liveupdate: kho: move to kernel/liveupdate Pasha Tatashin
2025-11-06 7:21 ` kernel test robot
2025-11-07 22:23 ` Andrew Morton
2025-11-08 18:01 ` Pasha Tatashin
2025-11-01 14:23 ` [PATCH v9 8/9] MAINTAINERS: update KHO maintainers Pasha Tatashin
2025-11-01 16:36 ` Mike Rapoport
2025-11-01 14:23 ` [PATCH v9 9/9] liveupdate: kho: Use %pe format specifier for error pointer printing Pasha Tatashin
2025-11-01 19:45 ` Zhu Yanjun
2025-11-02 6:59 ` Mike Rapoport
2025-11-03 12:59 ` Pratyush Yadav
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aQb_bJ2et5rO0k5q@kernel.org \
--to=rppt@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=corbet@lwn.net \
--cc=graf@amazon.com \
--cc=jgg@ziepe.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=masahiroy@kernel.org \
--cc=ojeda@kernel.org \
--cc=pasha.tatashin@soleen.com \
--cc=pratyush@kernel.org \
--cc=rdunlap@infradead.org \
--cc=tj@kernel.org \
--cc=yanjun.zhu@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.