Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp264467pxf; Wed, 17 Mar 2021 22:36:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7C52WFVAR/tzfr4JqN3iC/pjnQ1m1waMkA36NPOPynZUJ6QldMn4CNtb5v5nwUfJ8falv X-Received: by 2002:a17:906:fc1c:: with SMTP id ov28mr39258354ejb.342.1616045786122; Wed, 17 Mar 2021 22:36:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616045786; cv=none; d=google.com; s=arc-20160816; b=i2PtUIdB8vEa4sNzwz+Y4rtc2NkC8qr85TQnP8D+3eY9fyKeXinVAtTkpHpiaUgG4s UTxa3tNnpv6hE9hLkKzCF0jOI6hXVoxn6PG7EoKKLDZVKIH4XJRzmFZZf3mxjCkFCRG7 rf+H6d6VT3NfebDJHmVsE+GH775llsEpdR/c+A3ZaLmdzzu+Ujjn4VYRs6UrN4Pz/1UA Qg6R0l1p5CVNvFXSGmEEY5TzlcdSnFrLDAW5f9BHLR+KJkyy1WgdwrT+zH8dtJmJakJj L6SaAa3wR9oXB5UXZIbdhm6hOwKj1zIoIsot0PeZs9WpopYZ/L4XojFrZm2fDJyGVlK8 wErQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=+yFk7xD6PqbI6OhYwD0iAImZi77l7eyjm0lMBPjviQA=; b=u9xTFDSz/Xu4gpMPlFJWBt8e/Pq+w92tlgzlRAPftzO6ZViQWEuJP3vbKyPApZC9hT /zYJ5mxINfGeBAgeHGLaTIroCIXZfGgpPh/N9bcKbkHlsvRy/eQpkw+G2vgmOy3fu8rN pbzsLA+0X+EddR85Wl0rx4FicytDbCyTMO3sogg21noZCBljQUaGg9+jH3PCFvGx6U+R dD9wTzRPX4m6DfSAsqxAJQp2LNmcXaxprXkPlF+/zfWEhe0mCKUbL1y25hjWETYr0Co9 THvI2cckdPFaLtDESPq1BYItiBNmfW7Rl3DjKfWleP5p02/If+XqDERyVyPbQU423w+Z oJow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jp24si779864ejb.512.2021.03.17.22.36.02; Wed, 17 Mar 2021 22:36:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229454AbhCRFe6 (ORCPT + 99 others); Thu, 18 Mar 2021 01:34:58 -0400 Received: from mail.kingsoft.com ([114.255.44.146]:48652 "EHLO mail.kingsoft.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229512AbhCRFeR (ORCPT ); Thu, 18 Mar 2021 01:34:17 -0400 X-AuditID: 0a580157-47bff70000021a79-00-6052df77c806 Received: from mail.kingsoft.com (localhost [10.88.1.32]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.kingsoft.com (SMG-1-NODE-87) with SMTP id DB.61.06777.77FD2506; Thu, 18 Mar 2021 13:04:55 +0800 (HKT) Received: from alex-virtual-machine (172.16.253.254) by KSBJMAIL2.kingsoft.cn (10.88.1.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 18 Mar 2021 13:34:12 +0800 Date: Thu, 18 Mar 2021 13:34:12 +0800 From: Aili Yao To: Matthew Wilcox CC: David Hildenbrand , , , , , , , Oscar Salvador , Mike Kravetz , Subject: Re: [PATCH] mm/gup: check page posion status for coredump. Message-ID: <20210318133412.12078eb7@alex-virtual-machine> In-Reply-To: <20210318044600.GJ3420@casper.infradead.org> References: <20210317163714.328a038d@alex-virtual-machine> <20a0d078-f49d-54d6-9f04-f6b41dd51e5f@redhat.com> <20210318044600.GJ3420@casper.infradead.org> Organization: kingsoft X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [172.16.253.254] X-ClientProxiedBy: KSBJMAIL1.kingsoft.cn (10.88.1.31) To KSBJMAIL2.kingsoft.cn (10.88.1.32) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrELMWRmVeSWpSXmKPExsXCFcGooFt+PyjBYOlEcYs569ewWXxd/4vZ 4vKuOWwW99b8Z7X4uD/Y4mLjAUaLM9OKLH7/mMPmwOGxeYWWx6ZPk9g9Tsz4zeLx4upGFo+P T2+xeLzfd5XNY/Ppao/Pm+QCOKK4bFJSczLLUov07RK4Mq6dPMxWMJW74tOlrAbGBxxdjJwc EgImEm2Pf7N3MXJxCAlMZ5L4u+Q1E4TzilGid+07dpAqFgFViamn5zCB2GxA9q57s1i7GDk4 RAQ0JN5sMQKpZxbYwiSxu+ULM0iNsICzxObjM8FsXgEriS+ft4P1cgpYSpyYuoYFYsFcRomT n6aCLeAXEJPovfKfCeIke4m2LYsYIZoFJU7OfMICYjML6EicWHWMGcKWl9j+dg6YLSSgKHF4 yS92iF4liSPdM9gg7FiJZfNesU5gFJ6FZNQsJKNmIRm1gJF5FSNLcW664SZGSLSE72Cc1/RR 7xAjEwfjIUYJDmYlEV7TvIAEId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rwiUUApgfTEktTs1NSC 1CKYLBMHp1QDU9zyWZfZCiWXr5Oa+jJt0lJNJX7hIzxnQqaybH91ximVrePulsVK73oYY/+J O/wNkOVYtz5Ncsd/dukAg2el34UkHKO5bR2m7beWO/c/Y0vUAy1GjsWTfW6f8j/fWbBr+yy/ 55vOLlr5MUHB7KWOi02W6JVGxw/2h8Ibm1c9OpHbUbmYMch7yb5a7pfFzpNNuTKk4p9Lskad ff/oz4p/RnF3Y+2eZKft3JdrsdFUa634hTeyKfM1jQpXxGk0Lrp/ZVrTUt6I66dnCZ9l32A4 i6fR8q3WlFjT7ibBKAVbmQ5bj7Vsf999apmtceFoiNqMBQu/VHhnqsWyrPTTLDMqTHhw5+RG 3fX7TjH2pmSJKbEUZyQaajEXFScCABxGk1IFAwAA Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 18 Mar 2021 04:46:00 +0000 Matthew Wilcox wrote: > On Wed, Mar 17, 2021 at 10:12:02AM +0100, David Hildenbrand wrote: > > > + if (IS_ENABLED(CONFIG_MEMORY_FAILURE) && ret == 1) { > > > + if (unlikely(PageHuge(page) && PageHWPoison(compound_head(page)))) > > > + ret = 0; > > > + else if (unlikely(PageHWPoison(page))) > > > + ret = 0; > > > + } > > > > I wonder if a simple > > > > if (PageHWPoison(compound_head(page))) > > ret = 0; > > > > won't suffice. But I guess the "issue" is compound pages that are not huge > > pages or transparent huge pages. > > THPs don't set the HWPoison bit on the head page. > > https://lore.kernel.org/linux-mm/20210316140947.GA3420@casper.infradead.org/ > > (and PAGEFLAG(HWPoison, hwpoison, PF_ANY)) > > By the way, > > #ifdef CONFIG_MEMORY_FAILURE > PAGEFLAG(HWPoison, hwpoison, PF_ANY) > TESTSCFLAG(HWPoison, hwpoison, PF_ANY) > #define __PG_HWPOISON (1UL << PG_hwpoison) > extern bool take_page_off_buddy(struct page *page); > #else > PAGEFLAG_FALSE(HWPoison) > #define __PG_HWPOISON 0 > #endif > > so there's no need for this > if (IS_ENABLED(CONFIG_MEMORY_FAILURE) > check, as it simply turns into > > if (PageHuge(page) && 0) > else if (0) > > and the compiler can optimise it all away. Yes, You are right, I will modify this later. Thanks for correction -- Thanks! Aili Yao