[PATCH 1/2] x86: Optimize resource lookups for ioremap

2014-08-29 Thread Mike Travis
Since the ioremap operation is verifying that the specified address range is NOT RAM, it will search the entire ioresource list if the condition is true. To make matters worse, it does this one 4k page at a time. For a 128M BAR region this is 32 passes to determine the entire region does not conta

[PATCH 1/2] x86: Optimize resource lookups for ioremap

2014-08-29 Thread Mike Travis
Since the ioremap operation is verifying that the specified address range is NOT RAM, it will search the entire ioresource list if the condition is true. To make matters worse, it does this one 4k page at a time. For a 128M BAR region this is 32 passes to determine the entire region does not conta

Re: [PATCH 1/2] x86: Optimize resource lookups for ioremap

2014-08-27 Thread Andrew Morton
On Wed, 27 Aug 2014 16:54:18 -0700 Mike Travis wrote: > > If we're still at 1+ hours then little bodges like this are nowhere > > near sufficient and sterner stuff will be needed. > > > > Do we actually need the test? My googling turns up zero instances of > > anyone reporting the "ioremap on R

Re: [PATCH 1/2] x86: Optimize resource lookups for ioremap

2014-08-27 Thread Mike Travis
On 8/27/2014 4:37 PM, Andrew Morton wrote: > On Wed, 27 Aug 2014 16:25:24 -0700 Mike Travis wrote: > >>> >>> >>> >>> Doing strcmp("System RAM") is rather a hack. Is there nothing in >>> resource.flags which can be used? Or added otherwise? >> >> I agree except this mimics the page_is_ram fun

Re: [PATCH 1/2] x86: Optimize resource lookups for ioremap

2014-08-27 Thread Andrew Morton
On Wed, 27 Aug 2014 16:25:24 -0700 Mike Travis wrote: > > > > > > > > Doing strcmp("System RAM") is rather a hack. Is there nothing in > > resource.flags which can be used? Or added otherwise? > > I agree except this mimics the page_is_ram function: > > while ((res.start < res.end)

Re: [PATCH 1/2] x86: Optimize resource lookups for ioremap

2014-08-27 Thread Mike Travis
On 8/27/2014 4:18 PM, Andrew Morton wrote: > On Wed, 27 Aug 2014 16:09:09 -0700 Mike Travis wrote: > >> ... --- linux.orig/kernel/resource.c +++ linux/kernel/resource.c @@ -494,6 +494,43 @@ int __weak page_is_ram(unsigned long pfn } EXPORT_SYMBOL_GPL(pa

Re: [PATCH 1/2] x86: Optimize resource lookups for ioremap

2014-08-27 Thread Andrew Morton
On Wed, 27 Aug 2014 16:09:09 -0700 Mike Travis wrote: > > >> > >> ... > >> > >> --- linux.orig/kernel/resource.c > >> +++ linux/kernel/resource.c > >> @@ -494,6 +494,43 @@ int __weak page_is_ram(unsigned long pfn > >> } > >> EXPORT_SYMBOL_GPL(page_is_ram); > >> > >> +/* > >> + * Search for a

Re: [PATCH 1/2] x86: Optimize resource lookups for ioremap

2014-08-27 Thread Mike Travis
On 8/27/2014 4:05 PM, Andrew Morton wrote: > On Wed, 27 Aug 2014 17:59:28 -0500 Mike Travis wrote: > >> Since the ioremap operation is verifying that the specified address range >> is NOT RAM, it will search the entire ioresource list if the condition >> is true. To make matters worse, it does

[PATCH 1/2] x86: Optimize resource lookups for ioremap

2014-08-27 Thread Mike Travis
Since the ioremap operation is verifying that the specified address range is NOT RAM, it will search the entire ioresource list if the condition is true. To make matters worse, it does this one 4k page at a time. For a 128M BAR region this is 32 passes to determine the entire region does not conta

Re: [PATCH 1/2] x86: Optimize resource lookups for ioremap

2014-08-27 Thread Andrew Morton
On Wed, 27 Aug 2014 17:59:28 -0500 Mike Travis wrote: > Since the ioremap operation is verifying that the specified address range > is NOT RAM, it will search the entire ioresource list if the condition > is true. To make matters worse, it does this one 4k page at a time. > For a 128M BAR region