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=-5.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,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 D2C3BC433E0 for ; Mon, 15 Jun 2020 14:37:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7D22820679 for ; Mon, 15 Jun 2020 14:37:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nitingupta.dev header.i=@nitingupta.dev header.b="ATXcarCk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D22820679 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=nitingupta.dev Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2946F6B0008; Mon, 15 Jun 2020 10:37:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 21CA86B000A; Mon, 15 Jun 2020 10:37:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 10D0B6B000C; Mon, 15 Jun 2020 10:37:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0032.hostedemail.com [216.40.44.32]) by kanga.kvack.org (Postfix) with ESMTP id EA06D6B0008 for ; Mon, 15 Jun 2020 10:37:05 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 8C98B180C8721 for ; Mon, 15 Jun 2020 14:37:05 +0000 (UTC) X-FDA: 76931698410.15.egg65_400570d26df7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 3ED5E180947A3 for ; Mon, 15 Jun 2020 14:34:09 +0000 (UTC) X-HE-Tag: egg65_400570d26df7 X-Filterd-Recvd-Size: 13063 Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Mon, 15 Jun 2020 14:34:08 +0000 (UTC) Received: by mail-pl1-f195.google.com with SMTP id v24so6879963plo.6 for ; Mon, 15 Jun 2020 07:34:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nitingupta.dev; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=IX2rPyJbEoaddaAGCH0nUw/i8181BfJCP+lSnavbkzY=; b=ATXcarCkC9+xSjmKDB8AvCyvn9OM5sVbA6cYa4OAKaudXkHwo20jUr9mvpAsPj9NH9 Xh/oQhKUUp3zTGBlr+cP+DumdvJ8PStbo7qCqQiX4usFhDyT+/hEB/Keylap7ruYOWUC VX2oTprZDDvaSygIqk8cRSmbmnMQFoE1XAV35ftykqZ2mE7Zpsn7QV+u+NQQ7GTTnTx0 tnQtDKtI8Kswj1+Laa+Tzu5lHVTrU8YzIHuYvs3DT4yZkxjz7JOtFeiMyMD8zZTAmKQm r/s70yMVQDhMtMdpE9+5cSGd5RAR7uk+6o7RB/9ZAtal6ql8uZpuuXEoV1l++CisKTWU 6RoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=IX2rPyJbEoaddaAGCH0nUw/i8181BfJCP+lSnavbkzY=; b=qZQiqBrFgXl5Us4RwBZ78OhhUox4HrVFlZcaRiiSneSLmgxoMrwYTWyg3WMwogkPXp +GfgJmXsaqVJxGwqaoMmlfG76LqEu1iMhz6iz/Igiadul+m4z6eNwDOiEwGSMz1MqWEe LuWEcnawdx3mXy6sCQxQaL9j1YPddrFBAsJmYlqkmcRbBXZ2VySTWafSt0Jsc/00QiXs yIvPKr3tNMmdZEGMklO72E6x427/uxkXEFaWm/spm4pqVfXNXHokti8BMcOkPyCnXIUL fLfN+T7t358GravcV4R1wIUpnr/w3ZB9Oq2Ue4wLdwdw4H8yyxKITsXp2jfxbBiYAVUs Hkbg== X-Gm-Message-State: AOAM533jzzGnPWS8wU69dFxjQgSrAYgfR9CziTK31dln7c9Eswx28686 0jjgE6TX5CGjKzm3aoezTBgXPw== X-Google-Smtp-Source: ABdhPJweJCz4K83XMXCk0OAA1j2wz+OVWZDR1clh0cdtwXd6+cgkwO16yultgsQWctQweU6bY5pO9g== X-Received: by 2002:a17:902:710b:: with SMTP id a11mr22517450pll.156.1592231647395; Mon, 15 Jun 2020 07:34:07 -0700 (PDT) Received: from ngvpn01-160-224.dyn.scz.us.nvidia.com ([2601:646:9302:1050:b1c1:4f97:5a6a:3b73]) by smtp.gmail.com with ESMTPSA id nl5sm14039225pjb.36.2020.06.15.07.34.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Jun 2020 07:34:06 -0700 (PDT) Subject: Re: [PATCH v6] mm: Proactive compaction To: Oleksandr Natalenko , Nitin Gupta Cc: Mel Gorman , Michal Hocko , Vlastimil Babka , Matthew Wilcox , Andrew Morton , Mike Kravetz , Joonsoo Kim , David Rientjes , linux-kernel , linux-mm , Linux API References: <20200601194822.30252-1-nigupta@nvidia.com> <20200615082901.eccfhaklq6fz4bh6@butterfly.localdomain> <20200615142556.5mekzzwvratx2n2i@butterfly.localdomain> From: Nitin Gupta Message-ID: <3f8e66f4-e725-c871-8d8b-0fcd3da20b36@nitingupta.dev> Date: Mon, 15 Jun 2020 07:34:04 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200615142556.5mekzzwvratx2n2i@butterfly.localdomain> Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Rspamd-Queue-Id: 3ED5E180947A3 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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 6/15/20 7:25 AM, Oleksandr Natalenko wrote: > On Mon, Jun 15, 2020 at 10:29:01AM +0200, Oleksandr Natalenko wrote: >> Just to let you know, this fails to compile for me with THP disabled o= n >> v5.8-rc1: >> >> CC mm/compaction.o >> In file included from ./include/linux/dev_printk.h:14, >> from ./include/linux/device.h:15, >> from ./include/linux/node.h:18, >> from ./include/linux/cpu.h:17, >> from mm/compaction.c:11: >> In function =E2=80=98fragmentation_score_zone=E2=80=99, >> inlined from =E2=80=98__compact_finished=E2=80=99 at mm/compaction= .c:1982:11, >> inlined from =E2=80=98compact_zone=E2=80=99 at mm/compaction.c:206= 2:8: >> ./include/linux/compiler.h:392:38: error: call to =E2=80=98__compileti= me_assert_397=E2=80=99 declared with attribute error: BUILD_BUG failed >> 392 | _compiletime_assert(condition, msg, __compiletime_assert_, __= COUNTER__) >> | ^ >> ./include/linux/compiler.h:373:4: note: in definition of macro =E2=80=98= __compiletime_assert=E2=80=99 >> 373 | prefix ## suffix(); \ >> | ^~~~~~ >> ./include/linux/compiler.h:392:2: note: in expansion of macro =E2=80=98= _compiletime_assert=E2=80=99 >> 392 | _compiletime_assert(condition, msg, __compiletime_assert_, __= COUNTER__) >> | ^~~~~~~~~~~~~~~~~~~ >> ./include/linux/build_bug.h:39:37: note: in expansion of macro =E2=80=98= compiletime_assert=E2=80=99 >> 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond)= , msg) >> | ^~~~~~~~~~~~~~~~~~ >> ./include/linux/build_bug.h:59:21: note: in expansion of macro =E2=80=98= BUILD_BUG_ON_MSG=E2=80=99 >> 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") >> | ^~~~~~~~~~~~~~~~ >> ./include/linux/huge_mm.h:319:28: note: in expansion of macro =E2=80=98= BUILD_BUG=E2=80=99 >> 319 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) >> | ^~~~~~~~~ >> ./include/linux/huge_mm.h:115:26: note: in expansion of macro =E2=80=98= HPAGE_PMD_SHIFT=E2=80=99 >> 115 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT) >> | ^~~~~~~~~~~~~~~ >> mm/compaction.c:64:32: note: in expansion of macro =E2=80=98HPAGE_PMD_= ORDER=E2=80=99 >> 64 | #define COMPACTION_HPAGE_ORDER HPAGE_PMD_ORDER >> | ^~~~~~~~~~~~~~~ >> mm/compaction.c:1898:28: note: in expansion of macro =E2=80=98COMPACTI= ON_HPAGE_ORDER=E2=80=99 >> 1898 | extfrag_for_order(zone, COMPACTION_HPAGE_ORDER); >> | ^~~~~~~~~~~~~~~~~~~~~~ >> In function =E2=80=98fragmentation_score_zone=E2=80=99, >> inlined from =E2=80=98kcompactd=E2=80=99 at mm/compaction.c:1918:1= 2: >> ./include/linux/compiler.h:392:38: error: call to =E2=80=98__compileti= me_assert_397=E2=80=99 declared with attribute error: BUILD_BUG failed >> 392 | _compiletime_assert(condition, msg, __compiletime_assert_, __= COUNTER__) >> | ^ >> ./include/linux/compiler.h:373:4: note: in definition of macro =E2=80=98= __compiletime_assert=E2=80=99 >> 373 | prefix ## suffix(); \ >> | ^~~~~~ >> ./include/linux/compiler.h:392:2: note: in expansion of macro =E2=80=98= _compiletime_assert=E2=80=99 >> 392 | _compiletime_assert(condition, msg, __compiletime_assert_, __= COUNTER__) >> | ^~~~~~~~~~~~~~~~~~~ >> ./include/linux/build_bug.h:39:37: note: in expansion of macro =E2=80=98= compiletime_assert=E2=80=99 >> 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond)= , msg) >> | ^~~~~~~~~~~~~~~~~~ >> ./include/linux/build_bug.h:59:21: note: in expansion of macro =E2=80=98= BUILD_BUG_ON_MSG=E2=80=99 >> 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") >> | ^~~~~~~~~~~~~~~~ >> ./include/linux/huge_mm.h:319:28: note: in expansion of macro =E2=80=98= BUILD_BUG=E2=80=99 >> 319 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) >> | ^~~~~~~~~ >> ./include/linux/huge_mm.h:115:26: note: in expansion of macro =E2=80=98= HPAGE_PMD_SHIFT=E2=80=99 >> 115 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT) >> | ^~~~~~~~~~~~~~~ >> mm/compaction.c:64:32: note: in expansion of macro =E2=80=98HPAGE_PMD_= ORDER=E2=80=99 >> 64 | #define COMPACTION_HPAGE_ORDER HPAGE_PMD_ORDER >> | ^~~~~~~~~~~~~~~ >> mm/compaction.c:1898:28: note: in expansion of macro =E2=80=98COMPACTI= ON_HPAGE_ORDER=E2=80=99 >> 1898 | extfrag_for_order(zone, COMPACTION_HPAGE_ORDER); >> | ^~~~~~~~~~~~~~~~~~~~~~ >> In function =E2=80=98fragmentation_score_zone=E2=80=99, >> inlined from =E2=80=98kcompactd=E2=80=99 at mm/compaction.c:1918:1= 2: >> ./include/linux/compiler.h:392:38: error: call to =E2=80=98__compileti= me_assert_397=E2=80=99 declared with attribute error: BUILD_BUG failed >> 392 | _compiletime_assert(condition, msg, __compiletime_assert_, __= COUNTER__) >> | ^ >> ./include/linux/compiler.h:373:4: note: in definition of macro =E2=80=98= __compiletime_assert=E2=80=99 >> 373 | prefix ## suffix(); \ >> | ^~~~~~ >> ./include/linux/compiler.h:392:2: note: in expansion of macro =E2=80=98= _compiletime_assert=E2=80=99 >> 392 | _compiletime_assert(condition, msg, __compiletime_assert_, __= COUNTER__) >> | ^~~~~~~~~~~~~~~~~~~ >> ./include/linux/build_bug.h:39:37: note: in expansion of macro =E2=80=98= compiletime_assert=E2=80=99 >> 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond)= , msg) >> | ^~~~~~~~~~~~~~~~~~ >> ./include/linux/build_bug.h:59:21: note: in expansion of macro =E2=80=98= BUILD_BUG_ON_MSG=E2=80=99 >> 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") >> | ^~~~~~~~~~~~~~~~ >> ./include/linux/huge_mm.h:319:28: note: in expansion of macro =E2=80=98= BUILD_BUG=E2=80=99 >> 319 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) >> | ^~~~~~~~~ >> ./include/linux/huge_mm.h:115:26: note: in expansion of macro =E2=80=98= HPAGE_PMD_SHIFT=E2=80=99 >> 115 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT) >> | ^~~~~~~~~~~~~~~ >> mm/compaction.c:64:32: note: in expansion of macro =E2=80=98HPAGE_PMD_= ORDER=E2=80=99 >> 64 | #define COMPACTION_HPAGE_ORDER HPAGE_PMD_ORDER >> | ^~~~~~~~~~~~~~~ >> mm/compaction.c:1898:28: note: in expansion of macro =E2=80=98COMPACTI= ON_HPAGE_ORDER=E2=80=99 >> 1898 | extfrag_for_order(zone, COMPACTION_HPAGE_ORDER); >> | ^~~~~~~~~~~~~~~~~~~~~~ >> In function =E2=80=98fragmentation_score_zone=E2=80=99, >> inlined from =E2=80=98kcompactd=E2=80=99 at mm/compaction.c:1918:1= 2: >> ./include/linux/compiler.h:392:38: error: call to =E2=80=98__compileti= me_assert_397=E2=80=99 declared with attribute error: BUILD_BUG failed >> 392 | _compiletime_assert(condition, msg, __compiletime_assert_, __= COUNTER__) >> | ^ >> ./include/linux/compiler.h:373:4: note: in definition of macro =E2=80=98= __compiletime_assert=E2=80=99 >> 373 | prefix ## suffix(); \ >> | ^~~~~~ >> ./include/linux/compiler.h:392:2: note: in expansion of macro =E2=80=98= _compiletime_assert=E2=80=99 >> 392 | _compiletime_assert(condition, msg, __compiletime_assert_, __= COUNTER__) >> | ^~~~~~~~~~~~~~~~~~~ >> ./include/linux/build_bug.h:39:37: note: in expansion of macro =E2=80=98= compiletime_assert=E2=80=99 >> 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond)= , msg) >> | ^~~~~~~~~~~~~~~~~~ >> ./include/linux/build_bug.h:59:21: note: in expansion of macro =E2=80=98= BUILD_BUG_ON_MSG=E2=80=99 >> 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") >> | ^~~~~~~~~~~~~~~~ >> ./include/linux/huge_mm.h:319:28: note: in expansion of macro =E2=80=98= BUILD_BUG=E2=80=99 >> 319 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) >> | ^~~~~~~~~ >> ./include/linux/huge_mm.h:115:26: note: in expansion of macro =E2=80=98= HPAGE_PMD_SHIFT=E2=80=99 >> 115 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT) >> | ^~~~~~~~~~~~~~~ >> mm/compaction.c:64:32: note: in expansion of macro =E2=80=98HPAGE_PMD_= ORDER=E2=80=99 >> 64 | #define COMPACTION_HPAGE_ORDER HPAGE_PMD_ORDER >> | ^~~~~~~~~~~~~~~ >> mm/compaction.c:1898:28: note: in expansion of macro =E2=80=98COMPACTI= ON_HPAGE_ORDER=E2=80=99 >> 1898 | extfrag_for_order(zone, COMPACTION_HPAGE_ORDER); >> | ^~~~~~~~~~~~~~~~~~~~~~ >> make[1]: *** [scripts/Makefile.build:281: mm/compaction.o] Error 1 >> make: *** [Makefile:1764: mm] Error 2 >> >=20 > What about doing this: >=20 > diff --git a/mm/compaction.c b/mm/compaction.c > index 0d4f91dfb801..ac2030814edb 100644 > --- a/mm/compaction.c > +++ b/mm/compaction.c > @@ -60,7 +60,7 @@ static const int HPAGE_FRAG_CHECK_INTERVAL_MSEC =3D 5= 00; > * calculates external fragmentation, which is used as > * the "fragmentation score" of a node/zone. > */ > -#if defined HPAGE_PMD_ORDER > +#if defined CONFIG_TRANSPARENT_HUGEPAGE > #define COMPACTION_HPAGE_ORDER HPAGE_PMD_ORDER > #elif defined HUGETLB_PAGE_ORDER > #define COMPACTION_HPAGE_ORDER HUGETLB_PAGE_ORDER >=20 > ? >=20 Yes, this looks good. I will send out a v7 patch soon with this change. Thanks, Nitin