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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 7A933C433E2 for ; Thu, 28 May 2020 09:50:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 22915214D8 for ; Thu, 28 May 2020 09:50:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 22915214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7DBF58001A; Thu, 28 May 2020 05:50:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 78C3280010; Thu, 28 May 2020 05:50:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A0F18001A; Thu, 28 May 2020 05:50:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0043.hostedemail.com [216.40.44.43]) by kanga.kvack.org (Postfix) with ESMTP id 4EE0E80010 for ; Thu, 28 May 2020 05:50:45 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 17666180AD817 for ; Thu, 28 May 2020 09:50:45 +0000 (UTC) X-FDA: 76865658450.22.rate35_40afe468a8162 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id E8CDE18038E6B for ; Thu, 28 May 2020 09:50:44 +0000 (UTC) X-HE-Tag: rate35_40afe468a8162 X-Filterd-Recvd-Size: 3315 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 May 2020 09:50:44 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D6AB2AD3A; Thu, 28 May 2020 09:50:41 +0000 (UTC) Subject: Re: [PATCH v5] mm: Proactive compaction To: =?UTF-8?Q?Holger_Hoffst=c3=a4tte?= , Nitin Gupta , Mel Gorman , Michal Hocko Cc: Matthew Wilcox , Andrew Morton , Mike Kravetz , Joonsoo Kim , David Rientjes , Nitin Gupta , linux-kernel , linux-mm , Linux API References: <20200518181446.25759-1-nigupta@nvidia.com> <27b39956-2a21-8eef-8ebb-cb3a93a41a36@applied-asynchrony.com> From: Vlastimil Babka Message-ID: Date: Thu, 28 May 2020 11:50:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <27b39956-2a21-8eef-8ebb-cb3a93a41a36@applied-asynchrony.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Rspamd-Queue-Id: E8CDE18038E6B X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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 5/28/20 11:15 AM, Holger Hoffst=C3=A4tte wrote: >=20 > On 5/18/20 8:14 PM, Nitin Gupta wrote: > [patch v5 :)] >=20 > I've been successfully using this in my tree and it works great, but a = friend > who also uses my tree just found a bug (actually an improvement ;) due = to the > change from HUGETLB_PAGE_ORDER to HPAGE_PMD_ORDER in v5. >=20 > When building with CONFIG_TRANSPARENT_HUGEPAGE=3Dn (for some reason it = was off) > HPAGE_PMD_SHIFT expands to BUILD_BUG() and compilation fails like this: Oops, I forgot about this. Still I believe HPAGE_PMD_ORDER is the best ch= oice as long as THP's are enabled. I guess fallback to HUGETLB_PAGE_ORDER would b= e possible if THPS are not enabled, but AFAICS some architectures don't def= ine that. Such architectures perhaps won't benefit from proactive compaction = anyway? > ... > ./include/linux/huge_mm.h:284:28: note: in expansion of macro =E2=80=98= BUILD_BUG=E2=80=99 > 284 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) > | ^~~~~~~~~ > ./include/linux/huge_mm.h:78:26: note: in expansion of macro =E2=80=98H= PAGE_PMD_SHIFT=E2=80=99 > 78 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT) > | ^~~~~~~~~~~~~~~ > mm/compaction.c:1874:28: note: in expansion of macro =E2=80=98HPAGE_PMD= _ORDER=E2=80=99 > 1874 | extfrag_for_order(zone, HPAGE_PMD_ORDER); > | ^~~~~~~~~~~~~~~ > ... >=20 > It would be great if the whole thing would compile without THP; the onl= y > occurrence is in fragmentation_score_zone(). Unfortunately I'm not fami= liar > enough with how to properly check for THP and properly calculate whatev= er > you're doing there, otherwise I would ifdef this away myself. ;) >=20 > Thanks for an otherwise great patch! >=20 > cheers, > Holger >=20