From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E328C433F5 for ; Tue, 18 Jan 2022 13:56:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C1AE46B007B; Tue, 18 Jan 2022 08:56:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BCA736B007D; Tue, 18 Jan 2022 08:56:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AB9176B007E; Tue, 18 Jan 2022 08:56:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0163.hostedemail.com [216.40.44.163]) by kanga.kvack.org (Postfix) with ESMTP id 9C8BB6B007B for ; Tue, 18 Jan 2022 08:56:20 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4812C181B5810 for ; Tue, 18 Jan 2022 13:56:20 +0000 (UTC) X-FDA: 79043557320.22.A9CEFCA Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) by imf18.hostedemail.com (Postfix) with ESMTP id BA1C91C0006 for ; Tue, 18 Jan 2022 13:56:19 +0000 (UTC) Received: by mail-oi1-f170.google.com with SMTP id g205so28540036oif.5 for ; Tue, 18 Jan 2022 05:56:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=y87S7FBNpMHaq8MuQHnSDxCW/m+Dk2QKe9t3OSbppQk=; b=Fpph1DaYOTgcZnoQYHvAe8vEdqKojRDTkZqlOLiptjcT9K9JqJQ6Z7OjNG1rf5JQtM 5GK+lXpWVF5hJ1YLCrR87GPAuqZwenBG8kxOtP/cKxVR4C67APrsHhrIUyanKwrlGMw6 lGudgDza4PfWT87h4rTrtL8pG03R3uqrw2iVbsv4h9RLU/8db+hVIdhFdXKj6/uIgehC niIXnj6voqAQkbWicE1IbILM8bW1EKlX9cewm4tyz0LZiyjaHAjTs0R15T2gd0X0lVzL pNyBjHnAtB2CFexmD614+Xu1XBwBkwJ9tpBaH9WBuJpbqwMtSR/Z0DZYxngOWI4YZGqr IvaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=y87S7FBNpMHaq8MuQHnSDxCW/m+Dk2QKe9t3OSbppQk=; b=0dNkvTBTwMIGkp+68DcsixTko5BWsn7sIRG5imVNkAaWzQk2lhVl6CNruoQXjEdtGV ZihzQz4QLmCxHRrCnw9tmGF6zXAF/wVX/v+axXn82vN791cZWkC5w+BLwu9XamDhrRhd Fd1X+s6Qv2eDyHaEPVp0Ek+O723dbV52yfYNARg3G8y74St4xPQMhfgdS3gm1mLp4xdX 3Y4ZO1DptucRb14tzPJ4lEr0YMTo6rSXCNUvLXAF5UuDP4ZJzg7cWkfblbcfK+5BMNAd 45e4LZ9IiKgqzKPMyonEE5eI4556MAKfjlfDr09c3RMuF7sI68bL+3YLJSwFicUW4cMO Qlbw== X-Gm-Message-State: AOAM533Gg6/3Qn9nbRAbl7avnC44dSOE1qVyRftkyGixUaxtVn/O4n3m oQwJHRVmNgySiDJFPaucZuexB0FTSPgpWxU1UjM= X-Google-Smtp-Source: ABdhPJyTRyvodO+yjtgI5fGAd3D0TCHtBkRf8xviS5rrDyhEWbhCh4rkJQWmVNCLfXaEi2d9hbf78fCFHrROYoraGjU= X-Received: by 2002:aca:2b01:: with SMTP id i1mr16418519oik.158.1642514179030; Tue, 18 Jan 2022 05:56:19 -0800 (PST) MIME-Version: 1.0 References: <20220117142712.3967624-1-chenwandun@huawei.com> In-Reply-To: <20220117142712.3967624-1-chenwandun@huawei.com> From: Dong Aisheng Date: Tue, 18 Jan 2022 21:50:42 +0800 Message-ID: Subject: Re: [PATCH] Revert "mm/page_isolation: unset migratetype directly for non Buddy page" To: Chen Wandun Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, guillaume.tucker@collabora.com Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: BA1C91C0006 X-Stat-Signature: 93318ydwzm5afzij1knod7c63cr6jj7z Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Fpph1DaY; spf=pass (imf18.hostedemail.com: domain of dongas86@gmail.com designates 209.85.167.170 as permitted sender) smtp.mailfrom=dongas86@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1642514179-386592 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jan 17, 2022 at 10:12 PM Chen Wandun wrote: > > 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. > > Reported-by: "kernelci.org bot" > Signed-off-by: Chen Wandun The original patch broke imx6ul evk booting up. Bisect shows it was caused by that patch. After reverting, it works again. So: Tested-by: Dong Aisheng 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] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 8.748080] [] (show_stack) from [] (dump_stack_lvl+0x58/0x70) [ 8.755725] [] (dump_stack_lvl) from [] (dump_header+0x54/0x3cc) [ 8.763534] [] (dump_header) from [] (out_of_memory+0x54c/0x5f0) [ 8.771351] [] (out_of_memory) from [] (__alloc_pages+0xda8/0x1224) [ 8.779427] [] (__alloc_pages) from [] (new_slab+0x200/0x288) [ 8.786983] [] (new_slab) from [] (___slab_alloc.constprop.0+0x5b0/0xea4) [ 8.795585] [] (___slab_alloc.constprop.0) from [] (__slab_alloc.constprop.0+0x3c/0x5c) [ 8.805399] [] (__slab_alloc.constprop.0) from [] (__kmalloc_track_caller+0x264/0x3a4) [ 8.815125] [] (__kmalloc_track_caller) from [] (kstrdup_const+0x4c/0x7c) [ 8.823719] [] (kstrdup_const) from [] (__kernfs_new_node.constprop.0+0x30/0x260) [ 8.833009] [] (__kernfs_new_node.constprop.0) from [] (kernfs_new_node+0x30/0x50) [ 8.842384] [] (kernfs_new_node) from [] (kernfs_create_link+0x40/0xac) [ 8.850804] [] (kernfs_create_link) from [] (sysfs_do_create_link_sd+0x5c/0xd8) [ 8.859921] [] (sysfs_do_create_link_sd) from [] (device_add+0x264/0x8a8) [ 8.868518] [] (device_add) from [] (usb_add_gadget+0xd0/0x180) [ 8.876246] [] (usb_add_gadget) from [] (usb_add_gadget_udc+0x78/0xb4) [ 8.884580] [] (usb_add_gadget_udc) from [] (ci_hdrc_gadget_init+0x368/0x3e0) [ 8.893522] [] (ci_hdrc_gadget_init) from [] (ci_hdrc_probe+0x6c8/0x8b8) [ 8.902025] [] (ci_hdrc_probe) from [] (platform_probe+0x58/0xbc) [ 8.909919] [] (platform_probe) from [] (really_probe.part.0+0x9c/0x32c) [ 8.918427] [] (really_probe.part.0) from [] (__driver_probe_device+0xa0/0x138) [ 8.927544] [] (__driver_probe_device) from [] (driver_probe_device+0x30/0x10c) [ 8.936661] [] (driver_probe_device) from [] (__device_attach_driver+0xb0/0xf8) [ 8.945778] [] (__device_attach_driver) from [] (bus_for_each_drv+0x80/0xd0) [ 8.954631] [] (bus_for_each_drv) from [] (__device_attach+0xd0/0x19c) [ 8.962965] [] (__device_attach) from [] (bus_probe_device+0x88/0x90) [ 8.971212] [] (bus_probe_device) from [] (device_add+0x390/0x8a8) [ 8.979195] [] (device_add) from [] (platform_device_add+0x100/0x208) [ 8.987436] [] (platform_device_add) from [] (ci_hdrc_add_device+0x400/0x538) [ 8.996369] [] (ci_hdrc_add_device) from [] (ci_hdrc_imx_probe+0x250/0x62c) [ 9.005133] [] (ci_hdrc_imx_probe) from [] (platform_probe+0x58/0xbc) [ 9.013375] [] (platform_probe) from [] (really_probe.part.0+0x9c/0x32c) [ 9.021880] [] (really_probe.part.0) from [] (__driver_probe_device+0xa0/0x138) [ 9.030995] [] (__driver_probe_device) from [] (driver_probe_device+0x30/0x10c) [ 9.040110] [] (driver_probe_device) from [] (__device_attach_driver+0xb0/0xf8) [ 9.049225] [] (__device_attach_driver) from [] (bus_for_each_drv+0x80/0xd0) [ 9.058081] [] (bus_for_each_drv) from [] (__device_attach+0xd0/0x19c) [ 9.066414] [] (__device_attach) from [] (bus_probe_device+0x88/0x90) [ 9.074659] [] (bus_probe_device) from [] (deferred_probe_work_func+0x78/0xa8) [ 9.083691] [] (deferred_probe_work_func) from [] (process_one_work+0x294/0x7c0) [ 9.092896] [] (process_one_work) from [] (worker_thread+0x4c/0x554) [ 9.101052] [] (worker_thread) from [] (kthread+0x16c/0x194) [ 9.108515] [] (kthread) from [] (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 > --- > mm/page_isolation.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/page_isolation.c b/mm/page_isolation.c > index 6a0ddda6b3c5..f67c4c70f17f 100644 > --- a/mm/page_isolation.c > +++ b/mm/page_isolation.c > @@ -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 > >