From: Piotr Jaroszynski <pjaroszynski@nvidia.com>
To: Andrew Morton <akpm@linux-foundation.org>, p.jaroszynski@gmail.com
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
Christoph Hellwig <hch@lst.de>,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
Michal Hocko <mhocko@suse.com>
Subject: Re: [PATCH v2] iomap: get/put the page in iomap_page_create/release()
Date: Mon, 3 Dec 2018 16:38:14 -0800 [thread overview]
Message-ID: <5d92664b-1e37-a7ba-8c72-576af887009a@nvidia.com> (raw)
In-Reply-To: <20181203152243.095e6b846fd9f623a339e4ab@linux-foundation.org>
On 12/3/18 3:22 PM, Andrew Morton wrote:
> On Thu, 15 Nov 2018 10:41:40 -0800 p.jaroszynski@gmail.com wrote:
>
>> migrate_page_move_mapping() expects pages with private data set to have
>> a page_count elevated by 1. This is what used to happen for xfs through
>> the buffer_heads code before the switch to iomap in commit 82cb14175e7d
>> ("xfs: add support for sub-pagesize writeback without buffer_heads").
>> Not having the count elevated causes move_pages() to fail on memory
>> mapped files coming from xfs.
>>
>> Make iomap compatible with the migrate_page_move_mapping() assumption
>> by elevating the page count as part of iomap_page_create() and lowering
>> it in iomap_page_release().
>
> What are the real-world end-user effects of this bug?
It causes the move_pages() syscall to misbehave on memory mapped files
from xfs. It does not not move any pages, which I suppose is "just" a
perf issue, but it also ends up returning a positive number which is out
of spec for the syscall. Talking to Michal Hocko, it sounds like
returning positive numbers might be a necessary update to move_pages()
anyway though, see [1].
I only hit this in tests that verify that move_pages() actually moved
the pages. The test also got confused by the positive return from
move_pages() (it got treated as a success as positive numbers were not
expected and not handled) making it a bit harder to track down what's
going on.
>
> Is a -stable backport warranted?
>
I would say yes, but this is my first kernel contribution so others
would be probably better judges of that.
[1] - https://lkml.kernel.org/r/20181116114955.GJ14706@dhcp22.suse.cz
Thanks,
Piotr
prev parent reply other threads:[~2018-12-04 0:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-15 18:41 p.jaroszynski
2018-11-15 21:07 ` William Kucharski
2018-12-03 23:22 ` Andrew Morton
2018-12-04 0:38 ` Piotr Jaroszynski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5d92664b-1e37-a7ba-8c72-576af887009a@nvidia.com \
--to=pjaroszynski@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=p.jaroszynski@gmail.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox