* [PATCH] <linux/page-isolation.h>: provide stubs for MEMORY_ISOLATION not set (for Microblaze)
@ 2020-09-06 19:33 Randy Dunlap
2020-09-07 7:05 ` Mike Rapoport
0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2020-09-06 19:33 UTC (permalink / raw)
To: LKML, Linux MM, Andrew Morton
Cc: Michal Nazarewicz, Wen Congyang, Michal Simek, Christoph Hellwig,
Mike Rapoport, kernel test robot
From: Randy Dunlap <rdunlap@infradead.org>
Fix build errors in Microblaze when CONFIG_MEMORY_ISOLATION is not
set/enabled by adding stubs for 3 missing functions.
Fixes these build errors:
gcc-9.3.0-nolibc/microblaze-linux/bin/microblaze-linux-ld: mm/page_alloc.o: in function `alloc_contig_range':
(.text+0xa0c0): undefined reference to `start_isolate_page_range'
gcc-9.3.0-nolibc/microblaze-linux/bin/microblaze-linux-ld: (.text+0xa2bc): undefined reference to `test_pages_isolated'
gcc-9.3.0-nolibc/microblaze-linux/bin/microblaze-linux-ld: (.text+0xa378): undefined reference to `undo_isolate_page_range'
Fixes: 0815f3d81d76 ("mm: page_isolation: MIGRATE_CMA isolation functions added") # v3.10
Fixes: b023f46813cd ("memory-hotplug: skip HWPoisoned page when offlining pages") # v3.10
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Michal Nazarewicz <mina86@mina86.com>
Cc: Wen Congyang <wency@cn.fujitsu.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Cc: linux-mm@kvack.org
---
include/linux/page-isolation.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
--- linux-next-20200903.orig/include/linux/page-isolation.h
+++ linux-next-20200903/include/linux/page-isolation.h
@@ -28,6 +28,22 @@ static inline bool is_migrate_isolate(in
{
return false;
}
+static inline int test_pages_isolated(unsigned long start_pfn,
+ unsigned long end_pfn, int isol_flags)
+{
+ return 0;
+}
+static inline int
+start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
+ unsigned migratetype, int flags)
+{
+ return 0;
+}
+static inline void
+undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
+ unsigned migratetype)
+{
+}
#endif
#define MEMORY_OFFLINE 0x1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] <linux/page-isolation.h>: provide stubs for MEMORY_ISOLATION not set (for Microblaze)
2020-09-06 19:33 [PATCH] <linux/page-isolation.h>: provide stubs for MEMORY_ISOLATION not set (for Microblaze) Randy Dunlap
@ 2020-09-07 7:05 ` Mike Rapoport
2020-09-07 22:15 ` Randy Dunlap
0 siblings, 1 reply; 3+ messages in thread
From: Mike Rapoport @ 2020-09-07 7:05 UTC (permalink / raw)
To: Randy Dunlap
Cc: LKML, Linux MM, Andrew Morton, Michal Nazarewicz, Wen Congyang,
Michal Simek, Christoph Hellwig, kernel test robot
Hi Randy,
On Sun, Sep 06, 2020 at 12:33:08PM -0700, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
>
> Fix build errors in Microblaze when CONFIG_MEMORY_ISOLATION is not
> set/enabled by adding stubs for 3 missing functions.
I've tried to follow Kconfig dependencies to see how could we have both
CONTIG_ALLOC=y and CONFIG_MEMORY_ISOLATION=n and I could not find how
was this possible.
We have
config CONTIG_ALLOC
def_bool (MEMORY_ISOLATION && COMPACTION) || CMA
and
config CMA
bool "Contiguous Memory Allocator"
depends on MMU
select MIGRATION
select MEMORY_ISOLATION
and alloc_contig_range() is hidden behind '#ifdef CONFIG_CONTIG_ALLOC'
In any rate, I think the better fix would be to update Kconfig
dependencies rather than add stubs for these functions.
> Fixes these build errors:
>
> gcc-9.3.0-nolibc/microblaze-linux/bin/microblaze-linux-ld: mm/page_alloc.o: in function `alloc_contig_range':
> (.text+0xa0c0): undefined reference to `start_isolate_page_range'
> gcc-9.3.0-nolibc/microblaze-linux/bin/microblaze-linux-ld: (.text+0xa2bc): undefined reference to `test_pages_isolated'
> gcc-9.3.0-nolibc/microblaze-linux/bin/microblaze-linux-ld: (.text+0xa378): undefined reference to `undo_isolate_page_range'
>
> Fixes: 0815f3d81d76 ("mm: page_isolation: MIGRATE_CMA isolation functions added") # v3.10
> Fixes: b023f46813cd ("memory-hotplug: skip HWPoisoned page when offlining pages") # v3.10
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Michal Nazarewicz <mina86@mina86.com>
> Cc: Wen Congyang <wency@cn.fujitsu.com>
> Cc: Michal Simek <monstr@monstr.eu>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Mike Rapoport <rppt@linux.ibm.com>
> Cc: linux-mm@kvack.org
> ---
> include/linux/page-isolation.h | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> --- linux-next-20200903.orig/include/linux/page-isolation.h
> +++ linux-next-20200903/include/linux/page-isolation.h
> @@ -28,6 +28,22 @@ static inline bool is_migrate_isolate(in
> {
> return false;
> }
> +static inline int test_pages_isolated(unsigned long start_pfn,
> + unsigned long end_pfn, int isol_flags)
> +{
> + return 0;
> +}
> +static inline int
> +start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
> + unsigned migratetype, int flags)
> +{
> + return 0;
> +}
> +static inline void
> +undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
> + unsigned migratetype)
> +{
> +}
> #endif
>
> #define MEMORY_OFFLINE 0x1
>
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] <linux/page-isolation.h>: provide stubs for MEMORY_ISOLATION not set (for Microblaze)
2020-09-07 7:05 ` Mike Rapoport
@ 2020-09-07 22:15 ` Randy Dunlap
0 siblings, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2020-09-07 22:15 UTC (permalink / raw)
To: Mike Rapoport
Cc: LKML, Linux MM, Andrew Morton, Michal Nazarewicz, Wen Congyang,
Michal Simek, Christoph Hellwig, kernel test robot
On 9/7/20 12:05 AM, Mike Rapoport wrote:
> Hi Randy,
>
> On Sun, Sep 06, 2020 at 12:33:08PM -0700, Randy Dunlap wrote:
>> From: Randy Dunlap <rdunlap@infradead.org>
>>
>> Fix build errors in Microblaze when CONFIG_MEMORY_ISOLATION is not
>> set/enabled by adding stubs for 3 missing functions.
>
> I've tried to follow Kconfig dependencies to see how could we have both
> CONTIG_ALLOC=y and CONFIG_MEMORY_ISOLATION=n and I could not find how
> was this possible.
>
> We have
>
> config CONTIG_ALLOC
> def_bool (MEMORY_ISOLATION && COMPACTION) || CMA
>
> and
>
> config CMA
> bool "Contiguous Memory Allocator"
> depends on MMU
> select MIGRATION
> select MEMORY_ISOLATION
>
> and alloc_contig_range() is hidden behind '#ifdef CONFIG_CONTIG_ALLOC'
>
> In any rate, I think the better fix would be to update Kconfig
> dependencies rather than add stubs for these functions.
OK, working on that. Should have something soon.
>> Fixes these build errors:
>>
>> gcc-9.3.0-nolibc/microblaze-linux/bin/microblaze-linux-ld: mm/page_alloc.o: in function `alloc_contig_range':
>> (.text+0xa0c0): undefined reference to `start_isolate_page_range'
>> gcc-9.3.0-nolibc/microblaze-linux/bin/microblaze-linux-ld: (.text+0xa2bc): undefined reference to `test_pages_isolated'
>> gcc-9.3.0-nolibc/microblaze-linux/bin/microblaze-linux-ld: (.text+0xa378): undefined reference to `undo_isolate_page_range'
>>
>> Fixes: 0815f3d81d76 ("mm: page_isolation: MIGRATE_CMA isolation functions added") # v3.10
>> Fixes: b023f46813cd ("memory-hotplug: skip HWPoisoned page when offlining pages") # v3.10
>> Reported-by: kernel test robot <lkp@intel.com>
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Michal Nazarewicz <mina86@mina86.com>
>> Cc: Wen Congyang <wency@cn.fujitsu.com>
>> Cc: Michal Simek <monstr@monstr.eu>
>> Cc: Christoph Hellwig <hch@lst.de>
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Cc: Mike Rapoport <rppt@linux.ibm.com>
>> Cc: linux-mm@kvack.org
>> ---
>> include/linux/page-isolation.h | 16 ++++++++++++++++
>> 1 file changed, 16 insertions(+)
--
~Randy
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-07 22:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-06 19:33 [PATCH] <linux/page-isolation.h>: provide stubs for MEMORY_ISOLATION not set (for Microblaze) Randy Dunlap
2020-09-07 7:05 ` Mike Rapoport
2020-09-07 22:15 ` Randy Dunlap
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).