Re: [PATCH] drop_caches: Allow unmapping pages

2019-01-07 Thread Matthew Wilcox
On Mon, Jan 07, 2019 at 11:25:16AM -0800, Dave Hansen wrote: > On 1/7/19 6:15 AM, Matthew Wilcox wrote: > > You're going to get data corruption doing this. try_to_unmap_one() > > does: > > > > /* Move the dirty bit to the page. Now the pte is gone. */ > > if (pte_dirty(pteval))

Re: [PATCH] drop_caches: Allow unmapping pages

2019-01-07 Thread Dave Hansen
On 1/7/19 6:15 AM, Matthew Wilcox wrote: > You're going to get data corruption doing this. try_to_unmap_one() > does: > > /* Move the dirty bit to the page. Now the pte is gone. */ > if (pte_dirty(pteval)) > set_page_dirty(page); > > so PageDirty() can be false

Re: [PATCH] drop_caches: Allow unmapping pages

2019-01-07 Thread Matthew Wilcox
On Mon, Jan 07, 2019 at 02:02:39PM +0100, Vincent Whitchurch wrote: > +++ b/Documentation/sysctl/vm.txt > @@ -222,6 +222,10 @@ To increase the number of objects freed by this > operation, the user may run > number of dirty objects on the system and create more candidates to be > dropped. > > +

[PATCH] drop_caches: Allow unmapping pages

2019-01-07 Thread Vincent Whitchurch
drop_caches does not drop pages which are currently mapped. Add an option to try to unmap and drop even these pages. This provides a simple way to obtain a rough estimate of how many file pages are used in a particular use case: drop everything and check how much gets read back. # cat /proc/mem