|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v3 00/11] Defer completion and ring destruction until backend grant release
These patches look broadly good. AI has suggested a few potential issues; * RingD0ToD3 can block until a 0x9F bugcheck is triggered - this looks intentional here * BlkifRingDisconnect could get into a state where grants are reused incorrectly - Linux blkback stopping threads on Closing prevents this * BlkifRingTryPutRequest / GranterTryPut could race with backend clearing flags, leading to the SRB completion being delayed - adding a small retry loop here, similar to the previous revoke, could avoid this in most cases (I dont know how often this would happen, this would need further investigation, and can be a later patch) * BlkifRingReclaim stops at the first failure, even when later requests could be reclaimed - improving this could be a later patch In general, the 11 xenvbd and 1 xenbus patches: Reviewed-by: Owen Smith <owen.smith@xxxxxxxxxx> ________________________________________ From: win-pv-devel <win-pv-devel-bounces@xxxxxxxxxxxxxxxxxxxx> on behalf of Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx> Sent: 02 November 2026 11:20 AM To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx Cc: Tu Dinh Subject: [PATCH v3 00/11] Defer completion and ring destruction until backend grant release When a backend is accessing a grant entry, it'll set the GTF_reading| GTF_writing bits on that entry. RevokeForeignAccess will fail as long as these bits are still set. WinPV drivers assume that you can ignore RevokeForeignAccess failures after a certain number of retries. This is unfortunately not the case, as backends can still access the grants and corrupt things. We've observed data corruption that we suspect as being caused by this issue. This series converts RevokeForeignAccess into a fallible call named TryRevokeForeignAccess, and fixes the problem by deferring request completion and ring destruction until after the corresponding grants have been released by the backend. It has undergone testing using a harness for suspending I/O handling at critical points, and showed no deadlock or data corruption when the associated issues in tapdisk are fixed. This is the first series of fix for a class of similar issues. Further fixes will be needed in other drivers using the grant interface (esp. XenVif, XenIface); there are also other issues that have not been discussed in this series. Changes in v3: * Try harder to release existing grants before deferring a request * Add yet another fix to defer faking submitted requests until disconnect Changes in V2: * Rename RevokeForeignAccess in GNTTAB V5 to TryRevokeForeignAccess * Fix a deadlock during RingD0ToD3 (see the "ring: Defer destruction until backend grant release" commit for more details) * Add a fix for a C6387 warning in BlkifRing Tu Dinh (11): ring: Fix warning C6387: 'BlkifRing' could be '0' granter: Correct the accounting of Current Use GNTTAB_INTERFACE_V5 frontend: Initialize the granter before the ring granter: Split GranterTryPut to its own function granter: Decouple cache lifetime from Connected granter: Introduce GranterD0ToD3/D3ToD0 ring: Introduce RingD3ToD0/RingD0ToD3 ring: Defer destruction until backend grant release ring: Defer request completion until backend grant release ring: Defer faking submitted requests until disconnect include/gnttab_interface.h | 116 ++++-- src/xenvbd.inf | 6 +- src/xenvbd/frontend.c | 63 ++-- src/xenvbd/frontend.h | 4 +- src/xenvbd/granter.c | 177 +++++++-- src/xenvbd/granter.h | 17 +- src/xenvbd/ring.c | 737 ++++++++++++++++++++++++++++++------- src/xenvbd/ring.h | 13 + 8 files changed, 887 insertions(+), 246 deletions(-) -- 2.56.0.windows.4 -- Ngoc Tu Dinh | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |