Re: About refault distance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]