LKML Archive on lore.kernel.org
 help / color / Atom feed
From: Minchan Kim <minchan@kernel.org>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
	linux-kernel@vger.kernel.org, mhocko@suse.com, jannh@google.com,
	vbabka@suse.cz, dancol@google.com, joel@joelfernandes.org,
	akpm@linux-foundation.org
Subject: Re: [PATCH 2/2] mm/madvise: skip MADV_PAGEOUT on shared swap cache pages
Date: Thu, 26 Mar 2020 23:42:44 -0700
Message-ID: <20200327064244.GA80572@google.com> (raw)
In-Reply-To: <23ed6b05-3dd4-5683-a1d3-57d67a180c77@intel.com>

On Thu, Mar 26, 2020 at 04:00:09PM -0700, Dave Hansen wrote:
> On 3/25/20 11:28 PM, Minchan Kim wrote:
> >> diff -puN mm/madvise.c~madv-pageout-ignore-shared-swap-cache mm/madvise.c
> >> --- a/mm/madvise.c~madv-pageout-ignore-shared-swap-cache	2020-03-23 16:30:52.022385888 -0700
> >> +++ b/mm/madvise.c	2020-03-23 16:41:15.448384333 -0700
> >> @@ -261,6 +261,7 @@ static struct page *pte_get_reclaim_page
> >>  {
> >>  	swp_entry_t entry;
> >>  	struct page *page;
> >> +	int nr_page_references = 0;
> > nit: just 'referenced' would be enough.
> 
> I guess I could track one bit like that.  But, it would require checking
> both page_mapcount() and page_swapcount() for being >1.  This way, I
> just accumulate the count and have a check at a single place.
> 
> I think it ends up much simpler this way.

I meant the variable name. 'referenced' would be enough for indication
like rmap.c and khugepaged.c. Anyway, it's up to you.

      reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-23 23:41 [PATCH 0/2] mm/madvise: teach MADV_PAGEOUT about swap cache Dave Hansen
2020-03-23 23:41 ` [PATCH 1/2] mm/madvise: help MADV_PAGEOUT to find swap cache pages Dave Hansen
2020-03-26  6:24   ` Minchan Kim
2020-03-23 23:41 ` [PATCH 2/2] mm/madvise: skip MADV_PAGEOUT on shared " Dave Hansen
2020-03-26  6:28   ` Minchan Kim
2020-03-26 23:00     ` Dave Hansen
2020-03-27  6:42       ` Minchan Kim [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=20200327064244.GA80572@google.com \
    --to=minchan@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=dancol@google.com \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=jannh@google.com \
    --cc=joel@joelfernandes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@suse.com \
    --cc=vbabka@suse.cz \
    /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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lkml.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lkml.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lkml.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lkml.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lkml.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lkml.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lkml.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lkml.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lkml.kernel.org/lkml/8 lkml/git/8.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lkml.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git