zfsonlinux/zfs — pull request #2129 by tuxoko (2014-02-17 04:05:12+00:00)
Title: Move ARC data buffers out of vmalloc

***Warning***
This patchset requires further testing and review.
DO NOT USE IN PRODUCTION.

---
Introduce ABD: linear/scatter dual typed buffer for ARC

zfsolinux currently uses vmalloc backed slab for ARC buffers. There are some
major problems with this approach. One is that 32-bit system have only a
handful of vmalloc space. Another is that the fragmentation in slab will easily
trigger OOM in busy system.

With ABD, we use scatterlist to allocate data buffers. In this approach we can
allocate in HIGHMEM, which alleviates vmalloc space pressure on 32-bit. Also,
we don't have to rely on slab, so there's no fragmentation issue.

But for metadata buffers, we still uses linear buffer from slab. The reason for
this is that there are a lot of *_phys pointers directly point to metadata
buffers. So it's kind of impractical to change all those code. And metadata
should only be a small percentage so we probably don't have to worry about
the 32-bit and fragmentation issue, right?

---
This patchset is divided into the following part:
1. Add compatibility layer for {kmap,kunmap}\_atomic
2. Introduce ABD, but with scatter type disabled
3. Modify checksum implementation for ABD
4. Modify every file which touches abd_t field
5. Enable scatter type ABD