From: Andrew Morton <akpm@linux-foundation.org>
To: Minchan Kim <minchan.kim@gmail.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
kamezawa.hiroyu@jp.fujitsu.com, nishimura@mxp.nes.nec.co.jp,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] mm: add replace_page_cache_page() function
Date: Tue, 18 Jan 2011 17:48:26 -0800 [thread overview]
Message-ID: <20110118174826.4c6d47a3.akpm@linux-foundation.org> (raw)
In-Reply-To: <AANLkTimh7jq7HLjfxVX0XKdhOhWEQtDn-faGc+iJ-ykd@mail.gmail.com>
On Wed, 19 Jan 2011 10:24:09 +0900 Minchan Kim <minchan.kim@gmail.com> wrote:
> >
> > This is all pretty ugly and inefficient.
> >
> > We call __remove_from_page_cache() which does a radix-tree lookup and
> > then fiddles a bunch of accounting things.
> >
> > Then we immediately do the same radix-tree lookup and then undo the
> > accounting changes which we just did. __And we do it in an open-coded
> > fashion, thus giving the kernel yet another code site where various
> > operations need to be kept in sync.
> >
> > Would it not be better to do a single radix_tree_lookup_slot(),
> > overwrite the pointer therein and just leave all the ancilliary
> > accounting unaltered?
>
> I agree single radix_tree_lookup but accounting still is needed since
> newpage could be on another zone. What we can remove is just only
> mapping->nrpages.
Well. We only need to do inc/dec_zone_state if the zones are
different. Perhaps the zones-equal case is worth optimising for,
dunno.
Also, the radix_tree_preload() should be unneeded.
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Minchan Kim <minchan.kim@gmail.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
kamezawa.hiroyu@jp.fujitsu.com, nishimura@mxp.nes.nec.co.jp,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] mm: add replace_page_cache_page() function
Date: Tue, 18 Jan 2011 17:48:26 -0800 [thread overview]
Message-ID: <20110118174826.4c6d47a3.akpm@linux-foundation.org> (raw)
In-Reply-To: <AANLkTimh7jq7HLjfxVX0XKdhOhWEQtDn-faGc+iJ-ykd@mail.gmail.com>
On Wed, 19 Jan 2011 10:24:09 +0900 Minchan Kim <minchan.kim@gmail.com> wrote:
> >
> > This is all pretty ugly and inefficient.
> >
> > We call __remove_from_page_cache() which does a radix-tree lookup and
> > then fiddles a bunch of accounting things.
> >
> > Then we immediately do the same radix-tree lookup and then undo the
> > accounting changes which we just did. __And we do it in an open-coded
> > fashion, thus giving the kernel yet another code site where various
> > operations need to be kept in sync.
> >
> > Would it not be better to do a single radix_tree_lookup_slot(),
> > overwrite the pointer therein and just leave all the ancilliary
> > accounting unaltered?
>
> I agree single radix_tree_lookup but accounting still is needed since
> newpage could be on another zone. What we can remove is just only
> mapping->nrpages.
Well. We only need to do inc/dec_zone_state if the zones are
different. Perhaps the zones-equal case is worth optimising for,
dunno.
Also, the radix_tree_preload() should be unneeded.
--
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 policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-01-19 1:49 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-18 11:18 [PATCH v4] mm: add replace_page_cache_page() function Miklos Szeredi
2011-01-18 11:18 ` Miklos Szeredi
2011-01-18 23:28 ` Andrew Morton
2011-01-18 23:28 ` Andrew Morton
2011-01-19 0:27 ` Daisuke Nishimura
2011-01-19 0:27 ` Daisuke Nishimura
2011-01-19 0:41 ` Andrew Morton
2011-01-19 0:41 ` Andrew Morton
2011-01-19 0:48 ` KAMEZAWA Hiroyuki
2011-01-19 0:48 ` KAMEZAWA Hiroyuki
2011-01-19 1:11 ` nishimura
2011-01-19 1:11 ` nishimura
2011-01-19 1:23 ` KAMEZAWA Hiroyuki
2011-01-19 1:23 ` KAMEZAWA Hiroyuki
2011-01-21 5:52 ` Daisuke Nishimura
2011-01-21 5:52 ` Daisuke Nishimura
2011-01-21 6:17 ` KAMEZAWA Hiroyuki
2011-01-21 6:17 ` KAMEZAWA Hiroyuki
2011-01-19 0:33 ` KAMEZAWA Hiroyuki
2011-01-19 0:33 ` KAMEZAWA Hiroyuki
2011-01-19 1:24 ` Minchan Kim
2011-01-19 1:24 ` Minchan Kim
2011-01-19 1:48 ` Andrew Morton [this message]
2011-01-19 1:48 ` Andrew Morton
2011-01-19 2:17 ` Minchan Kim
2011-01-19 2:17 ` Minchan Kim
2011-09-08 23:52 ` Andrew Morton
2011-09-08 23:52 ` Andrew Morton
2011-09-08 23:52 ` Andrew Morton
2011-09-09 1:43 ` KAMEZAWA Hiroyuki
2011-09-09 1:43 ` KAMEZAWA Hiroyuki
2011-01-19 1:17 ` Minchan Kim
2011-01-19 1:17 ` Minchan Kim
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=20110118174826.4c6d47a3.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=miklos@szeredi.hu \
--cc=minchan.kim@gmail.com \
--cc=nishimura@mxp.nes.nec.co.jp \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.