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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1601C433F5 for ; Wed, 13 Oct 2021 03:09:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7E23660E52 for ; Wed, 13 Oct 2021 03:09:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7E23660E52 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 159A16B006C; Tue, 12 Oct 2021 23:09:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 109C16B0071; Tue, 12 Oct 2021 23:09:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F39E96B0072; Tue, 12 Oct 2021 23:09:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0202.hostedemail.com [216.40.44.202]) by kanga.kvack.org (Postfix) with ESMTP id E45216B006C for ; Tue, 12 Oct 2021 23:09:38 -0400 (EDT) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id A213539478 for ; Wed, 13 Oct 2021 03:09:38 +0000 (UTC) X-FDA: 78689934036.31.F29E1BF Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) by imf22.hostedemail.com (Postfix) with ESMTP id B140C1902 for ; Wed, 13 Oct 2021 03:09:37 +0000 (UTC) Received: by mail-ed1-f47.google.com with SMTP id y12so4046532eda.4 for ; Tue, 12 Oct 2021 20:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HCj1lkjwgbEmXu7cDtw3vmGVDAughdgaboyPo11IbyY=; b=gPg+9TXyXNbceMu0iZnHpqvcf/Dh8NUumwo5xVdgEzqQSBBRrM3O5An820DO8O/oPE I27gQ4e6omZrGCP9BZKNEqMjuoWXuqHfvmT0BtkdvKlX/afPEiihw0hOvsyQwbipoM6r JIt3oC8nckpl0NKL/Le5xeyZdnSSCJm334CwpRGYrfVd7Xcz648acE1gi5+TSB30kLED a5RPKNXRr2rQmmtNT+veO7ICttJac/qsZ64t/77ef+7mWbzWXMdDwMpMm3m0h/BlbRY4 0GtqwLaEtL6a0vaOjGmktsJtnhMEwnhCGS+dO4I/zdKegxFqBncJ4lwyb+s3qBO2OClB 7ybg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HCj1lkjwgbEmXu7cDtw3vmGVDAughdgaboyPo11IbyY=; b=XkfTemRVmmloXv9FGeKIjX5UzufAWrWlq3y2BoIZdQeLzjhHKFToOLouuJCztBiYL9 gTDuFObipM2Nn7AMUtpP4fE35J1KNEdmp9fPh/U0oJt+rh+sjFaGtoa4L2Ky1WEkvd5s NmILFtvaqO91p3VtUktXZzg2vJ/TvgT4YXAge1uXmPVc9Vsqc3tTOZ6XpF9hRNSYRELu wtLWqEZ3z38/Pi4LBmmWr7GOd7rC9mmxmkuKh0XKp3WUYc+iWQ844UDlTiAzbD5tr3f+ JdAXIE8P5f04Rm51rRhElInFhNt9YR/Ami08JvQ//r2vfO2nJD4xvSuI15JeQfzYTW+d bWtw== X-Gm-Message-State: AOAM532u6kkwDQYmfnkVFFRLNMrrw50Cu94mGHtb/96sfR6yxuTTesHs 6MrU3tg9h5PwkEYpNi9WtSf05tJZapJJnLkQ4Q8= X-Google-Smtp-Source: ABdhPJyuYJsTNqDNqpkO4cOocgXz+Ee+xNW+iBResKEZMLhch/S4NGvSvXFfukNYWy8lXyaKHbkK9TaixmdPHneWpoA= X-Received: by 2002:a05:6402:1e8c:: with SMTP id f12mr5508316edf.71.1634094576961; Tue, 12 Oct 2021 20:09:36 -0700 (PDT) MIME-Version: 1.0 References: <20210930215311.240774-1-shy828301@gmail.com> In-Reply-To: From: Yang Shi Date: Tue, 12 Oct 2021 20:09:24 -0700 Message-ID: Subject: Re: [RFC v3 PATCH 0/5] Solve silent data loss caused by poisoned page cache (shmem/tmpfs) To: Peter Xu Cc: =?UTF-8?B?SE9SSUdVQ0hJIE5BT1lBKOWggOWPoyDnm7TkuZ8p?= , Hugh Dickins , "Kirill A. Shutemov" , Matthew Wilcox , Oscar Salvador , Andrew Morton , Linux MM , Linux FS-devel Mailing List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: B140C1902 X-Stat-Signature: dwxwisgydq3zrm4rtt9agbfiw49m4u3x Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=gPg+9TXy; spf=pass (imf22.hostedemail.com: domain of shy828301@gmail.com designates 209.85.208.47 as permitted sender) smtp.mailfrom=shy828301@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1634094577-733151 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 Tue, Oct 12, 2021 at 7:41 PM Peter Xu wrote: > > On Thu, Sep 30, 2021 at 02:53:06PM -0700, Yang Shi wrote: > > Yang Shi (5): > > mm: hwpoison: remove the unnecessary THP check > > mm: filemap: check if THP has hwpoisoned subpage for PMD page fault > > mm: hwpoison: refactor refcount check handling > > mm: shmem: don't truncate page if memory failure happens > > mm: hwpoison: handle non-anonymous THP correctly > > Today I just noticed one more thing: unpoison path has (unpoison_memory): > > if (page_mapping(page)) { > unpoison_pr_info("Unpoison: the hwpoison page has non-NULL mapping %#lx\n", > pfn, &unpoison_rs); > return 0; > } > > I _think_ it was used to make sure we ignore page that was not successfully > poisoned/offlined before (for anonymous), so raising this question up on > whether we should make sure e.g. shmem hwpoisoned pages still can be unpoisoned > for debugging purposes. Yes, not only mapping, the refcount check is not right if page cache page is kept in page cache instead of being truncated after this series. But actually unpoison has been broken since commit 0ed950d1f28142ccd9a9453c60df87853530d778 ("mm,hwpoison: make get_hwpoison_page() call get_any_page()"). And Naoya said in the commit "unpoison_memory() is also unchanged because it's broken and need thorough fixes (will be done later)." I do have some fixes in my tree to unblock tests and fix unpoison for this series (just make it work for testing). Naoya may have some ideas in mind and it is just a debugging feature so I don't think it must be fixed in this series. It could be done later. I could add a TODO section in the cover letter to make this more clear. > > -- > Peter Xu >