I've made an update on this patch that consumes 4 times less memory.
This is accomplished by not saving the page (as suggested by Pete Zaitcev
<firstname.lastname@example.org>) and using 16-bit entries if the page size is less
than 16 bits.
On Wed, 4 Feb 2009, Mikulas Patocka wrote:
> This patch should fix bug 472796 in upstream kernel.
Bio layer modifies the vector list when the request partially succeeds.
Device mapper saves and restores various fields in the bio, but it doesn't save
the vector. So, when the block driver modifies the vector on partially succeeded
request, dm-raid1 and dm-multipath will attempt to resubmit a bio that has
mismatching bi_size and the size of vector. That will cause BUG() in the block
To make requests resubmittable in dm-raid1 and dm-multipath, we must save
and restore the bio vector as well.
To consume per-request memory, do not save the pages in a vector.
Also, use only 16-bit field size if the page size is less than 65536.