I think the reasonable solution is as follows:
1) Allocate an array of NULL pointers which is NR_CPUs in size (you could do
this all the time, as it would only be a few bytes)
2) If you need to do decompression on a cpu you check the array entry
for that CPU and if is NULL you vmalloc() the decompression buffers once
for that CPU. This avoid vmalloc() overhead for each read.
3) Any allocated buffers are freed in the same manner they are now -
when the last compressed volume is unmounted. There may be some or
all entries that are still NULL.
This also avoids allocating buffers when there are no files which are
actually compressed.
Cheers, Andreas
-- Andreas Dilger http://www-mddsp.enel.ucalgary.ca/People/adilger/ http://sourceforge.net/projects/ext2resize/- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/