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 E0CCBC3DA79 for ; Fri, 30 Dec 2022 00:56:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 67D078E0002; Thu, 29 Dec 2022 19:56:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 62D118E0001; Thu, 29 Dec 2022 19:56:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 51BFE8E0002; Thu, 29 Dec 2022 19:56:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 447118E0001 for ; Thu, 29 Dec 2022 19:56:14 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 10B61C01A6 for ; Fri, 30 Dec 2022 00:56:14 +0000 (UTC) X-FDA: 80297156268.21.C2D68A6 Received: from r3-24.sinamail.sina.com.cn (r3-24.sinamail.sina.com.cn [202.108.3.24]) by imf21.hostedemail.com (Postfix) with ESMTP id B47581C000D for ; Fri, 30 Dec 2022 00:56:11 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf21.hostedemail.com: domain of hdanton@sina.com designates 202.108.3.24 as permitted sender) smtp.mailfrom=hdanton@sina.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672361772; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZdItwsIwx0wY062yO2Qv3aabK/StI36TW8+ypaLyyGE=; b=vtswAP+w8bFELLfyJ1VvJXSfWfa4eOHI0JH7xhidCvk1wbKjYGln16TKPezABFCsf5UX8v F9uEiZfcKPAyuk2apuo0M2jCIB4KQXkQWhZnnw0ZUT8ma6vlpzRqvTwkJL27LRwUStRVwJ Y+JNXlRa26/INeSNDgMUkTFYIpsFJ3Q= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf21.hostedemail.com: domain of hdanton@sina.com designates 202.108.3.24 as permitted sender) smtp.mailfrom=hdanton@sina.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672361772; a=rsa-sha256; cv=none; b=jFU0xspkNKC9ggWOxUi0yK17kPwx/wUFQECX2hUfybeey7ZJpj2Co3jpPGbSNgapX1nATl kCAFcxSjv6YV1BMvaiZLZe2+O9B2aFUfaEiXRl18+14xLp+xkCJFfs5D4EoBY7dfjEqz7H GKGcg1//MKiw0J5DmhknSZD0GoRMqIk= Received: from unknown (HELO localhost.localdomain)([114.249.57.238]) by sina.com (172.16.97.23) with ESMTP id 63AE367B00001DDC; Fri, 30 Dec 2022 08:53:17 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 28343654923841 From: Hillf Danton To: Matthew Wilcox Cc: syzbot , linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] INFO: task hung in __unmap_and_move (4) Date: Fri, 30 Dec 2022 08:55:56 +0800 Message-Id: <20221230005556.3072-1-hdanton@sina.com> In-Reply-To: References: <000000000000e5738d05f0f46309@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: B47581C000D X-Stat-Signature: ostnrpfec7cksfwds5nie37qmy37r78t X-HE-Tag: 1672361771-485900 X-HE-Meta: U2FsdGVkX1+Rc0Szj7mJU+RFHFg/UzLr5KnjyYrjtvqyUSYfSjwc3FPngqt0BrDnZ+CGYgBnBLLU/jxg0FpW+7z7KpMuvrkEQpwi63CdJtrXhhXPMoU2l/FDSgf3n5kgGmvrM3uedsl1M5Esf/XraaYZKobJgNxvlhYjvMqvUD0A5ltjJfT6vEC2cJ3TZoSZWZAjX3jZCKce2kNIlqrRkLxf9BCny0A6askh28qY1AjLeswX+HU/OWF9wkR9hWV7qQCQEE5cD9zAo8PpM5wa/KhNmlglER198jKBBVlXYxByGTs2e/De/kSZlo8KjqVQ/2C55Y3b0XSmO793PsfIXWJqPOgcDEnubo8It+pK4CnMCRg8FX/BAmXpme7fvc9ZDdepXfeywLs+v11ESOEtORj9fkw42sd2wg0HcxP/gukE6qu5F0uc0oSyPLfu3+xl0kZOeLAsaKRgtt9sXMyudol/QizvvRRCQEEi1z8Vv7moa4fOkVRZyWSGt1Xz82FCc+U1UtkxUe6KrJHFxiqMCC0e2HzJSnhlUDg3xjikwTa+qnl1CAMCncjcqHwbKlj1t+K9CpAblvyKpGsRACewpU3766j4f3/IgDwiOhI1ZFrVNO3qSa54sIOwpLD3kMni8lobjfNb0F3ERnYFoPoMFxfDZ5xhmt1CDLhAx9bJRlxqN6veDjB6RuPFXEmZJ8dB5PoLgCVri8xtKcltZLQbi481rvUCvuC+0h9KRWyNOoWoRvDqIeKJG5GtQec8fxRkgY3EJTNKeNH4+VXR7hEOo1lGdENL/b9hJAsjJqX0qUdbG0ZXCd/hlTLCASpNhuxvRxI5CKVKTIMhEuHl0JZrpRWCm1I+nw2dCZLY0TQGm7zMzVVsG8xycy2QZ1pp5it9cAXlbIjf5HY9F1b84PnGgbQ4XcSGWDWMc5+fqX4gvNIL3nAlrmlMKnjnEUx+9iO7 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 29 Dec 2022 22:01:42 +0000 Matthew Wilcox > On Thu, Dec 29, 2022 at 01:48:42AM -0800, syzbot wrote: > > INFO: task kcompactd1:32 blocked for more than 143 seconds. > > Not tainted 6.1.0-syzkaller-14594-g72a85e2b0a1e #0 > > "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. > > task:kcompactd1 state:D stack:26360 pid:32 ppid:2 flags:0x00004000 > > Call Trace: > > > > context_switch kernel/sched/core.c:5244 [inline] > > __schedule+0x9d1/0xe40 kernel/sched/core.c:6555 > > schedule+0xcb/0x190 kernel/sched/core.c:6631 > > io_schedule+0x83/0x100 kernel/sched/core.c:8811 > > folio_wait_bit_common+0x8ca/0x1390 mm/filemap.c:1297 > > folio_lock include/linux/pagemap.h:938 [inline] > > __unmap_and_move+0x835/0x12a0 mm/migrate.c:1040 > > unmap_and_move+0x28f/0xd80 mm/migrate.c:1194 > > migrate_pages+0x50f/0x14d0 mm/migrate.c:1477 > > compact_zone+0x2893/0x37a0 mm/compaction.c:2413 > > proactive_compact_node mm/compaction.c:2665 [inline] > > kcompactd+0x1b46/0x2750 mm/compaction.c:2975 > > OK, so kcompactd is trying to compact a zone, has called folio_lock() > and whoever has the folio locked has had it locked for 143 seconds. > That seems like quite a long time. Probably it is locked waiting > for I/O. > > > NMI backtrace for cpu 1 > [...] > > lock_release+0x81/0x870 kernel/locking/lockdep.c:5679 > > rcu_read_unlock include/linux/rcupdate.h:797 [inline] > > folio_evictable+0x1df/0x2d0 mm/internal.h:140 > > move_folios_to_lru+0x324/0x25c0 mm/vmscan.c:2413 > > shrink_inactive_list+0x60b/0xca0 mm/vmscan.c:2529 > > shrink_list mm/vmscan.c:2767 [inline] > > shrink_lruvec+0x449/0xc50 mm/vmscan.c:5951 > > shrink_node_memcgs+0x35c/0x780 mm/vmscan.c:6138 > > shrink_node+0x299/0x1050 mm/vmscan.c:6169 > > shrink_zones+0x4fb/0xc40 mm/vmscan.c:6407 > > do_try_to_free_pages+0x215/0xcd0 mm/vmscan.c:6469 > > try_to_free_pages+0x3e8/0xc60 mm/vmscan.c:6704 > > __perform_reclaim mm/page_alloc.c:4750 [inline] > > __alloc_pages_direct_reclaim mm/page_alloc.c:4772 [inline] > > __alloc_pages_slowpath+0xd5c/0x2120 mm/page_alloc.c:5178 > > __alloc_pages+0x3d4/0x560 mm/page_alloc.c:5562 > > folio_alloc+0x1a/0x50 mm/mempolicy.c:2296 > > filemap_alloc_folio+0xca/0x2c0 mm/filemap.c:972 > > page_cache_ra_unbounded+0x212/0x820 mm/readahead.c:248 > > do_sync_mmap_readahead+0x786/0x950 mm/filemap.c:3062 > > filemap_fault+0x38d/0x1060 mm/filemap.c:3154 > > So dhcpd has taken a page fault, missed in the page cache, called > readahead, is presumably partway through the readahead (ie has folios > locked in the page cache, not uptodate and I/O hasn't been submitted > on them). It's trying to allocate pages, but has fallen into reclaim. > It's trying to shrink the inactive list at this point, but is not > having much luck. For one thing, it's a GFP_NOFS allocation. So > it was probably the one who woke kcompactd. In wakeup_kswapd(), wake up kcompactd instead of kswapd because of highly fragmented but balanced node. /* * There may be plenty of free memory available, but it's too * fragmented for high-order allocations. Wake up kcompactd * and rely on compaction_suitable() to determine if it's * needed. If it fails, it will defer subsequent attempts to * ratelimit its work. */ if (!(gfp_flags & __GFP_DIRECT_RECLAIM)) wakeup_kcompactd(pgdat, order, highest_zoneidx); > > Should readahead be trying less hard to allocate memory? It's already > using __GFP_NORETRY. Given blocked kcompactd, enough pages have been reclaimed by kswapd before waking up kcompactd, and order0 allocations should be satisfied.