From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934765AbcDMKgc (ORCPT ); Wed, 13 Apr 2016 06:36:32 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:37204 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932845AbcDMKgb (ORCPT ); Wed, 13 Apr 2016 06:36:31 -0400 Date: Wed, 13 Apr 2016 13:36:27 +0300 From: "Kirill A. Shutemov" To: Jason Baron Cc: akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, rientjes@google.com, aarcange@redhat.com, mgorman@techsingularity.net, mhocko@suse.com, hannes@cmpxchg.org, vbabka@suse.cz, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] mm: update min_free_kbytes from khugepaged after core initialization Message-ID: <20160413103627.GA5051@node.shutemov.name> References: <2bd05bd3f581116cee2d6396ea72613cf217a8c5.1460488349.git.jbaron@akamai.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2bd05bd3f581116cee2d6396ea72613cf217a8c5.1460488349.git.jbaron@akamai.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 12, 2016 at 03:54:37PM -0400, Jason Baron wrote: > Khugepaged attempts to raise min_free_kbytes if its set too low. However, > on boot khugepaged sets min_free_kbytes first from subsys_initcall(), and > then the mm 'core' over-rides min_free_kbytes after from > init_per_zone_wmark_min(), via a module_init() call. > > Khugepaged used to use a late_initcall() to set min_free_kbytes (such that > it occurred after the core initialization), however this was removed when > the initialization of min_free_kbytes was integrated into the starting of > the khugepaged thread. > > The fix here is simply to invoke the core initialization using a > core_initcall() instead of module_init(), such that the previous > initialization ordering is restored. I didn't restore the late_initcall() > since start_stop_khugepaged() already sets min_free_kbytes via > set_recommended_min_free_kbytes(). > > This was noticed when we had a number of page allocation failures when > moving a workload to a kernel with this new initialization ordering. On an > 8GB system this restores min_free_kbytes back to 67584 from 11365 when > CONFIG_TRANSPARENT_HUGEPAGE=y is set and either > CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y or > CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y. > > Fixes: 79553da293d3 ("thp: cleanup khugepaged startup") > Signed-off-by: Jason Baron Looks good to me: Acked-by: Kirill A. Shutemov -- Kirill A. Shutemov