From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail191.messagelabs.com (mail191.messagelabs.com [216.82.242.19]) by kanga.kvack.org (Postfix) with ESMTP id E40158D0039 for ; Thu, 17 Feb 2011 23:20:36 -0500 (EST) Received: by iwc10 with SMTP id 10so3251551iwc.14 for ; Thu, 17 Feb 2011 20:18:38 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <5677f3262774f4ddc24044065b7cbd6443ac5e16.1297940291.git.minchan.kim@gmail.com> <20110218005020.d202acd2.kamezawa.hiroyu@jp.fujitsu.com> Date: Fri, 18 Feb 2011 13:18:37 +0900 Message-ID: Subject: Re: [PATCH v5 1/4] deactivate invalidated pages From: Hiroyuki Kamezawa Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sender: owner-linux-mm@kvack.org List-ID: To: Minchan Kim Cc: KAMEZAWA Hiroyuki , Andrew Morton , linux-mm , LKML , Steven Barrett , Ben Gamari , Peter Zijlstra , Rik van Riel , Mel Gorman , KOSAKI Motohiro , Wu Fengguang , Johannes Weiner , Nick Piggin , Andrea Arcangeli , Balbir Singh 2011/2/18 Minchan Kim : > On Fri, Feb 18, 2011 at 12:50 AM, KAMEZAWA Hiroyuki > wrote: >> On Fri, 18 Feb 2011 00:08:19 +0900 >> Minchan Kim wrote: >> >>> Recently, there are reported problem about thrashing. >>> (http://marc.info/?l=3Drsync&m=3D128885034930933&w=3D2) >>> It happens by backup workloads(ex, nightly rsync). >>> That's because the workload makes just use-once pages >>> and touches pages twice. It promotes the page into >>> active list so that it results in working set page eviction. >>> >>> Some app developer want to support POSIX_FADV_NOREUSE. >>> But other OSes don't support it, either. >>> (http://marc.info/?l=3Dlinux-mm&m=3D128928979512086&w=3D2) >>> >>> By other approach, app developers use POSIX_FADV_DONTNEED. >>> But it has a problem. If kernel meets page is writing >>> during invalidate_mapping_pages, it can't work. >>> It makes for application programmer to use it since they always >>> have to sync data before calling fadivse(..POSIX_FADV_DONTNEED) to >>> make sure the pages could be discardable. At last, they can't use >>> deferred write of kernel so that they could see performance loss. >>> (http://insights.oetiker.ch/linux/fadvise.html) >>> >>> In fact, invalidation is very big hint to reclaimer. >>> It means we don't use the page any more. So let's move >>> the writing page into inactive list's head if we can't truncate >>> it right now. >>> >>> Why I move page to head of lru on this patch, Dirty/Writeback page >>> would be flushed sooner or later. It can prevent writeout of pageout >>> which is less effective than flusher's writeout. >>> >>> Originally, I reused lru_demote of Peter with some change so added >>> his Signed-off-by. >>> >>> Reported-by: Ben Gamari >>> Signed-off-by: Minchan Kim >>> Signed-off-by: Peter Zijlstra >>> Acked-by: Rik van Riel >>> Acked-by: Mel Gorman >>> Reviewed-by: KOSAKI Motohiro >>> Cc: Wu Fengguang >>> Cc: Johannes Weiner >>> Cc: Nick Piggin >>> Signed-off-by: Minchan Kim >> >> >> Reviewed-by: KAMEZAWA Hiroyuki >> >> One question is ....it seems there is no flush() code for percpu pagevec >> in this patch. Is it safe against cpu hot plug ? >> >> And from memory hot unplug point of view, I'm grad if pagevec for this >> is flushed at the same time as when we clear other per-cpu lru pagevecs. >> (And compaction will be affected by the page_count() magic by pagevec >> =A0which is flushed only when FADVISE is called.) >> >> Could you add add-on patches for flushing and hooks ? > > Isn't it enough in my patch? If I miss your point, Could you elaborate pl= ease? > > =A0* Drain pages out of the cpu's pagevecs. > =A0* Either "cpu" is the current CPU, and preemption has already been > =A0* disabled; or "cpu" is being hot-unplugged, and is already dead. > @@ -372,6 +427,29 @@ static void drain_cpu_pagevecs(int cpu) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 pagevec_move_tail(pvec); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 local_irq_restore(flags); > =A0 =A0 =A0 } > + > + =A0 =A0 =A0 pvec =3D &per_cpu(lru_deactivate_pvecs, cpu); > + =A0 =A0 =A0 if (pagevec_count(pvec)) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ____pagevec_lru_deactivate(pvec); > +} > I'm sorry that I missed this line. It seems I was wrong. Regards, -Kame -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org