diff for duplicates of <874ltsm0bi.fsf@yhuang-dev.intel.com> diff --git a/a/1.txt b/N1/1.txt index f2465e2..9d5a305 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -91,3 +91,103 @@ Best Regards, Huang, Ying --------->8--------- +>From 2487f0230fef59c1ef89792e2af7bcabc02470cf Mon Sep 17 00:00:00 2001 +From: Huang Ying <ying.huang@intel.com> +Date: Tue, 1 Aug 2017 11:20:23 +0800 +Subject: [PATCH] mm, THP, swap: Fix swap_page_trans_huge_swapped on HDD + +To fix the following kernel bug, + +[ 112.690842] ===> testcase 'mm/shmem_swap' start +[ 112.788440] Adding 40956k swap on +/mnt/tests/examples/regression/kernel/mm_regression/mm_regression/work/swapfile. +Priority:-2 extents:1 across:40956k FS +[ 112.815903] bash (17346): drop_caches: 3 +[ 112.975713] BUG: unable to handle kernel NULL pointer dereference at 0000000000000007 +[ 112.984464] IP: swap_page_trans_huge_swapped+0x49/0xd0 +[ 112.990202] PGD 805e62067 +[ 112.990202] P4D 805e62067 +[ 112.993219] PUD 80447b067 +[ 112.996236] PMD 0 +[ 112.999253] +[ 113.003155] Oops: 0000 [#1] SMP +[ 113.006658] Modules linked in: nfsv4 dns_resolver nfs fscache +xt_CHECKSUM iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4 +iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 +xt_conntrack nf_conntrack libcrc32c ipt_REJECT nf_reject_ipv4 tun +bridge stp llc ebtable_filter ebtables ip6_tables iptable_filter +intel_rapl x86_pkg_temp_thermal intel_powerclamp kvm_intel kvm +iTCO_wdt nfsd iTCO_vendor_support mei_me auth_rpcgss mei lpc_ich +ipmi_si ipmi_devintf irqbypass nfs_acl shpchp sg mfd_core ie31200_edac +lockd ipmi_msghandler pcspkr video acpi_pad grace sunrpc ip_tables +sr_mod sd_mod cdrom tg3 ata_generic pata_acpi ata_piix ptp libata +megaraid_sas crc32c_intel pps_core dm_mirror dm_region_hash dm_log +dm_mod +[ 113.077676] CPU: 0 PID: 17431 Comm: test_alloc_gene Not tainted 4.13.0-rc3-mm1-v4.13-rc3-mmotm-2017-07-31-16-56+ #1 +[ 113.089323] Hardware name: NEC Express5800/T110g-E [N8100-2187Y]/GA-6LASV1, BIOS 4.6.1204 10/17/2014 +[ 113.099516] task: ffffa06705de9740 task.stack: ffffac0947c0c000 +[ 113.106124] RIP: 0010:swap_page_trans_huge_swapped+0x49/0xd0 +[ 113.112438] RSP: 0018:ffffac0947c0fb38 EFLAGS: 00010246 +[ 113.118269] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000040 +[ 113.126233] RDX: 0000000000000001 RSI: 00000000000005d6 RDI: ffffa06705674cfc +[ 113.134196] RBP: ffffac0947c0fb60 R08: 0000000000000000 R09: ffffffff88ca2180 +[ 113.142161] R10: 0000000000000230 R11: ffffa066e7a9b451 R12: ffffa06705674c00 +[ 113.150123] R13: 00000000000005d6 R14: 0000000000000400 R15: ffffac0944001000 +[ 113.158088] FS: 00007f855b243740(0000) GS:ffffa0672fc00000(0000) knlGS:0000000000000000 +[ 113.167118] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +[ 113.173529] CR2: 0000000000000007 CR3: 0000000808de2002 CR4: 00000000001606f0 +[ 113.181493] Call Trace: +[ 113.184222] free_swap_and_cache+0x73/0x1d0 +[ 113.188889] shmem_free_swap+0x5e/0x70 +[ 113.193072] shmem_undo_range+0x4bd/0x8b0 +[ 113.197547] shmem_truncate_range+0x14/0x40 +[ 113.202211] shmem_evict_inode+0xba/0x190 +[ 113.206686] evict+0xd3/0x1a0 +[ 113.210004] iput+0x17d/0x1d0 +[ 113.213316] dentry_unlink_inode+0xb9/0xf0 +[ 113.217887] __dentry_kill+0xc7/0x170 +[ 113.221994] dput+0x19c/0x1d0 +[ 113.225311] __fput+0x188/0x210 +[ 113.228813] ____fput+0xe/0x10 +[ 113.232221] task_work_run+0x86/0xa0 +[ 113.236209] exit_to_usermode_loop+0x6d/0x99 +[ 113.240981] syscall_return_slowpath+0xad/0xd0 +[ 113.245961] entry_SYSCALL_64_fastpath+0xa3/0xa5 +[ 113.251127] RIP: 0033:0x7f855a940b17 +[ 113.255113] RSP: 002b:00007fff955b5048 EFLAGS: 00000206 ORIG_RAX: 000000000000001f +[ 113.263562] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f855a940b17 +[ 113.271524] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000028001 +[ 113.279488] RBP: 00007fff955b5060 R08: 0000000000000000 R09: 0000000000000000 +[ 113.287450] R10: 00007fff955b4dd0 R11: 0000000000000206 R12: 0000000000401da0 +[ 113.295414] R13: 00007fff955b5350 R14: 0000000000000000 R15: 0000000000000000 +[ 113.303378] Code: f5 41 54 49 89 fc 53 48 8b 47 70 4c 8b 7f 68 48 85 +c0 74 70 4c 89 f3 48 c1 eb 06 48 01 c3 48 89 df e8 fc 10 54 00 48 85 +db 74 59 <f6> 43 07 04 75 31 48 b8 ff ff ff ff ff ff ff 01 49 21 c5 43 +80 +[ 113.324450] RIP: swap_page_trans_huge_swapped+0x49/0xd0 RSP: ffffac0947c0fb38 +[ 113.332413] CR2: 0000000000000007 +[ 113.336121] ---[ end trace 2cd503b4980b0afc ]--- +[ 113.341281] Kernel panic - not syncing: Fatal exception +[ 113.347398] Kernel Offset: 0x7000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff) + +Reported-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> +Signed-off-by: "Huang, Ying" <ying.huang@intel.com> +--- + mm/swapfile.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mm/swapfile.c b/mm/swapfile.c +index d77fc2fe2b8f..32434541cc12 100644 +--- a/mm/swapfile.c ++++ b/mm/swapfile.c +@@ -1390,7 +1390,7 @@ static bool swap_page_trans_huge_swapped(struct swap_info_struct *si, + bool ret = false; + + ci = lock_cluster_or_swap_info(si, offset); +- if (!cluster_is_huge(ci)) { ++ if (!ci || !cluster_is_huge(ci)) { + if (map[roffset] != SWAP_HAS_CACHE) + ret = true; + goto unlock_out; +-- +2.13.2 diff --git a/a/content_digest b/N1/content_digest index 4e782d7..88c67f4 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -3,11 +3,11 @@ "Subject\0Re: \"BUG: unable to handle kernel NULL pointer dereference\" in swapping shmem\0" "Date\0Tue, 01 Aug 2017 11:30:41 +0800\0" "To\0Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>\0" - "Cc\0linux-mm@kvack.org <linux-mm@kvack.org>" + "Cc\0linux-mm\\@kvack.org <linux-mm@kvack.org>" Andrew Morton <akpm@linux-foundation.org> - Huang + " Huang\\" Ying <ying.huang@intel.com> - linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org> + " linux-kernel\\@vger.kernel.org <linux-kernel@vger.kernel.org>" Johannes Weiner <hannes@cmpxchg.org> Minchan Kim <minchan@kernel.org> Hugh Dickins <hughd@google.com> @@ -112,6 +112,106 @@ "Best Regards,\n" "Huang, Ying\n" "\n" - --------->8--------- + "--------->8---------\n" + ">From 2487f0230fef59c1ef89792e2af7bcabc02470cf Mon Sep 17 00:00:00 2001\n" + "From: Huang Ying <ying.huang@intel.com>\n" + "Date: Tue, 1 Aug 2017 11:20:23 +0800\n" + "Subject: [PATCH] mm, THP, swap: Fix swap_page_trans_huge_swapped on HDD\n" + "\n" + "To fix the following kernel bug,\n" + "\n" + "[ 112.690842] ===> testcase 'mm/shmem_swap' start\n" + "[ 112.788440] Adding 40956k swap on\n" + "/mnt/tests/examples/regression/kernel/mm_regression/mm_regression/work/swapfile.\n" + "Priority:-2 extents:1 across:40956k FS\n" + "[ 112.815903] bash (17346): drop_caches: 3\n" + "[ 112.975713] BUG: unable to handle kernel NULL pointer dereference at 0000000000000007\n" + "[ 112.984464] IP: swap_page_trans_huge_swapped+0x49/0xd0\n" + "[ 112.990202] PGD 805e62067\n" + "[ 112.990202] P4D 805e62067\n" + "[ 112.993219] PUD 80447b067\n" + "[ 112.996236] PMD 0\n" + "[ 112.999253]\n" + "[ 113.003155] Oops: 0000 [#1] SMP\n" + "[ 113.006658] Modules linked in: nfsv4 dns_resolver nfs fscache\n" + "xt_CHECKSUM iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4\n" + "iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4\n" + "xt_conntrack nf_conntrack libcrc32c ipt_REJECT nf_reject_ipv4 tun\n" + "bridge stp llc ebtable_filter ebtables ip6_tables iptable_filter\n" + "intel_rapl x86_pkg_temp_thermal intel_powerclamp kvm_intel kvm\n" + "iTCO_wdt nfsd iTCO_vendor_support mei_me auth_rpcgss mei lpc_ich\n" + "ipmi_si ipmi_devintf irqbypass nfs_acl shpchp sg mfd_core ie31200_edac\n" + "lockd ipmi_msghandler pcspkr video acpi_pad grace sunrpc ip_tables\n" + "sr_mod sd_mod cdrom tg3 ata_generic pata_acpi ata_piix ptp libata\n" + "megaraid_sas crc32c_intel pps_core dm_mirror dm_region_hash dm_log\n" + "dm_mod\n" + "[ 113.077676] CPU: 0 PID: 17431 Comm: test_alloc_gene Not tainted 4.13.0-rc3-mm1-v4.13-rc3-mmotm-2017-07-31-16-56+ #1\n" + "[ 113.089323] Hardware name: NEC Express5800/T110g-E [N8100-2187Y]/GA-6LASV1, BIOS 4.6.1204 10/17/2014\n" + "[ 113.099516] task: ffffa06705de9740 task.stack: ffffac0947c0c000\n" + "[ 113.106124] RIP: 0010:swap_page_trans_huge_swapped+0x49/0xd0\n" + "[ 113.112438] RSP: 0018:ffffac0947c0fb38 EFLAGS: 00010246\n" + "[ 113.118269] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000040\n" + "[ 113.126233] RDX: 0000000000000001 RSI: 00000000000005d6 RDI: ffffa06705674cfc\n" + "[ 113.134196] RBP: ffffac0947c0fb60 R08: 0000000000000000 R09: ffffffff88ca2180\n" + "[ 113.142161] R10: 0000000000000230 R11: ffffa066e7a9b451 R12: ffffa06705674c00\n" + "[ 113.150123] R13: 00000000000005d6 R14: 0000000000000400 R15: ffffac0944001000\n" + "[ 113.158088] FS: 00007f855b243740(0000) GS:ffffa0672fc00000(0000) knlGS:0000000000000000\n" + "[ 113.167118] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033\n" + "[ 113.173529] CR2: 0000000000000007 CR3: 0000000808de2002 CR4: 00000000001606f0\n" + "[ 113.181493] Call Trace:\n" + "[ 113.184222] free_swap_and_cache+0x73/0x1d0\n" + "[ 113.188889] shmem_free_swap+0x5e/0x70\n" + "[ 113.193072] shmem_undo_range+0x4bd/0x8b0\n" + "[ 113.197547] shmem_truncate_range+0x14/0x40\n" + "[ 113.202211] shmem_evict_inode+0xba/0x190\n" + "[ 113.206686] evict+0xd3/0x1a0\n" + "[ 113.210004] iput+0x17d/0x1d0\n" + "[ 113.213316] dentry_unlink_inode+0xb9/0xf0\n" + "[ 113.217887] __dentry_kill+0xc7/0x170\n" + "[ 113.221994] dput+0x19c/0x1d0\n" + "[ 113.225311] __fput+0x188/0x210\n" + "[ 113.228813] ____fput+0xe/0x10\n" + "[ 113.232221] task_work_run+0x86/0xa0\n" + "[ 113.236209] exit_to_usermode_loop+0x6d/0x99\n" + "[ 113.240981] syscall_return_slowpath+0xad/0xd0\n" + "[ 113.245961] entry_SYSCALL_64_fastpath+0xa3/0xa5\n" + "[ 113.251127] RIP: 0033:0x7f855a940b17\n" + "[ 113.255113] RSP: 002b:00007fff955b5048 EFLAGS: 00000206 ORIG_RAX: 000000000000001f\n" + "[ 113.263562] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f855a940b17\n" + "[ 113.271524] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000028001\n" + "[ 113.279488] RBP: 00007fff955b5060 R08: 0000000000000000 R09: 0000000000000000\n" + "[ 113.287450] R10: 00007fff955b4dd0 R11: 0000000000000206 R12: 0000000000401da0\n" + "[ 113.295414] R13: 00007fff955b5350 R14: 0000000000000000 R15: 0000000000000000\n" + "[ 113.303378] Code: f5 41 54 49 89 fc 53 48 8b 47 70 4c 8b 7f 68 48 85\n" + "c0 74 70 4c 89 f3 48 c1 eb 06 48 01 c3 48 89 df e8 fc 10 54 00 48 85\n" + "db 74 59 <f6> 43 07 04 75 31 48 b8 ff ff ff ff ff ff ff 01 49 21 c5 43\n" + "80\n" + "[ 113.324450] RIP: swap_page_trans_huge_swapped+0x49/0xd0 RSP: ffffac0947c0fb38\n" + "[ 113.332413] CR2: 0000000000000007\n" + "[ 113.336121] ---[ end trace 2cd503b4980b0afc ]---\n" + "[ 113.341281] Kernel panic - not syncing: Fatal exception\n" + "[ 113.347398] Kernel Offset: 0x7000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)\n" + "\n" + "Reported-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>\n" + "Signed-off-by: \"Huang, Ying\" <ying.huang@intel.com>\n" + "---\n" + " mm/swapfile.c | 2 +-\n" + " 1 file changed, 1 insertion(+), 1 deletion(-)\n" + "\n" + "diff --git a/mm/swapfile.c b/mm/swapfile.c\n" + "index d77fc2fe2b8f..32434541cc12 100644\n" + "--- a/mm/swapfile.c\n" + "+++ b/mm/swapfile.c\n" + "@@ -1390,7 +1390,7 @@ static bool swap_page_trans_huge_swapped(struct swap_info_struct *si,\n" + " \tbool ret = false;\n" + " \n" + " \tci = lock_cluster_or_swap_info(si, offset);\n" + "-\tif (!cluster_is_huge(ci)) {\n" + "+\tif (!ci || !cluster_is_huge(ci)) {\n" + " \t\tif (map[roffset] != SWAP_HAS_CACHE)\n" + " \t\t\tret = true;\n" + " \t\tgoto unlock_out;\n" + "-- \n" + 2.13.2 -578b48e2ec0fa1fea71385fec95b34125e12b4595dfbf696e4f41ae4bd0094e7 +962c14ffa9c8761c1e6f4c3c3fc3861f8426402db28f3f509b97a281a8278b36
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.