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 D53BAC433F5 for ; Wed, 13 Oct 2021 03:24:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 710E1603E8 for ; Wed, 13 Oct 2021 03:24:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 710E1603E8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 89D2D6B006C; Tue, 12 Oct 2021 23:24:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 84DAA6B0071; Tue, 12 Oct 2021 23:24:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C5FA6B0072; Tue, 12 Oct 2021 23:24:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0193.hostedemail.com [216.40.44.193]) by kanga.kvack.org (Postfix) with ESMTP id 5A8866B006C for ; Tue, 12 Oct 2021 23:24:43 -0400 (EDT) Received: from smtpin34.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 175E3181DA0B6 for ; Wed, 13 Oct 2021 03:24:43 +0000 (UTC) X-FDA: 78689972046.34.F92C995 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf03.hostedemail.com (Postfix) with ESMTP id 8FECA300009B for ; Wed, 13 Oct 2021 03:24:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634095482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VFq4tl1Jtp9nZpYEWOSTL46F9/L19MeOCUXgfSE6NU8=; b=hOyKPPEXHTwmFxPOZ2zCsy/9+uBh5Aqz9eY9r0QJE6bVURQ5Os0sX4edogsEQrefbOHiHS WY338sar0JOweHFBOhlqdCIfoRIhvbiWbyTvT3tfwAHxfxRjp3kw1h/e4pvreGK+cgJPa1 6M9et4xWA+WXxlLPVQItcRYGNyuMb58= Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-267-ecCK5grzO1C6NnKdja2UdA-1; Tue, 12 Oct 2021 23:24:41 -0400 X-MC-Unique: ecCK5grzO1C6NnKdja2UdA-1 Received: by mail-pf1-f200.google.com with SMTP id t79-20020a627852000000b0044d0ecd9f7aso746252pfc.13 for ; Tue, 12 Oct 2021 20:24:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=VFq4tl1Jtp9nZpYEWOSTL46F9/L19MeOCUXgfSE6NU8=; b=m5NSzIKGRr4uq4yXMLI9RAzIBA1Lui+kpiznh7MXqlv6r6MRI6wtFZerjrS7eIGn1l 0wx2Vbs5h/+uFm3R3C5zQvCx2qY6lxTmq5EVxJioOu7lrZluRpFnSmFA7V4/M9SaxVvn usbSrjT1zr/N5s7KCHATs/D8SjFfmK+JXMqyfyCRPaaOsHgFUKe5R1aWTl0SQhW+SkGa tADuCVEpJqNucBLffQSrIdSvrSeePmPw1gtJYzYkVmWia/0ddCqbBrbIjy+Zr4LgeAqW Wz96GXIkMLAvctCK24B0NEPAZDeWQuab8+qsWAZbLM3fQas68uB0aoiCKl0Bt54eeY8N vT0A== X-Gm-Message-State: AOAM530D8Co8CvS1/PMgxAiDpkyT2zoZ+Y1RD5rAprIWn7/9aoDqCtyq JkoNV9GSidejQcbvVJwGWsv/UkGePtL0KyZZOxYX3C1YNyyUKxoudSIcdzaj/WnyslLeNqfRlnx 0S4z3FEaDcrE= X-Received: by 2002:a17:90a:b117:: with SMTP id z23mr10654012pjq.74.1634095479005; Tue, 12 Oct 2021 20:24:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqVEIIX54ViTr9Fl25b2c2NyWmZugh7YneAkuuQyUA0cMR8iCPtZCAXhwzLevCG02Mzub8mg== X-Received: by 2002:a17:90a:b117:: with SMTP id z23mr10653986pjq.74.1634095478670; Tue, 12 Oct 2021 20:24:38 -0700 (PDT) Received: from t490s ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id j6sm12530899pgq.0.2021.10.12.20.24.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 20:24:38 -0700 (PDT) Date: Wed, 13 Oct 2021 11:24:31 +0800 From: Peter Xu To: Yang Shi Cc: HORIGUCHI =?utf-8?B?TkFPWUEo5aCA5Y+jIOebtOS5nyk=?= , Hugh Dickins , "Kirill A. Shutemov" , Matthew Wilcox , Oscar Salvador , Andrew Morton , Linux MM , Linux FS-devel Mailing List , Linux Kernel Mailing List Subject: Re: [RFC v3 PATCH 0/5] Solve silent data loss caused by poisoned page cache (shmem/tmpfs) Message-ID: References: <20210930215311.240774-1-shy828301@gmail.com> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 8FECA300009B X-Stat-Signature: ufgfbhby1f5wyrp1hy3kyswexasjeye1 Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=hOyKPPEX; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf03.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=peterx@redhat.com X-HE-Tag: 1634095482-285069 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 08:09:24PM -0700, Yang Shi wrote: > 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. I see, that sounds good enough to me. Thanks, -- Peter Xu