On Tue, 10 Oct 2017 17:19:37 +0200 Jan Kara <jack@xxxxxxx> wrote: > --- a/mm/truncate.c > +++ b/mm/truncate.c > @@ -294,6 +294,14 @@ void truncate_inode_pages_range(struct address_space *mapping, > while (index < end && pagevec_lookup_entries(&pvec, mapping, index, > min(end - index, (pgoff_t)PAGEVEC_SIZE), > indices)) { > + /* > + * Pagevec array has exceptional entries and we may also fail > + * to lock some pages. So we store pages that can be deleted > + * in an extra array. > + */ > + struct page *pages[PAGEVEC_SIZE]; > + int batch_count = 0; OK, but we could still use a new pagevec here. Then delete_from_page_cache_batch() and page_cache_tree_delete_batch() would take one less argument.