Re: [PATCH v2] mm: prototype: rid swapoff of quadratic complexity

2018-12-03 Thread Vineeth Remanan Pillai
Hi Matthew, This seems terribly complicated.  You run through i_pages, record the indices of the swap entries, then go back and look them up again by calling shmem_getpage() which calls the incredibly complex 300 line shmem_getpage_gfp(). Can we refactor shmem_getpage_gfp() to skip some of the

Re: [PATCH v2] mm: prototype: rid swapoff of quadratic complexity

2018-11-26 Thread Vineeth Remanan Pillai
Hi Mathew, Thanks for your response! On 11/26/18 12:22 PM, Matthew Wilcox wrote: On Mon, Nov 26, 2018 at 04:55:21PM +, Vineeth Remanan Pillai wrote: + do { + XA_STATE(xas, &mapping->i_pages, start); + int i; + int entries = 0; +

Re: [PATCH v2] mm: prototype: rid swapoff of quadratic complexity

2018-11-26 Thread Matthew Wilcox
On Mon, Nov 26, 2018 at 04:55:21PM +, Vineeth Remanan Pillai wrote: > + do { > + XA_STATE(xas, &mapping->i_pages, start); > + int i; > + int entries = 0; > + struct page *page; > + pgoff_t indices[PAGEVEC_SIZE]; > + uns

[PATCH v2] mm: prototype: rid swapoff of quadratic complexity

2018-11-26 Thread Vineeth Remanan Pillai
This patch was initially posted by Kelley(kelley...@gmail.com). Reposting the patch with all review comments addressed and with minor modifications and optimizations. Tests were rerun and commit message updated with new results. The function try_to_unuse() is of quadratic complexity, with a lot of