Received: by 10.223.185.116 with SMTP id b49csp2145035wrg; Thu, 15 Feb 2018 07:14:17 -0800 (PST) X-Google-Smtp-Source: AH8x2248as7R56zj+EpoKsbkp9fEM7PZwd/SFxfnO6Fqx2qZnUNf+4fCP43vy5OdaQi5SMmYaSbs X-Received: by 10.98.220.207 with SMTP id c76mr2458678pfl.159.1518707657062; Thu, 15 Feb 2018 07:14:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518707657; cv=none; d=google.com; s=arc-20160816; b=u6zpYhHp7mqT6V6SpqwCMKULEWXAgCt8XFhHALm+CFWEJzJUCva9t8QRfcn9Vwcnpq FZCTiBo/wKWNfVQhPeBdm6oC2gPvidf8v1gUqZZzoyrtYtrC9oZoZqqA9kpv8fJhlAh2 pAQNHHaKb9SAmR1eP4U5k5oZi1bL9nkMpJJrgCHJUzhwl44tYAPB1RzI+ndABzjKlJHs OQavJ96WfCk3WZHwAxyd2r+WSi20O5b1dfR423scBpeG05wBeUAlu8tA8UtdYqocMlbi 9UDNRk5td6L91M0X3l0KtGQNh19euiNkoo/xz8iagGJYlmb0TLuM4HuQ58Gf/24EyvFb Y83g== 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=QuJQabigJsdfwiDKYw8wi4X5Pjj36B0sTENHXrW1pIo=; b=N8jLrfWLNaZpz2aXETTanDmMYA9WSyd4YtXLwovMZh9M9OLz+kL2mVXhfC3Pwogdpt EU13oo2GspdZJG2fVhdA/LHOygl68LaHI7p2liOvhJ1RuM3yz5q0u5m7gvmvMHcLPU2D nHBZXRYmvu8mSVqYlSLpvZlpKUSa9qHhFdZTpPRyg/Bbj5TdljFXJ2VQmbNtNU7AB5Kp gYSNh15b/AxO6HGToZnwrkVcW/Zi+93dnlUPNwVoFoJMW2LY9KvYGk+WUh55HoQuufMH vL9koxDE6t8hpHpJ+HvGcFw6p4/QhJIz4Siz75SRM9eq182CvvvB0BCgeMNwn6F5/a5O DcDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=p3bxC0BX; 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 x14si2843816pge.2.2018.02.15.07.14.02; Thu, 15 Feb 2018 07:14:17 -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=p3bxC0BX; 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 S1033749AbeBOPLe (ORCPT + 99 others); Thu, 15 Feb 2018 10:11:34 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:45916 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033510AbeBOPLd (ORCPT ); Thu, 15 Feb 2018 10:11:33 -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=QuJQabigJsdfwiDKYw8wi4X5Pjj36B0sTENHXrW1pIo=; b=p3bxC0BXYyke06tYtPt/r/rIK EDdBmPM4+ch0U5KNluzH8xbGqdAMUlpeEpLlui/pTuqQCMvDsB6e0+3TCAbN2A2gZYbzmIkC494ig XhLUMUYHcROEKSDidYLdE6HSG5+Wtxyb6DuK8SeiQlR1zKG04kqiAmj0/cbn1CsqGwXlyAyrWyPa0 PsWNAJKbahGVKNmZUCI77x4T7wmmrwCmQDs7zTFosC0mldHlEFxGWszRfpWGevSLrR46CJWienUA5 vZPFqwuf6WlIuGeT6ntchk/0bg+0jMOIbQw8h7YfKnp6xboYtzsYxgoHmd8zzJDtdAvIpEtfgfhvt mhadp4uOg==; Received: from willy by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1emLC5-0004uF-N7; Thu, 15 Feb 2018 15:11:29 +0000 Date: Thu, 15 Feb 2018 07:11:29 -0800 From: Matthew Wilcox To: Michal Hocko Cc: Christoph Lameter , 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: <20180215151129.GB12360@bombadil.infradead.org> References: <20180214095911.GB28460@dhcp22.suse.cz> <20180215144525.GG7275@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180215144525.GG7275@dhcp22.suse.cz> 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 03:45:25PM +0100, Michal Hocko wrote: > > When the amount of kernel > > memory is well bounded for certain systems, it is better to aggressively > > reclaim from existing MIGRATE_UNMOVABLE pageblocks rather than eagerly > > fallback to others. > > > > We have additional patches that help with this fragmentation if you're > > interested, specifically kcompactd compaction of MIGRATE_UNMOVABLE > > pageblocks triggered by fallback of non-__GFP_MOVABLE allocations and > > draining of pcp lists back to the zone free area to prevent stranding. > > Yes, I think we need a proper fix. (Ab)using zone_movable for this > usecase is just sad. 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. I think even this should reduce fragmentation. We could enhance the fragmentation reduction by noticing when somebody else releases a page that was previously part of a slab MAX_ORDER page and handing that page back to slab. When slab notices that it has an entire MAX_ORDER page free (and sufficient other memory on hand that it's unlikely to need it soon), it can hand that MAX_ORDER page back to the page allocator.