From: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
To: Konstantin Khorenko <khorenko@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.2 v8 0/9] dm-ploop: give back unused tail of top delta on suspend
Date: Wed, 18 Nov 2026 16:07:07 +0100 [thread overview]
Message-ID: <8d116851-f06d-4d60-b3f9-67a2803fecba@virtuozzo.com> (raw)
In-Reply-To: <179500930710.202939.18409474108045244620.b4-review@b4>
On 11/18/26 14:41, Konstantin Khorenko wrote:
> I won't apply this version, please send v9 with the changes below.
>
> All eight v7 items are done in the code, thanks. What is left:
>
> 1. 8/9: prealloc_stopped drops every preallocation request for the
> whole time the device is suspended, so a "resize" (or a merge) of
> a suspended device that needs a cluster past top->file_size now
> fails with -EIO after the "Prealloc failed" retries; before it grew
> the file. Either fence only when the postsuspend wait was skipped
> (standby), or refuse resize and merge on a suspended device with
> -EBUSY, and say which in the message. ploop_flip_upper_deltas()
> still says "A resize of the suspended device may have restarted
> the allocator".
There is no persistent fence in the new version: ploop_stop_prealloc()
zeroes prealloc_size once in postsuspend and once at the end of a
message to a suspended device, and waits for the operation in flight
unless in standby. A resize or merge of a suspended device still gets
its preallocation while it runs, so it doesn't hit "Prealloc failed" / -EIO.
Only the requests left after it ends are dropped.
Rewrote the comment to "In standby, postsuspend may leave a prealloc in
flight".
> 2. 8/9: the preresume wait for inflight_md runs before ctl_rwsem, so a
> resize issued during the resume can leave it at 1 and the reload is
> skipped with no trace; at least log it.
Agreed, a message can slip in between the wait and down_write(). Fixed
by repeating the wait under ctl_rwsem. The first wait stays outside the
lock so a stuck writeback doesn't block status and messages.
> 3. Messages: 6/9 says "calls wake_up()" where the replaced code calls
> wake_up_interruptible(), and does not say that wake_up_locked() is
> what wakes the new uninterruptible wait in ploop_destroy(); split
> the "Request preallocation..." paragraph of 8/9 (eight sentences)
> and give the two __dm_destroy() sentences of 9/9 their own
> paragraph; 9/9 logs an expected -EBUSY skip on dirty md as an
> error.
- 6/9: fixed to wake_up_interruptible(), and the message now
says wake_up_locked() is what wakes the uninterruptible wait in
ploop_destroy().
- 8/9: split the preallocation paragraph into three.
- 9/9: moved the __dm_destroy() sentences into their own paragraph.
Moved the md_pages_are_clean check into ploop_truncate_unused_tail(),
so dirty md now skips the truncation silently instead of logging an
error.
> 4. Cover letter: the deploy order against the ploop PR is still
> missing; 3/9 fixes the is_raw order, not header validation; the
> wait left as is is in ploop_suspend_submitting_pios(), not in
> ploop_resize().
Fixed 2 and 3 in the cover letter. There is no deploy order to state:
the userspace PR is already merged. The cover letter now says
that it dropped the manual tail trimming, so the tail is not given
back until this series is applied.
> On Wed, 18 Nov 2026 14:10:23 +0100, Alexander Ivanov wrote:
>> - Patch 8 (was 9):
>> - keep the waits for preallocation and BAT writeback in postsuspend
>> uninterruptible and skip both in standby; drop
>> ploop_wait_prealloc();
>> - drop pending prealloc requests while suspended (prealloc_stopped),
>> so after a skipped wait the old allocator doesn't resize the top
>> delta under a ploop of a reloaded table;
> 1. Only work that can run after the table swap needs fencing, and the
> standby case is the only one where the wait is skipped. A message on
> the old table finishes before the swap (__bind() calls dm_sync_table()),
> so a resize of the suspended device does not race with the new table.
dm_sync_table() waits for the message, but not for the ploop_allocator()
thread it kicks: a resize relocates clusters via
ploop_allocate_cluster(), and
the allocator may keep preallocating after the swap, standby or not,
hence ploop_stop_prealloc() at the end of a message to the suspended
device. The BAT write of a resize is synchronous indeed, I reworded the
message: only its inflight_md reference may be dropped late, which
matters for resume of the same table.
> Thanks.
>
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
prev parent reply other threads:[~2026-11-18 15:08 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 13:10 Alexander Ivanov
2026-11-18 13:10 ` [Devel] [PATCH hci-8.2 v8 1/9] dm-ploop: reject a delta header whose BAT does not cover the target Alexander Ivanov
2026-11-18 13:14 ` no-reply
2026-11-18 13:10 ` [Devel] [PATCH hci-8.2 v8 2/9] dm-ploop: reject empty deltas Alexander Ivanov
2026-11-18 13:15 ` no-reply
2026-11-18 13:10 ` [Devel] [PATCH hci-8.2 v8 3/9] dm-ploop: set delta is_raw before applying its mappings Alexander Ivanov
2026-11-18 13:12 ` Denis V. Lunev
2026-11-18 13:18 ` Alexander Ivanov
2026-11-18 13:16 ` no-reply
2026-11-18 13:10 ` [Devel] [PATCH hci-8.2 v8 4/9] dm-ploop: factor out ploop_read_delta() from ploop_add_delta() Alexander Ivanov
2026-11-18 13:16 ` no-reply
2026-11-18 13:10 ` [Devel] [PATCH hci-8.2 v8 5/9] dm-ploop: take bat_lock around md page lookup in ploop_llseek_hole() Alexander Ivanov
2026-11-18 13:19 ` no-reply
2026-11-18 13:10 ` [Devel] [PATCH hci-8.2 v8 6/9] dm-ploop: fix use-after-free on the last inflight_md decrement Alexander Ivanov
2026-11-18 13:24 ` no-reply
2026-11-18 13:29 ` Alexander Ivanov
2026-11-18 13:10 ` [Devel] [PATCH hci-8.2 v8 7/9] dm-ploop: fix flip_upper_deltas racing with resume Alexander Ivanov
2026-11-18 13:21 ` no-reply
2026-11-18 13:10 ` [Devel] [PATCH hci-8.2 v8 8/9] dm-ploop: reload metadata on resume Alexander Ivanov
2026-11-18 13:30 ` no-reply
2026-11-18 14:07 ` Alexander Ivanov
2026-11-18 13:10 ` [Devel] [PATCH hci-8.2 v8 9/9] dm-ploop: truncate unused tail of top delta on suspend Alexander Ivanov
2026-11-18 13:29 ` no-reply
2026-11-18 13:11 ` [Devel] [PATCH hci-8.2 v8 0/9] dm-ploop: give back " Andrey Zhadchenko
2026-11-18 13:41 ` Konstantin Khorenko
2026-11-18 15:07 ` Alexander Ivanov [this message]
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=8d116851-f06d-4d60-b3f9-67a2803fecba@virtuozzo.com \
--to=alexander.ivanov@virtuozzo.com \
--cc=devel@openvz.org \
--cc=khorenko@virtuozzo.com \
/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.