Received: by 10.223.185.116 with SMTP id b49csp907271wrg; Fri, 16 Feb 2018 09:04:20 -0800 (PST) X-Google-Smtp-Source: AH8x2259K1FtZcUzZoZq2ppEpjKyAKkZe7jRjLo3GhHsNxRv4hcJz2FZ0jnzt5YZ0ecUqkYgPutc X-Received: by 10.99.4.131 with SMTP id 125mr5538213pge.375.1518800660563; Fri, 16 Feb 2018 09:04:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518800660; cv=none; d=google.com; s=arc-20160816; b=wPh7lCPqFk7IvlrwkmjLsg9tuGir2RjxouC+Cp+2I3xhAc18HC/OuGQbrxC70WMuoQ TSdBmfUmswaWqwxLf5o9vIQMZ6oT+Kqo4sqGSkwa6MyrYOV0swhVdwS+15jEen8oooUT 9rFFPrVE0CZcXp1EFNAxKjKC0ShOV38x2F0o7EA7aSuKPY0D21muw/flvVl255eIo+ho xlElT1RnFMQk7P2KfemYS7ztm6OV1LVeonmH565DpY/nF7dvs3vkSrDQEkH/nemf0ffP nDNg2gDvoPyJ3jWjiYKKM+CCzGTVrrPGEsndK/FD8bHRbIL0Ip9MQMgYCc7ocyli3ElW ZoOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=J8dfsX95GX8sCjCzKUZ3xLlXQIJa3VZQ19Aktkc2l6g=; b=Iyv1u7qCFwOvqUGpE8Ad+Q91VPqCDOjOt96dlwonDlhg7De0vPJrPDQo9fOMz4Xevq XLo0cKtYV7PX7rkc8/QNgrYdBQTovcvj1Bjvs4tov31yVOznqsj6gDyKRhtnaMkCQuS4 Dx4SR7bYDajjEPWrh2saZQyUWxRgEVhP5R0SWiNVvTkA3T/YH5aV8RAxSQ9WsJ58NVDX 2deE9Gibzuew4KuzBMkFX3UW16YTW4pn51qwkGkpJKNYDPXeMV+A+w5ZKEMqUBtrQK8D doRuHmFJxYAKTwbdtR0I0/5n+WZTHwhOd43Z33JW+A3hlv14aAEI9ya5AKlR5/qFcPKI LnEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=qlNGlzIU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si5166556pff.338.2018.02.16.09.03.52; Fri, 16 Feb 2018 09:04:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=qlNGlzIU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1166192AbeBOUsW (ORCPT + 99 others); Thu, 15 Feb 2018 15:48:22 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:58810 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161064AbeBOUsU (ORCPT ); Thu, 15 Feb 2018 15:48:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=J8dfsX95GX8sCjCzKUZ3xLlXQIJa3VZQ19Aktkc2l6g=; b=qlNGlzIUzHTDBRMFLZjeuF4Dy nd1LEEWsA790uD2SSfEGonFgt81lNKsVZMduA8KDD8T/8FiL3I4FE3xIZfkxPIMrDJh+ShfubKQsj 3dYcb4XVvvYpzPM4ZroGlwJXIBbGCDjXp4gDozgYYeVi9KcuGM4MGM7ANGhJohnW5dUf1uvubhwIt LBqN8BrJ6V+j5mVmckZm2xmNnNW03CKsCcPItcKaVGXuhfEhEOMHLfjkSutZAzouJA+A9kiUeI0zO bClhDALLbBm5Hw/X97jhEsmrXzODVOnjwZLp4z2VbMFx8+Wy9rWtJ8u4xAQwDEvUbmqOSfNyFYqY/ RQf0/jjWA==; Received: from willy by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1emQS1-0007A7-GF; Thu, 15 Feb 2018 20:48:17 +0000 Date: Thu, 15 Feb 2018 12:48:17 -0800 From: Matthew Wilcox To: Christopher Lameter Cc: Michal Hocko , David Rientjes , Andrew Morton , Jonathan Corbet , Vlastimil Babka , Mel Gorman , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-doc@vger.kernel.org Subject: Re: [patch 1/2] mm, page_alloc: extend kernelcore and movablecore for percent Message-ID: <20180215204817.GB22948@bombadil.infradead.org> References: <20180214095911.GB28460@dhcp22.suse.cz> <20180215144525.GG7275@dhcp22.suse.cz> <20180215151129.GB12360@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 15, 2018 at 09:49:00AM -0600, Christopher Lameter wrote: > On Thu, 15 Feb 2018, Matthew Wilcox wrote: > > What if ... on startup, slab allocated a MAX_ORDER page for itself. > > It would then satisfy its own page allocation requests from this giant > > page. If we start to run low on memory in the rest of the system, slab > > can be induced to return some of it via its shrinker. If slab runs low > > on memory, it tries to allocate another MAX_ORDER page for itself. > > The inducing of releasing memory back is not there but you can run SLUB > with MAX_ORDER allocations by passing "slab_min_order=9" or so on bootup. This is subtly different from the idea that I had. If you set slub_min_order to 9, then slub will allocate 2MB pages for each slab, so allocating one object from kmalloc-32 and one object from dentry will cause 4MB to be taken from the system. What I was proposing was an intermediate page allocator where slab would request 2MB for its own uses all at once, then allocate pages from that to individual slabs, so allocating a kmalloc-32 object and a dentry object would result in 510 pages of memory still being available for any slab that needed it.