From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163614AbcG1HUj (ORCPT ); Thu, 28 Jul 2016 03:20:39 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:32836 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754732AbcG1HUb (ORCPT ); Thu, 28 Jul 2016 03:20:31 -0400 Date: Thu, 28 Jul 2016 09:20:29 +0200 From: Michal Hocko To: Xishi Qiu Cc: Tejun Heo , Ingo Molnar , Peter Zijlstra , LKML , Linux MM , Andy Lutomirski Subject: Re: [RFC] can we use vmalloc to alloc thread stack if compaction failed Message-ID: <20160728072028.GC31860@dhcp22.suse.cz> References: <5799AF6A.2070507@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5799AF6A.2070507@huawei.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 28-07-16 15:08:26, Xishi Qiu wrote: > Usually THREAD_SIZE_ORDER is 2, it means we need to alloc 16kb continuous > physical memory during fork a new process. > > If the system's memory is very small, especially the smart phone, maybe there > is only 1G memory. So the free memory is very small and compaction is not > always success in slowpath(__alloc_pages_slowpath), then alloc thread stack > may be failed for memory fragment. Well, with the current implementation of the page allocator those requests will not fail in most cases. The oom killer would be invoked in order to free up some memory. > Can we use vmalloc to alloc thread stack if compaction failed in slowpath? Not yet but Andy is working on this. > e.g. Use vmalloc as a fallback if alloc_page/kamlloc failed. > > I think the performance may be a little regression, and any other problems? > > Thanks, > Xishi Qiu -- Michal Hocko SUSE Labs