qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC] block/nbd: Move s->ioc on AioContext change


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [RFC] block/nbd: Move s->ioc on AioContext change
Date: Tue, 1 Feb 2022 20:18:44 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0

01.02.2022 19:14, Hanna Reitz wrote:
reconnect_delay_timer should exist only during IO request: it's created during 
request if we don't have a connection. And request will not finish until timer 
elapsed or connection established (timer should be removed in this case too). 
So, again, when attaching / detaching the context we should be in a drained 
sections, so no in-flight requests and no reconnect_delay_timer.

Got it.  FWIW, other block drivers rely on this, too (e.g. null-aio with 
latency-ns set creates a timer in every I/O request and settles the request 
once the timer expires).

Looks like the timer isn’t removed when the connection is reestablished.

Oops. And that's wrong.. If connection lost again when old timer is still not 
fired, assertion in reconnect_delay_timer_init() will fail.

I think we just need reconnect_delay_timer_del() call at the end of 
nbd_reconnect_attempt() function (after nbd_co_do_establish_connection() call).


--
Best regards,
Vladimir



reply via email to

[Prev in Thread] Current Thread [Next in Thread]