From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f200.google.com (mail-pf0-f200.google.com [209.85.192.200]) by kanga.kvack.org (Postfix) with ESMTP id CE8116B0294 for ; Mon, 24 Oct 2016 20:15:18 -0400 (EDT) Received: by mail-pf0-f200.google.com with SMTP id r16so132118889pfg.4 for ; Mon, 24 Oct 2016 17:15:18 -0700 (PDT) Received: from mga02.intel.com (mga02.intel.com. [134.134.136.20]) by mx.google.com with ESMTPS id yp2si14986861pab.121.2016.10.24.17.15.18 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 24 Oct 2016 17:15:18 -0700 (PDT) From: "Kirill A. Shutemov" Subject: [PATCHv4 16/43] filemap: handle huge pages in filemap_fdatawait_range() Date: Tue, 25 Oct 2016 03:13:15 +0300 Message-Id: <20161025001342.76126-17-kirill.shutemov@linux.intel.com> In-Reply-To: <20161025001342.76126-1-kirill.shutemov@linux.intel.com> References: <20161025001342.76126-1-kirill.shutemov@linux.intel.com> Sender: owner-linux-mm@kvack.org List-ID: To: Theodore Ts'o , Andreas Dilger , Jan Kara , Andrew Morton Cc: Alexander Viro , Hugh Dickins , Andrea Arcangeli , Dave Hansen , Vlastimil Babka , Matthew Wilcox , Ross Zwisler , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org, "Kirill A. Shutemov" We writeback whole huge page a time. Signed-off-by: Kirill A. Shutemov --- mm/filemap.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mm/filemap.c b/mm/filemap.c index 954720092cf8..ecf5c2dba3fb 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -509,9 +509,14 @@ static int __filemap_fdatawait_range(struct address_space *mapping, if (page->index > end) continue; + page = compound_head(page); wait_on_page_writeback(page); if (TestClearPageError(page)) ret = -EIO; + if (PageTransHuge(page)) { + index = page->index + HPAGE_PMD_NR; + i += index - pvec.pages[i]->index - 1; + } } pagevec_release(&pvec); cond_resched(); -- 2.9.3 -- 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