linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@surriel.com>
To: huang ying <huang.ying.caritas@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org, kernel-team@fb.com,  niketa@fb.com,
	Andrew Morton <akpm@linux-foundation.org>,
	Seth Jennings <sjenning@redhat.com>,
	Dan Streetman <ddstreet@ieee.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Huang Ying <ying.huang@intel.com>
Subject: Re: [PATCH 2/2] mm,swap: skip swap readahead if page was obtained instantaneously
Date: Tue, 22 Sep 2020 07:33:04 -0400	[thread overview]
Message-ID: <f196b291874bad247315174fadebeaaf2426d986.camel@surriel.com> (raw)
In-Reply-To: <CAC=cRTP3Em2C7tRpbFyHztnjAvUMFn-9t1yqFCb=yc3MavpUcg@mail.gmail.com>

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

On Tue, 2020-09-22 at 11:13 +0800, huang ying wrote:
> On Tue, Sep 22, 2020 at 10:02 AM Rik van Riel <riel@surriel.com>
> wrote:
> > Check whether a swap page was obtained instantaneously, for example
> > because it is in zswap, or on a very fast IO device which uses busy
> > waiting, and we did not wait on IO to swap in this page.
> > If no IO was needed to get the swap page we want, kicking off
> > readahead
> > on surrounding swap pages is likely to be counterproductive,
> > because the
> > extra loads will cause additional latency, use up extra memory, and
> > chances
> > are the surrounding pages in swap are just as fast to load as this
> > one,
> > making readahead pointless.
> > 
> > Signed-off-by: Rik van Riel <riel@surriel.com>
> > ---
> >  mm/swap_state.c | 14 +++++++++++---
> >  1 file changed, 11 insertions(+), 3 deletions(-)
> > 
> > diff --git a/mm/swap_state.c b/mm/swap_state.c
> > index aacb9ba53f63..6919f9d5fe88 100644
> > --- a/mm/swap_state.c
> > +++ b/mm/swap_state.c
> > @@ -637,6 +637,7 @@ static struct page
> > *swap_cluster_read_one(swp_entry_t entry,
> >  struct page *swap_cluster_readahead(swp_entry_t entry, gfp_t
> > gfp_mask,
> >                                 struct vm_fault *vmf)
> 
> Why not do this for swap_vma_readahead()
> too?  swap_cluster_read_one()
> can be used in swap_vma_readahead() too.

Good point, I should do the same thing for swap_vma_readahead()
as well. Let me do that and send in a version 2 of the series.

-- 
All Rights Reversed.

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

  reply	other threads:[~2020-09-22 11:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22  2:01 [PATCH 0/2] mm,swap: skip swap readahead for instant IO (like zswap) Rik van Riel
2020-09-22  2:01 ` [PATCH 1/2] mm,swap: extract swap single page readahead into its own function Rik van Riel
2020-09-23  6:32   ` Christoph Hellwig
2020-09-23  8:02     ` Hillf Danton
2020-09-22  2:01 ` [PATCH 2/2] mm,swap: skip swap readahead if page was obtained instantaneously Rik van Riel
2020-09-22  3:13   ` huang ying
2020-09-22 11:33     ` Rik van Riel [this message]
2020-09-23  6:35   ` Christoph Hellwig
2020-09-22 17:12 ` [PATCH 0/2] mm,swap: skip swap readahead for instant IO (like zswap) Andrew Morton
2020-10-05 17:32   ` Rik van Riel
2020-10-09 14:38     ` Rik van Riel

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=f196b291874bad247315174fadebeaaf2426d986.camel@surriel.com \
    --to=riel@surriel.com \
    --cc=akpm@linux-foundation.org \
    --cc=ddstreet@ieee.org \
    --cc=hannes@cmpxchg.org \
    --cc=huang.ying.caritas@gmail.com \
    --cc=kernel-team@fb.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=niketa@fb.com \
    --cc=sjenning@redhat.com \
    --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