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