[lkml]   [2012]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: virtio(-scsi) vs. chained sg_lists (was Re: [PATCH] scsi: virtio-scsi: Fix address translation failure of HighMem pages used by sg list)
    Il 30/07/2012 01:50, Rusty Russell ha scritto:
    >> Also, being the first user of chained scatterlist doesn't exactly give
    >> me warm fuzzies.
    > We're far from the first user: they've been in the kernel for well over
    > 7 years. They were introduced for the block layer, but they tended to
    > ignore private uses of scatterlists like this one.

    Yeah, but sg_chain has no users in drivers, only a private one in
    lib/scatterlist.c. The internal API could be changed to something else
    and leave virtio-scsi screwed...

    > Yes, we should do this. But note that this means an iteration, so we
    > might as well combine the loops :)

    I'm really bad at posting pseudo-code, but you can count the number of
    physically-contiguous entries at the beginning of the list only. So if
    everything is contiguous, you use a single non-indirect buffer and save
    a kmalloc. If you use indirect buffers, I suspect it's much less
    effective to collapse physically-contiguous entries. More elaborate
    heuristics do need a loop, though.


     \ /
      Last update: 2012-07-30 10:01    [W:0.022 / U:3.124 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site