From: Nitin Gupta <ngupta@nitingupta.dev>
To: Oleksandr Natalenko <oleksandr@redhat.com>,
Nitin Gupta <nigupta@nvidia.com>
Cc: Mel Gorman <mgorman@techsingularity.net>,
Michal Hocko <mhocko@suse.com>, Vlastimil Babka <vbabka@suse.cz>,
Matthew Wilcox <willy@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
Mike Kravetz <mike.kravetz@oracle.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
David Rientjes <rientjes@google.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>,
Linux API <linux-api@vger.kernel.org>
Subject: Re: [PATCH v6] mm: Proactive compaction
Date: Mon, 15 Jun 2020 07:34:04 -0700 [thread overview]
Message-ID: <3f8e66f4-e725-c871-8d8b-0fcd3da20b36@nitingupta.dev> (raw)
In-Reply-To: <20200615142556.5mekzzwvratx2n2i@butterfly.localdomain>
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 on
>> 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 ‘fragmentation_score_zone’,
>> inlined from ‘__compact_finished’ at mm/compaction.c:1982:11,
>> inlined from ‘compact_zone’ at mm/compaction.c:2062:8:
>> ./include/linux/compiler.h:392:38: error: call to ‘__compiletime_assert_397’ 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 ‘__compiletime_assert’
>> 373 | prefix ## suffix(); \
>> | ^~~~~~
>> ./include/linux/compiler.h:392:2: note: in expansion of macro ‘_compiletime_assert’
>> 392 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
>> | ^~~~~~~~~~~~~~~~~~~
>> ./include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’
>> 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
>> | ^~~~~~~~~~~~~~~~~~
>> ./include/linux/build_bug.h:59:21: note: in expansion of macro ‘BUILD_BUG_ON_MSG’
>> 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
>> | ^~~~~~~~~~~~~~~~
>> ./include/linux/huge_mm.h:319:28: note: in expansion of macro ‘BUILD_BUG’
>> 319 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
>> | ^~~~~~~~~
>> ./include/linux/huge_mm.h:115:26: note: in expansion of macro ‘HPAGE_PMD_SHIFT’
>> 115 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
>> | ^~~~~~~~~~~~~~~
>> mm/compaction.c:64:32: note: in expansion of macro ‘HPAGE_PMD_ORDER’
>> 64 | #define COMPACTION_HPAGE_ORDER HPAGE_PMD_ORDER
>> | ^~~~~~~~~~~~~~~
>> mm/compaction.c:1898:28: note: in expansion of macro ‘COMPACTION_HPAGE_ORDER’
>> 1898 | extfrag_for_order(zone, COMPACTION_HPAGE_ORDER);
>> | ^~~~~~~~~~~~~~~~~~~~~~
>> In function ‘fragmentation_score_zone’,
>> inlined from ‘kcompactd’ at mm/compaction.c:1918:12:
>> ./include/linux/compiler.h:392:38: error: call to ‘__compiletime_assert_397’ 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 ‘__compiletime_assert’
>> 373 | prefix ## suffix(); \
>> | ^~~~~~
>> ./include/linux/compiler.h:392:2: note: in expansion of macro ‘_compiletime_assert’
>> 392 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
>> | ^~~~~~~~~~~~~~~~~~~
>> ./include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’
>> 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
>> | ^~~~~~~~~~~~~~~~~~
>> ./include/linux/build_bug.h:59:21: note: in expansion of macro ‘BUILD_BUG_ON_MSG’
>> 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
>> | ^~~~~~~~~~~~~~~~
>> ./include/linux/huge_mm.h:319:28: note: in expansion of macro ‘BUILD_BUG’
>> 319 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
>> | ^~~~~~~~~
>> ./include/linux/huge_mm.h:115:26: note: in expansion of macro ‘HPAGE_PMD_SHIFT’
>> 115 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
>> | ^~~~~~~~~~~~~~~
>> mm/compaction.c:64:32: note: in expansion of macro ‘HPAGE_PMD_ORDER’
>> 64 | #define COMPACTION_HPAGE_ORDER HPAGE_PMD_ORDER
>> | ^~~~~~~~~~~~~~~
>> mm/compaction.c:1898:28: note: in expansion of macro ‘COMPACTION_HPAGE_ORDER’
>> 1898 | extfrag_for_order(zone, COMPACTION_HPAGE_ORDER);
>> | ^~~~~~~~~~~~~~~~~~~~~~
>> In function ‘fragmentation_score_zone’,
>> inlined from ‘kcompactd’ at mm/compaction.c:1918:12:
>> ./include/linux/compiler.h:392:38: error: call to ‘__compiletime_assert_397’ 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 ‘__compiletime_assert’
>> 373 | prefix ## suffix(); \
>> | ^~~~~~
>> ./include/linux/compiler.h:392:2: note: in expansion of macro ‘_compiletime_assert’
>> 392 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
>> | ^~~~~~~~~~~~~~~~~~~
>> ./include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’
>> 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
>> | ^~~~~~~~~~~~~~~~~~
>> ./include/linux/build_bug.h:59:21: note: in expansion of macro ‘BUILD_BUG_ON_MSG’
>> 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
>> | ^~~~~~~~~~~~~~~~
>> ./include/linux/huge_mm.h:319:28: note: in expansion of macro ‘BUILD_BUG’
>> 319 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
>> | ^~~~~~~~~
>> ./include/linux/huge_mm.h:115:26: note: in expansion of macro ‘HPAGE_PMD_SHIFT’
>> 115 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
>> | ^~~~~~~~~~~~~~~
>> mm/compaction.c:64:32: note: in expansion of macro ‘HPAGE_PMD_ORDER’
>> 64 | #define COMPACTION_HPAGE_ORDER HPAGE_PMD_ORDER
>> | ^~~~~~~~~~~~~~~
>> mm/compaction.c:1898:28: note: in expansion of macro ‘COMPACTION_HPAGE_ORDER’
>> 1898 | extfrag_for_order(zone, COMPACTION_HPAGE_ORDER);
>> | ^~~~~~~~~~~~~~~~~~~~~~
>> In function ‘fragmentation_score_zone’,
>> inlined from ‘kcompactd’ at mm/compaction.c:1918:12:
>> ./include/linux/compiler.h:392:38: error: call to ‘__compiletime_assert_397’ 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 ‘__compiletime_assert’
>> 373 | prefix ## suffix(); \
>> | ^~~~~~
>> ./include/linux/compiler.h:392:2: note: in expansion of macro ‘_compiletime_assert’
>> 392 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
>> | ^~~~~~~~~~~~~~~~~~~
>> ./include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’
>> 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
>> | ^~~~~~~~~~~~~~~~~~
>> ./include/linux/build_bug.h:59:21: note: in expansion of macro ‘BUILD_BUG_ON_MSG’
>> 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
>> | ^~~~~~~~~~~~~~~~
>> ./include/linux/huge_mm.h:319:28: note: in expansion of macro ‘BUILD_BUG’
>> 319 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
>> | ^~~~~~~~~
>> ./include/linux/huge_mm.h:115:26: note: in expansion of macro ‘HPAGE_PMD_SHIFT’
>> 115 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
>> | ^~~~~~~~~~~~~~~
>> mm/compaction.c:64:32: note: in expansion of macro ‘HPAGE_PMD_ORDER’
>> 64 | #define COMPACTION_HPAGE_ORDER HPAGE_PMD_ORDER
>> | ^~~~~~~~~~~~~~~
>> mm/compaction.c:1898:28: note: in expansion of macro ‘COMPACTION_HPAGE_ORDER’
>> 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
>>
>
> What about doing this:
>
> 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 = 500;
> * 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
>
> ?
>
Yes, this looks good. I will send out a v7 patch soon with this change.
Thanks,
Nitin
prev parent reply other threads:[~2020-06-15 14:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-01 19:48 [PATCH v6] mm: Proactive compaction Nitin Gupta
2020-06-09 18:37 ` Nitin Gupta
2020-06-09 19:23 ` Khalid Aziz
2020-06-11 20:19 ` Nitin Gupta
2020-06-15 8:29 ` Oleksandr Natalenko
2020-06-15 14:25 ` Oleksandr Natalenko
2020-06-15 14:34 ` Nitin Gupta [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3f8e66f4-e725-c871-8d8b-0fcd3da20b36@nitingupta.dev \
--to=ngupta@nitingupta.dev \
--cc=akpm@linux-foundation.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@suse.com \
--cc=mike.kravetz@oracle.com \
--cc=nigupta@nvidia.com \
--cc=oleksandr@redhat.com \
--cc=rientjes@google.com \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).