Project

General

Profile

Bug #12511

vioblk should preallocate virtio chains

Added by Joshua M. Clulow 3 months ago. Updated 4 days ago.

Status:
Closed
Priority:
Normal
Category:
driver - device drivers
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

In vioblk_alloc_reqs(), vioblk makes an effort to preallocate a set of buffers for I/O requests. Unfortunately, in vioblk_common_start() we call the virtio_chain_alloc() routine to allocate memory for the descriptor chain we need to submit these requests into the virtqueue; this routine does dynamic allocations that can fail. We should follow the pattern established in vioif, and allocate the chains when we're initially populating the vib_reqs free list, using virtio_chain_clear() to reset them upon return to the free list.

History

#1

Updated by Patrick Mooney 4 days ago

I have a build VM (running OmniOSce 151034) which has been hit by this recently. An illumos-gate build will place the machine under memory pressure, at which point DMA allocations for swap IO fails and the machine locks up hard.

#2

Updated by Electric Monk 4 days ago

  • Gerrit CR set to 786
#3

Updated by Patrick Mooney 4 days ago

  • Status changed from New to In Progress
  • Assignee set to Patrick Mooney
#4

Updated by Patrick Mooney 4 days ago

I have a test VM using a virtio-block device to back its root (and only) zpool. I booted it up with this change and incurred some various IO:
- cloning a git repo
- scrubbing the pool
- trimming the pool (with the newly landed #12506)
All of these seemed to work without issue. I also NMIed the machine to make sure dump works, which it did. After it came back up, I savecore-ed the crash dump to make sure it looked OK.

#5

Updated by Electric Monk 4 days ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit 3decf16814408c6b0b69d8df1e56e01cd3313a4f

commit  3decf16814408c6b0b69d8df1e56e01cd3313a4f
Author: Patrick Mooney <pmooney@pfmooney.com>
Date:   2020-07-10T18:09:44.000Z

    12511 vioblk should preallocate virtio chains
    Reviewed by: Jason King <jason.king@joyent.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Reviewed by: Andy Fiddaman <andy@omniosce.org>
    Approved by: Joshua M. Clulow <josh@sysmgr.org>

Also available in: Atom PDF