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 X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B9F6C432C0 for ; Tue, 19 Nov 2019 12:24:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 208F720730 for ; Tue, 19 Nov 2019 12:24:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IGjdoZXa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 208F720730 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9204C6B0008; Tue, 19 Nov 2019 07:24:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8D0E46B000E; Tue, 19 Nov 2019 07:24:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7BFFA6B0010; Tue, 19 Nov 2019 07:24:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0098.hostedemail.com [216.40.44.98]) by kanga.kvack.org (Postfix) with ESMTP id 657876B0008 for ; Tue, 19 Nov 2019 07:24:04 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 083838249980 for ; Tue, 19 Nov 2019 12:24:04 +0000 (UTC) X-FDA: 76172944008.02.view01_236edd2225e26 X-HE-Tag: view01_236edd2225e26 X-Filterd-Recvd-Size: 3508 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Tue, 19 Nov 2019 12:24:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574166242; 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=IGjdoZXalo1DT+osZ9c1EqvfJTX7jr7dvxlF+a0saIXuNv429KsxfZ0v96ccccE0Tqfg2m sjB6oRr3RRKrHTgR61KDY44M/sbTBBGBfzFh1+PcwCQwwM9pVspbqSDWXikdVuFe5zCp5W 39CbQRkF6/KGb4TmYXFsyZeB/p755mo= 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 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 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