From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752073AbdK0LdY (ORCPT ); Mon, 27 Nov 2017 06:33:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54066 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752029AbdK0LdW (ORCPT ); Mon, 27 Nov 2017 06:33:22 -0500 Subject: Re: [RFC] a question about stack size form /proc/pid/task/child pid/limits To: Xishi Qiu , LKML , Linux MM Cc: zhong jiang References: <59AF5A20.2000101@huawei.com> From: Florian Weimer Message-ID: <780b9e4e-7405-2266-a589-17a182d7c7da@redhat.com> Date: Mon, 27 Nov 2017 12:33:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <59AF5A20.2000101@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 27 Nov 2017 11:33:22 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/06/2017 04:14 AM, Xishi Qiu wrote: > Hi, I find if I use a defined stack size to create a child thread, > then the max stack size from /proc/pid/task/child pid/limits still > shows "Max stack size 8388608", it doesn't update to > the user defined size, is it a problem? This reflects the maximum stack size of the main thread after execve. The size of the stack of the current thread is a separate matter; it can be located anywhere in the process image and much smaller or larger than the maximum size of the initial stack of the main thread. Thanks, Florian