* About refault distance
@ 2014-07-16 1:53 Zhang, Tianfei
2014-07-18 15:14 ` Johannes Weiner
0 siblings, 1 reply; 3+ messages in thread
From: Zhang, Tianfei @ 2014-07-16 1:53 UTC (permalink / raw)
To: hannes@cmpxchg.org; +Cc: linux-mm@kvack.org
[-- Attachment #1: Type: text/plain, Size: 1393 bytes --]
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().
Best,
Figo.zhang
[-- Attachment #2: Type: text/html, Size: 8202 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: About refault distance
2014-07-16 1:53 About refault distance Zhang, Tianfei
@ 2014-07-18 15:14 ` Johannes Weiner
2014-07-21 3:27 ` Zhang, Tianfei
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Weiner @ 2014-07-18 15:14 UTC (permalink / raw)
To: Zhang, Tianfei; +Cc: linux-mm@kvack.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.
--
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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: About refault distance
2014-07-18 15:14 ` Johannes Weiner
@ 2014-07-21 3:27 ` Zhang, Tianfei
0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Tianfei @ 2014-07-21 3:27 UTC (permalink / raw)
To: Johannes Weiner; +Cc: linux-mm@kvack.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>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-07-21 3:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-16 1:53 About refault distance Zhang, Tianfei
2014-07-18 15:14 ` Johannes Weiner
2014-07-21 3:27 ` Zhang, Tianfei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).