Received: by 10.213.65.68 with SMTP id h4csp688826imn; Tue, 13 Mar 2018 18:22:33 -0700 (PDT) X-Google-Smtp-Source: AG47ELshlVZGZOMNRNykNDG20JOUA/A2ddGf+Ongt59svETYD5OuWX9ulQxLwnq2q7UFSYUx64Pk X-Received: by 2002:a17:902:4001:: with SMTP id b1-v6mr2302892pld.28.1520990553822; Tue, 13 Mar 2018 18:22:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520990553; cv=none; d=google.com; s=arc-20160816; b=EKyrecT5+C650iJNyPyAD3L9umCgWgy7x58Rv8Y6vsVkkEEfFoi8ia9jJ7dMf+lBPb 7d3pwJa66ZBUUodw4gJbazYFncNyr8zEznpKk2KTAumVgMHLUWRDobYjn7dCY7eJoLGy AZYmNsQuagxhjR4weUTX++y+sztW5bxhTFTasUjy7K4hMY6ID/a1vge3VlR8QonuYcb/ WsFHdwIbsmK45NMwEpHG6pp0tCKYuLBH23TiJTzSKC97h6J0nN4kGq7xzCIM3MJxtGQY m/XDeXCMOYdqvm/hsidJVpWcwXIEry9FpE/ZIRt3a8i4JsopgjsdhpbMikNcf2uCgXKc aZ9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:arc-authentication-results; bh=UE7xaajdJMmknH/Rpn8ZkFGwhhZ0CWPx42NenD7/5n4=; b=QYlZ3q0uLSRPxrV7iXoCTe9VnwZx9fWZimj/uvL91iFDtozR9K4GkBW97V3bla3aK7 edgkEPC2IhdQy5Ja5bPQ9drqcigJy7san8GXly1ve9pPhSe+2hFlx6bEphZrDjGV1GS0 ulXBo9dnQhq6IZlBVaVmIPUD4PRPOyq8JaX6HI5SJIJ4fr2VpUyZiH2fi1euIc9y72sr TunGfaf35q+opwBYbxV3oQSVZhh+J9k356vfJZu8bjrhZKm4M3HlMvnqDr3JJKNQ72Mz PMZoYkvW7FstHK5hF6wyNr7NJ6iqVBBSmfwdH3dXTMqxTtW45e/vwVfitmtrHJuIxUVb Iv/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o20-v6si1066120pli.229.2018.03.13.18.22.19; Tue, 13 Mar 2018 18:22:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933012AbeCNBV1 (ORCPT + 99 others); Tue, 13 Mar 2018 21:21:27 -0400 Received: from mail-oi0-f54.google.com ([209.85.218.54]:37668 "EHLO mail-oi0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932634AbeCNBVZ (ORCPT ); Tue, 13 Mar 2018 21:21:25 -0400 Received: by mail-oi0-f54.google.com with SMTP id f186so1386271oig.4 for ; Tue, 13 Mar 2018 18:21:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UE7xaajdJMmknH/Rpn8ZkFGwhhZ0CWPx42NenD7/5n4=; b=ZmTo2kVouT1Yk22jrW7hBJO5rrwp5GbTG2V6SkRYS9HdT9/HPylU2KQ2kF8xvR+udk RVn88NSUE2ThfwcOCTK3vKBoMMKz5viFVHvRVnyRuZ4v5g7lcM70wVnCAeZIftkaJN5F aOkGWBQ/jXlT9g5h5d3gk/gSzRrzY1tdshkazxoJB8cG1djpjltaPL2uH+IvlpxokftF MUB3k//Vy6elnLm5FigXG55yKRjpRK8GiB6DhnNq+ZyopJS7jZtVnDp/+LgPW9JkkKBl 0FOE9t7e2pImjMU3bQUfYprt39s6nBm+dBXQTeKgAxX1zunJ8lGj5sQnIeFX/eyrI254 oJ0g== X-Gm-Message-State: AElRT7GLlets+Of5BvbdINaraVHeZ+8LURyBACF7kA/H5IpvSMHnWwfO tePZROJ0pmj+ZnBcl1vHKa1oT4c6UXY= X-Received: by 10.202.196.12 with SMTP id u12mr1746450oif.39.1520990484829; Tue, 13 Mar 2018 18:21:24 -0700 (PDT) Received: from ?IPv6:2601:602:9802:a8dc::b761? ([2601:602:9802:a8dc::b761]) by smtp.gmail.com with ESMTPSA id h96sm895466otb.80.2018.03.13.18.21.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Mar 2018 18:21:23 -0700 (PDT) Subject: Re: kernel BUG at mm/khugepaged.c:533 on 4.15.3 From: Laura Abbott To: "Kirill A. Shutemov" Cc: Linux-MM , "Kirill A. Shutemov" , Linux Kernel Mailing List References: <2a152301-0535-6cb6-8823-44035f007fae@redhat.com> <20180221091445.iqtncxx66etpqamt@node.shutemov.name> <70a4ca16-0d54-5df4-15bb-fdf1538ef080@redhat.com> Message-ID: Date: Tue, 13 Mar 2018 18:21:21 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <70a4ca16-0d54-5df4-15bb-fdf1538ef080@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/22/2018 09:33 AM, Laura Abbott wrote: > On 02/21/2018 01:14 AM, Kirill A. Shutemov wrote: >> On Mon, Feb 19, 2018 at 10:51:01AM -0800, Laura Abbott wrote: >>> Hi, >>> >>> Fedora got a bug report of a BUG with 4.15.3: >>> (https://bugzilla.redhat.com/show_bug.cgi?id=1546709) >> >> Is it new to v4.15 kernel? >> I don't see any recent change that could cause it. >> > > The original reporter only saw it on 4.15 but another reporter > saw it on 4.14.13 (I only found this out after I sent the > e-mail). So I suspect the bug may have been latent but > hard to trigger. > >> >>> page:fffffac1800a0000 count:513 mapcount:1 mapping:ffff95657ef359a1 index:0x7f95d3400 compound_mapcount: 0 >>> flags: 0xffffe00048268(uptodate|lru|active|owner_priv_1|head|swapbacked) >>> raw: 000ffffe00048268 ffff95657ef359a1 00000007f95d3400 0000020100000000 >>> raw: fffffac18edea9a0 fffffac18e7085a0 00000000000db400 ffff9567a3269800 >>> page dumped because: VM_BUG_ON_PAGE(PageCompound(page)) >>> page->mem_cgroup:ffff9567a3269800 >>> ------------[ cut here ]------------ >>> kernel BUG at mm/khugepaged.c:533! >>> invalid opcode: 0000 [#1] SMP PTI >>> Modules linked in: vhost_net vhost tap fuse xt_CHECKSUM ipt_MASQUERADE nf_nat_masquerade_ipv4 tun ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack libcrc32c iptable_mangle iptable_raw iptable_security ebtable_filter ebtables ip6table_filter ip6_tables sunrpc vfat fat rmi_smbus rmi_core arc4 intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp snd_hda_codec_hdmi iwlmvm kvm_intel iTCO_wdt mac80211 snd_hda_codec_realtek iTCO_vendor_support mei_wdt kvm snd_hda_codec_generic irqbypass intel_cstate snd_hda_intel intel_uncore iwlwifi uvcvideo intel_rapl_perf >>> snd_hda_codec videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_core snd_hda_core cfg80211 videodev snd_hwdep snd_seq snd_seq_device snd_pcm media mei_me snd_timer thinkpad_acpi wmi_bmof rtsx_pci_ms joydev tpm_tis memstick i2c_i801 mei tpm_tis_core snd soundcore intel_pch_thermal tpm shpchp rfkill dm_crypt hid_logitech_hidpp hid_logitech_dj mmc_block nouveau i915 rtsx_pci_sdmmc mmc_core mxm_wmi ttm e1000e i2c_algo_bit drm_kms_helper crct10dif_pclmul crc32_pclmul crc32c_intel ptp drm ghash_clmulni_intel serio_raw rtsx_pci pps_core wmi video >>> CPU: 2 PID: 66 Comm: khugepaged Not tainted 4.15.3-300.fc27.x86_64 #1 >>> Hardware name: LENOVO 20FXS0BB14/20FXS0BB14, BIOS R07ET63W (2.03 ) 03/15/2016 >>> RIP: 0010:khugepaged+0x1af6/0x2130 >>> RSP: 0018:ffffacacc1b4bdc0 EFLAGS: 00010282 >>> RAX: 0000000000000021 RBX: fffffac1800a0000 RCX: 0000000000000006 >>> RDX: 0000000000000000 RSI: 0000000000000086 RDI: ffff9567c14968f0 >>> RBP: fffffac18e3a5b40 R08: 00000000000004a8 R09: 0000000000000004 >>> R10: ffffacacc1b4bd70 R11: ffffffffb995b1ed R12: 00007f95f7e00000 >>> R13: ffff95661113eaf0 R14: ffff9567a9ea0000 R15: 8000000002800825 >>> FS:  0000000000000000(0000) GS:ffff9567c1480000(0000) knlGS:0000000000000000 >>> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033 >>> CR2: 0000000000481046 CR3: 00000002ee20a005 CR4: 00000000003626e0 >>> Call Trace: >>> ? finish_wait+0x80/0x80 >>> ? collapse_shmem+0xdd0/0xdd0 >>> kthread+0x113/0x130 >>> ? kthread_create_worker_on_cpu+0x70/0x70 >>> ret_from_fork+0x35/0x40 >>> Code: ff e9 e7 fd ff ff bb 07 00 00 00 49 89 c7 e9 20 fb ff ff 48 83 ea 01 e9 66 fc ff ff 48 c7 c6 d8 3f 0a b9 48 89 df e8 0a 82 fa ff <0f> 0b 31 c9 4c 89 fa 48 89 de 4c 89 f7 e8 58 f1 fd ff e9 2e fa >>> RIP: khugepaged+0x1af6/0x2130 RSP: ffffacacc1b4bdc0 >>> ---[ end trace a734c2f4d682e3bd ]--- >>> >>> Reporter said it happened several times. Config is attached. >>> Any ideas? >> >> Looks like somebody managed to insert THP into the range in split it back >> between khugepaged_scan_pmd() and __collapse_huge_page_isolate(). >> >> That's rather unlikely chain of events, but I don't see other option. >> >> Could you check if this works: >> >> diff --git a/mm/khugepaged.c b/mm/khugepaged.c >> index b7e2268dfc9a..c15da1ea7e63 100644 >> --- a/mm/khugepaged.c >> +++ b/mm/khugepaged.c >> @@ -530,7 +530,12 @@ static int __collapse_huge_page_isolate(struct vm_area_struct *vma, >>               goto out; >>           } >> -        VM_BUG_ON_PAGE(PageCompound(page), page); >> +        /* TODO: teach khugepaged to collapse THP mapped with pte */ >> +        if (PageCompound(page)) { >> +            result = SCAN_PAGE_COMPOUND; >> +            goto out; >> +        } >> + >>           VM_BUG_ON_PAGE(!PageAnon(page), page); >>           /* >> > > I asked the reporter(s) to test with this patch. I'll let you know > if I hear any results. > > Thanks, > Laura Reporter said he had been running with the patch for several weeks and hadn't seen the issue again. Thanks, Laura