Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp472440ybc; Tue, 19 Nov 2019 04:25:31 -0800 (PST) X-Google-Smtp-Source: APXvYqwfwbLXz6WEwbDavtP8vB6iaC9meQ4/Sjp6G0+45rzUr7LC9suRUR0pscLtx4SH0a20kV+m X-Received: by 2002:a05:6000:1605:: with SMTP id u5mr34994309wrb.252.1574166331391; Tue, 19 Nov 2019 04:25:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574166331; cv=none; d=google.com; s=arc-20160816; b=Wiru8VcUNuMWUYRfFAPgpi4n4ATl8BOwRQT/DmN730gNV1/Yd86eiP9dCDnHgaxwAJ DCAy12ZtBHXJb3Ch2WBlQzI8Ka/xnNxDoAdPZ/7nlBBuU0M5dLi8d1R3lwxc9Ewj26gV kWyYLu59sNa8sFkwA70kF8fgLOPBH9wVv7Hw3o9GcoY5Mt2BnC6ooBvQ3+lFyJTCcDDx DJmX3Hxu9xAutwNuqCa6wD25atDNJ8mZgZ3Irmf3/m4PwU4pwz3ae4Z9eq63gTxyQq9R /0R6JOj9Nychro2qSXTcMr0L7xEvuFJ9VCf3Civ9bOMTjt0tdG803YLFp8I8U3/Fzm0d tCxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=C6C32uts1Uhc4+2A9laxGruBZKmAzLGPWUERpPutUIA=; b=pQi1B8o/XfFUhSgfwFvr23BsRdnkyUBXQ1Yh6krXgOp9DU2xC7v2KO8A0Fm83DyB44 NT0xmJM8wtb9FcSDCUwaLMfhZsJaDfvEF+QQFdEHpC0fohqkcqTmMic4Yb/b0loCyNiF P70V5TnidYkITzmvnFtJtiLVd1FybW8mzBmN7m0cYPSC4AmdzoQ2M2IqVyc01sV64jB/ tepoGA7gOczL7Yg/rKVos1yS1ZIIoxw0O3A2Ly5HPkCOQn1cJR9BP1Zi7TwwxA7HNLtF xrwAG+rrXGd9Qh+GtibwGXz7V7mmF5nOVboNQwJwdUvJ9oh7plBgvSp6f9+pQSpB3ZVJ G/2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iwVghIqJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ce3si17850816edb.441.2019.11.19.04.25.06; Tue, 19 Nov 2019 04:25:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iwVghIqJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727646AbfKSMYC (ORCPT + 99 others); Tue, 19 Nov 2019 07:24:02 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:53134 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725798AbfKSMYC (ORCPT ); Tue, 19 Nov 2019 07:24:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574166240; 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=C6C32uts1Uhc4+2A9laxGruBZKmAzLGPWUERpPutUIA=; b=iwVghIqJ9HGYxxOhlo+BqeC7KQVXwOvBp/5rrXhU5UFiasJBM2dlg9LEUqa8PL1RyxO1P7 A9cF1cKXvXWxH+tVuTFX8SK2dkXA5m1opyPMADFTsFJUEcL95ArU7crJy8iUwZbB+lzjsH 3FYsqHUW2Qwmp+kd6tAsz9xOMCWYIao= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-308-HfaLaDUnOAK8q8zgiYEWmg-1; Tue, 19 Nov 2019 07:23:57 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8B883800686; Tue, 19 Nov 2019 12:23:56 +0000 (UTC) Received: from [10.36.117.126] (ovpn-117-126.ams2.redhat.com [10.36.117.126]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6F4714DA10; Tue, 19 Nov 2019 12:23:55 +0000 (UTC) Subject: Re: [PATCH 1/2] mm/memory-failure.c: PageHuge is handled at the beginning of memory_failure To: Wei Yang , n-horiguchi@ah.jp.nec.com, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20191118082003.26240-1-richardw.yang@linux.intel.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <1e61c115-5787-9ef4-a449-2e490c53fca7@redhat.com> Date: Tue, 19 Nov 2019 13:23:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20191118082003.26240-1-richardw.yang@linux.intel.com> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: HfaLaDUnOAK8q8zgiYEWmg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18.11.19 09:20, Wei Yang wrote: > PageHuge is handled by memory_failure_hugetlb(), so this case could be > removed. >=20 > Signed-off-by: Wei Yang > --- > mm/memory-failure.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) >=20 > diff --git a/mm/memory-failure.c b/mm/memory-failure.c > index 3151c87dff73..392ac277b17d 100644 > --- a/mm/memory-failure.c > +++ b/mm/memory-failure.c > @@ -1359,10 +1359,7 @@ int memory_failure(unsigned long pfn, int flags) > =09 * page_remove_rmap() in try_to_unmap_one(). So to determine page st= atus > =09 * correctly, we save a copy of the page flags at this time. > =09 */ > -=09if (PageHuge(p)) > -=09=09page_flags =3D hpage->flags; > -=09else > -=09=09page_flags =3D p->flags; > +=09page_flags =3D p->flags; > =20 > =09/* > =09 * unpoison always clear PG_hwpoison inside page lock >=20 I somewhat miss a proper explanation why this is safe to do. We access=20 page flags here, so why is it safe to refer to the ones of the sub-page? --=20 Thanks, David / dhildenb