linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@surriel.com>
To: Huang Ying <ying.huang@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Matthew Wilcox <willy@infradead.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Xu <peterx@redhat.com>, Hugh Dickins <hughd@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Mel Gorman <mgorman@suse.de>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Michal Hocko <mhocko@kernel.org>,
	Dave Hansen <dave.hansen@intel.com>,
	Tim Chen <tim.c.chen@intel.com>
Subject: Re: [PATCH] mm: move idle swap cache pages to the tail of LRU after COW
Date: Tue, 18 May 2021 22:12:42 -0400	[thread overview]
Message-ID: <7b2525ba7871e6b8ce3f48cfd2375804a6791a94.camel@surriel.com> (raw)
In-Reply-To: <20210519013313.1274454-1-ying.huang@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1066 bytes --]

On Wed, 2021-05-19 at 09:33 +0800, Huang Ying wrote:

> To test the patch, we used pmbench memory accessing benchmark with
> working-set larger than available memory on a 2-socket Intel server
> with a NVMe SSD as swap device.  Test results shows that the pmbench
> score increases up to 21.8% with the decreased size of swap cache and
> swapin throughput.

Nice!

> +++ b/mm/memory.c
> @@ -3012,6 +3012,11 @@ static vm_fault_t wp_page_copy(struct vm_fault
> *vmf)
>  				munlock_vma_page(old_page);
>  			unlock_page(old_page);
>  		}
> +		if (page_copied && PageSwapCache(old_page) &&
> +		    !page_mapped(old_page) && trylock_page(old_page)) {
> +			try_to_free_idle_swapcache(old_page);
> +			unlock_page(old_page);
> +		}

That's quite the if condition!

Would it make sense to move some of the tests, as well
as the trylock and unlock into try_to_free_idle_swapcache()
itself?

Especially considering that page_mapped is already tested
in that function, too...

>  		put_page(old_page);
>  	}



-- 
All Rights Reversed.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2021-05-19  2:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19  1:33 Huang Ying
2021-05-19  2:12 ` Rik van Riel [this message]
2021-05-19  4:56   ` Huang, Ying
2021-05-19  3:17 ` Linus Torvalds
2021-05-19  3:25   ` Linus Torvalds
2021-05-19  4:49     ` Huang, Ying
2021-05-19 14:49 ` Johannes Weiner
2021-05-20  1:22   ` Huang, Ying
2021-05-20  1:46     ` Johannes Weiner
2021-05-20  1:59       ` Huang, Ying
2021-05-20 17:49         ` Johannes Weiner
2021-05-21  2:05           ` Huang, Ying

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=7b2525ba7871e6b8ce3f48cfd2375804a6791a94.camel@surriel.com \
    --to=riel@surriel.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@intel.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@kernel.org \
    --cc=peterx@redhat.com \
    --cc=tim.c.chen@intel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=willy@infradead.org \
    --cc=ying.huang@intel.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