linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: mm: Fix the memblock allocation for LPAE machines
@ 2014-02-01 20:14 Santosh Shilimkar
  2014-02-05 23:39 ` Santosh Shilimkar
  0 siblings, 1 reply; 6+ messages in thread
From: Santosh Shilimkar @ 2014-02-01 20:14 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-kernel, Santosh Shilimkar, Yinghai Lu, Russell King,
	Strashko, Grygorii, Andrew Morton

Commit ad6492b8 added much needed memblock_virt_alloc_low() and further
commit 07bacb3 {memblock, bootmem: restore goal for alloc_low} fixed the
issue with low memory limit thansk to Yinghai. But even after all these fixes,
there is still one case where the limit check done with ARCH_LOW_ADDRESS_LIMIT
for low memory fails. Russell pointed out the issue with 32 bit LPAE machines
in below thread.
	https://lkml.org/lkml/2014/1/28/364

Since on some LPAE machines where memory start address is beyond 4GB,
the low memory marker in memblock will be set to default
ARCH_LOW_ADDRESS_LIMIT which is wrong. We can fix this by letting
architectures set the ARCH_LOW_ADDRESS_LIMIT using another export
similar to memblock_set_current_limit() but am not sure whether
its worth the trouble. Tell me if you think otherwise.

Rather am just trying to fix that one broken case using memblock_virt_alloc()
in setup code since the memblock.current_limit is updated appropriately
makes it work on all ARM 32 bit machines.

Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Strashko, Grygorii <grygorii.strashko@ti.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 arch/arm/kernel/setup.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index b0df976..1e8b030 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -731,7 +731,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
 	kernel_data.end     = virt_to_phys(_end - 1);
 
 	for_each_memblock(memory, region) {
-		res = memblock_virt_alloc_low(sizeof(*res), 0);
+		res = memblock_virt_alloc(sizeof(*res), 0);
 		res->name  = "System RAM";
 		res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region));
 		res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ARM: mm: Fix the memblock allocation for LPAE machines
  2014-02-01 20:14 [PATCH] ARM: mm: Fix the memblock allocation for LPAE machines Santosh Shilimkar
@ 2014-02-05 23:39 ` Santosh Shilimkar
  2014-02-05 23:48   ` Russell King - ARM Linux
  0 siblings, 1 reply; 6+ messages in thread
From: Santosh Shilimkar @ 2014-02-05 23:39 UTC (permalink / raw)
  To: Santosh Shilimkar, Russell King
  Cc: linux-arm-kernel, linux-kernel, Yinghai Lu, Strashko, Grygorii,
	Andrew Morton

Russell,

On Saturday 01 February 2014 03:14 PM, Santosh Shilimkar wrote:
> Commit ad6492b8 added much needed memblock_virt_alloc_low() and further
> commit 07bacb3 {memblock, bootmem: restore goal for alloc_low} fixed the
> issue with low memory limit thansk to Yinghai. But even after all these fixes,
> there is still one case where the limit check done with ARCH_LOW_ADDRESS_LIMIT
> for low memory fails. Russell pointed out the issue with 32 bit LPAE machines
> in below thread.
> 	https://lkml.org/lkml/2014/1/28/364
> 
> Since on some LPAE machines where memory start address is beyond 4GB,
> the low memory marker in memblock will be set to default
> ARCH_LOW_ADDRESS_LIMIT which is wrong. We can fix this by letting
> architectures set the ARCH_LOW_ADDRESS_LIMIT using another export
> similar to memblock_set_current_limit() but am not sure whether
> its worth the trouble. Tell me if you think otherwise.
> 
> Rather am just trying to fix that one broken case using memblock_virt_alloc()
> in setup code since the memblock.current_limit is updated appropriately
> makes it work on all ARM 32 bit machines.
> 
> Cc: Yinghai Lu <yinghai@kernel.org>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Strashko, Grygorii <grygorii.strashko@ti.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> ---
Whats you say here ? We should get the fix for the
issue. If you are ok, I can drop the patch in patch system.

>  arch/arm/kernel/setup.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> index b0df976..1e8b030 100644
> --- a/arch/arm/kernel/setup.c
> +++ b/arch/arm/kernel/setup.c
> @@ -731,7 +731,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
>  	kernel_data.end     = virt_to_phys(_end - 1);
>  
>  	for_each_memblock(memory, region) {
> -		res = memblock_virt_alloc_low(sizeof(*res), 0);
> +		res = memblock_virt_alloc(sizeof(*res), 0);
>  		res->name  = "System RAM";
>  		res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region));
>  		res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1;
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ARM: mm: Fix the memblock allocation for LPAE machines
  2014-02-05 23:39 ` Santosh Shilimkar
@ 2014-02-05 23:48   ` Russell King - ARM Linux
  2014-02-06  0:50     ` Santosh Shilimkar
  0 siblings, 1 reply; 6+ messages in thread
From: Russell King - ARM Linux @ 2014-02-05 23:48 UTC (permalink / raw)
  To: Santosh Shilimkar
  Cc: linux-arm-kernel, linux-kernel, Yinghai Lu, Strashko, Grygorii,
	Andrew Morton

On Wed, Feb 05, 2014 at 06:39:44PM -0500, Santosh Shilimkar wrote:
> Russell,
> 
> On Saturday 01 February 2014 03:14 PM, Santosh Shilimkar wrote:
> > Commit ad6492b8 added much needed memblock_virt_alloc_low() and further
> > commit 07bacb3 {memblock, bootmem: restore goal for alloc_low} fixed the
> > issue with low memory limit thansk to Yinghai. But even after all these fixes,
> > there is still one case where the limit check done with ARCH_LOW_ADDRESS_LIMIT
> > for low memory fails. Russell pointed out the issue with 32 bit LPAE machines
> > in below thread.
> > 	https://lkml.org/lkml/2014/1/28/364
> > 
> > Since on some LPAE machines where memory start address is beyond 4GB,
> > the low memory marker in memblock will be set to default
> > ARCH_LOW_ADDRESS_LIMIT which is wrong. We can fix this by letting
> > architectures set the ARCH_LOW_ADDRESS_LIMIT using another export
> > similar to memblock_set_current_limit() but am not sure whether
> > its worth the trouble. Tell me if you think otherwise.
> > 
> > Rather am just trying to fix that one broken case using memblock_virt_alloc()
> > in setup code since the memblock.current_limit is updated appropriately
> > makes it work on all ARM 32 bit machines.
> > 
> > Cc: Yinghai Lu <yinghai@kernel.org>
> > Cc: Russell King <linux@arm.linux.org.uk>
> > Cc: Strashko, Grygorii <grygorii.strashko@ti.com>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> > ---
> Whats you say here ? We should get the fix for the
> issue. If you are ok, I can drop the patch in patch system.

Is this still an issue, or has Tejun fixed it by some other means?  I've not
noticed anything being broken at the moment.

Can you confirm whether we still have an issue without this patch please?

Thanks.

-- 
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up.  Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ARM: mm: Fix the memblock allocation for LPAE machines
  2014-02-05 23:48   ` Russell King - ARM Linux
@ 2014-02-06  0:50     ` Santosh Shilimkar
  2014-02-06 18:41       ` Russell King - ARM Linux
  0 siblings, 1 reply; 6+ messages in thread
From: Santosh Shilimkar @ 2014-02-06  0:50 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: linux-arm-kernel, linux-kernel, Yinghai Lu, Strashko, Grygorii,
	Andrew Morton

On Wednesday 05 February 2014 06:48 PM, Russell King - ARM Linux wrote:
> On Wed, Feb 05, 2014 at 06:39:44PM -0500, Santosh Shilimkar wrote:
>> Russell,
>>
>> On Saturday 01 February 2014 03:14 PM, Santosh Shilimkar wrote:
>>> Commit ad6492b8 added much needed memblock_virt_alloc_low() and further
>>> commit 07bacb3 {memblock, bootmem: restore goal for alloc_low} fixed the
>>> issue with low memory limit thansk to Yinghai. But even after all these fixes,
>>> there is still one case where the limit check done with ARCH_LOW_ADDRESS_LIMIT
>>> for low memory fails. Russell pointed out the issue with 32 bit LPAE machines
>>> in below thread.
>>> 	https://lkml.org/lkml/2014/1/28/364
>>>
>>> Since on some LPAE machines where memory start address is beyond 4GB,
>>> the low memory marker in memblock will be set to default
>>> ARCH_LOW_ADDRESS_LIMIT which is wrong. We can fix this by letting
>>> architectures set the ARCH_LOW_ADDRESS_LIMIT using another export
>>> similar to memblock_set_current_limit() but am not sure whether
>>> its worth the trouble. Tell me if you think otherwise.
>>>
>>> Rather am just trying to fix that one broken case using memblock_virt_alloc()
>>> in setup code since the memblock.current_limit is updated appropriately
>>> makes it work on all ARM 32 bit machines.
>>>
>>> Cc: Yinghai Lu <yinghai@kernel.org>
>>> Cc: Russell King <linux@arm.linux.org.uk>
>>> Cc: Strashko, Grygorii <grygorii.strashko@ti.com>
>>> Cc: Andrew Morton <akpm@linux-foundation.org>
>>> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>>> ---
>> Whats you say here ? We should get the fix for the
>> issue. If you are ok, I can drop the patch in patch system.
> 
> Is this still an issue, or has Tejun fixed it by some other means?  I've not
> noticed anything being broken at the moment.
> 
> Can you confirm whether we still have an issue without this patch please?
> 
Fixes for all cases exist except 'LPAE + memory start beyond 4 GB'.
This case is still broken and  hence I posted the $subject patch.

Regards,
Santosh


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ARM: mm: Fix the memblock allocation for LPAE machines
  2014-02-06  0:50     ` Santosh Shilimkar
@ 2014-02-06 18:41       ` Russell King - ARM Linux
  2014-02-06 18:51         ` Santosh Shilimkar
  0 siblings, 1 reply; 6+ messages in thread
From: Russell King - ARM Linux @ 2014-02-06 18:41 UTC (permalink / raw)
  To: Santosh Shilimkar
  Cc: linux-arm-kernel, linux-kernel, Yinghai Lu, Strashko, Grygorii,
	Andrew Morton

On Wed, Feb 05, 2014 at 07:50:55PM -0500, Santosh Shilimkar wrote:
> On Wednesday 05 February 2014 06:48 PM, Russell King - ARM Linux wrote:
> > On Wed, Feb 05, 2014 at 06:39:44PM -0500, Santosh Shilimkar wrote:
> >> Russell,
> >>
> >> On Saturday 01 February 2014 03:14 PM, Santosh Shilimkar wrote:
> >>> Commit ad6492b8 added much needed memblock_virt_alloc_low() and further
> >>> commit 07bacb3 {memblock, bootmem: restore goal for alloc_low} fixed the
> >>> issue with low memory limit thansk to Yinghai. But even after all these fixes,
> >>> there is still one case where the limit check done with ARCH_LOW_ADDRESS_LIMIT
> >>> for low memory fails. Russell pointed out the issue with 32 bit LPAE machines
> >>> in below thread.
> >>> 	https://lkml.org/lkml/2014/1/28/364
> >>>
> >>> Since on some LPAE machines where memory start address is beyond 4GB,
> >>> the low memory marker in memblock will be set to default
> >>> ARCH_LOW_ADDRESS_LIMIT which is wrong. We can fix this by letting
> >>> architectures set the ARCH_LOW_ADDRESS_LIMIT using another export
> >>> similar to memblock_set_current_limit() but am not sure whether
> >>> its worth the trouble. Tell me if you think otherwise.
> >>>
> >>> Rather am just trying to fix that one broken case using memblock_virt_alloc()
> >>> in setup code since the memblock.current_limit is updated appropriately
> >>> makes it work on all ARM 32 bit machines.
> >>>
> >>> Cc: Yinghai Lu <yinghai@kernel.org>
> >>> Cc: Russell King <linux@arm.linux.org.uk>
> >>> Cc: Strashko, Grygorii <grygorii.strashko@ti.com>
> >>> Cc: Andrew Morton <akpm@linux-foundation.org>
> >>> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> >>> ---
> >> Whats you say here ? We should get the fix for the
> >> issue. If you are ok, I can drop the patch in patch system.
> > 
> > Is this still an issue, or has Tejun fixed it by some other means?  I've not
> > noticed anything being broken at the moment.
> > 
> > Can you confirm whether we still have an issue without this patch please?
> > 
> Fixes for all cases exist except 'LPAE + memory start beyond 4 GB'.
> This case is still broken and  hence I posted the $subject patch.

Okay.  Patch system please then.  Thanks.

-- 
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up.  Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ARM: mm: Fix the memblock allocation for LPAE machines
  2014-02-06 18:41       ` Russell King - ARM Linux
@ 2014-02-06 18:51         ` Santosh Shilimkar
  0 siblings, 0 replies; 6+ messages in thread
From: Santosh Shilimkar @ 2014-02-06 18:51 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: linux-arm-kernel, linux-kernel, Yinghai Lu, Strashko, Grygorii,
	Andrew Morton

On Thursday 06 February 2014 01:41 PM, Russell King - ARM Linux wrote:
> On Wed, Feb 05, 2014 at 07:50:55PM -0500, Santosh Shilimkar wrote:
>> On Wednesday 05 February 2014 06:48 PM, Russell King - ARM Linux wrote:
>>> On Wed, Feb 05, 2014 at 06:39:44PM -0500, Santosh Shilimkar wrote:
>>>> Russell,
>>>>
>>>> On Saturday 01 February 2014 03:14 PM, Santosh Shilimkar wrote:
>>>>> Commit ad6492b8 added much needed memblock_virt_alloc_low() and further
>>>>> commit 07bacb3 {memblock, bootmem: restore goal for alloc_low} fixed the
>>>>> issue with low memory limit thansk to Yinghai. But even after all these fixes,
>>>>> there is still one case where the limit check done with ARCH_LOW_ADDRESS_LIMIT
>>>>> for low memory fails. Russell pointed out the issue with 32 bit LPAE machines
>>>>> in below thread.
>>>>> 	https://lkml.org/lkml/2014/1/28/364
>>>>>
>>>>> Since on some LPAE machines where memory start address is beyond 4GB,
>>>>> the low memory marker in memblock will be set to default
>>>>> ARCH_LOW_ADDRESS_LIMIT which is wrong. We can fix this by letting
>>>>> architectures set the ARCH_LOW_ADDRESS_LIMIT using another export
>>>>> similar to memblock_set_current_limit() but am not sure whether
>>>>> its worth the trouble. Tell me if you think otherwise.
>>>>>
>>>>> Rather am just trying to fix that one broken case using memblock_virt_alloc()
>>>>> in setup code since the memblock.current_limit is updated appropriately
>>>>> makes it work on all ARM 32 bit machines.
>>>>>
>>>>> Cc: Yinghai Lu <yinghai@kernel.org>
>>>>> Cc: Russell King <linux@arm.linux.org.uk>
>>>>> Cc: Strashko, Grygorii <grygorii.strashko@ti.com>
>>>>> Cc: Andrew Morton <akpm@linux-foundation.org>
>>>>> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>>>>> ---
>>>> Whats you say here ? We should get the fix for the
>>>> issue. If you are ok, I can drop the patch in patch system.
>>>
>>> Is this still an issue, or has Tejun fixed it by some other means?  I've not
>>> noticed anything being broken at the moment.
>>>
>>> Can you confirm whether we still have an issue without this patch please?
>>>
>> Fixes for all cases exist except 'LPAE + memory start beyond 4 GB'.
>> This case is still broken and  hence I posted the $subject patch.
> 
> Okay.  Patch system please then.  Thanks.
> 
Thanks.  patch 7952/1

Regards,
Santosh

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-02-06 18:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-01 20:14 [PATCH] ARM: mm: Fix the memblock allocation for LPAE machines Santosh Shilimkar
2014-02-05 23:39 ` Santosh Shilimkar
2014-02-05 23:48   ` Russell King - ARM Linux
2014-02-06  0:50     ` Santosh Shilimkar
2014-02-06 18:41       ` Russell King - ARM Linux
2014-02-06 18:51         ` Santosh Shilimkar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).