ci starts bisection 2022-11-17 02:10:53.016027766 +0000 UTC m=+92763.580520560 bisecting fixing commit since 55be6084c8e0e0ada9278c2ab60b7a584378efda building syzkaller on 89b5a5097a095577d19574ae2fe3070e5af2a065 ensuring issue is reproducible on original commit 55be6084c8e0e0ada9278c2ab60b7a584378efda testing commit 55be6084c8e0e0ada9278c2ab60b7a584378efda gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 639cb658fdcf2767b8c7368de68a4eb72cb27c645fb9301b9e8e2f3eb7cf6062 all runs: crashed: general protection fault in kernfs_get_inode testing current HEAD cc675d22e422442f6d230654a55a5fc5682ea018 testing commit cc675d22e422442f6d230654a55a5fc5682ea018 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: f8ddeb42c17a4b3bc16b2e1c4b64541a768c63340b3ef1e0bb1a5358c20d897c all runs: OK # git bisect start cc675d22e422442f6d230654a55a5fc5682ea018 55be6084c8e0e0ada9278c2ab60b7a584378efda Bisecting: 2206 revisions left to test after this (roughly 11 steps) [66ae04368efbe20eb8951c9a76158f99ce672f25] Merge tag 'net-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net testing commit 66ae04368efbe20eb8951c9a76158f99ce672f25 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 9c0726e5640f589fc6c08b13243393dbb011234e1568d8e8beaf2bfbd06a1835 all runs: boot failed: WARNING in cpumask_next_wrap # git bisect skip 66ae04368efbe20eb8951c9a76158f99ce672f25 Bisecting: 2206 revisions left to test after this (roughly 11 steps) [20b2194eeee3ff8df8f2bbf7631e7278fced404a] perf lock: Remove unused struct lock_contention_key testing commit 20b2194eeee3ff8df8f2bbf7631e7278fced404a gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 393dbd0060ce8eb7a4a3804443a9d029043ca89677929b252cc7f8670115360a all runs: boot failed: WARNING in netlink_ack # git bisect skip 20b2194eeee3ff8df8f2bbf7631e7278fced404a Bisecting: 2206 revisions left to test after this (roughly 11 steps) [1dcaf30725c32b26daa70d22083999972ab99c29] cpufreq: tegra194: Fix module loading testing commit 1dcaf30725c32b26daa70d22083999972ab99c29 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: c4f463bd4ed12cbc5b24d6e4af5d861975128dee7f871d669a0cfbe4ef1f7940 all runs: boot failed: WARNING in __netif_set_xps_queue # git bisect skip 1dcaf30725c32b26daa70d22083999972ab99c29 Bisecting: 2206 revisions left to test after this (roughly 11 steps) [265f2fc52f5873ae3fa653ce1f2dbc47afef6344] media: venus: hfi: Remove the unneeded result variable testing commit 265f2fc52f5873ae3fa653ce1f2dbc47afef6344 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 3ac59bf1ec8d29f501ce63642f9414fabbdbfebc6f2c9e11a72216198904c5f7 run #0: boot failed: possible deadlock in vivid_update_format_cap run #1: boot failed: possible deadlock in vivid_update_format_cap run #2: boot failed: BUG: unable to handle kernel paging request in kernel_execve run #3: boot failed: general protection fault in mm_alloc run #4: boot failed: BUG: unable to handle kernel paging request in kernfs_link_sibling run #5: boot failed: WARNING in copy_process run #6: boot failed: general protection fault in driver_register run #7: boot failed: general protection fault in netdev_queue_update_kobjects run #8: boot failed: general protection fault in netdev_queue_update_kobjects run #9: boot failed: general protection fault in netdev_queue_update_kobjects # git bisect skip 265f2fc52f5873ae3fa653ce1f2dbc47afef6344 Bisecting: 2206 revisions left to test after this (roughly 11 steps) [45a3975f8e4c56829ada20f7a6a29095ca05e375] perf auxtrace arm: Refactor event list iteration in auxtrace_record__init() testing commit 45a3975f8e4c56829ada20f7a6a29095ca05e375 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 50f2bc398f981df5ee46bc1229fbe005bc59bdf4c5c7988880ce9583aa2186f7 all runs: boot failed: WARNING in cpumask_next_wrap # git bisect skip 45a3975f8e4c56829ada20f7a6a29095ca05e375 Bisecting: 2206 revisions left to test after this (roughly 11 steps) [7964cf8caa4dfa42c4149f3833d3878713cda3dc] mm: remove vmacache testing commit 7964cf8caa4dfa42c4149f3833d3878713cda3dc gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: a990160fa33c9659b53efff7f2806a508d7149624240469247eb0938de16eb06 all runs: OK # git bisect bad 7964cf8caa4dfa42c4149f3833d3878713cda3dc Bisecting: 106 revisions left to test after this (roughly 7 steps) [663d0cfd2e77aa3ed170df76d441c8f07efa3cf6] mm/page_alloc.c: delete a redundant parameter of rmqueue_pcplist testing commit 663d0cfd2e77aa3ed170df76d441c8f07efa3cf6 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: c6312f8e057836cdc4db8c11e12d5a94c2951fdf7cfc5d724b5ed6567f69b198 all runs: OK # git bisect bad 663d0cfd2e77aa3ed170df76d441c8f07efa3cf6 Bisecting: 53 revisions left to test after this (roughly 6 steps) [3a6bdda0b58bab883da8dc3a0503e2a13b9d7456] mm/hugetlb: fix WARN_ON(!kobj) in sysfs_create_group() testing commit 3a6bdda0b58bab883da8dc3a0503e2a13b9d7456 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: e44d817e15cb6ffc04c963541d2da23ce806e5fe430a641e990238317e55cdde all runs: OK # git bisect bad 3a6bdda0b58bab883da8dc3a0503e2a13b9d7456 Bisecting: 26 revisions left to test after this (roughly 5 steps) [050a388b7f05b13dbcc5b6f14a4c7565a69a5020] zsmalloc: zs_object_copy: add clarifying comment testing commit 050a388b7f05b13dbcc5b6f14a4c7565a69a5020 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 3a261cb847efbb0342c79e38fa861066f8f6e7ce0549cec81a1e9ed801b34770 all runs: OK # git bisect bad 050a388b7f05b13dbcc5b6f14a4c7565a69a5020 Bisecting: 12 revisions left to test after this (roughly 4 steps) [1370a21fe4708b3bfa748d355146e4fbadf52f90] selftests/vm: add selftest to verify recollapse of THPs testing commit 1370a21fe4708b3bfa748d355146e4fbadf52f90 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 1fb743d1c94d0d8b35b620eb48a9c2aef188627dcb8b507cb07b590f9a39e3d5 all runs: OK # git bisect bad 1370a21fe4708b3bfa748d355146e4fbadf52f90 Bisecting: 6 revisions left to test after this (roughly 3 steps) [50722804423680488b8063f6cc9a451333bf6f9b] mm/khugepaged: record SCAN_PMD_MAPPED when scan_pmd() finds hugepage testing commit 50722804423680488b8063f6cc9a451333bf6f9b gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 2c429500373e58e2194a45dbf1c557ff84b620a183bc9e1dea8094e3b830a4cc all runs: OK # git bisect bad 50722804423680488b8063f6cc9a451333bf6f9b Bisecting: 2 revisions left to test after this (roughly 2 steps) [50ad2f24b3b48c7123e0d61a467baf35875a9ba5] mm/khugepaged: propagate enum scan_result codes back to callers testing commit 50ad2f24b3b48c7123e0d61a467baf35875a9ba5 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 8fa6c043fb3c57b184c8c1264cfe160da6e08e20ed5d821d75f7f5fb0f5d8163 all runs: OK # git bisect bad 50ad2f24b3b48c7123e0d61a467baf35875a9ba5 Bisecting: 1 revision left to test after this (roughly 1 step) [34d6b470ab9cf3a038f9bcd0f8cf09016a2e6fbe] mm/khugepaged: add struct collapse_control testing commit 34d6b470ab9cf3a038f9bcd0f8cf09016a2e6fbe gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 9bf8888b7421b60bdae9f6105ac5091a11a86be3afecd68ca302dcad6efcc283 all runs: OK # git bisect bad 34d6b470ab9cf3a038f9bcd0f8cf09016a2e6fbe Bisecting: 0 revisions left to test after this (roughly 0 steps) [c6a7f445a2727a66fe68a7097f42698d8b31ea2c] mm: khugepaged: don't carry huge page to the next loop for !CONFIG_NUMA testing commit c6a7f445a2727a66fe68a7097f42698d8b31ea2c gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: aac755af655da2e0483de39b6d52f924ccc9369fbe79384d6b5a8035486308e0 all runs: OK # git bisect bad c6a7f445a2727a66fe68a7097f42698d8b31ea2c c6a7f445a2727a66fe68a7097f42698d8b31ea2c is the first bad commit commit c6a7f445a2727a66fe68a7097f42698d8b31ea2c Author: Yang Shi Date: Wed Jul 6 16:59:20 2022 -0700 mm: khugepaged: don't carry huge page to the next loop for !CONFIG_NUMA Patch series "mm: userspace hugepage collapse", v7. Introduction -------------------------------- This series provides a mechanism for userspace to induce a collapse of eligible ranges of memory into transparent hugepages in process context, thus permitting users to more tightly control their own hugepage utilization policy at their own expense. This idea was introduced by David Rientjes[5]. Interface -------------------------------- The proposed interface adds a new madvise(2) mode, MADV_COLLAPSE, and leverages the new process_madvise(2) call. process_madvise(2) Performs a synchronous collapse of the native pages mapped by the list of iovecs into transparent hugepages. This operation is independent of the system THP sysfs settings, but attempts to collapse VMAs marked VM_NOHUGEPAGE will still fail. THP allocation may enter direct reclaim and/or compaction. When a range spans multiple VMAs, the semantics of the collapse over of each VMA is independent from the others. Caller must have CAP_SYS_ADMIN if not acting on self. Return value follows existing process_madvise(2) conventions. A “success” indicates that all hugepage-sized/aligned regions covered by the provided range were either successfully collapsed, or were already pmd-mapped THPs. madvise(2) Equivalent to process_madvise(2) on self, with 0 returned on “success”. Current Use-Cases -------------------------------- (1) Immediately back executable text by THPs. Current support provided by CONFIG_READ_ONLY_THP_FOR_FS may take a long time on a large system which might impair services from serving at their full rated load after (re)starting. Tricks like mremap(2)'ing text onto anonymous memory to immediately realize iTLB performance prevents page sharing and demand paging, both of which increase steady state memory footprint. With MADV_COLLAPSE, we get the best of both worlds: Peak upfront performance and lower RAM footprints. Note that subsequent support for file-backed memory is required here. (2) malloc() implementations that manage memory in hugepage-sized chunks, but sometimes subrelease memory back to the system in native-sized chunks via MADV_DONTNEED; zapping the pmd. Later, when the memory is hot, the implementation could madvise(MADV_COLLAPSE) to re-back the memory by THPs to regain hugepage coverage and dTLB performance. TCMalloc is such an implementation that could benefit from this[6]. A prior study of Google internal workloads during evaluation of Temeraire, a hugepage-aware enhancement to TCMalloc, showed that nearly 20% of all cpu cycles were spent in dTLB stalls, and that increasing hugepage coverage by even small amount can help with that[7]. (3) userfaultfd-based live migration of virtual machines satisfy UFFD faults by fetching native-sized pages over the network (to avoid latency of transferring an entire hugepage). However, after guest memory has been fully copied to the new host, MADV_COLLAPSE can be used to immediately increase guest performance. Note that subsequent support for file/shmem-backed memory is required here. (4) HugeTLB high-granularity mapping allows HugeTLB a HugeTLB page to be mapped at different levels in the page tables[8]. As it's not "transparent" like THP, HugeTLB high-granularity mappings require an explicit user API. It is intended that MADV_COLLAPSE be co-opted for this use case[9]. Note that subsequent support for HugeTLB memory is required here. Future work -------------------------------- Only private anonymous memory is supported by this series. File and shmem memory support will be added later. One possible user of this functionality is a userspace agent that attempts to optimize THP utilization system-wide by allocating THPs based on, for example, task priority, task performance requirements, or heatmaps. For the latter, one idea that has already surfaced is using DAMON to identify hot regions, and driving THP collapse through a new DAMOS_COLLAPSE scheme[10]. This patch (of 17): The khugepaged has optimization to reduce huge page allocation calls for !CONFIG_NUMA by carrying the allocated but failed to collapse huge page to the next loop. CONFIG_NUMA doesn't do so since the next loop may try to collapse huge page from a different node, so it doesn't make too much sense to carry it. But when NUMA=n, the huge page is allocated by khugepaged_prealloc_page() before scanning the address space, so it means huge page may be allocated even though there is no suitable range for collapsing. Then the page would be just freed if khugepaged already made enough progress. This could make NUMA=n run have 5 times as much thp_collapse_alloc as NUMA=y run. This problem actually makes things worse due to the way more pointless THP allocations and makes the optimization pointless. This could be fixed by carrying the huge page across scans, but it will complicate the code further and the huge page may be carried indefinitely. But if we take one step back, the optimization itself seems not worth keeping nowadays since: * Not too many users build NUMA=n kernel nowadays even though the kernel is actually running on a non-NUMA machine. Some small devices may run NUMA=n kernel, but I don't think they actually use THP. * Since commit 44042b449872 ("mm/page_alloc: allow high-order pages to be stored on the per-cpu lists"), THP could be cached by pcp. This actually somehow does the job done by the optimization. Link: https://lkml.kernel.org/r/20220706235936.2197195-1-zokeefe@google.com Link: https://lkml.kernel.org/r/20220706235936.2197195-3-zokeefe@google.com Signed-off-by: Yang Shi Signed-off-by: Zach O'Keefe Co-developed-by: Peter Xu Signed-off-by: Peter Xu Cc: Hugh Dickins Cc: "Kirill A. Shutemov" Cc: Alex Shi Cc: Andrea Arcangeli Cc: Arnd Bergmann Cc: Axel Rasmussen Cc: Chris Kennelly Cc: Chris Zankel Cc: David Hildenbrand Cc: David Rientjes Cc: Helge Deller Cc: Ivan Kokshaysky Cc: James Bottomley Cc: Jens Axboe Cc: Matthew Wilcox Cc: Matt Turner Cc: Max Filippov Cc: Miaohe Lin Cc: Michal Hocko Cc: Minchan Kim Cc: Pasha Tatashin Cc: Pavel Begunkov Cc: Rongwei Wang Cc: SeongJae Park Cc: Song Liu Cc: Thomas Bogendoerfer Cc: Vlastimil Babka Cc: Zi Yan Cc: Dan Carpenter Cc: "Souptick Joarder (HPE)" Signed-off-by: Andrew Morton mm/khugepaged.c | 120 ++++++++++++-------------------------------------------- 1 file changed, 26 insertions(+), 94 deletions(-) parent commit b90cb1053190353cc30f0fef0ef1f378ccc063c5 wasn't tested testing commit b90cb1053190353cc30f0fef0ef1f378ccc063c5 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 6ffd61b67925d5071087a62e576cc698fec1e17879484f269ea83057dbf02cc0 culprit signature: aac755af655da2e0483de39b6d52f924ccc9369fbe79384d6b5a8035486308e0 parent signature: 6ffd61b67925d5071087a62e576cc698fec1e17879484f269ea83057dbf02cc0 revisions tested: 16, total time: 5h14m52.195526927s (build: 2h25m56.833056503s, test: 2h45m52.558287315s) first good commit: c6a7f445a2727a66fe68a7097f42698d8b31ea2c mm: khugepaged: don't carry huge page to the next loop for !CONFIG_NUMA recipients (to): ["akpm@linux-foundation.org" "peterx@redhat.com" "shy828301@gmail.com" "zokeefe@google.com"] recipients (cc): []