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=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 CD222C433E0 for ; Mon, 15 Jun 2020 14:26:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7FF7E206E2 for ; Mon, 15 Jun 2020 14:26:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="c/jFTYY1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7FF7E206E2 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 075866B0006; Mon, 15 Jun 2020 10:26:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F41E46B0007; Mon, 15 Jun 2020 10:26:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE25D6B0008; Mon, 15 Jun 2020 10:26:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0197.hostedemail.com [216.40.44.197]) by kanga.kvack.org (Postfix) with ESMTP id BA08B6B0006 for ; Mon, 15 Jun 2020 10:26:04 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 78A5A18022973 for ; Mon, 15 Jun 2020 14:26:04 +0000 (UTC) X-FDA: 76931670648.30.eyes39_2c0b3c726df7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id 3093A1840E89D for ; Mon, 15 Jun 2020 14:26:04 +0000 (UTC) X-HE-Tag: eyes39_2c0b3c726df7 X-Filterd-Recvd-Size: 13037 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Mon, 15 Jun 2020 14:26:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592231162; 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=UyTr5iFSBoqfroTpG9Z1s4sx4zju0b9aWlIjThdySOE=; b=c/jFTYY1eA5wRh6CPzzkqiAYeP3SAZhNRY19hAitO2+A596ZidCCqkM6THRTiX56kWV15t Z7nbhJIPJquSe5PLmUl3UrNrivBLgUVOs55DRIxTZUIWgi292Wyc2amth0CDX6e81EN1Hk 3FWz2awggltr1WeucM4oJMVngyYoC94= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-196-fUf6XyvuNhSEgp3fyHHrTQ-1; Mon, 15 Jun 2020 10:26:00 -0400 X-MC-Unique: fUf6XyvuNhSEgp3fyHHrTQ-1 Received: by mail-wr1-f71.google.com with SMTP id c14so7059308wrw.11 for ; Mon, 15 Jun 2020 07:26:00 -0700 (PDT) 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:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=UyTr5iFSBoqfroTpG9Z1s4sx4zju0b9aWlIjThdySOE=; b=lkfMEXwar39QrqcUlo61EsDQbYtodz1O0q4ghObhQemNO5AaV3p3K+aKBV+K1ju0Sz JNQuHjeUz0Pe3HE3rC75+EIVpWURjtQFRJ13OuxOFgWZvSRXFsdTgfBnP4Ozp6z/Oqyj dX3aOzmPdIE+NMp4FLWQUg1QdaRVt6BcoTx9d9OaHiFTIYxTiP9OWsAdehdl0RIBGaSz 2wypLnS2eK1WrRZzNnn6RShSurM+jJIjekOPjjJOhYk0K0TdSOJKh6zDCsOqqAU6hedL 06rrsNPSZibHbsELmGvbPW1GfXbAFNZvOMXmFimrnw71PU5JyH7y5a6uNZibHXfjr8cI FjUA== X-Gm-Message-State: AOAM531H2DGFd38EqdgWTjeSkvPOozCjdXt9wdFWkjURr47Roj34mtWm 9MNT6MwVY+5FPUHh+Me3nAZ4yNNI4Eu8d+XjZFSStHCvv+FHuGhgHu5Z65UAmDrLv3NT7dChQRY B8N/6JxCe4Cg= X-Received: by 2002:a7b:cd83:: with SMTP id y3mr13113642wmj.5.1592231159626; Mon, 15 Jun 2020 07:25:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziFDiv7xoYX9ZVuS+8wimiXfT73l/n+JIR8kAy3So2psGRB0eWDPdWUBlhvkbtOh5Cg5p16A== X-Received: by 2002:a7b:cd83:: with SMTP id y3mr13113550wmj.5.1592231158457; Mon, 15 Jun 2020 07:25:58 -0700 (PDT) Received: from localhost ([2001:470:5b39:29:79fc:ff4e:48ab:b845]) by smtp.gmail.com with ESMTPSA id a81sm24495019wmd.25.2020.06.15.07.25.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 07:25:57 -0700 (PDT) Date: Mon, 15 Jun 2020 16:25:56 +0200 From: Oleksandr Natalenko To: Nitin Gupta Cc: Mel Gorman , Michal Hocko , Vlastimil Babka , Matthew Wilcox , Andrew Morton , Mike Kravetz , Joonsoo Kim , David Rientjes , Nitin Gupta , linux-kernel , linux-mm , Linux API Subject: Re: [PATCH v6] mm: Proactive compaction Message-ID: <20200615142556.5mekzzwvratx2n2i@butterfly.localdomain> References: <20200601194822.30252-1-nigupta@nvidia.com> <20200615082901.eccfhaklq6fz4bh6@butterfly.localdomain> MIME-Version: 1.0 In-Reply-To: <20200615082901.eccfhaklq6fz4bh6@butterfly.localdomain> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Queue-Id: 3093A1840E89D 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 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: >=20 > 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:2062= :8: > ./include/linux/compiler.h:392:38: error: call to =E2=80=98__compiletim= e_assert_397=E2=80=99 declared with attribute error: BUILD_BUG failed > 392 | _compiletime_assert(condition, msg, __compiletime_assert_, __C= OUNTER__) > | ^ > ./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_, __C= OUNTER__) > | ^~~~~~~~~~~~~~~~~~~ > ./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_O= RDER=E2=80=99 > 64 | #define COMPACTION_HPAGE_ORDER HPAGE_PMD_ORDER > | ^~~~~~~~~~~~~~~ > mm/compaction.c:1898:28: note: in expansion of macro =E2=80=98COMPACTIO= N_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:12= : > ./include/linux/compiler.h:392:38: error: call to =E2=80=98__compiletim= e_assert_397=E2=80=99 declared with attribute error: BUILD_BUG failed > 392 | _compiletime_assert(condition, msg, __compiletime_assert_, __C= OUNTER__) > | ^ > ./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_, __C= OUNTER__) > | ^~~~~~~~~~~~~~~~~~~ > ./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_O= RDER=E2=80=99 > 64 | #define COMPACTION_HPAGE_ORDER HPAGE_PMD_ORDER > | ^~~~~~~~~~~~~~~ > mm/compaction.c:1898:28: note: in expansion of macro =E2=80=98COMPACTIO= N_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:12= : > ./include/linux/compiler.h:392:38: error: call to =E2=80=98__compiletim= e_assert_397=E2=80=99 declared with attribute error: BUILD_BUG failed > 392 | _compiletime_assert(condition, msg, __compiletime_assert_, __C= OUNTER__) > | ^ > ./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_, __C= OUNTER__) > | ^~~~~~~~~~~~~~~~~~~ > ./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_O= RDER=E2=80=99 > 64 | #define COMPACTION_HPAGE_ORDER HPAGE_PMD_ORDER > | ^~~~~~~~~~~~~~~ > mm/compaction.c:1898:28: note: in expansion of macro =E2=80=98COMPACTIO= N_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:12= : > ./include/linux/compiler.h:392:38: error: call to =E2=80=98__compiletim= e_assert_397=E2=80=99 declared with attribute error: BUILD_BUG failed > 392 | _compiletime_assert(condition, msg, __compiletime_assert_, __C= OUNTER__) > | ^ > ./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_, __C= OUNTER__) > | ^~~~~~~~~~~~~~~~~~~ > ./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_O= RDER=E2=80=99 > 64 | #define COMPACTION_HPAGE_ORDER HPAGE_PMD_ORDER > | ^~~~~~~~~~~~~~~ > mm/compaction.c:1898:28: note: in expansion of macro =E2=80=98COMPACTIO= N_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: 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 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 ? --=20 Best regards, Oleksandr Natalenko (post-factum) Principal Software Maintenance Engineer