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 18096ECAAD5 for ; Sat, 27 Aug 2022 02:56:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6844F6B0073; Fri, 26 Aug 2022 22:56:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 633A26B0074; Fri, 26 Aug 2022 22:56:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4FB19940007; Fri, 26 Aug 2022 22:56:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 4216C6B0073 for ; Fri, 26 Aug 2022 22:56:52 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 0D9FA80323 for ; Sat, 27 Aug 2022 02:56:52 +0000 (UTC) X-FDA: 79843860264.01.CAD9F39 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by imf16.hostedemail.com (Postfix) with ESMTP id 9DAF618001A for ; Sat, 27 Aug 2022 02:56:51 +0000 (UTC) Content-Type: text/plain; charset=utf-8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1661569010; 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=NcpFLSKaQAxTxdf0ghmhR9spotb00VoGyO0+l7yqmw4=; b=oQD3APUKMRgcT71zbhGfdRAoqHaJKOh1/u1UydwxeBjKTyX9UxnLKRcyzFw2U8Yw0/IZcI +tqLElxGM273NAeeaOFN7DPTzWcYTp3b6/VzXPrgydLq1Q1FpUejccrZuwV3p2HpxeRLiz a078oqnbN9o+eIAbrzuI1OK1zWQ/mfw= MIME-Version: 1.0 Subject: Re: [PATCH 08/10] hugetlb: remove unneeded SetHPageVmemmapOptimized() X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: Date: Sat, 27 Aug 2022 10:56:40 +0800 Cc: Andrew Morton , Mike Kravetz , Muchun Song , Linux MM , linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <767650F7-25B2-4E14-B47C-C103500D31B9@linux.dev> References: <20220826092422.39591-1-linmiaohe@huawei.com> <20220826092422.39591-9-linmiaohe@huawei.com> To: Miaohe Lin X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=oQD3APUK; spf=pass (imf16.hostedemail.com: domain of muchun.song@linux.dev designates 91.121.223.63 as permitted sender) smtp.mailfrom=muchun.song@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661569011; a=rsa-sha256; cv=none; b=rG3pvUk6kl/85g8aC+YZL5Q/COZQ7M9oarWosa6hgUgNnRMlk2GqmjLsi+VVRBWlrM9dJz lSbMfHkoPrzaS8Po+FRFHFzdx2LlrHL9Y/5Xj3fDPzYaOlrVG+fZHtPUTVJ7dReyXPY2ml D9QTE5+VhCj/1M1B5y4HR4N+1RNDeU4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661569011; h=from:from:sender: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:dkim-signature; bh=NcpFLSKaQAxTxdf0ghmhR9spotb00VoGyO0+l7yqmw4=; b=ndo6whG7jwVAqXmSdfSfQZ49w09ugThSd/GRiuH19YcBkf5AJQFALks7eHBtkTIoiOYQWg Queo289l2HfKngGePFXWyrmWNHvcaCUTadUGWlBPJB5/6Waa8g4vpzHMjjJMnbwlS7quA+ WWmisMzw0zKFKjdqnBMOMfegMjCTZoU= X-Rspam-User: Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=oQD3APUK; spf=pass (imf16.hostedemail.com: domain of muchun.song@linux.dev designates 91.121.223.63 as permitted sender) smtp.mailfrom=muchun.song@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Rspamd-Server: rspam07 X-Stat-Signature: 5qz1tkakm6zaw6asok41jum6d9kgy7ct X-Rspamd-Queue-Id: 9DAF618001A X-HE-Tag: 1661569011-233513 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 Aug 27, 2022, at 10:18, Miaohe Lin wrote: >=20 > On 2022/8/27 9:35, Muchun Song wrote: >>=20 >>=20 >>> On Aug 26, 2022, at 17:24, Miaohe Lin wrote: >>>=20 >>> If code reaches here, it's guaranteed that HPageVmemmapOptimized is = set >>> for the hugetlb page (or VM_BUG_ON_PAGE() will complain about it). = It's >>=20 >> Hi Miaohe, >>=20 >> Right. >>=20 >>> unnecessary to set it again. >>=20 >> No, I suppose you didn=E2=80=99t test this patch since it does not = work. The >> HPageVmemmapOptimized is cleared in the above code of line >> (set_page_private(page, 0)). So NAck. >=20 > Sorry, I missed that and thanks for pointing this out. Does this code = deserves a > comment like below? >=20 > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index d0617d64d718..3374c1d2b52e 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -1522,6 +1522,10 @@ static void add_hugetlb_page(struct hstate *h, = struct page *page, >=20 > set_compound_page_dtor(page, HUGETLB_PAGE_DTOR); > set_page_private(page, 0); > + /* > + * We have to set HPageVmemmapOptimized again as above > + * set_page_private(page, 0) cleared it. > + */ > SetHPageVmemmapOptimized(page); I=E2=80=99m fine with this comment. Reviewed-by: Muchun Song >=20 > /* >=20 >=20 > Thanks, > Miaohe Lin