Badari Pulavarty <pbadari@xxxxxxxxxx> wrote:
Why does madvise_remove() have an explicit check for swapper_space?
I really don't remember (I yanked code from some other kernel routine
vmtruncate()).
I don't see such a thing anywhere. vmtruncate() has the IS_SWAPFILE()
test, which I guess vmtruncate_range() ought to have too, for
future-safety.
Will do.
Logically, vmtruncate() should just be a special case of vmtruncate_range().
But it's not - ugly, but hard to do anything about (need to implement
->truncate_range in all filesystems, but "know" which ones only support
->truncate_range() at eof).
In your testing, how are you determining that the code is successfully
removing the correct number of pages, from the correct file offset?
I verified with test programs, added debug printk + looked through live
"crash" session + verified with UML testcases.
OK, well please be sure to test it on 32-bit and 64-bit, operating in three
ranges of the file: <2G, 2G-4G amd >4G.