[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100713163417.17895202.kamezawa.hiroyu@jp.fujitsu.com>
Date: Tue, 13 Jul 2010 16:34:17 +0900
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To: Russell King - ARM Linux <linux@....linux.org.uk>
Cc: Minchan Kim <minchan.kim@...il.com>,
Yinghai Lu <yinghai@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Shaohua Li <shaohua.li@...el.com>,
Yakui Zhao <yakui.zhao@...el.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
arm-kernel@...ts.infradead.org, kgene.kim@...sung.com,
Mel Gorman <mel@....ul.ie>
Subject: Re: [RFC] Tight check of pfn_valid on sparsemem
On Tue, 13 Jul 2010 08:20:09 +0100
Russell King - ARM Linux <linux@....linux.org.uk> wrote:
> On Tue, Jul 13, 2010 at 03:04:00PM +0900, Minchan Kim wrote:
> > > __get_user() works with TLB and page table, the vaddr is really mapped or not.
> > > If you got SEGV, __get_user() returns -EFAULT. It works per page granule.
>
> Not in kernel space. It works on 1MB sections there.
>
> Testing whether a page is mapped by __get_user is a hugely expensive
> way to test whether a PFN is valid.
Note: pfn_valid() is for checking "there is memmap".
> It'd be cheaper to use our flatmem implementation of pfn_valid() instead.
>
Hmm. IIUC, pfn_valid() succeeds in almost all case if there is a section.
But yes, I'm not familar with ARM.
I love another idea as I've already shown as preparing _a_ page filled with
0x00004000 and map it into the all holes. PG_reserved will help almost all case
even if it's ugly.
Anyway, sparsemem is designed to be aligned to SECTION_SIZE of memmap.
Please avoid adding new Spaghetti code without proper configs.
Thanks,
-Kame
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists