From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163457AbcG1HNQ (ORCPT ); Thu, 28 Jul 2016 03:13:16 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:10804 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162820AbcG1HND (ORCPT ); Thu, 28 Jul 2016 03:13:03 -0400 Message-ID: <5799AF6A.2070507@huawei.com> Date: Thu, 28 Jul 2016 15:08:26 +0800 From: Xishi Qiu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Tejun Heo , Ingo Molnar , Michal Hocko , Peter Zijlstra CC: LKML , Linux MM Subject: [RFC] can we use vmalloc to alloc thread stack if compaction failed Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.25.179] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.5799B07A.00E1,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 6977df4e27f5dd4d1529470e991d1f96 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Can we use vmalloc to alloc thread stack if compaction failed in slowpath? 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