> > LVM does (that is where the bug was discovered). Basically, it scans all
LVM must not allocate any memory when doing IO because it suspends the
block device and memory allocation could trigger writeback on the
suspended device and deadlock.
So it preallocates heap and stack, mlockall()s itself and does direct IO.
Well, there are still two allocations on direct IO path --- one in
__blockdev_direct_IO and the other in dio_bio_alloc. If you have an idea
how to get rid of them (especially that kzalloc(sizeof(*dio), GFP_KERNEL),
that bio allocation would be quite easy to avoid), it would be benefical.
Mikulas
--