From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
To: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
cgroups@vger.kernel.org
Cc: Michal Hocko <mhocko@suse.com>, Roman Gushchin <guro@fb.com>,
Johannes Weiner <hannes@cmpxchg.org>
Subject: [PATCH v1 7/7] mm/mlock: recharge mlocked pages at culling by vmscan
Date: Wed, 04 Sep 2019 16:53:22 +0300 [thread overview]
Message-ID: <156760520240.6560.4933207338618527335.stgit@buzz> (raw)
In-Reply-To: <156760509382.6560.17364256340940314860.stgit@buzz>
If mlock cannot catch page in LRU then it isn't moved into unevictable lru.
These pages are 'culled' by reclaimer and moved into unevictable lru.
It seems pages locked with MLOCK_ONFAULT always go through this path.
Reclaimer calls try_to_unmap for already isolated pages, thus on this path
we could freely change page to owner of any mlock vma we found in rmap.
This patch passes flag TTU_LRU_ISOLATED into try_to_ummap to move pages
in mmlock_vma_page().
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
---
mm/vmscan.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index bf7a05e8a717..2060f254dd6b 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1345,7 +1345,8 @@ static unsigned long shrink_page_list(struct list_head *page_list,
* processes. Try to unmap it here.
*/
if (page_mapped(page)) {
- enum ttu_flags flags = ttu_flags | TTU_BATCH_FLUSH;
+ enum ttu_flags flags = ttu_flags | TTU_BATCH_FLUSH |
+ TTU_LRU_ISOLATED;
if (unlikely(PageTransHuge(page)))
flags |= TTU_SPLIT_HUGE_PMD;
next prev parent reply other threads:[~2019-09-04 13:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-04 13:53 [PATCH v1 0/7] mm/memcontrol: recharge mlocked pages Konstantin Khlebnikov
2019-09-04 13:53 ` [PATCH v1 1/7] mm/memcontrol: move locking page out of mem_cgroup_move_account Konstantin Khlebnikov
2019-09-04 13:53 ` [PATCH v1 2/7] mm/memcontrol: add mem_cgroup_recharge Konstantin Khlebnikov
2019-09-04 13:53 ` [PATCH v1 3/7] mm/mlock: add vma argument for mlock_vma_page() Konstantin Khlebnikov
2019-09-04 13:53 ` [PATCH v1 4/7] mm/mlock: recharge memory accounting to first mlock user Konstantin Khlebnikov
2019-09-04 13:53 ` [PATCH v1 5/7] mm/mlock: recharge memory accounting to second mlock user at munlock Konstantin Khlebnikov
2019-09-04 13:53 ` [PATCH v1 6/7] mm/vmscan: allow changing page memory cgroup during reclaim Konstantin Khlebnikov
2019-09-04 13:53 ` Konstantin Khlebnikov [this message]
2019-09-04 14:37 ` [PATCH v1 0/7] mm/memcontrol: recharge mlocked pages Michal Hocko
2019-09-05 7:38 ` Konstantin Khlebnikov
2019-09-05 23:11 ` Roman Gushchin
2019-09-04 23:13 ` Roman Gushchin
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=156760520240.6560.4933207338618527335.stgit@buzz \
--to=khlebnikov@yandex-team.ru \
--cc=cgroups@vger.kernel.org \
--cc=guro@fb.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.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).