* [Patch v3] mm/memblock: remove empty dummy entry
@ 2024-04-05 1:58 Wei Yang
2024-04-08 5:44 ` Mike Rapoport
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Wei Yang @ 2024-04-05 1:58 UTC (permalink / raw)
To: rppt, akpm; +Cc: linux-mm, Wei Yang, Paul Mackerras, Tejun Heo
The dummy entry is introduced in the initial implementation of lmb in
commit 7c8c6b9776fb ("powerpc: Merge lmb.c and make MM initialization
use it.").
As the comment says the empty dummy entry is to simplify the code.
/* Create a dummy zero size LMB which will get coalesced away later.
* This simplifies the lmb_add() code below...
*/
While current code is reimplemented by Tejun in commit 784656f9c680
("memblock: Reimplement memblock_add_region()"). This empty dummy entry
seems not benefit the code any more.
Let's remove it.
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
CC: Paul Mackerras <paulus@ozlabs.org>
CC: Tejun Heo <tj@kernel.org>
CC: Mike Rapoport <rppt@kernel.org>
---
v2: remove cnt initialization to 0 and keep special case for empty array
v3: reset cnt to 0 in memblock test
---
mm/memblock.c | 7 ++-----
tools/testing/memblock/tests/basic_api.c | 8 ++++----
tools/testing/memblock/tests/common.c | 4 ++--
3 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/mm/memblock.c b/mm/memblock.c
index d09136e040d3..98d25689cf10 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -114,12 +114,10 @@ static struct memblock_region memblock_physmem_init_regions[INIT_PHYSMEM_REGIONS
struct memblock memblock __initdata_memblock = {
.memory.regions = memblock_memory_init_regions,
- .memory.cnt = 1, /* empty dummy entry */
.memory.max = INIT_MEMBLOCK_MEMORY_REGIONS,
.memory.name = "memory",
.reserved.regions = memblock_reserved_init_regions,
- .reserved.cnt = 1, /* empty dummy entry */
.reserved.max = INIT_MEMBLOCK_RESERVED_REGIONS,
.reserved.name = "reserved",
@@ -130,7 +128,6 @@ struct memblock memblock __initdata_memblock = {
#ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP
struct memblock_type physmem = {
.regions = memblock_physmem_init_regions,
- .cnt = 1, /* empty dummy entry */
.max = INIT_PHYSMEM_REGIONS,
.name = "physmem",
};
@@ -356,7 +353,6 @@ static void __init_memblock memblock_remove_region(struct memblock_type *type, u
/* Special case for empty arrays */
if (type->cnt == 0) {
WARN_ON(type->total_size != 0);
- type->cnt = 1;
type->regions[0].base = 0;
type->regions[0].size = 0;
type->regions[0].flags = 0;
@@ -600,12 +596,13 @@ static int __init_memblock memblock_add_range(struct memblock_type *type,
/* special case for empty array */
if (type->regions[0].size == 0) {
- WARN_ON(type->cnt != 1 || type->total_size);
+ WARN_ON(type->cnt != 0 || type->total_size);
type->regions[0].base = base;
type->regions[0].size = size;
type->regions[0].flags = flags;
memblock_set_region_node(&type->regions[0], nid);
type->total_size = size;
+ type->cnt = 1;
return 0;
}
diff --git a/tools/testing/memblock/tests/basic_api.c b/tools/testing/memblock/tests/basic_api.c
index 57bf2688edfd..f317fe691fc4 100644
--- a/tools/testing/memblock/tests/basic_api.c
+++ b/tools/testing/memblock/tests/basic_api.c
@@ -15,12 +15,12 @@ static int memblock_initialization_check(void)
PREFIX_PUSH();
ASSERT_NE(memblock.memory.regions, NULL);
- ASSERT_EQ(memblock.memory.cnt, 1);
+ ASSERT_EQ(memblock.memory.cnt, 0);
ASSERT_EQ(memblock.memory.max, EXPECTED_MEMBLOCK_REGIONS);
ASSERT_EQ(strcmp(memblock.memory.name, "memory"), 0);
ASSERT_NE(memblock.reserved.regions, NULL);
- ASSERT_EQ(memblock.reserved.cnt, 1);
+ ASSERT_EQ(memblock.reserved.cnt, 0);
ASSERT_EQ(memblock.memory.max, EXPECTED_MEMBLOCK_REGIONS);
ASSERT_EQ(strcmp(memblock.reserved.name, "reserved"), 0);
@@ -1295,7 +1295,7 @@ static int memblock_remove_only_region_check(void)
ASSERT_EQ(rgn->base, 0);
ASSERT_EQ(rgn->size, 0);
- ASSERT_EQ(memblock.memory.cnt, 1);
+ ASSERT_EQ(memblock.memory.cnt, 0);
ASSERT_EQ(memblock.memory.total_size, 0);
test_pass_pop();
@@ -1723,7 +1723,7 @@ static int memblock_free_only_region_check(void)
ASSERT_EQ(rgn->base, 0);
ASSERT_EQ(rgn->size, 0);
- ASSERT_EQ(memblock.reserved.cnt, 1);
+ ASSERT_EQ(memblock.reserved.cnt, 0);
ASSERT_EQ(memblock.reserved.total_size, 0);
test_pass_pop();
diff --git a/tools/testing/memblock/tests/common.c b/tools/testing/memblock/tests/common.c
index f43b6f414983..c2c569f12178 100644
--- a/tools/testing/memblock/tests/common.c
+++ b/tools/testing/memblock/tests/common.c
@@ -40,13 +40,13 @@ void reset_memblock_regions(void)
{
memset(memblock.memory.regions, 0,
memblock.memory.cnt * sizeof(struct memblock_region));
- memblock.memory.cnt = 1;
+ memblock.memory.cnt = 0;
memblock.memory.max = INIT_MEMBLOCK_REGIONS;
memblock.memory.total_size = 0;
memset(memblock.reserved.regions, 0,
memblock.reserved.cnt * sizeof(struct memblock_region));
- memblock.reserved.cnt = 1;
+ memblock.reserved.cnt = 0;
memblock.reserved.max = INIT_MEMBLOCK_RESERVED_REGIONS;
memblock.reserved.total_size = 0;
}
--
2.34.1
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [Patch v3] mm/memblock: remove empty dummy entry
2024-04-05 1:58 [Patch v3] mm/memblock: remove empty dummy entry Wei Yang
@ 2024-04-08 5:44 ` Mike Rapoport
2024-04-08 12:37 ` Wei Yang
2024-04-09 5:02 ` Mike Rapoport
[not found] ` <8d6205d4-18fb-4e98-97e6-db226dcf48f3@roeck-us.net>
2 siblings, 1 reply; 10+ messages in thread
From: Mike Rapoport @ 2024-04-08 5:44 UTC (permalink / raw)
To: Wei Yang; +Cc: akpm, linux-mm, Paul Mackerras, Tejun Heo
On Fri, Apr 05, 2024 at 01:58:21AM +0000, Wei Yang wrote:
> The dummy entry is introduced in the initial implementation of lmb in
> commit 7c8c6b9776fb ("powerpc: Merge lmb.c and make MM initialization
> use it.").
>
> As the comment says the empty dummy entry is to simplify the code.
>
> /* Create a dummy zero size LMB which will get coalesced away later.
> * This simplifies the lmb_add() code below...
> */
>
> While current code is reimplemented by Tejun in commit 784656f9c680
> ("memblock: Reimplement memblock_add_region()"). This empty dummy entry
> seems not benefit the code any more.
>
> Let's remove it.
>
> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
> CC: Paul Mackerras <paulus@ozlabs.org>
> CC: Tejun Heo <tj@kernel.org>
> CC: Mike Rapoport <rppt@kernel.org>
>
> ---
> v2: remove cnt initialization to 0 and keep special case for empty array
> v3: reset cnt to 0 in memblock test
> ---
> mm/memblock.c | 7 ++-----
> tools/testing/memblock/tests/basic_api.c | 8 ++++----
> tools/testing/memblock/tests/common.c | 4 ++--
> 3 files changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/mm/memblock.c b/mm/memblock.c
> index d09136e040d3..98d25689cf10 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -114,12 +114,10 @@ static struct memblock_region memblock_physmem_init_regions[INIT_PHYSMEM_REGIONS
>
> struct memblock memblock __initdata_memblock = {
> .memory.regions = memblock_memory_init_regions,
> - .memory.cnt = 1, /* empty dummy entry */
> .memory.max = INIT_MEMBLOCK_MEMORY_REGIONS,
> .memory.name = "memory",
>
> .reserved.regions = memblock_reserved_init_regions,
> - .reserved.cnt = 1, /* empty dummy entry */
> .reserved.max = INIT_MEMBLOCK_RESERVED_REGIONS,
> .reserved.name = "reserved",
>
> @@ -130,7 +128,6 @@ struct memblock memblock __initdata_memblock = {
> #ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP
> struct memblock_type physmem = {
> .regions = memblock_physmem_init_regions,
> - .cnt = 1, /* empty dummy entry */
> .max = INIT_PHYSMEM_REGIONS,
> .name = "physmem",
> };
> @@ -356,7 +353,6 @@ static void __init_memblock memblock_remove_region(struct memblock_type *type, u
> /* Special case for empty arrays */
> if (type->cnt == 0) {
> WARN_ON(type->total_size != 0);
> - type->cnt = 1;
Sorry if I wasn't clear, I meant to keep special case only in
memblock_add_range. Here I think
WARN_ON(type->cnt == 0 && type->total_size != 0);
should be enough.
> type->regions[0].base = 0;
> type->regions[0].size = 0;
> type->regions[0].flags = 0;
> @@ -600,12 +596,13 @@ static int __init_memblock memblock_add_range(struct memblock_type *type,
>
> /* special case for empty array */
> if (type->regions[0].size == 0) {
> - WARN_ON(type->cnt != 1 || type->total_size);
> + WARN_ON(type->cnt != 0 || type->total_size);
> type->regions[0].base = base;
> type->regions[0].size = size;
> type->regions[0].flags = flags;
> memblock_set_region_node(&type->regions[0], nid);
> type->total_size = size;
> + type->cnt = 1;
> return 0;
> }
>
> diff --git a/tools/testing/memblock/tests/basic_api.c b/tools/testing/memblock/tests/basic_api.c
> index 57bf2688edfd..f317fe691fc4 100644
> --- a/tools/testing/memblock/tests/basic_api.c
> +++ b/tools/testing/memblock/tests/basic_api.c
> @@ -15,12 +15,12 @@ static int memblock_initialization_check(void)
> PREFIX_PUSH();
>
> ASSERT_NE(memblock.memory.regions, NULL);
> - ASSERT_EQ(memblock.memory.cnt, 1);
> + ASSERT_EQ(memblock.memory.cnt, 0);
> ASSERT_EQ(memblock.memory.max, EXPECTED_MEMBLOCK_REGIONS);
> ASSERT_EQ(strcmp(memblock.memory.name, "memory"), 0);
>
> ASSERT_NE(memblock.reserved.regions, NULL);
> - ASSERT_EQ(memblock.reserved.cnt, 1);
> + ASSERT_EQ(memblock.reserved.cnt, 0);
> ASSERT_EQ(memblock.memory.max, EXPECTED_MEMBLOCK_REGIONS);
> ASSERT_EQ(strcmp(memblock.reserved.name, "reserved"), 0);
>
> @@ -1295,7 +1295,7 @@ static int memblock_remove_only_region_check(void)
> ASSERT_EQ(rgn->base, 0);
> ASSERT_EQ(rgn->size, 0);
>
> - ASSERT_EQ(memblock.memory.cnt, 1);
> + ASSERT_EQ(memblock.memory.cnt, 0);
> ASSERT_EQ(memblock.memory.total_size, 0);
>
> test_pass_pop();
> @@ -1723,7 +1723,7 @@ static int memblock_free_only_region_check(void)
> ASSERT_EQ(rgn->base, 0);
> ASSERT_EQ(rgn->size, 0);
>
> - ASSERT_EQ(memblock.reserved.cnt, 1);
> + ASSERT_EQ(memblock.reserved.cnt, 0);
> ASSERT_EQ(memblock.reserved.total_size, 0);
>
> test_pass_pop();
> diff --git a/tools/testing/memblock/tests/common.c b/tools/testing/memblock/tests/common.c
> index f43b6f414983..c2c569f12178 100644
> --- a/tools/testing/memblock/tests/common.c
> +++ b/tools/testing/memblock/tests/common.c
> @@ -40,13 +40,13 @@ void reset_memblock_regions(void)
> {
> memset(memblock.memory.regions, 0,
> memblock.memory.cnt * sizeof(struct memblock_region));
> - memblock.memory.cnt = 1;
> + memblock.memory.cnt = 0;
> memblock.memory.max = INIT_MEMBLOCK_REGIONS;
> memblock.memory.total_size = 0;
>
> memset(memblock.reserved.regions, 0,
> memblock.reserved.cnt * sizeof(struct memblock_region));
> - memblock.reserved.cnt = 1;
> + memblock.reserved.cnt = 0;
> memblock.reserved.max = INIT_MEMBLOCK_RESERVED_REGIONS;
> memblock.reserved.total_size = 0;
> }
> --
> 2.34.1
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [Patch v3] mm/memblock: remove empty dummy entry
2024-04-08 5:44 ` Mike Rapoport
@ 2024-04-08 12:37 ` Wei Yang
0 siblings, 0 replies; 10+ messages in thread
From: Wei Yang @ 2024-04-08 12:37 UTC (permalink / raw)
To: Mike Rapoport; +Cc: Wei Yang, akpm, linux-mm, Paul Mackerras, Tejun Heo
On Mon, Apr 08, 2024 at 08:44:31AM +0300, Mike Rapoport wrote:
>On Fri, Apr 05, 2024 at 01:58:21AM +0000, Wei Yang wrote:
>> The dummy entry is introduced in the initial implementation of lmb in
>> commit 7c8c6b9776fb ("powerpc: Merge lmb.c and make MM initialization
>> use it.").
>>
>> As the comment says the empty dummy entry is to simplify the code.
>>
>> /* Create a dummy zero size LMB which will get coalesced away later.
>> * This simplifies the lmb_add() code below...
>> */
>>
>> While current code is reimplemented by Tejun in commit 784656f9c680
>> ("memblock: Reimplement memblock_add_region()"). This empty dummy entry
>> seems not benefit the code any more.
>>
>> Let's remove it.
>>
>> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>> CC: Paul Mackerras <paulus@ozlabs.org>
>> CC: Tejun Heo <tj@kernel.org>
>> CC: Mike Rapoport <rppt@kernel.org>
>>
>> ---
>> v2: remove cnt initialization to 0 and keep special case for empty array
>> v3: reset cnt to 0 in memblock test
>> ---
>> mm/memblock.c | 7 ++-----
>> tools/testing/memblock/tests/basic_api.c | 8 ++++----
>> tools/testing/memblock/tests/common.c | 4 ++--
>> 3 files changed, 8 insertions(+), 11 deletions(-)
>>
>> diff --git a/mm/memblock.c b/mm/memblock.c
>> index d09136e040d3..98d25689cf10 100644
>> --- a/mm/memblock.c
>> +++ b/mm/memblock.c
>> @@ -114,12 +114,10 @@ static struct memblock_region memblock_physmem_init_regions[INIT_PHYSMEM_REGIONS
>>
>> struct memblock memblock __initdata_memblock = {
>> .memory.regions = memblock_memory_init_regions,
>> - .memory.cnt = 1, /* empty dummy entry */
>> .memory.max = INIT_MEMBLOCK_MEMORY_REGIONS,
>> .memory.name = "memory",
>>
>> .reserved.regions = memblock_reserved_init_regions,
>> - .reserved.cnt = 1, /* empty dummy entry */
>> .reserved.max = INIT_MEMBLOCK_RESERVED_REGIONS,
>> .reserved.name = "reserved",
>>
>> @@ -130,7 +128,6 @@ struct memblock memblock __initdata_memblock = {
>> #ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP
>> struct memblock_type physmem = {
>> .regions = memblock_physmem_init_regions,
>> - .cnt = 1, /* empty dummy entry */
>> .max = INIT_PHYSMEM_REGIONS,
>> .name = "physmem",
>> };
>> @@ -356,7 +353,6 @@ static void __init_memblock memblock_remove_region(struct memblock_type *type, u
>> /* Special case for empty arrays */
>> if (type->cnt == 0) {
>> WARN_ON(type->total_size != 0);
>> - type->cnt = 1;
>
>Sorry if I wasn't clear, I meant to keep special case only in
>memblock_add_range. Here I think
>
> WARN_ON(type->cnt == 0 && type->total_size != 0);
>
>should be enough.
>
You mean change like this?
diff --git a/mm/memblock.c b/mm/memblock.c
index d09136e040d3..b75b835f99d1 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -352,16 +352,7 @@ static void __init_memblock memblock_remove_region(struct memblock_type *type, u
memmove(&type->regions[r], &type->regions[r + 1],
(type->cnt - (r + 1)) * sizeof(type->regions[r]));
type->cnt--;
-
- /* Special case for empty arrays */
- if (type->cnt == 0) {
- WARN_ON(type->total_size != 0);
- type->cnt = 1;
- type->regions[0].base = 0;
- type->regions[0].size = 0;
- type->regions[0].flags = 0;
- memblock_set_region_node(&type->regions[0], MAX_NUMNODES);
- }
+ WARN_ON(type->cnt == 0 && type->total_size != 0);
}
#ifndef CONFIG_ARCH_KEEP_MEMBLOCK
This doesn't work, since on removing the last region, memmove would take no
effect and left regions[0].base .size .flags not changed.
So we need to keep the special handling here.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Patch v3] mm/memblock: remove empty dummy entry
2024-04-05 1:58 [Patch v3] mm/memblock: remove empty dummy entry Wei Yang
2024-04-08 5:44 ` Mike Rapoport
@ 2024-04-09 5:02 ` Mike Rapoport
[not found] ` <8d6205d4-18fb-4e98-97e6-db226dcf48f3@roeck-us.net>
2 siblings, 0 replies; 10+ messages in thread
From: Mike Rapoport @ 2024-04-09 5:02 UTC (permalink / raw)
To: akpm, Wei Yang; +Cc: Mike Rapoport, linux-mm, Paul Mackerras, Tejun Heo
From: Mike Rapoport (IBM) <rppt@kernel.org>
On Fri, 05 Apr 2024 01:58:21 +0000, Wei Yang wrote:
> The dummy entry is introduced in the initial implementation of lmb in
> commit 7c8c6b9776fb ("powerpc: Merge lmb.c and make MM initialization
> use it.").
>
> As the comment says the empty dummy entry is to simplify the code.
>
> /* Create a dummy zero size LMB which will get coalesced away later.
> * This simplifies the lmb_add() code below...
> */
>
> [...]
Applied to for-next branch of memblock.git tree, thanks!
[1/1] mm/memblock: remove empty dummy entry
commit: e5d1fdecfaf8470bad3874d00c7921e3883495b7
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock
branch: for-next
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 10+ messages in thread[parent not found: <8d6205d4-18fb-4e98-97e6-db226dcf48f3@roeck-us.net>]
* Re: [Patch v3] mm/memblock: remove empty dummy entry
[not found] ` <8d6205d4-18fb-4e98-97e6-db226dcf48f3@roeck-us.net>
@ 2024-06-21 1:07 ` Wei Yang
2024-06-21 2:34 ` Guenter Roeck
2024-06-21 1:11 ` Wei Yang
1 sibling, 1 reply; 10+ messages in thread
From: Wei Yang @ 2024-06-21 1:07 UTC (permalink / raw)
To: Guenter Roeck; +Cc: Wei Yang, rppt, akpm, linux-mm, Paul Mackerras, Tejun Heo
On Thu, Jun 20, 2024 at 02:58:17PM -0700, Guenter Roeck wrote:
>Hi,
>
>On Fri, Apr 05, 2024 at 01:58:21AM +0000, Wei Yang wrote:
>> The dummy entry is introduced in the initial implementation of lmb in
>> commit 7c8c6b9776fb ("powerpc: Merge lmb.c and make MM initialization
>> use it.").
>>
>> As the comment says the empty dummy entry is to simplify the code.
>>
>> /* Create a dummy zero size LMB which will get coalesced away later.
>> * This simplifies the lmb_add() code below...
>> */
>>
>> While current code is reimplemented by Tejun in commit 784656f9c680
>> ("memblock: Reimplement memblock_add_region()"). This empty dummy entry
>> seems not benefit the code any more.
>>
>> Let's remove it.
>>
>> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>> CC: Paul Mackerras <paulus@ozlabs.org>
>> CC: Tejun Heo <tj@kernel.org>
>> CC: Mike Rapoport <rppt@kernel.org>
>>
>
>With this patch in linux-next, all microblaze qemu images fail to boot. Reverting it
>fixes the problem.
>
>Bisect log is attached for reference.
>
Thanks for the reporting.
Would you mind running the test to take a look?
It is in tools/testing/memblock. Simply make and ./main.
>Guenter
>
>---
># bad: [2102cb0d050d34d50b9642a3a50861787527e922] Add linux-next specific files for 20240619
># good: [6ba59ff4227927d3a8530fc2973b80e94b54d58f] Linux 6.10-rc4
>git bisect start 'HEAD' 'v6.10-rc4'
># good: [a8fa5261ec87d5aafd3211548d93008d5739457d] Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
>git bisect good a8fa5261ec87d5aafd3211548d93008d5739457d
># good: [ee551f4db89753511a399b808db75654facec7c8] Merge branch 'for-linux-next' of https://gitlab.freedesktop.org/drm/i915/kernel
>git bisect good ee551f4db89753511a399b808db75654facec7c8
># good: [ec3557f4b791d72d93bfb69702d441d2c9f8cd0d] Merge branch 'next' of git://git.kernel.org/pub/scm/virt/kvm/kvm.git
>git bisect good ec3557f4b791d72d93bfb69702d441d2c9f8cd0d
># good: [48d51b3acbb237074014d498d76ea6b6ce5aed69] Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy.git
>git bisect good 48d51b3acbb237074014d498d76ea6b6ce5aed69
># good: [59972b98583cd97febf9ecc576a706a7c5046278] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git
>git bisect good 59972b98583cd97febf9ecc576a706a7c5046278
># good: [49aa15d761ce8976bb131f06886e89bd10cdb9fd] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching
>git bisect good 49aa15d761ce8976bb131f06886e89bd10cdb9fd
># bad: [129b9b07cd69885a804319c3fac82ef79e012e07] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock.git
>git bisect bad 129b9b07cd69885a804319c3fac82ef79e012e07
># good: [344db92cbecc8da1f58d559926c61ceb72e72a03] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/srini/nvmem.git
>git bisect good 344db92cbecc8da1f58d559926c61ceb72e72a03
># bad: [ce8ebb95439459f7e24b02c6943e278f46d2d328] mm/mm_init.c: get the highest zone directly
>git bisect bad ce8ebb95439459f7e24b02c6943e278f46d2d328
># bad: [1a879671bdfd14698a839f30de8e6d76e1e858fd] memblock tests: add memblock_overlaps_region_checks
>git bisect bad 1a879671bdfd14698a839f30de8e6d76e1e858fd
># bad: [3d3165193776ddacf59f101f0fa05cfab9f1a9ba] memblock tests: add memblock_reserve_all_locations_check()
>git bisect bad 3d3165193776ddacf59f101f0fa05cfab9f1a9ba
># bad: [721f4a6526daafca15634f30c9865e880da3e1d1] mm/memblock: remove empty dummy entry
>git bisect bad 721f4a6526daafca15634f30c9865e880da3e1d1
># first bad commit: [721f4a6526daafca15634f30c9865e880da3e1d1] mm/memblock: remove empty dummy entry
--
Wei Yang
Help you, Help me
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [Patch v3] mm/memblock: remove empty dummy entry
2024-06-21 1:07 ` Wei Yang
@ 2024-06-21 2:34 ` Guenter Roeck
2024-06-21 23:06 ` Wei Yang
0 siblings, 1 reply; 10+ messages in thread
From: Guenter Roeck @ 2024-06-21 2:34 UTC (permalink / raw)
To: Wei Yang; +Cc: rppt, akpm, linux-mm, Paul Mackerras, Tejun Heo
On 6/20/24 18:07, Wei Yang wrote:
> On Thu, Jun 20, 2024 at 02:58:17PM -0700, Guenter Roeck wrote:
>> Hi,
>>
>> On Fri, Apr 05, 2024 at 01:58:21AM +0000, Wei Yang wrote:
>>> The dummy entry is introduced in the initial implementation of lmb in
>>> commit 7c8c6b9776fb ("powerpc: Merge lmb.c and make MM initialization
>>> use it.").
>>>
>>> As the comment says the empty dummy entry is to simplify the code.
>>>
>>> /* Create a dummy zero size LMB which will get coalesced away later.
>>> * This simplifies the lmb_add() code below...
>>> */
>>>
>>> While current code is reimplemented by Tejun in commit 784656f9c680
>>> ("memblock: Reimplement memblock_add_region()"). This empty dummy entry
>>> seems not benefit the code any more.
>>>
>>> Let's remove it.
>>>
>>> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>>> CC: Paul Mackerras <paulus@ozlabs.org>
>>> CC: Tejun Heo <tj@kernel.org>
>>> CC: Mike Rapoport <rppt@kernel.org>
>>>
>>
>> With this patch in linux-next, all microblaze qemu images fail to boot. Reverting it
>> fixes the problem.
>>
>> Bisect log is attached for reference.
>>
>
> Thanks for the reporting.
>
> Would you mind running the test to take a look?
>
> It is in tools/testing/memblock. Simply make and ./main.
>
This is a silent failure. There is no console output, so the image crashes
before it gets to that point.
Building microblaze:petalogix-s3adsp1800:initrd ... running ................R............. failed (silent)
------------
qemu log:
qemu-system-microblaze: terminating on signal 15 from pid 2343410 (/bin/bash)
Guenter
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [Patch v3] mm/memblock: remove empty dummy entry
2024-06-21 2:34 ` Guenter Roeck
@ 2024-06-21 23:06 ` Wei Yang
[not found] ` <2113ef59-0efd-4de2-83f7-f5940ce40fca@roeck-us.net>
0 siblings, 1 reply; 10+ messages in thread
From: Wei Yang @ 2024-06-21 23:06 UTC (permalink / raw)
To: Guenter Roeck; +Cc: Wei Yang, rppt, akpm, linux-mm, Paul Mackerras, Tejun Heo
On Thu, Jun 20, 2024 at 07:34:06PM -0700, Guenter Roeck wrote:
>On 6/20/24 18:07, Wei Yang wrote:
>> On Thu, Jun 20, 2024 at 02:58:17PM -0700, Guenter Roeck wrote:
>> > Hi,
>> >
>> > On Fri, Apr 05, 2024 at 01:58:21AM +0000, Wei Yang wrote:
>> > > The dummy entry is introduced in the initial implementation of lmb in
>> > > commit 7c8c6b9776fb ("powerpc: Merge lmb.c and make MM initialization
>> > > use it.").
>> > >
>> > > As the comment says the empty dummy entry is to simplify the code.
>> > >
>> > > /* Create a dummy zero size LMB which will get coalesced away later.
>> > > * This simplifies the lmb_add() code below...
>> > > */
>> > >
>> > > While current code is reimplemented by Tejun in commit 784656f9c680
>> > > ("memblock: Reimplement memblock_add_region()"). This empty dummy entry
>> > > seems not benefit the code any more.
>> > >
>> > > Let's remove it.
>> > >
>> > > Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>> > > CC: Paul Mackerras <paulus@ozlabs.org>
>> > > CC: Tejun Heo <tj@kernel.org>
>> > > CC: Mike Rapoport <rppt@kernel.org>
>> > >
>> >
>> > With this patch in linux-next, all microblaze qemu images fail to boot. Reverting it
>> > fixes the problem.
>> >
>> > Bisect log is attached for reference.
>> >
>>
>> Thanks for the reporting.
>>
>> Would you mind running the test to take a look?
>>
>> It is in tools/testing/memblock. Simply make and ./main.
>>
This is a user-space test case, would you mind running it with this commit
applied?
>
>This is a silent failure. There is no console output, so the image crashes
>before it gets to that point.
>
>Building microblaze:petalogix-s3adsp1800:initrd ... running ................R............. failed (silent)
>------------
>qemu log:
>qemu-system-microblaze: terminating on signal 15 from pid 2343410 (/bin/bash)
>
Would you mind add kernel parameter memblock=debug without the commit applied?
If my understanding is correct, you can bootup without this commit, right?
>Guenter
--
Wei Yang
Help you, Help me
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Patch v3] mm/memblock: remove empty dummy entry
[not found] ` <8d6205d4-18fb-4e98-97e6-db226dcf48f3@roeck-us.net>
2024-06-21 1:07 ` Wei Yang
@ 2024-06-21 1:11 ` Wei Yang
1 sibling, 0 replies; 10+ messages in thread
From: Wei Yang @ 2024-06-21 1:11 UTC (permalink / raw)
To: Guenter Roeck; +Cc: Wei Yang, rppt, akpm, linux-mm, Paul Mackerras, Tejun Heo
On Thu, Jun 20, 2024 at 02:58:17PM -0700, Guenter Roeck wrote:
>Hi,
>
>On Fri, Apr 05, 2024 at 01:58:21AM +0000, Wei Yang wrote:
>> The dummy entry is introduced in the initial implementation of lmb in
>> commit 7c8c6b9776fb ("powerpc: Merge lmb.c and make MM initialization
>> use it.").
>>
>> As the comment says the empty dummy entry is to simplify the code.
>>
>> /* Create a dummy zero size LMB which will get coalesced away later.
>> * This simplifies the lmb_add() code below...
>> */
>>
>> While current code is reimplemented by Tejun in commit 784656f9c680
>> ("memblock: Reimplement memblock_add_region()"). This empty dummy entry
>> seems not benefit the code any more.
>>
>> Let's remove it.
>>
>> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>> CC: Paul Mackerras <paulus@ozlabs.org>
>> CC: Tejun Heo <tj@kernel.org>
>> CC: Mike Rapoport <rppt@kernel.org>
>>
>
>With this patch in linux-next, all microblaze qemu images fail to boot. Reverting it
>fixes the problem.
>
>Bisect log is attached for reference.
>
Also, would you mind add kernel parameter memblock=debug and give me the log?
>Guenter
>
>---
># bad: [2102cb0d050d34d50b9642a3a50861787527e922] Add linux-next specific files for 20240619
># good: [6ba59ff4227927d3a8530fc2973b80e94b54d58f] Linux 6.10-rc4
>git bisect start 'HEAD' 'v6.10-rc4'
># good: [a8fa5261ec87d5aafd3211548d93008d5739457d] Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
>git bisect good a8fa5261ec87d5aafd3211548d93008d5739457d
># good: [ee551f4db89753511a399b808db75654facec7c8] Merge branch 'for-linux-next' of https://gitlab.freedesktop.org/drm/i915/kernel
>git bisect good ee551f4db89753511a399b808db75654facec7c8
># good: [ec3557f4b791d72d93bfb69702d441d2c9f8cd0d] Merge branch 'next' of git://git.kernel.org/pub/scm/virt/kvm/kvm.git
>git bisect good ec3557f4b791d72d93bfb69702d441d2c9f8cd0d
># good: [48d51b3acbb237074014d498d76ea6b6ce5aed69] Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy.git
>git bisect good 48d51b3acbb237074014d498d76ea6b6ce5aed69
># good: [59972b98583cd97febf9ecc576a706a7c5046278] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git
>git bisect good 59972b98583cd97febf9ecc576a706a7c5046278
># good: [49aa15d761ce8976bb131f06886e89bd10cdb9fd] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching
>git bisect good 49aa15d761ce8976bb131f06886e89bd10cdb9fd
># bad: [129b9b07cd69885a804319c3fac82ef79e012e07] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock.git
>git bisect bad 129b9b07cd69885a804319c3fac82ef79e012e07
># good: [344db92cbecc8da1f58d559926c61ceb72e72a03] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/srini/nvmem.git
>git bisect good 344db92cbecc8da1f58d559926c61ceb72e72a03
># bad: [ce8ebb95439459f7e24b02c6943e278f46d2d328] mm/mm_init.c: get the highest zone directly
>git bisect bad ce8ebb95439459f7e24b02c6943e278f46d2d328
># bad: [1a879671bdfd14698a839f30de8e6d76e1e858fd] memblock tests: add memblock_overlaps_region_checks
>git bisect bad 1a879671bdfd14698a839f30de8e6d76e1e858fd
># bad: [3d3165193776ddacf59f101f0fa05cfab9f1a9ba] memblock tests: add memblock_reserve_all_locations_check()
>git bisect bad 3d3165193776ddacf59f101f0fa05cfab9f1a9ba
># bad: [721f4a6526daafca15634f30c9865e880da3e1d1] mm/memblock: remove empty dummy entry
>git bisect bad 721f4a6526daafca15634f30c9865e880da3e1d1
># first bad commit: [721f4a6526daafca15634f30c9865e880da3e1d1] mm/memblock: remove empty dummy entry
--
Wei Yang
Help you, Help me
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-06-23 0:31 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-05 1:58 [Patch v3] mm/memblock: remove empty dummy entry Wei Yang
2024-04-08 5:44 ` Mike Rapoport
2024-04-08 12:37 ` Wei Yang
2024-04-09 5:02 ` Mike Rapoport
[not found] ` <8d6205d4-18fb-4e98-97e6-db226dcf48f3@roeck-us.net>
2024-06-21 1:07 ` Wei Yang
2024-06-21 2:34 ` Guenter Roeck
2024-06-21 23:06 ` Wei Yang
[not found] ` <2113ef59-0efd-4de2-83f7-f5940ce40fca@roeck-us.net>
2024-06-22 18:16 ` Mike Rapoport
2024-06-23 0:31 ` Wei Yang
2024-06-21 1:11 ` Wei Yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox