From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751258AbbCNQT3 (ORCPT ); Sat, 14 Mar 2015 12:19:29 -0400 Received: from mail-we0-f178.google.com ([74.125.82.178]:35866 "EHLO mail-we0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750767AbbCNQT1 (ORCPT ); Sat, 14 Mar 2015 12:19:27 -0400 Message-ID: <55045F84.70605@gmail.com> Date: Sat, 14 Mar 2015 18:19:16 +0200 From: Alex Dowad User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: josh@joshtriplett.org CC: linux-kernel@vger.kernel.org, Andrew Morton , Oleg Nesterov , Peter Zijlstra , "Kirill A. Shutemov" , Rik van Riel , Vladimir Davydov Subject: Re: [PATCH 01/32] do_fork(): Rename 'stack_size' argument to reflect actual use References: <1426269888-25600-1-git-send-email-alexinbeijing@gmail.com> <20150313230354.GA11522@cloud> In-Reply-To: <20150313230354.GA11522@cloud> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/03/15 01:04, josh@joshtriplett.org wrote: > On Fri, Mar 13, 2015 at 08:04:16PM +0200, Alex Dowad wrote: >> The 'stack_size' argument is never used to pass a stack size. It's only used when >> forking a kernel thread, in which case it is an argument which should be passed >> to the 'main' function which the kernel thread executes. Hence, rename it to >> 'kthread_arg'. > That's not the only use of stack_size. Take a look at the clone2 system > call (very minimally documented in the clone manpage) and the > implementation of copy_thread on ia64, which does use stack_size in the > non-kthread path. Thanks for pointing that out. I searched for all uses with cscope but missed sys_clone2 (which is implemented in asm). Won't make that mistake again... I've just been searching for history on sys_clone2() but have come up empty. "git blame" isn't helping, either... the current code dates back before the start of the git history. So out of curiosity, if you are willing to explain more: why does clone2 only exist on IA-64? Is there some characteristic of the architecture that makes being able to specify the size of the user-mode stack especially valuable, as compared to other archs? Is it used much (such as being called from the C library)? Thanks for your feedback, Alex Dowad