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.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 2B759C432C3 for ; Mon, 2 Dec 2019 22:28:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D099620848 for ; Mon, 2 Dec 2019 22:28:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M2STPfwq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D099620848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 799426B0003; Mon, 2 Dec 2019 17:28:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 748D36B0006; Mon, 2 Dec 2019 17:28:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 638576B0007; Mon, 2 Dec 2019 17:28:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0221.hostedemail.com [216.40.44.221]) by kanga.kvack.org (Postfix) with ESMTP id 492FC6B0003 for ; Mon, 2 Dec 2019 17:28:31 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id A27B6181AEF1E for ; Mon, 2 Dec 2019 22:28:30 +0000 (UTC) X-FDA: 76221641580.15.sand55_6757417196f04 X-HE-Tag: sand55_6757417196f04 X-Filterd-Recvd-Size: 4880 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Mon, 2 Dec 2019 22:28:30 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id y17so1251430wrh.5 for ; Mon, 02 Dec 2019 14:28:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=BMjiRy3QJEUM7qi9iVtt3EpRL4urnDNurtn48A3AP18=; b=M2STPfwqrNHD9OcY0KGbYeWlNtCjqaz0glKPsVV2z8Rdh22fPf3UgtQSxE2Y4L97X/ LTGM6llw3dSR29MPdKwcygrfakK9W82mmZgd19q+dBV6Nkm/EPU4gXaILzTxPZvLPXyz 48OvcgS/LYVWFwdxM05VJfxISnJknSx79+rCgh+a4oCnCPm66DmltP3MYtHb6LPxdUVR BN9kEXTtBUdTRN2MhjZ7FUsOqIibXcqzB/c4tqKBVch00IILr/pVeJyCwckMy2HN5fZX FSNjAtsILVfEWtsZ6zeE7NhRVHvShnKrSuv7Q/bAmz2cA5lyPN13UFe3i737os8vHYFI Vfeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=BMjiRy3QJEUM7qi9iVtt3EpRL4urnDNurtn48A3AP18=; b=udXw4wwK/iROkuIDCUnpb3gOn815LNazidsFRl+5JYefG7/4xQP5VYojbCUi2gRQYk Dx+OWzrvPoIXLBfYrccfUbggeTc5Ktp+7L8FyWH2txm7C5rh6f7IrARtRAd0tZl3Fb5H 1h8DzMOVqXY7jGbWSv+CnTNHcrJuVOf52CjMNbGN4ekJ5rXK4LlrzP4ZN03oymd3f0c4 Nel/RoXb/y7d/rBhaF9f4sMiEA0ePMK+mg0ii4foGZKB95eWINVrA5zdP1VxfllmZuQQ XwnLuBMsLT82+IMWTN6v9E54pBxUl4YbBFn7/QstcwCozc9uSD47KzwEvBJc3CFLfIzE n2+Q== X-Gm-Message-State: APjAAAXDVdQPbGiNG1ZrG4fki3fPf1sxV943rdqQUh6GL+jjOArYep1p s7UZNmPcV6SAgKKfdq3PT74= X-Google-Smtp-Source: APXvYqxVufMWAPntjkOfUuktfrfgT33XpBapZ9/uwzUSD06bk8TCn9ojcnCzzSD5MJcghbNho4Ksbg== X-Received: by 2002:adf:8150:: with SMTP id 74mr1558824wrm.114.1575325709070; Mon, 02 Dec 2019 14:28:29 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id o21sm835335wmc.17.2019.12.02.14.28.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Dec 2019 14:28:28 -0800 (PST) Date: Mon, 2 Dec 2019 22:28:27 +0000 From: Wei Yang To: David Hildenbrand Cc: Wei Yang , n-horiguchi@ah.jp.nec.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] mm/memory-failure.c: not necessary to recalculate hpage Message-ID: <20191202222827.isaelnqmuyn7zrns@master> Reply-To: Wei Yang References: <20191118082003.26240-1-richardw.yang@linux.intel.com> <20191118082003.26240-2-richardw.yang@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000018, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Nov 20, 2019 at 04:07:38PM +0100, David Hildenbrand wrote: >On 18.11.19 09:20, Wei Yang wrote: >> hpage is not changed. >> >> Signed-off-by: Wei Yang >> --- >> mm/memory-failure.c | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/mm/memory-failure.c b/mm/memory-failure.c >> index 392ac277b17d..9784f4339ae7 100644 >> --- a/mm/memory-failure.c >> +++ b/mm/memory-failure.c >> @@ -1319,7 +1319,6 @@ int memory_failure(unsigned long pfn, int flags) >> } >> unlock_page(p); >> VM_BUG_ON_PAGE(!page_count(p), p); >> - hpage = compound_head(p); >> } >> /* >> > >I am *absolutely* no transparent huge page expert (sorry :) ), but won't the >split_huge_page(p) eventually split the compound page, such that >compound_head(p) will return something else after that call? > Hi, David Took sometime to look into the code and re-think about it. Found maybe we can simplify this in another way. First, code touches here means split_huge_page() succeeds and "p" is now a PTE page. So compound_head(p) == p. Then let's look at who will use hpage in the following function. There are two uses in current upstream: * page_flags calculation * hwpoison_user_mappings() The first one would be removed in next patch since PageHuge is handled at the beginning. And in the second place, comment says if split succeeds, hpage points to page "p". After all, we don't need to re-calculate hpage after split, and just replace hpage in hwpoison_user_mappings() with p is enough. >-- > >Thanks, > >David / dhildenb -- Wei Yang Help you, Help me