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 2171CC3DA7A for ; Fri, 30 Dec 2022 00:54:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 435218E0002; Thu, 29 Dec 2022 19:54:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3E4F78E0001; Thu, 29 Dec 2022 19:54:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2D3818E0002; Thu, 29 Dec 2022 19:54:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 1E6A18E0001 for ; Thu, 29 Dec 2022 19:54:05 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id D801CAACCA for ; Fri, 30 Dec 2022 00:54:04 +0000 (UTC) X-FDA: 80297150808.27.C361158 Received: from r3-23.sinamail.sina.com.cn (r3-23.sinamail.sina.com.cn [202.108.3.23]) by imf29.hostedemail.com (Postfix) with ESMTP id AC21D120004 for ; Fri, 30 Dec 2022 00:54:01 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=none; spf=pass (imf29.hostedemail.com: domain of hdanton@sina.com designates 202.108.3.23 as permitted sender) smtp.mailfrom=hdanton@sina.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672361643; a=rsa-sha256; cv=none; b=FZW5Nd8nt4RWjCYwcsMDPjPgLWTRp1PkhyAMruOM19vcHBSIbyq533R+9nOqSaSE8jfk7l pP9PTY3k5M4zKHOfh1isKbyoWthFRTT1fkzY/+BxoyscE0fI/sR9PNZj5YrDPghYkME+IV h9o60yBTOr+pUuwuzpIuO93wed9pMnQ= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=none; spf=pass (imf29.hostedemail.com: domain of hdanton@sina.com designates 202.108.3.23 as permitted sender) smtp.mailfrom=hdanton@sina.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672361643; 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=aImHXVW1spZEP92NS8jFIFF7n1oLa3sAooj3dWckYg5O8Zwm/u92XN6UkGzU+fQLIFR/26 FDYYZSu2hPMV8tf31cF+kjd5wNZeh6aQbD1xlruE/g0w5RGZwVZE0NnId1UII04beZ+e4/ rsvhM9iNYOl9Ds8dTke8EzNu0ac4/YI= Received: from unknown (HELO localhost.localdomain)([114.249.57.238]) by sina.com (172.16.97.23) with ESMTP id 63AE35FA00037FE4; Fri, 30 Dec 2022 08:51:07 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 79331154919715 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:53:46 +0800 Message-Id: <20221230005346.3021-1-hdanton@sina.com> In-Reply-To: References: <000000000000e5738d05f0f46309@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Queue-Id: AC21D120004 X-Rspamd-Server: rspam01 X-Stat-Signature: ostnrpfec7cksfwds5nie37qmy37r78t X-HE-Tag: 1672361641-248672 X-HE-Meta: U2FsdGVkX18eErTxaQyi/Kser0tRc8Zj5Ud1QARunVWB8ks/2MzlSnrtBDxmgcwHU5QKHlZdIoNhHkD3CO2jjmMwmaAjH2aw5pg5cuYhOhYMH4PNrLRkSQWUUlcv0zgjQ0gbmUDyNo9abeKmH5yDBIMyOUh6DZfCoEuNBVZtIefILCpL3SfJnsfgiE/CjEcOIhMof6+imyZmGP1hupUPiAJIQVn2BayIcQfj/UvUUNgyP8YBczrVIlZAyRGL+JfoKIj/Pb2Dz09W4MWqYEtO4/dQJPfFXEoHYnZLcSFRjOsQdvvLqPL56ACLMV83dGuhMMVXOEdMP0OhzO1QdqSy9iE6M//VYh6mSxx6Qdnuy78l64o2iEfi32sQak7m2lHmA66/+ZzbTiZSDOwviVgPjlheusTFUUOOsrofBPM41SMfAcEa1QCvgwXqiYPJwUBByMYlMdJ8NqQa1KaPAEqj6byPcDabDEsUtUlb+JGfRt82tVo6/D3o/NjseTqPHVbn4xgn2nSM2egcLXsDfpWaL226S5jDjYqIE1gMDJgTdEdbGtGBLWZn1+etal9GVDceilE58PlMwaJcc8dqKQdvrAMwGspP9et6fKtBn5TPpRPJ4cKqzwU4lvhALAXLMszJ3j7bUaOK5HbWGElrs3FNcO8WZwOyvpmbtjGsB/zpQSXFz4bLsXvxM/0or1wJ+5aBJ4q1uZhkUYU4TwGgyaC4b+wzhh5Vnyrog336PNQ/Zjh9C8cXReSsre+prWlqNa2vU3MJ5hdbC5wRRAasokmADZrMnvMDJvroD5FcAMqGlQyEVUlcanPRdF1tiNyWgJmKnrd+v2ZXpf9kgn3OkeInocnGUghOD9JZOpyw5Onu4cpjbYHOPsjRQ5bb415cpNHvAd2J1MbGdltkuQhFwSLdbLhgjbL0zPTjAqzxKJORbThuIJfkWOOaWKej/MZCOaSv 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.