kernelci/staging.kernelci.org bisection: baseline.login on qemu_arm64-virt-gicv2 #684-staging


staging.kernelci.org bot
 

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This automated bisection report was sent to you on the basis *
* that you may be involved with the breaking commit it has *
* found. No manual investigation has been done to verify it, *
* and the root cause of the problem may be somewhere else. *
* *
* If you do send a fix, please include this trailer: *
* Reported-by: "kernelci.org bot" <bot@...> *
* *
* Hope this helps! *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

kernelci/staging.kernelci.org bisection: baseline.login on qemu_arm64-virt-gicv2 #684-staging

Summary:
Start: 400864cefbce staging-20200916.2
Plain log: https://storage.staging.kernelci.org/kernelci/staging.kernelci.org/staging-20200916.2/arm64/defconfig/gcc-8/lab-collabora/baseline-qemu_arm64-virt-gicv2.txt
HTML log: https://storage.staging.kernelci.org/kernelci/staging.kernelci.org/staging-20200916.2/arm64/defconfig/gcc-8/lab-collabora/baseline-qemu_arm64-virt-gicv2.html
Result: c999bd436fe9 mm/cma: make number of CMA areas dynamic, remove CONFIG_CMA_AREAS

Checks:
revert: PASS
verify: PASS

Parameters:
Tree: kernelci
URL: https://github.com/kernelci/linux.git
Branch: staging.kernelci.org
Target: qemu_arm64-virt-gicv2
CPU arch: arm64
Lab: lab-collabora
Compiler: gcc-8
Config: defconfig
Test case: baseline.login

Breaking commit found:

-------------------------------------------------------------------------------
commit c999bd436fe9bf0167e49a35976f4e58a708d79a
Author: Mike Kravetz <mike.kravetz@...>
Date: Wed Sep 16 13:49:17 2020 +1000

mm/cma: make number of CMA areas dynamic, remove CONFIG_CMA_AREAS

The number of distinct CMA areas is limited by the constant
CONFIG_CMA_AREAS. In most environments, this was set to a default
value of 7. Not too long ago, support was added to allocate hugetlb
gigantic pages from CMA. More recent changes to make dma_alloc_coherent
NUMA-aware on arm64 added more potential users of CMA areas. Along
with the dma_alloc_coherent changes, the default value of CMA_AREAS
was bumped up to 19 if NUMA is enabled.

It seems that the number of CMA users is likely to grow. Instead of
using a static array for cma areas, use a simple linked list. These
areas are used before normal memory allocators, so use the memblock
allocator.

Link: https://lkml.kernel.org/r/20200915205703.34572-1-mike.kravetz@oracle.com
Signed-off-by: Mike Kravetz <mike.kravetz@...>
Acked-by: Roman Gushchin <guro@...>
Cc: Barry Song <song.bao.hua@...>
Cc: Mike Rapoport <rppt@...>
Cc: Joonsoo Kim <js1304@...>
Cc: Rik van Riel <riel@...>
Cc: Aslan Bakirov <aslan@...>
Cc: Michal Hocko <mhocko@...>
Signed-off-by: Andrew Morton <akpm@...>
Signed-off-by: Stephen Rothwell <sfr@...>

diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 8a8949174b1c..764286637a0b 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -383,25 +383,33 @@ postcore_initcall(atomic_pool_init);
struct dma_contig_early_reserve {
phys_addr_t base;
unsigned long size;
+ struct list_head areas;
};

-static struct dma_contig_early_reserve dma_mmu_remap[MAX_CMA_AREAS] __initdata;
-
-static int dma_mmu_remap_num __initdata;
+static __initdata LIST_HEAD(dma_mmu_remap_areas);

void __init dma_contiguous_early_fixup(phys_addr_t base, unsigned long size)
{
- dma_mmu_remap[dma_mmu_remap_num].base = base;
- dma_mmu_remap[dma_mmu_remap_num].size = size;
- dma_mmu_remap_num++;
+ struct dma_contig_early_reserve *d;
+
+ d = memblock_alloc(sizeof(*d), sizeof(void *));
+ if (!d) {
+ pr_err("Unable to allocate dma_contig_early_reserve struct!\n");
+ return;
+ }
+
+ d->base = base;
+ d->size = size;
+ list_add_tail(&d->areas, &dma_mmu_remap_areas);
}

void __init dma_contiguous_remap(void)
{
- int i;
- for (i = 0; i < dma_mmu_remap_num; i++) {
- phys_addr_t start = dma_mmu_remap[i].base;
- phys_addr_t end = start + dma_mmu_remap[i].size;
+ struct dma_contig_early_reserve *d;
+
+ list_for_each_entry(d, &dma_mmu_remap_areas, areas) {
+ phys_addr_t start = d->base;
+ phys_addr_t end = start + d->size;
struct map_desc map;
unsigned long addr;

diff --git a/arch/mips/configs/cu1000-neo_defconfig b/arch/mips/configs/cu1000-neo_defconfig
index e924c817f73d..b86f3fd420f2 100644
--- a/arch/mips/configs/cu1000-neo_defconfig
+++ b/arch/mips/configs/cu1000-neo_defconfig
@@ -31,7 +31,6 @@ CONFIG_HZ_100=y
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
# CONFIG_COMPACTION is not set
CONFIG_CMA=y
-CONFIG_CMA_AREAS=7
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
diff --git a/arch/mips/configs/cu1830-neo_defconfig b/arch/mips/configs/cu1830-neo_defconfig
index cbfb62900273..98a31334fc57 100644
--- a/arch/mips/configs/cu1830-neo_defconfig
+++ b/arch/mips/configs/cu1830-neo_defconfig
@@ -31,7 +31,6 @@ CONFIG_HZ_100=y
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
# CONFIG_COMPACTION is not set
CONFIG_CMA=y
-CONFIG_CMA_AREAS=7
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
diff --git a/include/linux/cma.h b/include/linux/cma.h
index 6ff79fefd01f..3c1c5c38d423 100644
--- a/include/linux/cma.h
+++ b/include/linux/cma.h
@@ -6,18 +6,6 @@
#include <linux/types.h>
#include <linux/numa.h>

-/*
- * There is always at least global CMA area and a few optional
- * areas configured in kernel .config.
- */
-#ifdef CONFIG_CMA_AREAS
-#define MAX_CMA_AREAS (1 + CONFIG_CMA_AREAS)
-
-#else
-#define MAX_CMA_AREAS (0)
-
-#endif
-
struct cma;

extern unsigned long totalcma_pages;
diff --git a/mm/Kconfig b/mm/Kconfig
index f7c9374da7b3..358e27075941 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -513,17 +513,6 @@ config CMA_DEBUGFS
help
Turns on the DebugFS interface for CMA.

-config CMA_AREAS
- int "Maximum count of the CMA areas"
- depends on CMA
- default 7
- help
- CMA allows to create CMA areas for particular purpose, mainly,
- used as device private area. This parameter sets the maximum
- number of CMA area in the system.
-
- If unsure, leave the default value "7".
-
config MEM_SOFT_DIRTY
bool "Track memory changes"
depends on CHECKPOINT_RESTORE && HAVE_ARCH_SOFT_DIRTY && PROC_FS
diff --git a/mm/cma.c b/mm/cma.c
index 7f415d7cda9f..f3a983acf70e 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -36,8 +36,9 @@

#include "cma.h"

-struct cma cma_areas[MAX_CMA_AREAS];
-unsigned cma_area_count;
+/* modify here */
+LIST_HEAD(cma_areas);
+static unsigned int cma_area_count;
static DEFINE_MUTEX(cma_mutex);

phys_addr_t cma_get_base(const struct cma *cma)
@@ -143,10 +144,10 @@ static void __init cma_activate_area(struct cma *cma)

static int __init cma_init_reserved_areas(void)
{
- int i;
+ struct cma *c;

- for (i = 0; i < cma_area_count; i++)
- cma_activate_area(&cma_areas[i]);
+ list_for_each_entry(c, &cma_areas, areas)
+ cma_activate_area(c);

return 0;
}
@@ -172,12 +173,6 @@ int __init cma_init_reserved_mem(phys_addr_t base, phys_addr_t size,
struct cma *cma;
phys_addr_t alignment;

- /* Sanity checks */
- if (cma_area_count == ARRAY_SIZE(cma_areas)) {
- pr_err("Not enough slots for CMA reserved regions!\n");
- return -ENOSPC;
- }
-
if (!size || !memblock_is_region_reserved(base, size))
return -EINVAL;

@@ -192,12 +187,17 @@ int __init cma_init_reserved_mem(phys_addr_t base, phys_addr_t size,
if (ALIGN(base, alignment) != base || ALIGN(size, alignment) != size)
return -EINVAL;

+ cma = memblock_alloc(sizeof(*cma), sizeof(long));
+ if (!cma) {
+ pr_err("Unable to allocate CMA descriptor!\n");
+ return -ENOSPC;
+ }
+ list_add_tail(&cma->areas, &cma_areas);
+
/*
* Each reserved area must be initialised later, when more kernel
* subsystems (like slab allocator) are available.
*/
- cma = &cma_areas[cma_area_count];
-
if (name)
snprintf(cma->name, CMA_MAX_NAME, name);
else
@@ -253,11 +253,6 @@ int __init cma_declare_contiguous_nid(phys_addr_t base,
pr_debug("%s(size %pa, base %pa, limit %pa alignment %pa)\n",
__func__, &size, &base, &limit, &alignment);

- if (cma_area_count == ARRAY_SIZE(cma_areas)) {
- pr_err("Not enough slots for CMA reserved regions!\n");
- return -ENOSPC;
- }
-
if (!size)
return -EINVAL;

@@ -530,10 +525,10 @@ bool cma_release(struct cma *cma, const struct page *pages, unsigned int count)

int cma_for_each_area(int (*it)(struct cma *cma, void *data), void *data)
{
- int i;
+ struct cma *c;

- for (i = 0; i < cma_area_count; i++) {
- int ret = it(&cma_areas[i], data);
+ list_for_each_entry(c, &cma_areas, areas) {
+ int ret = it(c, data);

if (ret)
return ret;
diff --git a/mm/cma.h b/mm/cma.h
index 20f6e24bc477..528c7991daa8 100644
--- a/mm/cma.h
+++ b/mm/cma.h
@@ -17,11 +17,11 @@ struct cma {
spinlock_t mem_head_lock;
struct debugfs_u32_array dfs_bitmap;
#endif
+ struct list_head areas;
char name[CMA_MAX_NAME];
};

-extern struct cma cma_areas[MAX_CMA_AREAS];
-extern unsigned cma_area_count;
+extern struct list_head cma_areas;

static inline unsigned long cma_bitmap_maxno(struct cma *cma)
{
diff --git a/mm/cma_debug.c b/mm/cma_debug.c
index d5bf8aa34fdc..c39695d50224 100644
--- a/mm/cma_debug.c
+++ b/mm/cma_debug.c
@@ -188,12 +188,12 @@ static void cma_debugfs_add_one(struct cma *cma, struct dentry *root_dentry)
static int __init cma_debugfs_init(void)
{
struct dentry *cma_debugfs_root;
- int i;
+ struct cma *c;

cma_debugfs_root = debugfs_create_dir("cma", NULL);

- for (i = 0; i < cma_area_count; i++)
- cma_debugfs_add_one(&cma_areas[i], cma_debugfs_root);
+ list_for_each_entry(c, &cma_areas, areas)
+ cma_debugfs_add_one(c, cma_debugfs_root);

return 0;
}
-------------------------------------------------------------------------------


Git bisection log:

-------------------------------------------------------------------------------
git bisect start
# good: [fc4f28bb3daf3265d6bc5f73b497306985bb23ab] Merge tag 'for-5.9-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
git bisect good fc4f28bb3daf3265d6bc5f73b497306985bb23ab
# bad: [400864cefbce50601102242d0cd581e7fa754131] staging-20200916.2
git bisect bad 400864cefbce50601102242d0cd581e7fa754131
# good: [7973e424f0fc10f41badb20eb26e04b1b3dfb67e] Merge remote-tracking branch 'crypto/master' into master
git bisect good 7973e424f0fc10f41badb20eb26e04b1b3dfb67e
# good: [2fd69d863d4f9558c545e5c4531c2efa99fee4f8] Merge remote-tracking branch 'spi/for-next' into master
git bisect good 2fd69d863d4f9558c545e5c4531c2efa99fee4f8
# good: [f5f933f3914fdfab4ad799cf26d78a198cc9ee15] Merge remote-tracking branch 'thunderbolt/next' into master
git bisect good f5f933f3914fdfab4ad799cf26d78a198cc9ee15
# good: [fe8a4f21751c5e62a95ffce502bc08b89fccf799] Merge remote-tracking branch 'kselftest/next' into master
git bisect good fe8a4f21751c5e62a95ffce502bc08b89fccf799
# bad: [83360f00d8327c00ae86e0184d246f74fd04ca62] mm/memory_hotplug: mark pageblocks MIGRATE_ISOLATE while onlining memory
git bisect bad 83360f00d8327c00ae86e0184d246f74fd04ca62
# good: [06247c2987a51267ca90c66302cc1e55a60e398e] mm/mmap: leverage vma_rb_erase_ignore() to implement vma_rb_erase()
git bisect good 06247c2987a51267ca90c66302cc1e55a60e398e
# good: [7b019e814dd945301c6c98ca1bf6e04b58d9f872] memblock: remove unused memblock_mem_size()
git bisect good 7b019e814dd945301c6c98ca1bf6e04b58d9f872
# bad: [35028cd1b6007fb5c2158a4984920a289826302d] mm, hwpoison: remove recalculating hpage
git bisect bad 35028cd1b6007fb5c2158a4984920a289826302d
# good: [8dd7033f5d5db00606449d12e10876778e86742c] mm/huge_memory: fix split assumption of page size
git bisect good 8dd7033f5d5db00606449d12e10876778e86742c
# bad: [bf458fb386cfec27138047f740d89045a7ac1776] mm/readahead: add DEFINE_READAHEAD
git bisect bad bf458fb386cfec27138047f740d89045a7ac1776
# good: [7474019aff3cd092677c532ed2bd1704725da89c] mm/truncate: fix truncation for pages of arbitrary size
git bisect good 7474019aff3cd092677c532ed2bd1704725da89c
# good: [70a1b4f440b5d72d2e541ededf799aefbc14ad5a] mm/vmscan: allow arbitrary sized pages to be paged out
git bisect good 70a1b4f440b5d72d2e541ededf799aefbc14ad5a
# bad: [c999bd436fe9bf0167e49a35976f4e58a708d79a] mm/cma: make number of CMA areas dynamic, remove CONFIG_CMA_AREAS
git bisect bad c999bd436fe9bf0167e49a35976f4e58a708d79a
# first bad commit: [c999bd436fe9bf0167e49a35976f4e58a708d79a] mm/cma: make number of CMA areas dynamic, remove CONFIG_CMA_AREAS
-------------------------------------------------------------------------------

Join kernelci-results-staging@groups.io to automatically receive all group messages.