Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4293702ybz; Mon, 20 Apr 2020 20:27:31 -0700 (PDT) X-Google-Smtp-Source: APiQypIba4Je3ljZJgFRj4pH+uxDsMWx0qWyL847OCe3TZIxOU+WAbr7s5vJ+FujBehOj91pFYPZ X-Received: by 2002:a17:906:4a94:: with SMTP id x20mr19397553eju.306.1587439651676; Mon, 20 Apr 2020 20:27:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587439651; cv=none; d=google.com; s=arc-20160816; b=DVfksw7wNxF7tIxkfg6UHF5nz6E0p1ZBgyvrKaA7uOD/FIGFvXAwFx6tOe7zxfLxVP lJJN1vb+Xrx6d02umvs8skuHwlK1VxI8p5eqXRyR6EJultBbPDOmC61kesRMhuu38fjy pwtEravzyC4tQaJ76Exo5f4QuRxLJ/ndX7L5I7x/dQYy0Haef5fvTxQuAoIKUBRl/uBq 5uuKVB/naf1iDJGGtf5Wv9qe1TXXScTgwfxZCTb1y1Opa2G3WZ6TUibJsQfRrKkeJDdz 2HUukU/lvYrzCCi0jnjX7aGl9idprf4CS1XMXi5N1GSTTi1OcWAjKvpBPxQ1bXvPnk7M lFQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=o5jZKvJdz2fzfNKYDHjzrE4gCxhPfaCJ9zsAP0sD7es=; b=GAT1O0mf7p5HxnWqmdmitEwJAFTLwiRl8crL6PRI/GphhyaoDjQ2TYxzm6PWmoQ38U X9e41+hNFYRB9XS/hp0k2krwMvJ2lHpEY60f4QIJutXZDgca6FdC8pQ5nUOUEGdTYaxk /0dIJPbaDI2iMGT4iw6QSXDTm2iGNjbFSgsO1MV86Jvn0235Qt/also84a09ocSmU91u lawMJJsZ7yRg4aCXzBIAeKbaerblpAMFBkHrX8aG3XbWFLtRaNcZTZpF8bdxzImqqLDA X+XmaKitAaAs3iNeb3HB5wdn/49YxgB1J1XraQIOK9ZIPmzfdaErCO9c808I3yTP9mSt MJbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MoKVQvI+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u22si736295eja.142.2020.04.20.20.27.08; Mon, 20 Apr 2020 20:27:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MoKVQvI+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727915AbgDUD0R (ORCPT + 99 others); Mon, 20 Apr 2020 23:26:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:42352 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726801AbgDUD0R (ORCPT ); Mon, 20 Apr 2020 23:26:17 -0400 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/