[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161011154031.GK6952@quack2.suse.cz>
Date: Tue, 11 Oct 2016 17:40:31 +0200
From: Jan Kara <jack@...e.cz>
To: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
Cc: Theodore Ts'o <tytso@....edu>,
Andreas Dilger <adilger.kernel@...ger.ca>,
Jan Kara <jack@...e.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Hugh Dickins <hughd@...gle.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Dave Hansen <dave.hansen@...el.com>,
Vlastimil Babka <vbabka@...e.cz>,
Matthew Wilcox <willy@...radead.org>,
Ross Zwisler <ross.zwisler@...ux.intel.com>,
linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
linux-block@...r.kernel.org
Subject: Re: [PATCHv3 11/41] thp: try to free page's buffers before attempt
split
On Thu 15-09-16 14:54:53, Kirill A. Shutemov wrote:
> We want page to be isolated from the rest of the system before spliting
> it. We rely on page count to be 2 for file pages to make sure nobody
> uses the page: one pin to caller, one to radix-tree.
>
> Filesystems with backing storage can have page count increased if it has
> buffers.
>
> Let's try to free them, before attempt split. And remove one guarding
> VM_BUG_ON_PAGE().
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
...
> @@ -2041,6 +2041,23 @@ int split_huge_page_to_list(struct page *page, struct list_head *list)
> goto out;
> }
>
> + /* Try to free buffers before attempt split */
> + if (!PageSwapBacked(head) && PagePrivate(page)) {
> + /*
> + * We cannot trigger writeback from here due possible
> + * recursion if triggered from vmscan, only wait.
> + *
> + * Caller can trigger writeback it on its own, if safe.
> + */
> + wait_on_page_writeback(head);
> +
> + if (page_has_buffers(head) &&
> + !try_to_free_buffers(head)) {
> + ret = -EBUSY;
> + goto out;
> + }
Shouldn't you rather use try_to_release_page() here? Because filesystems
have their ->releasepage() callbacks for freeing data associated with a
page. It is not guaranteed page private data are buffers although it is
true for ext4...
Honza
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists