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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 7609FC433ED for ; Mon, 10 May 2021 00:17:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EBC8361377 for ; Mon, 10 May 2021 00:17:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EBC8361377 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5AEE56B0070; Sun, 9 May 2021 20:17:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 585B56B0071; Sun, 9 May 2021 20:17:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4747C6B0072; Sun, 9 May 2021 20:17:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0066.hostedemail.com [216.40.44.66]) by kanga.kvack.org (Postfix) with ESMTP id 2B9076B0070 for ; Sun, 9 May 2021 20:17:51 -0400 (EDT) Received: from smtpin40.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D5CBF943A for ; Mon, 10 May 2021 00:17:50 +0000 (UTC) X-FDA: 78123408300.40.2E0705A Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf10.hostedemail.com (Postfix) with ESMTP id 351DE40002E8 for ; Mon, 10 May 2021 00:17:35 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id C262A610CC; Mon, 10 May 2021 00:17:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1620605869; bh=i+YJLqFNH50CIrJgOP6blmezF+nf9yUjSX5iWGJKM1c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Cc2LoCTnOfNVzw8V4AFywY6mT9DyhBwsacADhMkAGYrceCN6/6xJcTs4cM7y3O8RQ pFtZ72D7/rz7oTpSSWElYfFWY6bnDgtSTBWVULYyVHhArMrK8HbWjm6BRq61V5B0Ad tEW8mJ39FHtXFK3vcD4J1ZJTIdC19DfRbHMxi6t0= Date: Sun, 9 May 2021 17:17:48 -0700 From: Andrew Morton To: chukaiping Cc: mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com, vbabka@suse.cz, nigupta@nvidia.com, bhe@redhat.com, khalid.aziz@oracle.com, iamjoonsoo.kim@lge.com, mateusznosek0@gmail.com, sh_def@163.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Mel Gorman , David Rientjes Subject: Re: [PATCH v4] mm/compaction: let proactive compaction order configurable Message-Id: <20210509171748.8dbc70ceccc5cc1ae61fe41c@linux-foundation.org> In-Reply-To: <1619576901-9531-1-git-send-email-chukaiping@baidu.com> References: <1619576901-9531-1-git-send-email-chukaiping@baidu.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=Cc2LoCTn; dmarc=none; spf=pass (imf10.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 351DE40002E8 X-Stat-Signature: g9ho99o6kja6puj1gpac39ey63qgrcwu Received-SPF: none (linux-foundation.org>: No applicable sender policy available) receiver=imf10; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1620605855-672481 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 Wed, 28 Apr 2021 10:28:21 +0800 chukaiping wrote: > Currently the proactive compaction order is fixed to > COMPACTION_HPAGE_ORDER(9), it's OK in most machines with lots of > normal 4KB memory, but it's too high for the machines with small > normal memory, for example the machines with most memory configured > as 1GB hugetlbfs huge pages. In these machines the max order of > free pages is often below 9, and it's always below 9 even with hard > compaction. This will lead to proactive compaction be triggered very > frequently. In these machines we only care about order of 3 or 4. > This patch export the oder to proc and let it configurable > by user, and the default value is still COMPACTION_HPAGE_ORDER. It would be great to do this automatically? It's quite simple to see when memory is being handed out to hugetlbfs - so can we tune proactive_compaction_order in response to this? That would be far better than adding a manual tunable. But from having read Khalid's comments, that does sound quite involved. Is there some partial solution that we can come up with that will get most people out of trouble? That being said, this patch is super-super-simple so perhaps we should just merge it just to get one person (and hopefully a few more) out of trouble. But on the other hand, once we add a /proc tunable we must maintain that tunable for ever (or at least a very long time) even if the internal implementations change a lot.