dm vdo block-map: optimize enter_zone_read_only_mode

Rather than incrementally dequeue from the zone->flush_waiters
vdo_wait_queue, simply re-initialize it.

Reviewed-by: Ken Raeburn <raeburn@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
This commit is contained in:
Mike Snitzer 2023-11-20 17:29:19 -05:00
parent e752e5c33b
commit 29f0ef873c

View File

@ -641,12 +641,10 @@ static void enter_zone_read_only_mode(struct block_map_zone *zone, int result)
vdo_enter_read_only_mode(zone->block_map->vdo, result);
/*
* We are in read-only mode, so we won't ever write any page out. Just take all waiters off
* the queue so the zone can drain.
* We are in read-only mode, so we won't ever write any page out.
* Just take all waiters off the waitq so the zone can drain.
*/
while (vdo_waitq_has_waiters(&zone->flush_waiters))
vdo_waitq_dequeue_next_waiter(&zone->flush_waiters);
vdo_waitq_init(&zone->flush_waiters);
check_for_drain_complete(zone);
}