From: Johannes Weiner <hannes@cmpxchg.org>
To: "Zhang, Tianfei" <tianfei.zhang@intel.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: About refault distance
Date: Fri, 18 Jul 2014 11:14:46 -0400 [thread overview]
Message-ID: <20140718151446.GI29639@cmpxchg.org> (raw)
In-Reply-To: <BA6F50564D52C24884F9840E07E32DEC17D58E35@CDSMSX102.ccr.corp.intel.com>
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.
--
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>
next prev parent reply other threads:[~2014-07-18 15:14 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 [this message]
2014-07-21 3:27 ` Zhang, Tianfei
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=20140718151446.GI29639@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=linux-mm@kvack.org \
--cc=tianfei.zhang@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