linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: mm: Align bank start to MAX_ORDER_NR_PAGES
@ 2011-09-28  8:32 Johan Palsson
  2011-09-29  8:31 ` Linus Walleij
  2011-10-04 19:51 ` Michael Bohan
  0 siblings, 2 replies; 3+ messages in thread
From: Johan Palsson @ 2011-09-28  8:32 UTC (permalink / raw)
  To: linux-arm-kernel

The VM subsystem assumes that there are valid memmap entries from
the bank start aligned to MAX_ORDER_NR_PAGES.

Cc: stable at kernel.org
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Michael Bohan <mbohan@codeaurora.org>
Cc: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Johan Palsson <johan.palsson@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/mm/init.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index cc7e2d8..f8037ba 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -496,6 +496,13 @@ static void __init free_unused_memmap(struct meminfo *mi)
 		 */
 		bank_start = min(bank_start,
 				 ALIGN(prev_bank_end, PAGES_PER_SECTION));
+#else
+		/*
+		 * Align down here since the VM subsystem insists that the
+		 * memmap entries are valid from the bank start aligned to
+		 * MAX_ORDER_NR_PAGES.
+		 */
+		bank_start = round_down(bank_start, MAX_ORDER_NR_PAGES);
 #endif
 		/*
 		 * If we had a previous bank, and there is a space
-- 
1.7.3.2

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

* [PATCH] ARM: mm: Align bank start to MAX_ORDER_NR_PAGES
  2011-09-28  8:32 [PATCH] ARM: mm: Align bank start to MAX_ORDER_NR_PAGES Johan Palsson
@ 2011-09-29  8:31 ` Linus Walleij
  2011-10-04 19:51 ` Michael Bohan
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2011-09-29  8:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Sep 28, 2011 at 10:32 AM, Johan Palsson
<johan.palsson@stericsson.com> wrote:

> The VM subsystem assumes that there are valid memmap entries from
> the bank start aligned to MAX_ORDER_NR_PAGES.
>
> Cc: stable at kernel.org
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> Cc: Michael Bohan <mbohan@codeaurora.org>
> Cc: Nicolas Pitre <nico@fluxnic.net>
> Signed-off-by: Johan Palsson <johan.palsson@stericsson.com>
> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

I should mention that this is triggered a lot by our platform using
several disparate mem=n arguments on the command line,
chopping out pieces of memory here and there.

I will repost with a more descriptive message and then I'll
put it into the patch tracker, as it's a blocker already on 3.0
for us.

Yours,
Linus Walleij

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

* [PATCH] ARM: mm: Align bank start to MAX_ORDER_NR_PAGES
  2011-09-28  8:32 [PATCH] ARM: mm: Align bank start to MAX_ORDER_NR_PAGES Johan Palsson
  2011-09-29  8:31 ` Linus Walleij
@ 2011-10-04 19:51 ` Michael Bohan
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Bohan @ 2011-10-04 19:51 UTC (permalink / raw)
  To: linux-arm-kernel

On 9/28/2011 1:32 AM, Johan Palsson wrote:
> The VM subsystem assumes that there are valid memmap entries from
> the bank start aligned to MAX_ORDER_NR_PAGES.
>
> Cc: stable at kernel.org
> Cc: Russell King<rmk+kernel@arm.linux.org.uk>
> Cc: Michael Bohan<mbohan@codeaurora.org>
> Cc: Nicolas Pitre<nico@fluxnic.net>
> Signed-off-by: Johan Palsson<johan.palsson@stericsson.com>
> Signed-off-by: Rabin Vincent<rabin.vincent@stericsson.com>
> Signed-off-by: Linus Walleij<linus.walleij@linaro.org>
> ---
>   arch/arm/mm/init.c |    7 +++++++
>   1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> index cc7e2d8..f8037ba 100644
> --- a/arch/arm/mm/init.c
> +++ b/arch/arm/mm/init.c
> @@ -496,6 +496,13 @@ static void __init free_unused_memmap(struct meminfo *mi)
>   		 */
>   		bank_start = min(bank_start,
>   				 ALIGN(prev_bank_end, PAGES_PER_SECTION));
> +#else
> +		/*
> +		 * Align down here since the VM subsystem insists that the

Can we change this to say 'Round down here' instead of 'Align down 
here'? For consistency, we should probably change the comment and code 
for the prev_bank_end case below to say 'Round up' and use round_up 
instead of ALIGN().

> +		 * memmap entries are valid from the bank start aligned to
> +		 * MAX_ORDER_NR_PAGES.
> +		 */
> +		bank_start = round_down(bank_start, MAX_ORDER_NR_PAGES);
>   #endif

We ran into this bug on 2.6.38 and I had similar fix. Are you sure this 
doesn't apply SPARSEMEM configurations? At first glance, it seems like 
there could be an issue there as well.

Thanks,
Mike

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

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

end of thread, other threads:[~2011-10-04 19:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-28  8:32 [PATCH] ARM: mm: Align bank start to MAX_ORDER_NR_PAGES Johan Palsson
2011-09-29  8:31 ` Linus Walleij
2011-10-04 19:51 ` Michael Bohan

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).