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=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 4243EC433ED for ; Tue, 27 Apr 2021 08:09:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AC05C613B3 for ; Tue, 27 Apr 2021 08:09:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC05C613B3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=techsingularity.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 37BAD6B006E; Tue, 27 Apr 2021 04:09:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 352F16B0071; Tue, 27 Apr 2021 04:09:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 181D66B0072; Tue, 27 Apr 2021 04:09:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0153.hostedemail.com [216.40.44.153]) by kanga.kvack.org (Postfix) with ESMTP id EA22D6B006E for ; Tue, 27 Apr 2021 04:09:25 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id A505E180AD82F for ; Tue, 27 Apr 2021 08:09:25 +0000 (UTC) X-FDA: 78077422290.01.6C7281A Received: from outbound-smtp30.blacknight.com (outbound-smtp30.blacknight.com [81.17.249.61]) by imf28.hostedemail.com (Postfix) with ESMTP id A47282000254 for ; Tue, 27 Apr 2021 08:09:26 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail02.blacknight.ie [81.17.254.11]) by outbound-smtp30.blacknight.com (Postfix) with ESMTPS id AA9C8BB637 for ; Tue, 27 Apr 2021 09:09:23 +0100 (IST) Received: (qmail 32322 invoked from network); 27 Apr 2021 08:09:23 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.17.248]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 27 Apr 2021 08:09:23 -0000 Date: Tue, 27 Apr 2021 09:09:22 +0100 From: Mel Gorman To: Charan Teja Reddy Cc: akpm@linux-foundation.org, vbabka@suse.cz, bhe@redhat.com, nigupta@nvidia.com, khalid.aziz@oracle.com, mateusznosek0@gmail.com, sh_def@163.com, iamjoonsoo.kim@lge.com, mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com, mhocko@suse.com, rientjes@google.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, vinmenon@codeaurora.org Subject: Re: [PATCH] mm: compaction: improve /proc trigger for full node memory compaction Message-ID: <20210427080921.GG4239@techsingularity.net> References: <1619098678-8501-1-git-send-email-charante@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1619098678-8501-1-git-send-email-charante@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: A47282000254 X-Stat-Signature: ct5i79igfn8ia7bo18axg6bkjftcsa6j Received-SPF: none (techsingularity.net>: No applicable sender policy available) receiver=imf28; identity=mailfrom; envelope-from=""; helo=outbound-smtp30.blacknight.com; client-ip=81.17.249.61 X-HE-DKIM-Result: none/none X-HE-Tag: 1619510966-721106 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, Apr 22, 2021 at 07:07:58PM +0530, Charan Teja Reddy wrote: > The existing /proc/sys/vm/compact_memory interface do the full node > compaction when user writes an arbitrary value to it and is targeted for > the usecases like an app launcher prepares the system before the target > application runs. The intent behind compact_memory was a debugging interface to tell the difference between an application failing to allocate a huge page prematurely and the inability of compaction to find a free page. > The downside of it is that even if there are > sufficient higher order pages left in the system for the targeted > application to run, full node compaction will still be triggered thus > wasting few CPU cycles. This problem can be solved if it is known when > the sufficient higher order pages are available in the system thus full > node compaction can be stopped in the middle. The proactive > compaction[1] can give these details about the availability of higher > order pages in the system(it checks for COMPACTION_HPAGE_ORDER pages, > which usually be order-9) thus can be used to trigger for full node > compaction. > > This patch adds a new /proc interface, > /proc/sys/vm/proactive_compact_memory, and on write of an arbitrary > value triggers the full node compaction but can be stopped in the middle > if sufficient higher order(COMPACTION_HPAGE_ORDER) pages available in > the system. The availability of pages that a user looking for can be > given as input through /proc/sys/vm/compaction_proactiveness. > > [1]https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=facdaa917c4d5a376d09d25865f5a863f906234a > > Signed-off-by: Charan Teja Reddy Hence, while I do not object to the patch as-such, I'm wary of the trend towards improving explicit out-of-band compaction via proc interfaces. I would have preferred if the focus was on reducing the cost of compaction so that direct allocation requests succeed quickly or improving background compaction via kcompactd when there has been recent failures. -- Mel Gorman SUSE Labs