<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Intermittent Xen blkfront I/O stalls: all guest tags busy while tapdisk reports zero outstanding requests]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">We are investigating recurring complete I/O stalls affecting Linux data VMs running on XCP-ng 8.3.</p>
<p dir="auto">We have experienced five incidents on different physical hypervisors. All affected hosts run the same XCP-ng, Xen, blktap, SM, and dom0 versions.</p>
<p dir="auto">The most recent incident was captured in detail and appears to show a discrepancy between the Linux Xen blkfront state and the XCP-ng backend/tapdisk state:</p>
<ul>
<li>The guest believed that all blkfront requests and tags were still in flight.</li>
<li>The backend/tapdisk reported zero outstanding requests.</li>
<li>Both Xen frontend and backend remained in the <code>Connected</code> state.</li>
<li>Only a VM reboot restored I/O.</li>
</ul>
<p dir="auto">We do not yet have a deterministic reproducer. The failures happen under a high-I/O OpenSearch workload with frequent fsync, flush, shard recovery, and merge operations.</p>
<h2>Environment</h2>
<p dir="auto">Hypervisor stack, identical on the affected hosts:</p>
<ul>
<li>XCP-ng 8.3 LTS</li>
<li>Build date: <code>20260430T09:28:41Z</code></li>
<li><code>xcp-ng-release-8.3.0-37</code></li>
<li>Xen: <code>4.17.6-6</code></li>
<li>Package: <code>xen-hypervisor-4.17.6-6.2.xcpng8.3</code></li>
<li>XAPI: <code>26.1.3</code></li>
<li>dom0 kernel reported by <code>uname</code>: <code>4.19.0+1</code></li>
<li>blktap: <code>3.55.5-6.7.xcpng8.3</code></li>
<li>SM: <code>3.2.12-17.8.xcpng8.3</code></li>
</ul>
<p dir="auto">Guest:</p>
<ul>
<li>Debian 12</li>
<li>Kernel: <code>6.1.0-47-amd64</code> (<code>6.1.170-3</code>)</li>
<li>12 vCPUs</li>
<li>64 GiB RAM</li>
<li>OpenSearch 3.4.0</li>
<li>Data filesystem: XFS</li>
<li>Data device: approximately 6.1 TiB</li>
<li>QCOW2 VDI on an LVM SR backed by HW raid with raid10 arrays</li>
</ul>
<p dir="auto">The OpenSearch cluster has 21 data nodes and approximately 18,800 active shard copies.</p>
<h2>Symptoms in the guest</h2>
<p dir="auto">The VM remained reachable over SSH and the OpenSearch TCP ports remained open, but the local OpenSearch API stopped responding.</p>
<p dir="auto">Observed guest metrics:</p>
<ul>
<li>
<p dir="auto">Load average around 38</p>
</li>
<li>
<p dir="auto">Approximately 30 blocked processes</p>
</li>
<li>
<p dir="auto">Approximately 91% I/O wait</p>
</li>
<li>
<p dir="auto">I/O PSI:</p>
<p dir="auto">some avg10=100.00<br />
full avg10≈91.00</p>
</li>
</ul>
<p dir="auto">Kernel stacks contained calls such as:</p>
<pre><code>blk_mq_get_tag
folio_wait_writeback
xfs_vm_writepages
xfs_file_fsync
xfs_log_force
fsync
fdatasync
</code></pre>
<p dir="auto">There was no <code>wbt_wait</code> or <code>rq_qos_wait</code> in this incident.</p>
<p dir="auto">WBT and THP had already been disabled:</p>
<pre><code>/sys/block/xvdb/queue/wbt_lat_usec = 0
transparent_hugepage/enabled = never
transparent_hugepage/defrag = never
</code></pre>
<p dir="auto">No completed I/O was observed in <code>/proc/diskstats</code> during a five-second interval, although approximately 31 requests remained in flight.</p>
<h2>blk-mq state in the guest</h2>
<p dir="auto">For <code>xvdb</code>, debugfs showed:</p>
<pre><code>hctx state: SCHED_RESTART
</code></pre>
<p dir="auto">Driver tags:</p>
<pre><code>nr_tags=32
nr_reserved_tags=0
active_queues=0
busy=32
</code></pre>
<p dir="auto">Scheduler tags:</p>
<pre><code>nr_tags=64
nr_reserved_tags=0
active_queues=0
busy=64
</code></pre>
<p dir="auto">There were 32 requests marked as in flight, including a FLUSH request, and another request waiting in the dispatch queue.</p>
<p dir="auto">The relevant queue settings were:</p>
<pre><code>nr_requests=64
scheduler=[mq-deadline] none
wbt_lat_usec=0
max_sectors_kb=44
max_segments=11
max_segment_size=4096
</code></pre>
<p dir="auto">The guest’s Xen blkfront module was configured with:</p>
<pre><code>max_ring_page_order=0
max_queues=4
feature_persistent=Y
</code></pre>
<p dir="auto">However, boot negotiation reported:</p>
<pre><code>barrier: enabled
persistent grants: disabled
indirect descriptors: disabled
bounce buffer: disabled
</code></pre>
<h2>State on the XCP-ng host</h2>
<p dir="auto">At the same time:</p>
<ul>
<li>
<p dir="auto">The physical LUN was in the <code>running</code> state.</p>
</li>
<li>
<p dir="auto">Host-side latency and I/O wait were low.</p>
</li>
<li>
<p dir="auto">There were no SCSI resets, timeouts, or I/O errors in dom0 logs.</p>
</li>
<li>
<p dir="auto">Xen frontend state was <code>4</code> (<code>Connected</code>).</p>
</li>
<li>
<p dir="auto">Xen backend state was <code>4</code> (<code>Connected</code>).</p>
</li>
<li>
<p dir="auto">The frontend had one ring page/ring reference.</p>
</li>
<li>
<p dir="auto">The backend advertised <code>max-ring-page-order=3</code>.</p>
</li>
<li>
<p dir="auto">The tapdisk process was running.</p>
</li>
<li>
<p dir="auto"><code>tap-ctl stats</code> reported:</p>
<p dir="auto">reqs_outstanding=0</p>
</li>
<li>
<p dir="auto">No message, map, VBD, image, or ENOSPC errors were reported by tapdisk.</p>
</li>
</ul>
<p dir="auto">Therefore, at the same point in time:</p>
<ul>
<li>Guest blkfront: 32 requests still in flight, all driver tags exhausted.</li>
<li>Backend/tapdisk: zero requests outstanding.</li>
</ul>
<p dir="auto">Our current interpretation is a possible lost completion or Xen frontend/backend ring desynchronization. XFS and OpenSearch appear to be downstream victims rather than the original cause.</p>
<h2>Recovery behavior</h2>
<p dir="auto">Stopping OpenSearch did not help because the requests and processes were stuck inside the kernel.</p>
<p dir="auto">A normal guest reboot also hung during shutdown. We had to use:</p>
<pre><code>xe vm-reboot uuid=&lt;VM_UUID&gt; force=true
</code></pre>
<p dir="auto">After the VM reboot, XFS log recovery completed normally and the node returned to the OpenSearch cluster.</p>
<h2>Canary test with a larger Xen ring</h2>
<p dir="auto">Because the backend advertised <code>max-ring-page-order=3</code>, we tested the following on the affected VM:</p>
<pre><code>options xen_blkfront max_ring_page_order=3
</code></pre>
<p dir="auto">We rebuilt initramfs and rebooted the VM.</p>
<p dir="auto">After reboot, xenstore showed:</p>
<pre><code>ring-page-order = 3
ring-ref0 ... ring-ref7
state = 4
</code></pre>
<p dir="auto">The guest queue then showed:</p>
<pre><code>driver tags: 256
scheduler tags: 256
nr_requests: 256
</code></pre>
<p dir="auto">The VM successfully started OpenSearch, completed shard recovery, and the cluster returned to green. No blkfront tags remained busy after recovery.</p>
<p dir="auto">This is only a canary result. We do not consider it proof that the original issue is fixed. It may only provide more queue capacity and delay the same failure if a completion is actually being lost.</p>
<h2>Questions</h2>
<ol>
<li>Is there a known XCP-ng 8.3, blktap, or Xen issue matching this frontend/backend state mismatch?</li>
<li>Can tapdisk or the Xen backend lose a completion while both sides remain in state <code>Connected</code>?</li>
<li>Is <code>xen_blkfront.max_ring_page_order=3</code> considered safe and recommended with this backend?</li>
<li>Could increasing the ring size reduce the probability of this failure, or would it only mask it temporarily?</li>
<li>Is the fact that persistent grants and indirect descriptors are not negotiated relevant?</li>
<li>Are there additional tapdisk, xenstore, event-channel, or ring diagnostics that we should enable before the next incident?</li>
<li>Are there candidate packages or patches that would be useful to test on one canary host?</li>
<li>Could the use of a multi-terabyte QCOW2 VDI on an LVM SR be relevant to this failure mode?</li>
</ol>
<p dir="auto">We can provide the complete blk-mq request list, xenstore frontend/backend trees, tapdisk statistics, and sanitized host logs if useful.</p>
<p dir="auto">Thank you.</p>
]]></description><link>https://xcp-ng.org/forum/topic/12362/intermittent-xen-blkfront-i-o-stalls-all-guest-tags-busy-while-tapdisk-reports-zero-outstanding-requests</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Jul 2026 11:34:09 GMT</lastBuildDate><atom:link href="https://xcp-ng.org/forum/topic/12362.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 15 Jul 2026 09:17:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Intermittent Xen blkfront I/O stalls: all guest tags busy while tapdisk reports zero outstanding requests on Wed, 15 Jul 2026 09:22:04 GMT]]></title><description><![CDATA[<p dir="auto">Ping <a class="plugin-mentions-group plugin-mentions-a" href="/forum/groups/team-storage" aria-label="Profile: Team-Storage">@<bdi>Team-Storage</bdi></a></p>
]]></description><link>https://xcp-ng.org/forum/post/106935</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/106935</guid><dc:creator><![CDATA[olivierlambert]]></dc:creator><pubDate>Wed, 15 Jul 2026 09:22:04 GMT</pubDate></item></channel></rss>