linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hiroyuki Kamezawa <kamezawa.hiroyuki@gmail.com>
To: Minchan Kim <minchan.kim@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Steven Barrett <damentz@liquorix.net>,
	Ben Gamari <bgamari.foss@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Rik van Riel <riel@redhat.com>, Mel Gorman <mel@csn.ul.ie>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Wu Fengguang <fengguang.wu@intel.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Nick Piggin <npiggin@kernel.dk>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Balbir Singh <balbir@linux.vnet.ibm.com>
Subject: Re: [PATCH v5 1/4] deactivate invalidated pages
Date: Fri, 18 Feb 2011 13:18:37 +0900	[thread overview]
Message-ID: <AANLkTik+Kw0N8b=ny+NxjBAh577P3=GZmatRkTV1ZD7s@mail.gmail.com> (raw)
In-Reply-To: <AANLkTikfbqjk18JM8pTh+F6QR69m+QxQzdw6CQGOuZjH@mail.gmail.com>

2011/2/18 Minchan Kim <minchan.kim@gmail.com>:
> On Fri, Feb 18, 2011 at 12:50 AM, KAMEZAWA Hiroyuki
> <kamezawa.hiroyu@jp.fujitsu.com> wrote:
>> On Fri, 18 Feb 2011 00:08:19 +0900
>> Minchan Kim <minchan.kim@gmail.com> wrote:
>>
>>> Recently, there are reported problem about thrashing.
>>> (http://marc.info/?l=rsync&m=128885034930933&w=2)
>>> 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=linux-mm&m=128928979512086&w=2)
>>>
>>> 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 <bgamari.foss@gmail.com>
>>> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
>>> Signed-off-by: Peter Zijlstra <peterz@infradead.org>
>>> Acked-by: Rik van Riel <riel@redhat.com>
>>> Acked-by: Mel Gorman <mel@csn.ul.ie>
>>> Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>>> Cc: Wu Fengguang <fengguang.wu@intel.com>
>>> Cc: Johannes Weiner <hannes@cmpxchg.org>
>>> Cc: Nick Piggin <npiggin@kernel.dk>
>>> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
>>
>>
>> Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>>
>> 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
>>  which 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 please?
>
>  * Drain pages out of the cpu's pagevecs.
>  * Either "cpu" is the current CPU, and preemption has already been
>  * disabled; or "cpu" is being hot-unplugged, and is already dead.
> @@ -372,6 +427,29 @@ static void drain_cpu_pagevecs(int cpu)
>               pagevec_move_tail(pvec);
>               local_irq_restore(flags);
>       }
> +
> +       pvec = &per_cpu(lru_deactivate_pvecs, cpu);
> +       if (pagevec_count(pvec))
> +               ____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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-02-18  4:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-17 15:08 [PATCH v5 0/4] fadvise(DONTNEED) support Minchan Kim
2011-02-17 15:08 ` [PATCH v5 1/4] deactivate invalidated pages Minchan Kim
2011-02-17 15:50   ` KAMEZAWA Hiroyuki
2011-02-18  0:33     ` Minchan Kim
2011-02-18  4:18       ` Hiroyuki Kamezawa [this message]
2011-02-18  6:29   ` Balbir Singh
2011-02-18 10:39     ` Minchan Kim
2011-02-17 15:08 ` [PATCH v5 2/4] memcg: move memcg reclaimable page into tail of inactive list Minchan Kim
2011-02-17 16:04   ` KAMEZAWA Hiroyuki
2011-02-18  0:14     ` Minchan Kim
2011-02-18  4:16       ` Hiroyuki Kamezawa
2011-02-18 11:02         ` Minchan Kim
2011-02-17 15:08 ` [PATCH v5 3/4] Reclaim invalidated page ASAP Minchan Kim
2011-02-17 16:06   ` KAMEZAWA Hiroyuki
2011-02-17 15:08 ` [PATCH v5 4/4] add profile information for invalidated page Minchan Kim
2011-02-17 16:08   ` KAMEZAWA Hiroyuki
2011-02-18 16:58   ` Mel Gorman
2011-02-18 22:07     ` Minchan Kim
2011-02-18 23:17       ` Mel Gorman
2011-02-18 23:38         ` Minchan Kim
2011-02-18  5:55 ` [PATCH v5 0/4] fadvise(DONTNEED) support Balbir Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTik+Kw0N8b=ny+NxjBAh577P3=GZmatRkTV1ZD7s@mail.gmail.com' \
    --to=kamezawa.hiroyuki@gmail.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=bgamari.foss@gmail.com \
    --cc=damentz@liquorix.net \
    --cc=fengguang.wu@intel.com \
    --cc=hannes@cmpxchg.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=minchan.kim@gmail.com \
    --cc=npiggin@kernel.dk \
    --cc=peterz@infradead.org \
    --cc=riel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox