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 B503BC433F5 for ; Wed, 13 Oct 2021 21:42:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3D1EF611C2 for ; Wed, 13 Oct 2021 21:42:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3D1EF611C2 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 4FCA3900003; Wed, 13 Oct 2021 17:42:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4AC8F900002; Wed, 13 Oct 2021 17:42:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 34D8C900003; Wed, 13 Oct 2021 17:42:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0157.hostedemail.com [216.40.44.157]) by kanga.kvack.org (Postfix) with ESMTP id 26E83900002 for ; Wed, 13 Oct 2021 17:42:56 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id DADFA3017C for ; Wed, 13 Oct 2021 21:42:55 +0000 (UTC) X-FDA: 78692739510.02.028D6B4 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) by imf02.hostedemail.com (Postfix) with ESMTP id B0AE17001A23 for ; Wed, 13 Oct 2021 21:42:54 +0000 (UTC) Received: by mail-ed1-f51.google.com with SMTP id y12so16303045eda.4 for ; Wed, 13 Oct 2021 14:42:55 -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=+74ZuFQnhra1mA1yYzIx/vvNdxWlZMlZrX1c1bZpxQM=; b=mZC4pT++UMEOauA4S5g8YTkpiJT3CPeW6UBji2zCvAvlZmBYIsXB3UU+bQPMBvM1Sr aw24uTe6odebY5TY6caJLOAxOYisGTqjcpNffBqf6VrFB2cuiMq5tIH2+ZbmB39eR3ka SE4rX/119ghNd45eGNppFMcMsFC+D9cB74ShLm+W1q3ROL0HDkvJjKAGXqVnPl9kVnlD SVUkE4nDALNivePSINq5hG2KpEUM0gtTNkl0MO+GBggjUZkn+sW2bnv1kXqKl/WLB1PC OMJ3NcPwajOfk1Q2q9umNygvEEizenOB2Aa5f0L/NpzyUPTB7X+3f26XRkxlyaqph0mc m+aQ== 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=+74ZuFQnhra1mA1yYzIx/vvNdxWlZMlZrX1c1bZpxQM=; b=0E18la9PzYsohmG4YFVqhxJ7S235yplRXpoamwlmzQ1WPaaKaVI1UZW1QxVmS0phAT hBfnqcP5hiw5iP/hTBA2T+C26jlId4pZXy2ouf2ADkyb6AQGpLM321sio76WUHRA14JC 4jnBInwHzfFp8pkppPEX4AHoLEQuwp7zKUjqh78u5G/RgpSF0KV0dpNLplXAy5MEY1Ee +D/JdOQpzobmnUYEPyL2YhtWK++dB2Tqw+yozB01YjqFlwUB1qOs2n+5o+GujG6AO4wC 5DRSICdCS7EfCQQGamp3jwtXbWiEL+8UiOeMN1zm5mveahaYsz/q9ybhwPAOvE4oulnn GyWA== X-Gm-Message-State: AOAM532CtcyG/l+iwJJZiaemUxsl1acjXWCTbB55dIFFGAA9zYpr7yfK cd2YtvPKy34Np/LpO4Y0zd4T3hUlBIjDu8dO73E= X-Google-Smtp-Source: ABdhPJx9tJwAHOBTrDWPCFv16dqCid3PHadT6+J/KPMUKiY7D2dPw3VxGvjydNx4DFMQCrjVpO4jdVubBe1D8lZwVGY= X-Received: by 2002:a17:906:a94b:: with SMTP id hh11mr2073351ejb.85.1634161374135; Wed, 13 Oct 2021 14:42:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Yang Shi Date: Wed, 13 Oct 2021 14:42:42 -0700 Message-ID: Subject: Re: [v3 PATCH 2/5] mm: filemap: check if THP has hwpoisoned subpage for PMD page fault 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-Queue-Id: B0AE17001A23 X-Stat-Signature: haugsxtddgozdizap7nacha3e4ggaj5u Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=mZC4pT++; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf02.hostedemail.com: domain of shy828301@gmail.com designates 209.85.208.51 as permitted sender) smtp.mailfrom=shy828301@gmail.com X-Rspamd-Server: rspam02 X-HE-Tag: 1634161374-231691 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 8:41 PM Peter Xu wrote: > > On Tue, Oct 12, 2021 at 08:27:06PM -0700, Yang Shi wrote: > > > But this also reminded me that shouldn't we be with the page lock already > > > during the process of "setting hwpoison-subpage bit, split thp, clear > > > hwpoison-subpage bit"? If it's only the small window that needs protection, > > > while when looking up the shmem pagecache we always need to take the page lock > > > too, then it seems already safe even without the extra bit? Hmm? > > > > I don't quite get your point. Do you mean memory_failure()? If so the > > answer is no, outside the page lock. And the window may be indefinite > > since file THP doesn't get split before this series and the split may > > fail even after this series. > > What I meant is that we could extend the page_lock in try_to_split_thp_page() > to cover setting hwpoison-subpage too (and it of course covers the clearing if > thp split succeeded, as that's part of the split process). But yeah it's a > good point that the split may fail, so the extra bit seems still necessary. > > Maybe that'll be something worth mentioning in the commit message too? The > commit message described very well on the overhead of looping over 512 pages, > however the reader can easily overlook the real reason for needing this bit - > IMHO it's really for the thp split failure case, as we could also mention that > if thp split won't fail, page lock should be suffice (imho). We could also Not only for THP split failure case. Before this series, shmem THP does't get split at all. And this commit is supposed to be backported to the older versions, so saying "page lock is sufficient" is not precise and confusing. > mention about why soft offline does not need that extra bit, which seems not > obvious as well, so imho good material for commit messages. It would be nice to mention soft offline case. > > Sorry to have asked for a lot of commit message changes; I hope they make sense. Thanks a lot for all the great suggestions. > > Thanks, > > -- > Peter Xu >