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=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 1B3D6C55183 for ; Tue, 21 Apr 2020 03:26:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CEBBF2084D for ; Tue, 21 Apr 2020 03:26:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="MoKVQvI+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CEBBF2084D 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 674078E0005; Mon, 20 Apr 2020 23:26:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 624488E0003; Mon, 20 Apr 2020 23:26:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 512128E0005; Mon, 20 Apr 2020 23:26:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0083.hostedemail.com [216.40.44.83]) by kanga.kvack.org (Postfix) with ESMTP id 390FF8E0003 for ; Mon, 20 Apr 2020 23:26:18 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 08F852DFA for ; Tue, 21 Apr 2020 03:26:18 +0000 (UTC) X-FDA: 76730424036.10.fold05_541232b8ab85c X-HE-Tag: fold05_541232b8ab85c X-Filterd-Recvd-Size: 3196 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Tue, 21 Apr 2020 03:26:17 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6F198206F9; Tue, 21 Apr 2020 03:26:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587439576; bh=FX6uG5F8AzQ1flbZ2fXf08M3XCLcX/I/Er+4aPB3lI8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MoKVQvI+tqfAlfk+k0e77LTTf38deWd0xVvaRxd057+hRHlzNUBxbRIj2MifWjAjH TOygngigqi31EUrMLsYSzKs83kBCvJNSLmOwP/20UtlfXj6L97YhQY6mh7yfGaug7/ ISY3AbK77ACPfsmSBfz4AZujkOsgvHgKClnDqlwE= Date: Mon, 20 Apr 2020 20:26:15 -0700 From: Andrew Morton To: Nitin Gupta Cc: Mel Gorman , Michal Hocko , Vlastimil Babka , Matthew Wilcox , Mike Kravetz , Joonsoo Kim , David Rientjes , Nitin Gupta , linux-kernel , linux-mm , Linux API Subject: Re: [PATCH v3] mm: Proactive compaction Message-Id: <20200420202615.daa216426294e842cb0b523c@linux-foundation.org> In-Reply-To: <20200310222539.1981-1-nigupta@nvidia.com> References: <20200310222539.1981-1-nigupta@nvidia.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 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 Tue, 10 Mar 2020 15:25:39 -0700 Nitin Gupta wrote: > For some applications we need to allocate almost all memory as > hugepages. However, on a running system, higher order allocations can > fail if the memory is fragmented. Linux kernel currently does on-demand > compaction as we request more hugepages but this style of compaction > incurs very high latency. Experiments with one-time full memory > compaction (followed by hugepage allocations) shows that kernel is able > to restore a highly fragmented memory state to a fairly compacted memory > state within <1 sec for a 32G system. Such data suggests that a more > proactive compaction can help us allocate a large fraction of memory as > hugepages keeping allocation latencies low. hn, there was plenty of feedback for earlier versions, but then everyone went quiet. I guess it's time for a refresh and resend, please. With some code comments, please! Is the code really so self-evident that this: +/* Compact all zones within a node according to proactiveness */ is the only thing which needs to be said about it? How is the reader to know what proactive compaction actually *is*? What does extfrag_for_order() do and what does its return value mean? Please document /sys/kernel/mm/compaction/proactiveness in the appropriate place under Documentation/