Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp963827ybi; Fri, 31 May 2019 11:28:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzj15wQeMNKaZwicFoVeEDBaARkANknhyn749KvEzJA/vT1g0hnwBV3lUI7gfYqYM8te0Ho X-Received: by 2002:a65:534b:: with SMTP id w11mr11124331pgr.210.1559327331391; Fri, 31 May 2019 11:28:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559327331; cv=none; d=google.com; s=arc-20160816; b=M0vkiz7+I0ZXFpmHr3taTimptyYSttEf3JiNvwYzpcCz/5oQCIAv4OuPWVwiCERRUX TdM1991+O6v61vFENZruAeTerqpwyWITE78GkNmZC1VoogZ46EqeBIp7QHNKIAZwo/JM p/PAU4DkTAw03/razw4U3OaYhB2/0PUhfj53tPrzVFR2eKJRfnyJBKT+dQ2HlWzRzf+j BuEP8IuGcY4hTSXRYWF5IzLnxHy9bTUPAu/gh5fDG1/tKkbeoVzPqDbEUsIfLL7HlmTp qJllrs7bhgFI1mGGay2DT9J8hAkLj98CcfDXHqRGXMJkmNgQ1hPSFItAVl8E7StXhotq Zpgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=1bbOqnbmTGXv/6/haJB5JLsDUylGaUzhOYgszuwARoI=; b=emq1nI6slm4YOYESEQ4a6Tx9MYXtTOOWigjczyMSqTjC7ONvRWXtx8qmMoXPGb5y3U 3uj3EtCRC5FGton5ESVut81z7U4K0liO7VAjG6YjkIuRu7NfhCdzknYvGhYcrpOTgN20 5c+YlhoN5h5wO+QmTiwHz8j3MKmi/h9/STUxT1uj4gmij0CT9d1mceYmp/L8MeDoUmAS SDSXzRyCmUyLbriTi4sUgTmkZFE06PlHLRhL2/OTb7wJESBVqC1ZB1gCh3h62NLEQNK6 /zWeef316Aur3CMOHhq4Yz21/x4wog3NBsW0/fJbwuc3SevG171yCj2lr4Vk2ziV9rIF 8/nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=q3mAGvJt; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h4si7828118plb.206.2019.05.31.11.28.35; Fri, 31 May 2019 11:28:51 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=q3mAGvJt; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727057AbfEaS1c (ORCPT + 99 others); Fri, 31 May 2019 14:27:32 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:42112 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726869AbfEaS1c (ORCPT ); Fri, 31 May 2019 14:27:32 -0400 Received: by mail-pg1-f193.google.com with SMTP id e6so3226718pgd.9 for ; Fri, 31 May 2019 11:27:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1bbOqnbmTGXv/6/haJB5JLsDUylGaUzhOYgszuwARoI=; b=q3mAGvJtn/FGfV5nqwCBNUkHV2yfFVW/ZH8teze3YIS4vx/yz/KQVsxWIOgvan37n+ 9aaMX2KNuiMUxYhFH6kCLdCQ3lqWNoMxLoxYJqIhqtF48CAR70F2hCzaMzru8Ue2eNY1 OITa4PMxjQsb6BVOdunQQK3xduHsxEp2ycL0+7h7q7pA8UuF40TYB490dwb5KADwoPQs dxZiMKY4WMl5pSPIJOUaN9hqKQw2Sp7woWaQCcEgj3IaOi+F37mktiz05ih+QSihJ1YW SQKn7HlK4ZZtKEGBtiweqZuqbFCtqwR+7dOYJCovF+W2YnHoLetG00/2f7hP9XNt1Mgs JTbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1bbOqnbmTGXv/6/haJB5JLsDUylGaUzhOYgszuwARoI=; b=W/9xjJqK3S5Rh08XQDB2IR3RVloVave5OxX4Po9cXKf/UzEa+iv35pnwv2eMNMuFAH GSYan/X2LsekHU0oJYfTAV1SNE6oY/TnQof9ElZsJ7w6BigfLwGV08vow63KrNds0RjF Le96lWBJYdXkCNzTJP1LeQliy4tNAX0WZLXWroJ2VGl+ERUZ1Uu/QcSo2snui4XD4Vwv HEM0jxxthRCm/uFzcvY8TtniLPg9rluIndhJ1Iyy0mYIywz1B0zznkLuK2ftit0MBxD0 lIHwLKFobe0WNfhw+LIqvjWYGZ4Agp0VjHZdUukJUGFLO0q2ijokr/6zKiuJKBfx5gv0 ASvQ== X-Gm-Message-State: APjAAAXcC57hSHNvfwNvZRmkCf0yZII2t8SeB1pG71oaoSyJeHxwhI4R LVAsi0N3wkghoM0G8qz62P0MOaL7DcGbPS2oNKI= X-Received: by 2002:aa7:8dc3:: with SMTP id j3mr12239577pfr.141.1559327251853; Fri, 31 May 2019 11:27:31 -0700 (PDT) MIME-Version: 1.0 References: <20190531024102.21723-1-ying.huang@intel.com> <2d8e1195-e0f1-4fa8-b0bd-b9ea69032b51@oracle.com> In-Reply-To: <2d8e1195-e0f1-4fa8-b0bd-b9ea69032b51@oracle.com> From: Dexuan-Linux Cui Date: Fri, 31 May 2019 11:27:20 -0700 Message-ID: Subject: Re: [PATCH -mm] mm, swap: Fix bad swap file entry warning To: Mike Kravetz Cc: "Huang, Ying" , Andrew Morton , linux-mm@kvack.org, Linux Kernel Mailing List , Andrea Parri , "Paul E . McKenney" , Michal Hocko , Minchan Kim , Hugh Dickins , Dexuan Cui , v-lide@microsoft.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 31, 2019 at 10:00 AM Mike Kravetz wrote: > > On 5/30/19 7:41 PM, Huang, Ying wrote: > > From: Huang Ying > > > > Mike reported the following warning messages > > > > get_swap_device: Bad swap file entry 1400000000000001 > > > > This is produced by > > > > - total_swapcache_pages() > > - get_swap_device() > > > > Where get_swap_device() is used to check whether the swap device is > > valid and prevent it from being swapoff if so. But get_swap_device() > > may produce warning message as above for some invalid swap devices. > > This is fixed via calling swp_swap_info() before get_swap_device() to > > filter out the swap devices that may cause warning messages. > > > > Fixes: 6a946753dbe6 ("mm/swap_state.c: simplify total_swapcache_pages() with get_swap_device()") > > Signed-off-by: "Huang, Ying" > > Thank you, this eliminates the messages for me: > > Tested-by: Mike Kravetz > > -- > Mike Kravetz Hi, Did you know about the panic reported here: https://marc.info/?t=155930773000003&r=1&w=2 "Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: write_irq_affinity.isra" This panic is reported on PowerPC and x86. In the case of x86, we see a lot of "get_swap_device: Bad swap file entry" errors before the panic: ... [ 24.404693] get_swap_device: Bad swap file entry 5800000000000001 [ 24.408702] get_swap_device: Bad swap file entry 5c00000000000001 [ 24.412510] get_swap_device: Bad swap file entry 6000000000000001 [ 24.416519] get_swap_device: Bad swap file entry 6400000000000001 [ 24.420217] get_swap_device: Bad swap file entry 6800000000000001 [ 24.423921] get_swap_device: Bad swap file entry 6c00000000000001 [ 24.427685] get_swap_device: Bad swap file entry 7000000000000001 [ 24.760678] Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: write_irq_affinity.isra.7+0xe5/0xf0 [ 24.760975] CPU: 25 PID: 1773 Comm: irqbalance Not tainted 5.2.0-rc2-2fefea438dac #1 [ 24.760975] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS 090007 06/02/2017 [ 24.760975] Call Trace: [ 24.760975] dump_stack+0x46/0x5b [ 24.760975] panic+0xf8/0x2d2 [ 24.760975] ? write_irq_affinity.isra.7+0xe5/0xf0 [ 24.760975] __stack_chk_fail+0x15/0x20 [ 24.760975] write_irq_affinity.isra.7+0xe5/0xf0 [ 24.760975] proc_reg_write+0x40/0x60 [ 24.760975] vfs_write+0xb3/0x1a0 [ 24.760975] ? _cond_resched+0x16/0x40 [ 24.760975] ksys_write+0x5c/0xe0 [ 24.760975] do_syscall_64+0x4f/0x120 [ 24.760975] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 24.760975] RIP: 0033:0x7f93bcdde187 [ 24.760975] Code: c3 66 90 41 54 55 49 89 d4 53 48 89 f5 89 fb 48 83 ec 10 e8 6b 05 02 00 4c 89 e2 41 89 c0 48 89 ee 89 df b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 44 89 c7 48 89 44 24 08 e8 a4 05 02 00 48 [ 24.760975] RSP: 002b:00007ffc4600d900 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 [ 24.760975] RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 00007f93bcdde187 [ 24.760975] RDX: 0000000000000008 RSI: 00005595ad515540 RDI: 0000000000000006 [ 24.760975] RBP: 00005595ad515540 R08: 0000000000000000 R09: 00005595ab381820 [ 24.760975] R10: 0000000000000008 R11: 0000000000000293 R12: 0000000000000008 [ 24.760975] R13: 0000000000000008 R14: 00007f93bd0b62a0 R15: 00007f93bd0b5760 [ 24.760975] Kernel Offset: 0x3a000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff) [ 24.760975] ---[ end Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: write_irq_affinity.isra.7+0xe5/0xf0 ]--- Thanks, -- Dexuan