From: Michal Hocko <mhocko@kernel.org>
To: Minchan Kim <minchan@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, shli@fb.com,
hillf.zj@alibaba-inc.com, hughd@google.com,
mgorman@techsingularity.net, riel@redhat.com,
mm-commits@vger.kernel.org
Subject: Re: + mm-reclaim-madv_free-pages.patch added to -mm tree
Date: Tue, 7 Mar 2017 10:58:33 +0100 [thread overview]
Message-ID: <20170307095833.GB28642@dhcp22.suse.cz> (raw)
In-Reply-To: <20170307055551.GC29458@bbox>
On Tue 07-03-17 14:55:51, Minchan Kim wrote:
[...]
> >From d42d296950c3bbce74afddcff307fa18eef305fe Mon Sep 17 00:00:00 2001
> From: Minchan Kim <minchan@kernel.org>
> Date: Tue, 7 Mar 2017 14:48:37 +0900
> Subject: [PATCH] mm: fix lazyfree bug on check in try_to_unmap_one
>
> If a page is swapbacked, it means it should be in swapcache
> in try_to_unmap_one's path.
>
> If a page is !swapbacked, it mean it shouldn't be in swapcache
> in try_to_unmap_one's path.
>
> Check both two cases all at once and if it fails, warn and
> return SWAP_FAIL. Such bug never mean we should shut down
> the kernel.
>
> Suggested-by: Johannes Weiner <hannes@cmpxchg.org>
> Signed-off-by: Minchan Kim <minchan@kernel.org>
looks good to me
Acked-by: Michal Hocko <mhocko@suse.com>
> ---
> mm/rmap.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/mm/rmap.c b/mm/rmap.c
> index 35acb83..9925f32 100644
> --- a/mm/rmap.c
> +++ b/mm/rmap.c
> @@ -1413,8 +1413,13 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
> * Store the swap location in the pte.
> * See handle_pte_fault() ...
> */
> - VM_BUG_ON_PAGE(!PageSwapCache(page) && PageSwapBacked(page),
> - page);
> + if (VM_WARN_ON_ONCE(PageSwapBacked(page) !=
> + PageSwapCache(page))) {
> + ret = SWAP_FAIL;
> + page_vma_mapped_walk_done(&pvmw);
> + break;
> +
> + }
>
> /* MADV_FREE page check */
> if (!PageSwapBacked(page)) {
> --
> 2.7.4
>
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2017-03-07 9:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <58b616a6.hCl1D/BVn0fPDi+K%akpm@linux-foundation.org>
2017-03-03 2:52 ` Minchan Kim
2017-03-03 15:18 ` Johannes Weiner
2017-03-06 3:03 ` Minchan Kim
2017-03-06 15:49 ` Johannes Weiner
2017-03-07 5:46 ` Minchan Kim
2017-03-07 5:55 ` Minchan Kim
2017-03-07 9:58 ` Michal Hocko [this message]
2017-03-07 16:59 ` Johannes Weiner
2017-03-03 16:02 ` Shaohua Li
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=20170307095833.GB28642@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hillf.zj@alibaba-inc.com \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@techsingularity.net \
--cc=minchan@kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=riel@redhat.com \
--cc=shli@fb.com \
/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
all inboxes | Powered by JetHome®