Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1535144 > unrolled thread

[PATCH 7/8 linux-next] mm: warn about possible alignment problem

Started byFabian Frederick <fabf@skynet.be>
First post2016-12-02 20:30 +0100
Last post2016-12-02 21:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 7/8 linux-next] mm: warn about possible alignment problem Fabian Frederick <fabf@skynet.be> - 2016-12-02 20:30 +0100
    Re: [PATCH 7/8 linux-next] mm: warn about possible alignment problem Dan Williams <dan.j.williams@intel.com> - 2016-12-02 21:00 +0100

#1535144 — [PATCH 7/8 linux-next] mm: warn about possible alignment problem

FromFabian Frederick <fabf@skynet.be>
Date2016-12-02 20:30 +0100
Subject[PATCH 7/8 linux-next] mm: warn about possible alignment problem
Message-ID<sK1GV-7VR-9@gated-at.bofh.it>
Commit 5f29a77cd957
("mm: fix mixed zone detection in devm_memremap_pages")
Aligned resource limits before region_intersects() which breaks
the following with false assertions on kernel command line: memmap=4M!700M

"devm_memremap_pages attempted on mixed region [ mem 0x2bc00000-0x2bfffff
flags 0x200]"

Memory regions
0x100000-0x2bbfffff: usable
0x2bc000000-0x2bbfffff: persistent
0x2c0000000-0x2bffffff: usable

resource start: 0x2bc00000
align start:    0x28000000
resource size:  0x3fffffff
align size:     0x80000000
SECTION_SIZE:    0x8000000

Now we need aligned memmap declarations based on 128M in this case
eg memmap=128!640M

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 kernel/memremap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/memremap.c b/kernel/memremap.c
index b501e39..1bb5eec 100644
--- a/kernel/memremap.c
+++ b/kernel/memremap.c
@@ -296,8 +296,8 @@ void *devm_memremap_pages(struct device *dev, struct resource *res,
 		IORESOURCE_SYSTEM_RAM, IORES_DESC_NONE);
 
 	if (is_ram == REGION_MIXED) {
-		WARN_ONCE(1, "%s attempted on mixed region %pr\n",
-				__func__, res);
+		WARN_ONCE(1, "%s attempted on mixed region %pr or arguments not aligned to section size: %#lx\n",
+				__func__, res, SECTION_SIZE);
 		return ERR_PTR(-ENXIO);
 	}
 
-- 
2.7.4

[toc] | [next] | [standalone]


#1535179

FromDan Williams <dan.j.williams@intel.com>
Date2016-12-02 21:00 +0100
Message-ID<sK29X-85B-3@gated-at.bofh.it>
In reply to#1535144
On Fri, Dec 2, 2016 at 11:22 AM, Fabian Frederick <fabf@skynet.be> wrote:
> Commit 5f29a77cd957
> ("mm: fix mixed zone detection in devm_memremap_pages")
> Aligned resource limits before region_intersects() which breaks
> the following with false assertions on kernel command line: memmap=4M!700M
>
> "devm_memremap_pages attempted on mixed region [ mem 0x2bc00000-0x2bfffff
> flags 0x200]"
>
> Memory regions
> 0x100000-0x2bbfffff: usable
> 0x2bc000000-0x2bbfffff: persistent
> 0x2c0000000-0x2bffffff: usable
>
> resource start: 0x2bc00000
> align start:    0x28000000
> resource size:  0x3fffffff
> align size:     0x80000000
> SECTION_SIZE:    0x8000000
>
> Now we need aligned memmap declarations based on 128M in this case
> eg memmap=128!640M
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
>  kernel/memremap.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/memremap.c b/kernel/memremap.c
> index b501e39..1bb5eec 100644
> --- a/kernel/memremap.c
> +++ b/kernel/memremap.c
> @@ -296,8 +296,8 @@ void *devm_memremap_pages(struct device *dev, struct resource *res,
>                 IORESOURCE_SYSTEM_RAM, IORES_DESC_NONE);
>
>         if (is_ram == REGION_MIXED) {
> -               WARN_ONCE(1, "%s attempted on mixed region %pr\n",
> -                               __func__, res);
> +               WARN_ONCE(1, "%s attempted on mixed region %pr or arguments not aligned to section size: %#lx\n",
> +                               __func__, res, SECTION_SIZE);
>                 return ERR_PTR(-ENXIO);
>         }

This should be addressed by the sub-section hotplug patches:

"[PATCH 00/11] mm: sub-section memory hotplug support"
https://lkml.org/lkml/2016/12/1/740

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web