linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Zhang, Tianfei" <tianfei.zhang@intel.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: RE: About refault distance
Date: Mon, 21 Jul 2014 03:27:49 +0000	[thread overview]
Message-ID: <BA6F50564D52C24884F9840E07E32DEC17D5DAE1@CDSMSX102.ccr.corp.intel.com> (raw)
In-Reply-To: <20140718151446.GI29639@cmpxchg.org>

> 
> On Wed, Jul 16, 2014 at 01:53:55AM +0000, Zhang, Tianfei wrote:
> > Hi Johannes,
> >
> > May I ask you a question about refault distance?
> >
> > Is it supposed the distance of the first and second time to access the
> > a faulted page cache is the same? In reality how about the ratio will be the
> same?
> >
> >             Refault Distance1 = Refault Distance2
> >
> > On the first refault, We supposed that:
> >             Refault Distance = A
> >             NR_INACTIVE_FILE = B
> >             NR_ACTIVE_FILE = C
> >
> > *                  fault page add to inactive list tail
> >                     The Refault Distance  = A
> >                           |
> >  *                   B     |        |            C
> > *              +--------------+   |            +-------------+
> > *   reclaim <- |   inactive   | <-+-- demotion |    active   | <--+
> > *              +--------------+                +-------------+    |
> > *                     |
> |
> > *                     +-------------- promotion ------------------+
> >
> >
> > Why we use A <= C to add faulted page to ACTIVE LIST?
> >
> > Your patch is want to solve "A workload is thrashing when its pages
> > are frequently used but they are evicted from the inactive list every
> > time before another access would have promoted them to the active list." ?
> >
> > so when a First Refault page add to INACTIVE LIST, it is a Distance B before
> eviction.
> > So I am confuse the condition on workingset_refault().
> 
> The reuse distance of a page is B + A.  B + C is the available memory overall.
> When a page refaults, we want to compare its reuse distance to overall
> memory to see if it is eligible for activation (= accessed twice while in memory).
> That check would be A + B <= B + C.  But we can simply drop B on both sides
> and get A <= C.

Thank you very much, it is more clear explanation than comments of code (workingset.c).

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2014-07-21  3:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16  1:53 Zhang, Tianfei
2014-07-18 15:14 ` Johannes Weiner
2014-07-21  3:27   ` Zhang, Tianfei [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=BA6F50564D52C24884F9840E07E32DEC17D5DAE1@CDSMSX102.ccr.corp.intel.com \
    --to=tianfei.zhang@intel.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.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