Skip to contentSkip to conversation

Revert "mm/page_isolation: unset migratetype directly for non Buddy page"

PATCH Superseded Chen Wandun 8 participants 11 messages Jan 17, 2022 – Feb 5, 2022

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "mm/page_isolation: unset migratetype directly for non Buddy page"

This reverts commit 075782149abff45ee22f27315eced44d02b96779.

commit 075782149abf ("mm/page_isolation: unset migratetype directly for non Buddy page") will result memory that should in buddy disappear by mistake. move_freepages_block move all pages in pageblock instead of pages indicated by input parameter, so if input pages is not in buddy but other pages in pageblock is in buddy, it will result in page out of control.

---
 mm/page_isolation.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_isolation.c +1 -1
index 6a0ddda6b3c5..f67c4c70f17f 100644
@@ -115,7 +115,7 @@ static void unset_migratetype_isolate(struct page *page, unsigned migratetype)
 	 * onlining - just onlined memory won't immediately be considered for
 	 * allocation.
 	 */
-	if (!isolated_page && PageBuddy(page)) {
+	if (!isolated_page) {
 		nr_pages = move_freepages_block(zone, page, migratetype, NULL);
 		__mod_zone_freepage_state(zone, nr_pages, migratetype);
 	}
Signature · 1 line
2.18.0.huawei.25
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Chen Wandun

This reverts commit 075782149abff45ee22f27315eced44d02b96779.

commit 075782149abf ("mm/page_isolation: unset migratetype directly for non Buddy page") will result memory that should in buddy disappear by mistake. move_freepages_block move all pages in pageblock instead of pages indicated by input parameter, so if input pages is not in buddy but other pages in pageblock is in buddy, it will result in page out of control.

I was wondering about exactly that condition when skimming over the patch but didn't have time review in detail.

Quoted 19 lines
---
 mm/page_isolation.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_isolation.c +1 -1
index 6a0ddda6b3c5..f67c4c70f17f 100644
@@ -115,7 +115,7 @@ static void unset_migratetype_isolate(struct page *page, unsigned migratetype)
 	 * onlining - just onlined memory won't immediately be considered for
 	 * allocation.
 	 */
-	if (!isolated_page && PageBuddy(page)) {
+	if (!isolated_page) {
 		nr_pages = move_freepages_block(zone, page, migratetype, NULL);
 		__mod_zone_freepage_state(zone, nr_pages, migratetype);
 	}
Signature · 3 lines
Thanks,

David / dhildenb
#2 lore raw
Quoted 10 lines · David Hildenbrand
Quoted 9 lines · Chen Wandun

This reverts commit 075782149abff45ee22f27315eced44d02b96779.

commit 075782149abf ("mm/page_isolation: unset migratetype directly for non Buddy page") will result memory that should in buddy disappear by mistake. move_freepages_block move all pages in pageblock instead of pages indicated by input parameter, so if input pages is not in buddy but other pages in pageblock is in buddy, it will result in page out of control.

Quoted 2 lines

I was wondering about exactly that condition when skimming over the patch but didn't have time review in detail.

when the first valid page in pageblock is non-buddy page and the page order is not equal pagblock_order,  unset_migratetype_isolate will missing move free page in this pageblock.

Quoted 23 lines
Quoted 19 lines
---
  mm/page_isolation.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_isolation.c +1 -1
index 6a0ddda6b3c5..f67c4c70f17f 100644
@@ -115,7 +115,7 @@ static void unset_migratetype_isolate(struct page *page, unsigned migratetype)
  	 * onlining - just onlined memory won't immediately be considered for
  	 * allocation.
  	 */
-	if (!isolated_page && PageBuddy(page)) {
+	if (!isolated_page) {
  		nr_pages = move_freepages_block(zone, page, migratetype, NULL);
  		__mod_zone_freepage_state(zone, nr_pages, migratetype);
  	}
Tested-by on v1 1/1
#3 lore raw
In reply to Chen Wandun
Quoted 10 lines · Chen Wandun

This reverts commit 075782149abff45ee22f27315eced44d02b96779.

commit 075782149abf ("mm/page_isolation: unset migratetype directly for non Buddy page") will result memory that should in buddy disappear by mistake. move_freepages_block move all pages in pageblock instead of pages indicated by input parameter, so if input pages is not in buddy but other pages in pageblock is in buddy, it will result in page out of control.

Quoted 2 lines

The original patch broke imx6ul evk booting up.
Bisect shows it was caused by that patch.
After reverting, it works again.

So:

Below is the original error log:

[    8.710031] kworker/u2:2 invoked oom-killer:
gfp_mask=0xcc0(GFP_KERNEL), order=0, oom_score_adj=0
[    8.719920] CPU: 0 PID: 29 Comm: kworker/u2:2 Not tainted
5.16.0-00095-g721fb891ad0b #95
[    8.728093] Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[    8.734322] Workqueue: events_unbound deferred_probe_work_func
[    8.740258] [<c0111640>] (unwind_backtrace) from [<c010ba84>]
(show_stack+0x10/0x14)
[    8.748080] [<c010ba84>] (show_stack) from [<c0f38aa4>]
(dump_stack_lvl+0x58/0x70)
[    8.755725] [<c0f38aa4>] (dump_stack_lvl) from [<c0f32f60>]
(dump_header+0x54/0x3cc)
[    8.763534] [<c0f32f60>] (dump_header) from [<c02aec94>]
(out_of_memory+0x54c/0x5f0)
[    8.771351] [<c02aec94>] (out_of_memory) from [<c030166c>]
(__alloc_pages+0xda8/0x1224)
[    8.779427] [<c030166c>] (__alloc_pages) from [<c03102f4>]
(new_slab+0x200/0x288)
[    8.786983] [<c03102f4>] (new_slab) from [<c03129ec>]
(___slab_alloc.constprop.0+0x5b0/0xea4)
[    8.795585] [<c03129ec>] (___slab_alloc.constprop.0) from
[<c031331c>] (__slab_alloc.constprop.0+0x3c/0x5c)
[    8.805399] [<c031331c>] (__slab_alloc.constprop.0) from
[<c03135a0>] (__kmalloc_track_caller+0x264/0x3a4)
[    8.815125] [<c03135a0>] (__kmalloc_track_caller) from [<c02c8cec>]
(kstrdup_const+0x4c/0x7c)
[    8.823719] [<c02c8cec>] (kstrdup_const) from [<c03cf890>]
(__kernfs_new_node.constprop.0+0x30/0x260)
[    8.833009] [<c03cf890>] (__kernfs_new_node.constprop.0) from
[<c03d0c4c>] (kernfs_new_node+0x30/0x50)
[    8.842384] [<c03d0c4c>] (kernfs_new_node) from [<c03d2e24>]
(kernfs_create_link+0x40/0xac)
[    8.850804] [<c03d2e24>] (kernfs_create_link) from [<c03d419c>]
(sysfs_do_create_link_sd+0x5c/0xd8)
[    8.859921] [<c03d419c>] (sysfs_do_create_link_sd) from
[<c086e9a4>] (device_add+0x264/0x8a8)
[    8.868518] [<c086e9a4>] (device_add) from [<c09f99dc>]
(usb_add_gadget+0xd0/0x180)
[    8.876246] [<c09f99dc>] (usb_add_gadget) from [<c09fa124>]
(usb_add_gadget_udc+0x78/0xb4)
[    8.884580] [<c09fa124>] (usb_add_gadget_udc) from [<c09ec674>]
(ci_hdrc_gadget_init+0x368/0x3e0)
[    8.893522] [<c09ec674>] (ci_hdrc_gadget_init) from [<c09e7870>]
(ci_hdrc_probe+0x6c8/0x8b8)
[    8.902025] [<c09e7870>] (ci_hdrc_probe) from [<c08756f4>]
(platform_probe+0x58/0xbc)
[    8.909919] [<c08756f4>] (platform_probe) from [<c0872e14>]
(really_probe.part.0+0x9c/0x32c)
[    8.918427] [<c0872e14>] (really_probe.part.0) from [<c0873144>]
(__driver_probe_device+0xa0/0x138)
[    8.927544] [<c0873144>] (__driver_probe_device) from [<c087320c>]
(driver_probe_device+0x30/0x10c)
[    8.936661] [<c087320c>] (driver_probe_device) from [<c08737dc>]
(__device_attach_driver+0xb0/0xf8)
[    8.945778] [<c08737dc>] (__device_attach_driver) from [<c0870ec8>]
(bus_for_each_drv+0x80/0xd0)
[    8.954631] [<c0870ec8>] (bus_for_each_drv) from [<c08734f0>]
(__device_attach+0xd0/0x19c)
[    8.962965] [<c08734f0>] (__device_attach) from [<c0871f5c>]
(bus_probe_device+0x88/0x90)
[    8.971212] [<c0871f5c>] (bus_probe_device) from [<c086ead0>]
(device_add+0x390/0x8a8)
[    8.979195] [<c086ead0>] (device_add) from [<c0875370>]
(platform_device_add+0x100/0x208)
[    8.987436] [<c0875370>] (platform_device_add) from [<c09e686c>]
(ci_hdrc_add_device+0x400/0x538)
[    8.996369] [<c09e686c>] (ci_hdrc_add_device) from [<c09eee90>]
(ci_hdrc_imx_probe+0x250/0x62c)
[    9.005133] [<c09eee90>] (ci_hdrc_imx_probe) from [<c08756f4>]
(platform_probe+0x58/0xbc)
[    9.013375] [<c08756f4>] (platform_probe) from [<c0872e14>]
(really_probe.part.0+0x9c/0x32c)
[    9.021880] [<c0872e14>] (really_probe.part.0) from [<c0873144>]
(__driver_probe_device+0xa0/0x138)
[    9.030995] [<c0873144>] (__driver_probe_device) from [<c087320c>]
(driver_probe_device+0x30/0x10c)
[    9.040110] [<c087320c>] (driver_probe_device) from [<c08737dc>]
(__device_attach_driver+0xb0/0xf8)
[    9.049225] [<c08737dc>] (__device_attach_driver) from [<c0870ec8>]
(bus_for_each_drv+0x80/0xd0)
[    9.058081] [<c0870ec8>] (bus_for_each_drv) from [<c08734f0>]
(__device_attach+0xd0/0x19c)
[    9.066414] [<c08734f0>] (__device_attach) from [<c0871f5c>]
(bus_probe_device+0x88/0x90)
[    9.074659] [<c0871f5c>] (bus_probe_device) from [<c0872390>]
(deferred_probe_work_func+0x78/0xa8)
[    9.083691] [<c0872390>] (deferred_probe_work_func) from
[<c0149174>] (process_one_work+0x294/0x7c0)
[    9.092896] [<c0149174>] (process_one_work) from [<c01496ec>]
(worker_thread+0x4c/0x554)
[    9.101052] [<c01496ec>] (worker_thread) from [<c01525c8>]
(kthread+0x16c/0x194)
[    9.108515] [<c01525c8>] (kthread) from [<c010011c>]
(ret_from_fork+0x14/0x38)
[    9.115800] Exception stack(0xc4349fb0 to 0xc4349ff8)
[    9.120906] 9fa0:                                     00000000
00000000 00000000 00000000
[    9.129138] 9fc0: 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000
[    9.137364] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[    9.145304] Mem-Info:
[    9.147682] active_anon:0 inactive_anon:0 isolated_anon:0
[    9.147682]  active_file:0 inactive_file:0 isolated_file:0
[    9.147682]  unevictable:0 dirty:0 writeback:0
[    9.147682]  slab_reclaimable:2805 slab_unreclaimable:1466
[    9.147682]  mapped:0 shmem:0 pagetables:0 bounce:0
[    9.147682]  kernel_misc_reclaimable:0
[    9.147682]  free:0 free_pcp:5 free_cma:0
[    9.182265] Node 0 active_anon:0kB inactive_anon:0kB
active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB
isolated(file):0kB mapped:0kB dirty:0kB writeback:0kB shmem:0kB
writeback_tmp:0kB kerno
[    9.205657] Normal free:0kB boost:0kB min:2780kB low:3472kB
high:4164kB reserved_highatomic:0KB active_anon:0kB inactive_anon:0kB
active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB
present:524B
[    9.232095] lowmem_reserve[]: 0 0 0
[    9.235772] Normal: 5*4kB (UMI) 5*8kB (UEI) 10*16kB (UMEI) 9*32kB
(UME) 5*64kB (UME) 7*128kB (UMEI) 7*256kB (UMEI) 4*512kB (MEI)
2*1024kB (M) 4*2048kB (UMI) 5*4096kB (UMEI) 2*8192kB (MI) 5*16384kB
(UMEI) 10*3B
[    9.257621] 0 total pagecache pages
[    9.261441] 0 pages in swap cache
[    9.264820] Swap cache stats: add 0, delete 0, find 0/0
[    9.270258] Free swap  = 0kB
[    9.273199] Total swap = 0kB
[    9.276133] 131072 pages RAM
[    9.279293] 0 pages HighMem/MovableOnly
[    9.283188] 10061 pages reserved
[    9.286468] 16384 pages cma reserved
[    9.290239] Tasks state (memory values in pages):
[    9.295087] [  pid  ]   uid  tgid total_vm      rss pgtables_bytes
swapents oom_score_adj name
[    9.303927] Out of memory and no killable processes...
[    9.309285] Kernel panic - not syncing: System is deadlocked on memory

Regards
Aisheng

Quoted 21 lines
---
 mm/page_isolation.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_isolation.c +1 -2
index 6a0ddda6b3c5..f67c4c70f17f 100644
@@ -115,7 +115,7 @@ static void unset_migratetype_isolate(struct page *page, unsigned migratetype)
         * onlining - just onlined memory won't immediately be considered for
         * allocation.
         */
-       if (!isolated_page && PageBuddy(page)) {
+       if (!isolated_page) {
                nr_pages = move_freepages_block(zone, page, migratetype, NULL);
                __mod_zone_freepage_state(zone, nr_pages, migratetype);
        }
--

2.18.0.huawei.25

#4 lore raw
Quoted 11 lines · Dong Aisheng
Quoted 10 lines · Chen Wandun

This reverts commit 075782149abff45ee22f27315eced44d02b96779.

commit 075782149abf ("mm/page_isolation: unset migratetype directly for non Buddy page") will result memory that should in buddy disappear by mistake. move_freepages_block move all pages in pageblock instead of pages indicated by input parameter, so if input pages is not in buddy but other pages in pageblock is in buddy, it will result in page out of control.

Quoted 5 lines
Quoted 2 lines

The original patch broke imx6ul evk booting up.

Same issue present on imx7.

Acked-by on v1 1/1
#5 lore raw
In reply to Chen Wandun
Quoted 3 lines · Chen Wandun

This reverts commit 075782149abff45ee22f27315eced44d02b96779.

commit 075782149abf ("mm/page_isolation: unset migratetype directly for

That's an old -next commit id, it went to mainline as 721fb891ad0b ("mm/page_isolation: unset migratetype directly for non Buddy page")

Quoted 8 lines

non Buddy page") will result memory that should in buddy disappear by mistake. move_freepages_block move all pages in pageblock instead of pages indicated by input parameter, so if input pages is not in buddy but other pages in pageblock is in buddy, it will result in page out of control.

#regzbot ^introduced: 721fb891ad0b

There should better be also:

Fixes 721fb891ad0b ("mm/page_isolation: unset migratetype directly for non

Buddy page")

Especially as that commit had a (inadequate, IMHO, for an optimization)
Fixes: tag and could end up being backported somewhere without the followup fix/revert.

Quoted 17 lines
---
 mm/page_isolation.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_isolation.c +1 -1
index 6a0ddda6b3c5..f67c4c70f17f 100644
@@ -115,7 +115,7 @@ static void unset_migratetype_isolate(struct page *page, unsigned migratetype)
 	 * onlining - just onlined memory won't immediately be considered for
 	 * allocation.
 	 */
-	if (!isolated_page && PageBuddy(page)) {
+	if (!isolated_page) {
 		nr_pages = move_freepages_block(zone, page, migratetype, NULL);
 		__mod_zone_freepage_state(zone, nr_pages, migratetype);
 	}
#6 lore raw
Quoted 19 lines · Vlastimil Babka
Quoted 3 lines · Chen Wandun

This reverts commit 075782149abff45ee22f27315eced44d02b96779.

commit 075782149abf ("mm/page_isolation: unset migratetype directly for

That's an old -next commit id, it went to mainline as 721fb891ad0b ("mm/page_isolation: unset migratetype directly for non Buddy page")

Quoted 8 lines

non Buddy page") will result memory that should in buddy disappear by mistake. move_freepages_block move all pages in pageblock instead of pages indicated by input parameter, so if input pages is not in buddy but other pages in pageblock is in buddy, it will result in page out of control.

#regzbot ^introduced: 721fb891ad0b

Quoted 8 lines

There should better be also:

Fixes 721fb891ad0b ("mm/page_isolation: unset migratetype directly for non

Buddy page")

Especially as that commit had a (inadequate, IMHO, for an optimization)
Fixes: tag and could end up being backported somewhere without the followup fix/revert.

thanks, I will send v2

Quoted 19 lines
Quoted 10 lines
---
  mm/page_isolation.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_isolation.c +0 -0
index 6a0ddda6b3c5..f67c4c70f17f 100644

mm/page_isolation.c static void unset_migratetype_isolate(struct page *page, unsigned migratetype) · line 121

Quoted 8 lines
mm/page_isolation.c +1 -1
@@ -115,7 +115,7 @@ static void unset_migratetype_isolate(struct page *page, unsigned migratetype)
  	 * onlining - just onlined memory won't immediately be considered for
  	 * allocation.
  	 */
-	if (!isolated_page && PageBuddy(page)) {
+	if (!isolated_page) {
  		nr_pages = move_freepages_block(zone, page, migratetype, NULL);
  		__mod_zone_freepage_state(zone, nr_pages, migratetype);
  	}

.

#7 lore raw

Hi, this is your Linux kernel regression tracker speaking.

Quoted 14 lines · Chen Wandun
Quoted 13 lines · Vlastimil Babka
Quoted 3 lines · Chen Wandun

This reverts commit 075782149abff45ee22f27315eced44d02b96779.

commit 075782149abf ("mm/page_isolation: unset migratetype directly for

That's an old -next commit id, it went to mainline as 721fb891ad0b ("mm/page_isolation: unset migratetype directly for non Buddy page")

Quoted 6 lines

non Buddy page") will result memory that should in buddy disappear by mistake. move_freepages_block move all pages in pageblock instead of pages indicated by input parameter, so if input pages is not in buddy but other pages in pageblock is in buddy, it will result in page out of control.

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

#regzbot ^introduced: 721fb891ad0b

Thx for getting regzbot involved, much appreciated.

Quoted 6 lines
Quoted 6 lines

There should better be also:

Fixes 721fb891ad0b ("mm/page_isolation: unset migratetype directly

for non
Buddy page")

Quoted 6 lines
Quoted 4 lines

Especially as that commit had a (inadequate, IMHO, for an optimization)
Fixes: tag and could end up being backported somewhere without the followup
fix/revert.

thanks, I will send v2

Just wondering:

Andrew, I don't see this patch in the list of changes you sent to Linus yesterday. Shouldn't it be in there due to above reason alone? And there is another reason: it seems to be an issue people actually hit, as Guenter mentioned in this thread. It thus complicates things for those that want to help testing pre-releases.

Or am I missing something/asking too much in this case?

BTW, let's tell regzbot about v2:

#regzbot monitor:
https://lore.kernel.org/all/[email protected]/

Ciao, Thorsten

Quoted 24 lines
Quoted 21 lines
Quoted 12 lines

---
  mm/page_isolation.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_isolation.c +0 -0
index 6a0ddda6b3c5..f67c4c70f17f 100644
@@ -115,7 +115,7 @@ static void unset_migratetype_isolate(struct page
 *page, unsigned migratetype)
        * onlining - just onlined memory won't immediately be

considered for

Quoted 8 lines

       * allocation.
       */
-    if (!isolated_page && PageBuddy(page)) {
+    if (!isolated_page) {
          nr_pages = move_freepages_block(zone, page, migratetype, NULL);
          __mod_zone_freepage_state(zone, nr_pages, migratetype); }

.

maintainer
#8 lore raw
Quoted 5 lines · On Sun, 30 Jan 2022 10:24:43 +0100 Thorsten Leemhuis…

Andrew, I don't see this patch in the list of changes you sent to Linus yesterday. Shouldn't it be in there due to above reason alone? And there is another reason: it seems to be an issue people actually hit, as Guenter mentioned in this thread. It thus complicates things for those that want to help testing pre-releases.

I prefer to give fixes some time in linux-next before upstreaming them. At least a day, worst case. So I have this patch in this week's pile.

#9 lore raw
In reply to Thorsten Leemhuis

For the record:

#regzbot fixed-by: a85468b766d3bc17c8b17ed23a36ef6469340bb2

Quoted 80 lines · Thorsten Leemhuis

Hi, this is your Linux kernel regression tracker speaking.

Quoted 14 lines · Chen Wandun
Quoted 13 lines · Vlastimil Babka
Quoted 3 lines · Chen Wandun

This reverts commit 075782149abff45ee22f27315eced44d02b96779.

commit 075782149abf ("mm/page_isolation: unset migratetype directly for

That's an old -next commit id, it went to mainline as 721fb891ad0b ("mm/page_isolation: unset migratetype directly for non Buddy page")

Quoted 6 lines

non Buddy page") will result memory that should in buddy disappear by mistake. move_freepages_block move all pages in pageblock instead of pages indicated by input parameter, so if input pages is not in buddy but other pages in pageblock is in buddy, it will result in page out of control.

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

#regzbot ^introduced: 721fb891ad0b

Thx for getting regzbot involved, much appreciated.

Quoted 6 lines
Quoted 6 lines

There should better be also:

Fixes 721fb891ad0b ("mm/page_isolation: unset migratetype directly

for non
Buddy page")

Quoted 6 lines
Quoted 4 lines

Especially as that commit had a (inadequate, IMHO, for an optimization)
Fixes: tag and could end up being backported somewhere without the followup
fix/revert.

thanks, I will send v2

Just wondering:

Andrew, I don't see this patch in the list of changes you sent to Linus yesterday. Shouldn't it be in there due to above reason alone? And there is another reason: it seems to be an issue people actually hit, as Guenter mentioned in this thread. It thus complicates things for those that want to help testing pre-releases.

Or am I missing something/asking too much in this case?

BTW, let's tell regzbot about v2:

#regzbot monitor:
https://lore.kernel.org/all/[email protected]/

Ciao, Thorsten

Quoted 24 lines
Quoted 21 lines
Quoted 12 lines

---
  mm/page_isolation.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_isolation.c +0 -0
index 6a0ddda6b3c5..f67c4c70f17f 100644
@@ -115,7 +115,7 @@ static void unset_migratetype_isolate(struct page
 *page, unsigned migratetype)
        * onlining - just onlined memory won't immediately be

considered for

Quoted 8 lines

       * allocation.
       */
-    if (!isolated_page && PageBuddy(page)) {
+    if (!isolated_page) {
          nr_pages = move_freepages_block(zone, page, migratetype, NULL);
          __mod_zone_freepage_state(zone, nr_pages, migratetype); }

.

Tested-by on v1 1/1
#10 lore raw
In reply to Chen Wandun
Quoted 11 lines · Chen Wandun

This reverts commit 075782149abff45ee22f27315eced44d02b96779.

commit 075782149abf ("mm/page_isolation: unset migratetype directly for non Buddy page") will result memory that should in buddy disappear by mistake. move_freepages_block move all pages in pageblock instead of pages indicated by input parameter, so if input pages is not in buddy but other pages in pageblock is in buddy, it will result in page out of control.

I see a number of qemu emulations fail with memory allocation errors in v5.17-rc1. This revert fixes the problem.

Guenter

Quoted 21 lines
---
 mm/page_isolation.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_isolation.c +1 -1
index 6a0ddda6b3c5..f67c4c70f17f 100644
@@ -115,7 +115,7 @@ static void unset_migratetype_isolate(struct page *page, unsigned migratetype)
 	 * onlining - just onlined memory won't immediately be considered for
 	 * allocation.
 	 */
-	if (!isolated_page && PageBuddy(page)) {
+	if (!isolated_page) {
 		nr_pages = move_freepages_block(zone, page, migratetype, NULL);
 		__mod_zone_freepage_state(zone, nr_pages, migratetype);
 	}
Signature · 1 line
2.18.0.huawei.25