Re: mmotm 2018-02-21-14-48 uploaded (mm/page_alloc.c on UML)

2018-02-24 Thread Eugeniu Rosca
Hello Andrew, Michal,

On Thu, Feb 22, 2018 at 02:26:30PM +0100, Michal Hocko wrote:
> On Thu 22-02-18 14:08:14, Eugeniu Rosca wrote:
> > On Thu, Feb 22, 2018 at 01:59:55PM +0100, Michal Hocko wrote:
> > > On Thu 22-02-18 11:38:32, Eugeniu Rosca wrote:
> > > > Hi Michal,
> > > > 
> > > > Please, let me know if any action is expected from my end.
> > > 
> > > I do not thing anything is really needed right now. If you have a strong
> > > opinion about the solution (ifdef vs. noop stub) then speak up.
> > 
> > No different preference on my side. I was more thinking if you are going
> > to amend the patch or create a fix on top of it. Since it didn't reach
> > mainline, it makes sense to amend it. If you can do it without the
> > intervention of the author, that's also fine for me.
> 
> Andrew usually takes the incremental fix and then squash them when
> sending to Linus

This may sound like bikeshedding, but if commit [1] is squashed onto [2],
the resulted commit will pointlessly relocate the ifdef line, like seen
in [3]. Feel free to skip this comment/request, but imho applying [4] on
top of [1] would then result in a cleaner squashed commit. No functional
change is intended here. TIA.

[1] linux-next commit 5fd667a8c762 
("mm-page_alloc-skip-over-regions-of-invalid-pfns-on-uma-fix")
[2] linux-next commit 72a571e91476 ("mm: page_alloc: skip over regions of 
invalid pfns on UMA")

[3] Ugly and unneeded ifdef line relocation
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index cb416723538f..a89b029985ef 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5355,12 +5355,12 @@ void __meminit memmap_init_zone(unsigned long size, int 
nid, unsigned long zone,
goto not_early;

if (!early_pfn_valid(pfn)) {
-#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
/*
 * Skip to the pfn preceding the next valid one (or
 * end_pfn), such that we hit a valid pfn (or end_pfn)
 * on our next iteration of the loop.
 */
+#ifdef CONFIG_HAVE_MEMBLOCK
pfn = memblock_next_valid_pfn(pfn, end_pfn) - 1;
 #endif
continue;


[4] Patch to be applied on top of [1], for a cleaner squashed commit.
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index a89b029985ef..10cbf9f1fb35 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5355,12 +5355,12 @@ void __meminit memmap_init_zone(unsigned long size, int 
nid, unsigned long zone,
goto not_early;

if (!early_pfn_valid(pfn)) {
+#ifdef CONFIG_HAVE_MEMBLOCK
/*
 * Skip to the pfn preceding the next valid one (or
 * end_pfn), such that we hit a valid pfn (or end_pfn)
 * on our next iteration of the loop.
 */
-#ifdef CONFIG_HAVE_MEMBLOCK
pfn = memblock_next_valid_pfn(pfn, end_pfn) - 1;
 #endif
continue;

Best regards,
Eugeniu.


Re: mmotm 2018-02-21-14-48 uploaded (mm/page_alloc.c on UML)

2018-02-22 Thread Michal Hocko
On Thu 22-02-18 14:08:14, Eugeniu Rosca wrote:
> On Thu, Feb 22, 2018 at 01:59:55PM +0100, Michal Hocko wrote:
> > On Thu 22-02-18 11:38:32, Eugeniu Rosca wrote:
> > > Hi Michal,
> > > 
> > > Please, let me know if any action is expected from my end.
> > 
> > I do not thing anything is really needed right now. If you have a strong
> > opinion about the solution (ifdef vs. noop stub) then speak up.
> 
> No different preference on my side. I was more thinking if you are going
> to amend the patch or create a fix on top of it. Since it didn't reach
> mainline, it makes sense to amend it. If you can do it without the
> intervention of the author, that's also fine for me.

Andrew usually takes the incremental fix and then squash them when
sending to Linus

-- 
Michal Hocko
SUSE Labs


Re: mmotm 2018-02-21-14-48 uploaded (mm/page_alloc.c on UML)

2018-02-22 Thread Eugeniu Rosca
On Thu, Feb 22, 2018 at 01:59:55PM +0100, Michal Hocko wrote:
> On Thu 22-02-18 11:38:32, Eugeniu Rosca wrote:
> > Hi Michal,
> > 
> > Please, let me know if any action is expected from my end.
> 
> I do not thing anything is really needed right now. If you have a strong
> opinion about the solution (ifdef vs. noop stub) then speak up.

No different preference on my side. I was more thinking if you are going
to amend the patch or create a fix on top of it. Since it didn't reach
mainline, it makes sense to amend it. If you can do it without the
intervention of the author, that's also fine for me.

> > Thank you for your support and sorry for the ifdef troubles.
> 
> No troubles at all. It was me who pushed you this direction...
> -- 
> Michal Hocko
> SUSE Labs

Thanks,
Eugeniu.


Re: mmotm 2018-02-21-14-48 uploaded (mm/page_alloc.c on UML)

2018-02-22 Thread Michal Hocko
On Thu 22-02-18 11:38:32, Eugeniu Rosca wrote:
> Hi Michal,
> 
> Please, let me know if any action is expected from my end.

I do not thing anything is really needed right now. If you have a strong
opinion about the solution (ifdef vs. noop stub) then speak up.

> Thank you for your support and sorry for the ifdef troubles.

No troubles at all. It was me who pushed you this direction...
-- 
Michal Hocko
SUSE Labs


Re: mmotm 2018-02-21-14-48 uploaded (mm/page_alloc.c on UML)

2018-02-22 Thread Eugeniu Rosca
Hi Michal,

Please, let me know if any action is expected from my end.
Thank you for your support and sorry for the ifdef troubles.

Best regards,
Eugeniu.

On Thu, Feb 22, 2018 at 08:20:37AM +0100, Michal Hocko wrote:
> On Wed 21-02-18 15:58:41, Randy Dunlap wrote:
> > On 02/21/2018 02:48 PM, a...@linux-foundation.org wrote:
> > > The mm-of-the-moment snapshot 2018-02-21-14-48 has been uploaded to
> > > 
> > >http://www.ozlabs.org/~akpm/mmotm/
> > > 
> > > mmotm-readme.txt says
> > > 
> > > README for mm-of-the-moment:
> > > 
> > > http://www.ozlabs.org/~akpm/mmotm/
> > > 
> > > This is a snapshot of my -mm patch queue.  Uploaded at random hopefully
> > > more than once a week.
> > > 
> > > You will need quilt to apply these patches to the latest Linus release 
> > > (4.x
> > > or 4.x-rcY).  The series file is in broken-out.tar.gz and is duplicated in
> > > http://ozlabs.org/~akpm/mmotm/series
> > > 
> > > The file broken-out.tar.gz contains two datestamp files: .DATE and
> > > .DATE--mm-dd-hh-mm-ss.  Both contain the string -mm-dd-hh-mm-ss,
> > > followed by the base kernel version against which this patch series is to
> > > be applied.
> > 
> > um (or uml) defconfig on i386 and/or x86_64:
> > 
> > ../mm/page_alloc.c: In function 'memmap_init_zone':
> > ../mm/page_alloc.c:5450:5: error: implicit declaration of function 
> > 'memblock_next_valid_pfn' [-Werror=implicit-function-declaration]
> >  pfn = memblock_next_valid_pfn(pfn, end_pfn) - 1;
> >  ^
> > 
> > 
> > probably (?):
> > From: Eugeniu Rosca 
> > Subject: mm: page_alloc: skip over regions of invalid pfns on UMA
> 
> Yes. Steven has already reported the same [1]. There are two possible
> ways around this. Either provide and empty stub or use ifdef around
> memblock_next_valid_pfn. I would use the later because it is less
> confusing. We really do not want memblock_next_valid_pfn to be used
> outside of memblock aware code.
> 
> [1] http://lkml.kernel.org/r/20180222143057.3a1b3...@canb.auug.org.au
> 
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 4334d3a9c6a2..2836bc9e0999 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -5446,8 +5446,9 @@ void __meminit memmap_init_zone(unsigned long size, int 
> nid, unsigned long zone,
>* end_pfn), such that we hit a valid pfn (or end_pfn)
>* on our next iteration of the loop.
>*/
> - if (IS_ENABLED(CONFIG_HAVE_MEMBLOCK))
> - pfn = memblock_next_valid_pfn(pfn, end_pfn) - 1;
> +#ifdef CONFIG_HAVE_MEMBLOCK
> + pfn = memblock_next_valid_pfn(pfn, end_pfn) - 1;
> +#endif
>   continue;
>   }
>   if (!early_pfn_in_nid(pfn, nid))
> -- 
> Michal Hocko
> SUSE Labs


Re: mmotm 2018-02-21-14-48 uploaded (mm/page_alloc.c on UML)

2018-02-21 Thread Michal Hocko
On Wed 21-02-18 15:58:41, Randy Dunlap wrote:
> On 02/21/2018 02:48 PM, a...@linux-foundation.org wrote:
> > The mm-of-the-moment snapshot 2018-02-21-14-48 has been uploaded to
> > 
> >http://www.ozlabs.org/~akpm/mmotm/
> > 
> > mmotm-readme.txt says
> > 
> > README for mm-of-the-moment:
> > 
> > http://www.ozlabs.org/~akpm/mmotm/
> > 
> > This is a snapshot of my -mm patch queue.  Uploaded at random hopefully
> > more than once a week.
> > 
> > You will need quilt to apply these patches to the latest Linus release (4.x
> > or 4.x-rcY).  The series file is in broken-out.tar.gz and is duplicated in
> > http://ozlabs.org/~akpm/mmotm/series
> > 
> > The file broken-out.tar.gz contains two datestamp files: .DATE and
> > .DATE--mm-dd-hh-mm-ss.  Both contain the string -mm-dd-hh-mm-ss,
> > followed by the base kernel version against which this patch series is to
> > be applied.
> 
> um (or uml) defconfig on i386 and/or x86_64:
> 
> ../mm/page_alloc.c: In function 'memmap_init_zone':
> ../mm/page_alloc.c:5450:5: error: implicit declaration of function 
> 'memblock_next_valid_pfn' [-Werror=implicit-function-declaration]
>  pfn = memblock_next_valid_pfn(pfn, end_pfn) - 1;
>  ^
> 
> 
> probably (?):
> From: Eugeniu Rosca 
> Subject: mm: page_alloc: skip over regions of invalid pfns on UMA

Yes. Steven has already reported the same [1]. There are two possible
ways around this. Either provide and empty stub or use ifdef around
memblock_next_valid_pfn. I would use the later because it is less
confusing. We really do not want memblock_next_valid_pfn to be used
outside of memblock aware code.

[1] http://lkml.kernel.org/r/20180222143057.3a1b3...@canb.auug.org.au


diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 4334d3a9c6a2..2836bc9e0999 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5446,8 +5446,9 @@ void __meminit memmap_init_zone(unsigned long size, int 
nid, unsigned long zone,
 * end_pfn), such that we hit a valid pfn (or end_pfn)
 * on our next iteration of the loop.
 */
-   if (IS_ENABLED(CONFIG_HAVE_MEMBLOCK))
-   pfn = memblock_next_valid_pfn(pfn, end_pfn) - 1;
+#ifdef CONFIG_HAVE_MEMBLOCK
+   pfn = memblock_next_valid_pfn(pfn, end_pfn) - 1;
+#endif
continue;
}
if (!early_pfn_in_nid(pfn, nid))
-- 
Michal Hocko
SUSE Labs


Re: mmotm 2018-02-21-14-48 uploaded (mm/page_alloc.c on UML)

2018-02-21 Thread Randy Dunlap
On 02/21/2018 02:48 PM, a...@linux-foundation.org wrote:
> The mm-of-the-moment snapshot 2018-02-21-14-48 has been uploaded to
> 
>http://www.ozlabs.org/~akpm/mmotm/
> 
> mmotm-readme.txt says
> 
> README for mm-of-the-moment:
> 
> http://www.ozlabs.org/~akpm/mmotm/
> 
> This is a snapshot of my -mm patch queue.  Uploaded at random hopefully
> more than once a week.
> 
> You will need quilt to apply these patches to the latest Linus release (4.x
> or 4.x-rcY).  The series file is in broken-out.tar.gz and is duplicated in
> http://ozlabs.org/~akpm/mmotm/series
> 
> The file broken-out.tar.gz contains two datestamp files: .DATE and
> .DATE--mm-dd-hh-mm-ss.  Both contain the string -mm-dd-hh-mm-ss,
> followed by the base kernel version against which this patch series is to
> be applied.

um (or uml) defconfig on i386 and/or x86_64:

../mm/page_alloc.c: In function 'memmap_init_zone':
../mm/page_alloc.c:5450:5: error: implicit declaration of function 
'memblock_next_valid_pfn' [-Werror=implicit-function-declaration]
 pfn = memblock_next_valid_pfn(pfn, end_pfn) - 1;
 ^


probably (?):
From: Eugeniu Rosca 
Subject: mm: page_alloc: skip over regions of invalid pfns on UMA


-- 
~Randy