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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 C7CC7C433DF for ; Thu, 28 May 2020 17:39:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8A0AE207BC for ; Thu, 28 May 2020 17:39:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nitingupta.dev header.i=@nitingupta.dev header.b="AMSzGREp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8A0AE207BC 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 EA67D8001A; Thu, 28 May 2020 13:39:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E57AA80010; Thu, 28 May 2020 13:39:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D6BA28001A; Thu, 28 May 2020 13:39:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0088.hostedemail.com [216.40.44.88]) by kanga.kvack.org (Postfix) with ESMTP id BDFED80010 for ; Thu, 28 May 2020 13:39:11 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7674B181AEF10 for ; Thu, 28 May 2020 17:39:11 +0000 (UTC) X-FDA: 76866838902.05.hate96_502ec2321fc4d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 5DBF818030340 for ; Thu, 28 May 2020 17:39:11 +0000 (UTC) X-HE-Tag: hate96_502ec2321fc4d X-Filterd-Recvd-Size: 4641 Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 May 2020 17:39:10 +0000 (UTC) Received: by mail-lj1-f193.google.com with SMTP id k5so34402135lji.11 for ; Thu, 28 May 2020 10:39:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nitingupta.dev; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=GSyn/GzlUuBVZreRe5FoudqPDQtAy00iQYfXxKL+O/Q=; b=AMSzGREpSnoqwtwv9pZaGx8ez0dlArn60F3wpoUwlsaAoeLWH+YHNw44SgBlBc7vag nn2sp9vyKpRzVPN2on4hlPXML8hzV9g2MyHMr3GY249VZJRGGaUIZ5yc10CadFZiTtzk vcuNxha92NhynzKiT0b3k8qSRW7e8dp7oNXB84i2wREsncxeDD9rVNkm2JqJALwopBVm S+YRP+Hb5qUqPmxTTMYrYWWTXXwJKyQATZ+qjgYUdJ/8fG61hiGWvtHweD/MIWMX0a2a y8r66OlLZHSCB4BwPYW16zxiL2qM9iDqfxCMWJfACPLhLqsM2icegfAyoFt0HgTWVS4Q vlQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=GSyn/GzlUuBVZreRe5FoudqPDQtAy00iQYfXxKL+O/Q=; b=nMs3atICr9MunKO+vdFODMhqUNANs8sG+nqws6msdZ0ueKPwAf+4TIzLyDiBsebMWB CMc/nnXaxYRfnVsUc1L8OkWD4ywx9Y7t2v+49eg9I8hF6ipOMigNgHUHwA5EQ7Oel5m2 8PSFQ4hwjDvUMG/F5Elv1YIFw3N+cEalajz+5W1OnJmhzgCrApHe5tJNSGCHfHHuavsL Q2XD6oKBz48oyU/gmpSetDwBtkgnpGSEvHrB2ucsIMejg5S2UBeRP1CRB4Xu/S5nlOiZ N5zXRfOQxEMLZso86v7FjHkG/NyNvTW6xf702Ia7rby0e7GzJCry8ZLzYnb9FwVphxgH mkoA== X-Gm-Message-State: AOAM533e2FCI7jdOKRz85nzBPUrsbPrHEmfBxLMJAcOhC1bnH03jxQAS yuJlIY01t2ELh1+Qogw2qNI/k5NwkKp31PTUYmrpxA== X-Google-Smtp-Source: ABdhPJztXzq3yXMj4FT3uUbqkiTJL24i9SV+yD18Z6q5cM2dbT2DdkdzT9A9pFh+q0gqZ0uWQC5J3lj/V1fV3PrxgyM= X-Received: by 2002:a2e:9099:: with SMTP id l25mr2082879ljg.82.1590687549294; Thu, 28 May 2020 10:39:09 -0700 (PDT) MIME-Version: 1.0 References: <20200518181446.25759-1-nigupta@nvidia.com> <27b39956-2a21-8eef-8ebb-cb3a93a41a36@applied-asynchrony.com> In-Reply-To: From: Nitin Gupta Date: Thu, 28 May 2020 10:38:57 -0700 Message-ID: Subject: Re: [PATCH v5] mm: Proactive compaction To: Vlastimil Babka Cc: =?UTF-8?Q?Holger_Hoffst=C3=A4tte?= , Nitin Gupta , Mel Gorman , Michal Hocko , Matthew Wilcox , Andrew Morton , Mike Kravetz , Joonsoo Kim , David Rientjes , linux-kernel , linux-mm , Linux API Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 5DBF818030340 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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 Thu, May 28, 2020 at 2:50 AM Vlastimil Babka wrote: > > On 5/28/20 11:15 AM, Holger Hoffst=C3=A4tte wrote: > > > > On 5/18/20 8:14 PM, Nitin Gupta wrote: > > [patch v5 :)] > > > > 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. > > > > 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? > I am not sure about such architectures but in such cases, we would end up calculating "fragmentation score" based on a page size which does not match the architecture's view of the "default hugepage size" which is not a terrible thing in itself as compaction can still be done in the background, after all. Since we always need a target order to calculate the fragmentation score, h= ow about this fallack scheme: HPAGE_PMD_ORDER -> HUGETLB_PAGE_ORDER -> PMD_ORDER Thanks, Nitin