[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2b19b3c4-2bc4-15fa-15cc-27a13e5c7af1@aol.com>
Date: Fri, 14 Dec 2018 20:26:28 +0800
From: Gao Xiang <hsiangkao@....com>
To: Richard Weinberger <richard@....at>
Cc: zhangjun <openzhangj@...il.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
"Darrick J . Wong" <darrick.wong@...cle.com>, hch@....de,
bfoster@...hat.com, Dave Chinner <david@...morbit.com>,
akpm@...ux-foundation.org, kirill.shutemov@...ux.intel.com,
mhocko@...e.com, n-horiguchi@...jp.nec.com,
mgorman@...hsingularity.net, aarcange@...hat.com,
willy@...radead.org, linux@...inikbrodowski.net,
linux-mm@...ck.org, Gao Xiang <gaoxiang25@...wei.com>
Subject: Re: [PATCH] fix page_count in ->iomap_migrate_page()
Hi Richard,
On 2018/12/14 19:25, Richard Weinberger wrote:
> This is the third place which needs this workaround.
> UBIFS, F2FS, and now iomap.
>
> I agree with Dave that nobody can assume that PG_private implies an additional
> page reference.
> But page migration does that. Including parts of the write back code.
It seems that it's clearly documented in
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/mm.h#n780
* A pagecache page contains an opaque `private' member, which belongs to the
* page's address_space. Usually, this is the address of a circular list of
* the page's disk buffers. PG_private must be set to tell the VM to call
* into the filesystem to release these pages.
*
* A page may belong to an inode's memory mapping. In this case, page->mapping
* is the pointer to the inode, and page->index is the file offset of the page,
* in units of PAGE_SIZE.
*
* If pagecache pages are not associated with an inode, they are said to be
* anonymous pages. These may become associated with the swapcache, and in that
* case PG_swapcache is set, and page->private is an offset into the swapcache.
*
* In either case (swapcache or inode backed), the pagecache itself holds one
* reference to the page. Setting PG_private should also increment the
* refcount. The each user mapping also has a reference to the page.
and when I looked into that, I found
https://lore.kernel.org/lkml/3CB3CA93.D141680B@zip.com.au/
Thanks,
Gao Xiang
Powered by blists - more mailing lists