Il 12/03/2013 12:51, Peter Lieven ha scritto: >> > buffer_is_zero is used in somewhat special cases (block >> > streaming/copy-on-read) where throughput doesn't really matter, unlike >> > is_dup_page/find_zero_bit which are used in migration. But you can use >> > similar code for is_dup_page and buffer_is_zero. > ok, i will prepare a patch series for review. at the moment without touching > is_dup_page(). you can decide later if you use buffer_Is_zero to check > for zero pages later (maybe if the first x-bit are zero). > > Two comments on changing is_dup_page() to is_zero_page(): > a) Would it make sense to only check for zero pages in the first (bulk) round?
Interesting idea. Benchmark it. :) > b) Would it make sense to not transfer zero pages at all in the first round? Perhaps yes, but I'm not sure how to efficiently implement it. There really isn't a well-specified first round in the RAM migration code. Of course you could have another bitmap for known-zero pages. But zero pages should be rare in real-world testcases, except for ballooned pages. The OS should try to use free memory for caches. > The memory at the target should read as zero (not allocated) anyway. Paolo