From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 17 Oct 2017 16:05:21 -0700 From: Andrew Morton To: Jan Kara Cc: , Mel Gorman , "Kirill A. Shutemov" , Subject: Re: [PATCH 7/7] mm: Batch radix tree operations when truncating pages Message-Id: <20171017160521.33ca85c45431c355833daa63@linux-foundation.org> In-Reply-To: <20171010151937.26984-8-jack@suse.cz> References: <20171010151937.26984-1-jack@suse.cz> <20171010151937.26984-8-jack@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: On Tue, 10 Oct 2017 17:19:37 +0200 Jan Kara 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. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org