linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Shakeel Butt <shakeelb@google.com>
To: Hugh Dickins <hughd@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Alex Shi <alex.shi@linux.alibaba.com>,
	 Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@suse.com>,
	 Mike Kravetz <mike.kravetz@oracle.com>,
	Matthew Wilcox <willy@infradead.org>, Qian Cai <cai@lca.pw>,
	 Chris Wilson <chris@chris-wilson.co.uk>,
	Kuo-Hsin Yang <vovoy@chromium.org>,
	 LKML <linux-kernel@vger.kernel.org>,
	Linux MM <linux-mm@kvack.org>
Subject: Re: [PATCH 4/5] mm: fix check_move_unevictable_pages() on THP
Date: Mon, 31 Aug 2020 07:44:33 -0700	[thread overview]
Message-ID: <CALvZod793qTH_i82nrcFCuyXVW2YoDDqcRoXrgkEd2E2_7rTrA@mail.gmail.com> (raw)
In-Reply-To: <alpine.LSU.2.11.2008301405000.5954@eggly.anvils>

On Sun, Aug 30, 2020 at 2:08 PM Hugh Dickins <hughd@google.com> wrote:
>
> check_move_unevictable_pages() is used in making unevictable shmem pages
> evictable: by shmem_unlock_mapping(), drm_gem_check_release_pagevec() and
> i915/gem check_release_pagevec().  Those may pass down subpages of a huge
> page, when /sys/kernel/mm/transparent_hugepage/shmem_enabled is "force".
>
> That does not crash or warn at present, but the accounting of vmstats
> unevictable_pgs_scanned and unevictable_pgs_rescued is inconsistent:
> scanned being incremented on each subpage, rescued only on the head
> (since tails already appear evictable once the head has been updated).
>
> 5.8 commit 5d91f31faf8e ("mm: swap: fix vmstats for huge page") has
> established that vm_events in general (and unevictable_pgs_rescued in
> particular) should count every subpage: so follow that precedent here.
>
> Do this in such a way that if mem_cgroup_page_lruvec() is made stricter
> (to check page->mem_cgroup is always set), no problem: skip the tails
> before calling it, and add thp_nr_pages() to vmstats on the head.
>
> Signed-off-by: Hugh Dickins <hughd@google.com>

Thanks for catching this.

Reviewed-by: Shakeel Butt <shakeelb@google.com>


  reply	other threads:[~2020-08-31 14:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-30 20:57 [PATCH 0/5] mm: fixes to past from future testing Hugh Dickins
2020-08-30 20:59 ` [PATCH 1/5] ksm: reinstate memcg charge on copied pages Hugh Dickins
2020-08-31 14:40   ` Shakeel Butt
2020-09-01 15:01   ` Johannes Weiner
2020-08-30 21:01 ` [PATCH 2/5] mm: migration of hugetlbfs page skip memcg Hugh Dickins
2020-08-31 14:40   ` Shakeel Butt
2020-09-01 15:02   ` Johannes Weiner
2020-08-30 21:08 ` [PATCH 4/5] mm: fix check_move_unevictable_pages() on THP Hugh Dickins
2020-08-31 14:44   ` Shakeel Butt [this message]
2020-09-01  2:04   ` Alex Shi
2020-09-01  3:59     ` Hugh Dickins
2020-09-01 15:57   ` Yang Shi
2020-08-30 21:09 ` [PATCH 5/5] mlock: fix unevictable_pgs event counts " Hugh Dickins
2020-08-31 14:45   ` Shakeel Butt
2020-09-01 15:41   ` Yang Shi
2020-09-01  2:28 ` [PATCH 0/5] mm: fixes to past from future testing Alex Shi
2020-09-01  4:08   ` Hugh Dickins

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=CALvZod793qTH_i82nrcFCuyXVW2YoDDqcRoXrgkEd2E2_7rTrA@mail.gmail.com \
    --to=shakeelb@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex.shi@linux.alibaba.com \
    --cc=cai@lca.pw \
    --cc=chris@chris-wilson.co.uk \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=mike.kravetz@oracle.com \
    --cc=vovoy@chromium.org \
    --cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).