Received: by 10.223.185.116 with SMTP id b49csp907246wrg; Fri, 16 Feb 2018 09:04:19 -0800 (PST) X-Google-Smtp-Source: AH8x227A/kkMRf3YrD7XJhN845KJszZ9BdyT8emdaNDRKtINKM2j0S1WtyKfsno/vNYh6zPS/sKv X-Received: by 2002:a17:902:4083:: with SMTP id c3-v6mr6233198pld.90.1518800659772; Fri, 16 Feb 2018 09:04:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518800659; cv=none; d=google.com; s=arc-20160816; b=zy+agZqmHg+hejKLEQ4OrrqqHB/R2pHFWE0AHzeR2qFA+nZ3Zpb5O3gaAYoyYVSoO5 5FKL+v+MnZZcBRQZmGGRSpybjwR1r2ahoq7nPQxt8BHQcL4M0wzIDqg0b7ZEpt1/NyjG qDwvbpC1nfW0oRy+l6yD2XMkQf6CG6QIKPgd/3QgBdSHVeqGVaXY9kTAXP6lDQnPgCRD N0rUlEZIaagm0dZWwjyQs1Kag0x5A57fpi1ryNx9hP+x1q/omtqSi9AShWoExbdDNCAo LD7RQlIWEpwpg/WHVQ8JZm5bIZ/56KET4k9X7T8px33215N5vZxN+uqGflCSQ+xm9kh3 uozw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=uGoBKixx94sseJIdvg22KylQx1wHzPgPK6NsMAdAV8U=; b=Kl8As095SETgVFYgzk6B8pjs/uVK4o0Ip9cssHcCJ04Rssq8Lu2prEJexUV88hCTLH OAGQ/7p5unXqRjTcejzH+n2RZ8bWCdjyB61Q7sePVdxZemmseC4DCHW1cTTYTHjxlcWj DyHWZw6T2iMGcVr1ZyOVz+UsHCUHo33jQ3mRY2efVWIjAHtthAJAqSeMCDrcIWkj37rW OxYtflhYNiyQF6pVBLes4IGdCcGPkLilZwDUjSweWSWTvGfBbTMTWfOdBZhgSrfsRpwv 6vuaUFtHMmJo1Qd79xsg/w4ZiAAmcxWFUBTGZYcxnDhiu7bswPtmoyPsRiwhbC0m+4WY m5gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=S49XBIwj; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z6si2746065pgn.46.2018.02.16.09.03.46; Fri, 16 Feb 2018 09:04:19 -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=pass header.i=@google.com header.s=20161025 header.b=S49XBIwj; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162489AbeBOUrn (ORCPT + 99 others); Thu, 15 Feb 2018 15:47:43 -0500 Received: from mail-io0-f195.google.com ([209.85.223.195]:34316 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161064AbeBOUrk (ORCPT ); Thu, 15 Feb 2018 15:47:40 -0500 Received: by mail-io0-f195.google.com with SMTP id e7so2076699ioj.1 for ; Thu, 15 Feb 2018 12:47:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=uGoBKixx94sseJIdvg22KylQx1wHzPgPK6NsMAdAV8U=; b=S49XBIwjAIPuvCbM840AVWmt4XkWjPSBUCrhl1pwe3lrewHcUwLgse77nHzMe5IqDn Rxp7orE8h+4E2pvcojdUtxDqtCnIGYU76Tjh6+RlwR5rwX8Fx+iOhCFLM4qUflEyGBib EIRwf+iLmXq4SkYLyDhAi+Yoh6QKzbctRlZDX0r0wtCbCx399IY+GmN/iwdCrz9zKqg0 Y81A5DsFRjMCUVn/m4+jzJAQmEmeJMlngEZePFyuF6mVIthqUA8cjLaDdhUamZ6iEBm2 UitJiLlFeyr/E6sY+sZRrdcDmb5scNCLqXujnTfeRSMJYfJLsI47WcnEKfxi0wt/2JIH plwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=uGoBKixx94sseJIdvg22KylQx1wHzPgPK6NsMAdAV8U=; b=HCtbwIA29BzQ6E0P/tziLiP/ZNp8DHb6PVkR1ni6JEBMbSe76MtDGomk530HykhBQX /Vri6lHysEXUtNFrR+LXTaXx+hvgyz7u08DC/uCfWEcY7x4vCVhb2GQPni32T6SFMXkr 4AsBAUCLReurm/IoukIhQElI+A8jMNYeYsSBdeHaGXC3vm0uevSJ2PUW0JHllFxtKmdh M+RKFa6GMVVyKWT9Y+o0rPAlXHH7qJtFerpVT8xjUFu088T1XdphXPQ35krdynPEKy9V JES6/OPXhR6XsAd90w/fzTkGnJ5FcYHDPIVOEUIvF4p9xUp9r/mN2o7s6XSLG0TFD78w qJQQ== X-Gm-Message-State: APf1xPCLVmOF1o4jKLYpRgxKvdGob7rehw+wLyW9cA3qD7s1jo2FpbHc bRg3wKH/mVSdzUkkUGYO3v38AQdX7CM= X-Received: by 10.107.136.80 with SMTP id k77mr5203476iod.4.1518727659946; Thu, 15 Feb 2018 12:47:39 -0800 (PST) Received: from [2620:15c:17:3:550f:5c57:9fcd:1960] ([2620:15c:17:3:550f:5c57:9fcd:1960]) by smtp.gmail.com with ESMTPSA id y23sm680567itc.15.2018.02.15.12.47.38 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Feb 2018 12:47:38 -0800 (PST) Date: Thu, 15 Feb 2018 12:47:37 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Michal Hocko cc: 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 In-Reply-To: <20180215144525.GG7275@dhcp22.suse.cz> Message-ID: References: <20180214095911.GB28460@dhcp22.suse.cz> <20180215144525.GG7275@dhcp22.suse.cz> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 15 Feb 2018, 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. > It's a hard balance to achieve between a fast page allocator with per-cpu pagesets, reducing fragmentation of unmovable memory, and the performance impact of any fix to reduce that fragmentation for users currently unaffected. Our patches to kick kcompactd for MIGRATE_UNMOVABLE pageblocks on fallback would be a waste unless you have a ton of anonymous memory you want backed by thp. If hugepages is the main motivation for reducing the fragmentation, hugetlbfs could be suggested because it would give us more runtime control and we could leave surplus pages sitting in the free pool unless reclaimed under memory pressure. That works fine in dedicated environments where we know how much hugetlb to reserve; if we give it back under memory pressure it becomes hard to reallocate the high number of hugepages we want (>95% of system memory). It's much more sloppy in shared environments where the amount of hugepages are unknown. And of course this doesn't address when a pin prevents memory from being migrated during memory compaction that is __GFP_MOVABLE at allocation but later pinned in place, which can still be a problem with ZONE_MOVABLE. It would nice to have a solution where this memory can be annotated to want to come from a non-MIGRATE_MOVABLE pageblock, if possible.