From: Andrew Morton <akpm@linux-foundation.org>
To: Minchan Kim <minchan@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Hugh Dickins <hughd@google.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Rik van Riel <riel@redhat.com>, Jason Evans <je@fb.com>,
Daniel Micay <danielmicay@gmail.com>,
"Kirill A. Shutemov" <kirill@shutemov.name>,
Shaohua Li <shli@kernel.org>, Michal Hocko <mhocko@suse.cz>,
yalin.wang2010@gmail.com
Subject: Re: [PATCH] mm: account pglazyfreed exactly
Date: Fri, 4 Dec 2015 16:51:16 -0800 [thread overview]
Message-ID: <20151204165116.e878bc3de8e461f7f020312a@linux-foundation.org> (raw)
In-Reply-To: <1449147064-1345-1-git-send-email-minchan@kernel.org>
On Thu, 3 Dec 2015 21:51:04 +0900 Minchan Kim <minchan@kernel.org> wrote:
> If anon pages are zapped by unmapping between page_mapped check
> and try_to_unmap in shrink_page_list, they could be !PG_dirty
> although thre are not MADV_FREEed pages so that VM accoutns it
> as pglazyfreed wrongly.
>
> To fix, this patch counts the number of lazyfree ptes in
> try_to_unmap_one and try_to_unmap returns SWAP_LZFREE only if
> the count is not zero, page is !PG_dirty and SWAP_SUCCESS.
A few tiny things...
diff -puN mm/rmap.c~mm-support-madvisemadv_free-fix-2-fix mm/rmap.c
--- a/mm/rmap.c~mm-support-madvisemadv_free-fix-2-fix
+++ a/mm/rmap.c
@@ -1605,7 +1605,7 @@ int try_to_unmap(struct page *page, enum
struct rmap_walk_control rwc = {
.rmap_one = try_to_unmap_one,
- .arg = (void *)&rp,
+ .arg = &rp,
.done = page_not_mapped,
.anon_lock = page_lock_anon_vma_read,
};
@@ -1651,7 +1651,6 @@ int try_to_unmap(struct page *page, enum
int try_to_munlock(struct page *page)
{
int ret;
-
struct rmap_private rp = {
.flags = TTU_MUNLOCK,
.lazyfreed = 0,
@@ -1659,7 +1658,7 @@ int try_to_munlock(struct page *page)
struct rmap_walk_control rwc = {
.rmap_one = try_to_unmap_one,
- .arg = (void *)&rp,
+ .arg = &rp,
.done = page_not_mapped,
.anon_lock = page_lock_anon_vma_read,
diff -puN mm/vmscan.c~mm-support-madvisemadv_free-fix-2-fix mm/vmscan.c
_
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2015-12-05 0:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-03 12:51 [PATCH] mm: account pglazyfreed exactly Minchan Kim
2015-12-05 0:51 ` Andrew Morton [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=20151204165116.e878bc3de8e461f7f020312a@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=danielmicay@gmail.com \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=je@fb.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.cz \
--cc=minchan@kernel.org \
--cc=riel@redhat.com \
--cc=shli@kernel.org \
--cc=yalin.wang2010@gmail.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;
as well as URLs for NNTP newsgroup(s).