From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753429AbcG2SI6 (ORCPT ); Fri, 29 Jul 2016 14:08:58 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:36105 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752283AbcG2SI4 convert rfc822-to-8bit (ORCPT ); Fri, 29 Jul 2016 14:08:56 -0400 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH] mm: move swap-in anonymous page into active list From: Nadav Amit In-Reply-To: <1469811331.13905.10.camel@redhat.com> Date: Fri, 29 Jul 2016 11:08:53 -0700 Cc: Minchan Kim , Andrew Morton , LKML , "open list:MEMORY MANAGEMENT" , Mel Gorman , Johannes Weiner Content-Transfer-Encoding: 8BIT Message-Id: <39F87A25-801A-48A8-A042-A64861A0229B@gmail.com> References: <1469762740-17860-1-git-send-email-minchan@kernel.org> <1469811331.13905.10.camel@redhat.com> To: Rik van Riel X-Mailer: Apple Mail (2.3124) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rik van Riel wrote: > On Fri, 2016-07-29 at 12:25 +0900, Minchan Kim wrote: >> Every swap-in anonymous page starts from inactive lru list's head. >> It should be activated unconditionally when VM decide to reclaim >> because page table entry for the page always usually has marked >> accessed bit. Thus, their window size for getting a new referece >> is 2 * NR_inactive + NR_active while others is NR_active + NR_active. >> >> It's not fair that it has more chance to be referenced compared >> to other newly allocated page which starts from active lru list's >> head. >> >> Signed-off-by: Minchan Kim > > Acked-by: Rik van Riel > > The reason newly read in swap cache pages start on the > inactive list is that we do some amount of read-around, > and do not know which pages will get used. > > However, immediately activating the ones that DO get > used, like your patch does, is the right thing to do. Can it cause the swap clusters to lose spatial locality? For instance, if a process writes sequentially to memory multiple times, and if pages are swapped out, in and back out. In such case, doesn’t it increase the probability that the swap cluster will hold irrelevant data and make swap prefetch less efficient? Regards, Nadav