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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99DF4C433F5 for ; Fri, 8 Apr 2022 08:52:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1E3126B0071; Fri, 8 Apr 2022 04:52:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 192D16B0072; Fri, 8 Apr 2022 04:52:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 05A1A6B0074; Fri, 8 Apr 2022 04:52:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id E9E196B0071 for ; Fri, 8 Apr 2022 04:52:10 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id B6E08977 for ; Fri, 8 Apr 2022 08:52:10 +0000 (UTC) X-FDA: 79333094820.10.421F37F Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf08.hostedemail.com (Postfix) with ESMTP id 2DC80160007 for ; Fri, 8 Apr 2022 08:52:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649407929; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oJBkCLhhtTvaSyY708hDkFvl+npCwl4oscvepwItiog=; b=JcqKQYmTUhTk7Q8phM9FlwNvVD4vap8mFtxCpK1eQ/CF3SPVkvSaVMGolGe6GEJ9jPz/hE 0Ty7bPOUzIexiv2gwaJb4xfo6GiZr6O8dHcNLpgY64GG4HEP3gdDv0QeHL9knNwgNtmeVF +s1aJ1uhxc8yVkF2iD7yT1YgjOO3BDo= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-88-XpfwKNJeNUS0tIFis2rFkg-1; Fri, 08 Apr 2022 04:52:07 -0400 X-MC-Unique: XpfwKNJeNUS0tIFis2rFkg-1 Received: by mail-wm1-f69.google.com with SMTP id p32-20020a05600c1da000b0038e9e6359dbso885195wms.9 for ; Fri, 08 Apr 2022 01:52:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=oJBkCLhhtTvaSyY708hDkFvl+npCwl4oscvepwItiog=; b=Em/nnf6vvquJ/KUbP4I3D76RYqtRnqOmS1YUIPt3OtebYetaGDpoVqxONeymFSSy8/ xTq3iI8EKCaMSIyMtnz9s0AG+rPgsrgac59pjyUgQ9Hbm1XW5vHUS9pRhJ9Lczxt+/8L WTckt2rSXu+HAawEsuFhUAqPW2mFoAGqDXFtiBfyqADH85NexIonbo+1dCx+03GObLdp YptA1Cv6TatTmGKDgnJXDRwQYpxdBh25mOTb967PbQKv5i8flscBIY39Jk9cB/DCRuUP +psPuBWF9afZZ6rJ6dCXnjuL6l+el+ObNbLyPL/GxecUOk+cpS0jG9N8OqJ7sTQF9Ogw iyaQ== X-Gm-Message-State: AOAM5302v/jT/EHGLBxVrpqRDLfVpJIajti2Rag011cBcqPh7g/HOq1P doOQKilaAGnG74R93ziSaP8JJISoXxYeQmCC1KC7/G0/G2c0k9Di4sCYri8jhqs1alaywO1UkdR E6K5KoeV1hRM= X-Received: by 2002:adf:f390:0:b0:206:16e1:b020 with SMTP id m16-20020adff390000000b0020616e1b020mr13554881wro.194.1649407925888; Fri, 08 Apr 2022 01:52:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQFPCXmJ8V5LLQgyW9ibZI5VirMVcGjo+6OHBySw9rFxhGD1cCjDRUb1iE1oNeaCMXESwkpw== X-Received: by 2002:adf:f390:0:b0:206:16e1:b020 with SMTP id m16-20020adff390000000b0020616e1b020mr13554866wro.194.1649407925662; Fri, 08 Apr 2022 01:52:05 -0700 (PDT) Received: from ?IPV6:2003:cb:c704:fd00:612:f12b:a4a2:26b0? (p200300cbc704fd000612f12ba4a226b0.dip0.t-ipconnect.de. [2003:cb:c704:fd00:612:f12b:a4a2:26b0]) by smtp.gmail.com with ESMTPSA id m187-20020a1c26c4000000b0038e9a8b2139sm2665179wmm.11.2022.04.08.01.52.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Apr 2022 01:52:05 -0700 (PDT) Message-ID: <09d363ba-5bd0-75ae-8ece-cd91997f1b46@redhat.com> Date: Fri, 8 Apr 2022 10:52:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH 1/3] mm/memory-failure.c: avoid false-postive PageSwapCache test To: Miaohe Lin , akpm@linux-foundation.org, naoya.horiguchi@nec.com Cc: shy828301@gmail.com, mike.kravetz@oracle.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20220407130352.15618-1-linmiaohe@huawei.com> <20220407130352.15618-2-linmiaohe@huawei.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20220407130352.15618-2-linmiaohe@huawei.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=JcqKQYmT; spf=none (imf08.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: gc4jb7yjbcyrtzzzp4duxmpsxhh6zirn X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 2DC80160007 X-HE-Tag: 1649407929-729089 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 07.04.22 15:03, Miaohe Lin wrote: > PageSwapCache is only reliable when PageAnon is true because PG_swapcache > serves as PG_owner_priv_1 which can be used by fs if it's pagecache page. > So we should test PageAnon to distinguish pagecache page from swapcache > page to avoid false-postive PageSwapCache test. Well, that's not quite correct. Just because a page is PageAnon() doesn't mean that it's in the swapache. It means that it might be in the swapcache but cannot be in the pagecache. Maybe you wanted to say "So we should test PageAnon() to distinguish pagecache pages from anonymous pages." > > Signed-off-by: Miaohe Lin > --- > mm/memory-failure.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/memory-failure.c b/mm/memory-failure.c > index ef402b490663..2e97302d62e4 100644 > --- a/mm/memory-failure.c > +++ b/mm/memory-failure.c > @@ -2262,7 +2262,7 @@ static int __soft_offline_page(struct page *page) > return 0; > } > > - if (!PageHuge(page) && PageLRU(page) && !PageSwapCache(page)) > + if (!PageHuge(page) && PageLRU(page) && !PageAnon(page)) > /* > * Try to invalidate first. This should work for > * non dirty unmapped page cache pages. -- Thanks, David / dhildenb