Re: [PATCH] 2.6.14 patch for supporting madvise(MADV_REMOVE)

From: Andrew Morton
Date: Fri Nov 11 2005 - 20:43:56 EST


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.

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.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/