From: Yang Shi <yang.shi@linux.alibaba.com>
To: Hillf Danton <hdanton@sina.com>,
Mel Gorman <mgorman@techsingularity.net>
Cc: linux-mm@kvack.org, Johannes Weiner <hannes@cmpxchg.org>,
Minchan Kim <minchan@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mm: vmscan: Add warn on inadvertently reclaiming mapped page
Date: Mon, 27 May 2019 15:42:21 +0800 [thread overview]
Message-ID: <6168defb-06e3-7e98-3e7d-32c71e654fed@linux.alibaba.com> (raw)
In-Reply-To: <20190526062353.14684-1-hdanton@sina.com>
On 5/26/19 2:23 PM, Hillf Danton wrote:
> In the function isolate_lru_pages(), we check scan_control::may_unmap and set
> isolation mode accordingly in order to not isolate from the lru list any page
> that does not match the isolation mode. For example, we should skip all sill
> mapped pages if isolation mode is set to be ISOLATE_UNMAPPED.
>
> So complain, while scanning the isolated pages, about the very unlikely event
> that we hit a mapped page that we should never have isolated. Note no change
> is added in the current scanning behavior without VM debug configured.
>
> And cut off one line of comment that goes stale.
Looks good to me. Reviewed-by: Yang Shi <yang.shi@linux.alibaba.com>
>
> Cc: Mel Gorman <mgorman@techsingularity.net>
> Cc: Johannes Weiner <hannes@cmpxchg.org>
> Cc: Minchan Kim <minchan@kernel.org>
> Cc: Yang Shi <yang.shi@linux.alibaba.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Hillf Danton <hdanton@sina.com>
> ---
> mm/vmscan.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index d9c3e87..799ad9e 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -1134,8 +1134,10 @@ static unsigned long shrink_page_list(struct list_head *page_list,
> if (unlikely(!page_evictable(page)))
> goto activate_locked;
>
> - if (!sc->may_unmap && page_mapped(page))
> + if (!sc->may_unmap && page_mapped(page)) {
> + VM_WARN_ON(true);
> goto keep_locked;
> + }
>
> /* Double the slab pressure for mapped and swapcache pages */
> if ((page_mapped(page) || PageSwapCache(page)) &&
> @@ -1632,7 +1634,6 @@ static __always_inline void update_lru_sizes(struct lruvec *lruvec,
> * @dst: The temp list to put pages on to.
> * @nr_scanned: The number of pages that were scanned.
> * @sc: The scan_control struct for this reclaim session
> - * @mode: One of the LRU isolation modes
> * @lru: LRU list id for isolating
> *
> * returns how many pages were moved onto *@dst.
> --
next parent reply other threads:[~2019-05-27 7:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190526062353.14684-1-hdanton@sina.com>
2019-05-27 7:42 ` Yang Shi [this message]
2019-05-29 4:22 ` Andrew Morton
2019-05-29 17:01 ` Johannes Weiner
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=6168defb-06e3-7e98-3e7d-32c71e654fed@linux.alibaba.com \
--to=yang.shi@linux.alibaba.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hdanton@sina.com \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=minchan@kernel.org \
/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