From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9016C43331 for ; Sun, 29 Mar 2020 02:31:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 670192071B for ; Sun, 29 Mar 2020 02:31:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iHJaMHR9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 670192071B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 896358E0005; Sat, 28 Mar 2020 22:31:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 846098E0001; Sat, 28 Mar 2020 22:31:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 75BD18E0005; Sat, 28 Mar 2020 22:31:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0137.hostedemail.com [216.40.44.137]) by kanga.kvack.org (Postfix) with ESMTP id 5CC658E0001 for ; Sat, 28 Mar 2020 22:31:07 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 062685010 for ; Sun, 29 Mar 2020 02:31:07 +0000 (UTC) X-FDA: 76646822574.29.straw81_9b8fe8a6a619 X-HE-Tag: straw81_9b8fe8a6a619 X-Filterd-Recvd-Size: 4902 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Sun, 29 Mar 2020 02:31:06 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id g62so17330557wme.1 for ; Sat, 28 Mar 2020 19:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KGKn+Q4xDiKGmT4lj04RdnzRCL/EzsbA8clai2nCpw8=; b=iHJaMHR9ndxOg01T8AVnpg7OQ0tbXwruaQDEAkpVPEr6b53m64OnolQw86/Q6leK7W QpAPda3+UbqrDTHxAnMv15ufW42zSOy+6xChZLAoCSuDgCxDDJSo4oPlWtD1DcfUigkU zA/RSUQl2bkftsGtL1r3DM9Rml/cBMtFb8yT7r+9Hp7ksQHwBjyamodm9d4JqnJgFS8Z HfBGKj+sbmO5poMnVJ5RCWQfvHqTsV1zzMjEydhovEllHch+J4NiEZElNnZQPEfBGJTl gDdoyfkKrBFHiGDbcd445kz6clhvHmlo1FxROn70TGqnJu5Si0YZ4HVC8PZYp6HOahR/ Uc1g== 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:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=KGKn+Q4xDiKGmT4lj04RdnzRCL/EzsbA8clai2nCpw8=; b=aPNqFO1rcoAOx6GRIsXedrlu4pek6p+rFYHoVRjYPtQCl46Hw6qetBrs2IHPgjpGHm WERzrJeRm94awySK+KiiqGwXCGqnuoQLT8JjqN4MulQWyLq2TgkkPpH2r+ahR6oGeJDL eTyIqD65WTbj9narEP2FS3sGz5rOl32/0QyPrxD2xaXWgWLhWO0M0gfgAUUep2nrij4q 30faWLJ4fIe2kjfoSb2meOfCaQ4GWeAIJT8IB7YuZdgKVhu6ktLE/VoGLf92kGo+HnmY Jh8EdAv4b/S7gQ9s7AiOxuFpaVMYJNa7sE+6AsSgMhlpOWXnsf0TmTjh6tiykAa/eZeT 0zug== X-Gm-Message-State: ANhLgQ19EbqfYgjoKWbRmi7nWHI5pc3wRXg2WXe/QbKIOQ3ZKTXo8vw0 LslSJe4seuOne9yl41/18X0= X-Google-Smtp-Source: ADFU+vt/63IWxJc8HIOV7cz6SgVp+UHGwZuJDfKA1qvo0awOQLPcjuxRq0v9Aq/nmcier0m5C198Xw== X-Received: by 2002:a7b:c1da:: with SMTP id a26mr6671747wmj.91.1585449065619; Sat, 28 Mar 2020 19:31:05 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id p21sm15985630wma.0.2020.03.28.19.31.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 28 Mar 2020 19:31:04 -0700 (PDT) Date: Sun, 29 Mar 2020 02:31:04 +0000 From: Wei Yang To: John Hubbard Cc: Wei Yang , akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, jgg@ziepe.ca, david@redhat.com Subject: Re: [Patch v2 2/2] mm/page_alloc.c: define node_order with all zero Message-ID: <20200329023104.6vvklsudemh5vjh4@master> Reply-To: Wei Yang References: <20200327220121.27823-1-richard.weiyang@gmail.com> <20200327220121.27823-2-richard.weiyang@gmail.com> <4c9d8138-d379-810f-64e7-0d018ed019df@nvidia.com> <20200328002616.kjtf7dpkqbugyzi2@master> <97a6bf40-792b-6216-d35b-691027c85aad@nvidia.com> <20200328011031.olsaehwdev2gqdsn@master> <40facd34-40b2-0925-90ca-a4c53fc520e8@nvidia.com> <20200328025605.cpnbnavl27pphr7g@master> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, Mar 28, 2020 at 06:30:00PM -0700, John Hubbard wrote: >On 3/27/20 7:56 PM, Wei Yang wrote: >... >> > Further note: On my current testing .config, I've got MAX_NUMNODES set to 64, which makes >> > 256 bytes required for node_order array. 256 bytes on a 16KB stack is a little bit above >> > my mental watermark for "that's too much in today's kernels". >> > >> >> Thanks for your explanation. I would keep this in mind. >> >> Now I have one more question, hope it won't sound silly. (16KB / 256) = 64, >> this means if each function call takes 256 space on stack, the max call depth >> is 64. So how deep a kernel function call would be? or expected to be? >> > >64 is quite a bit deeper call depth than we expect to see. So 256 bytes on the stack >is not completely indefensible, but it's getting close. But worse, that's just an >example based on my .config choices. And (as Baoquan just pointed out) it can be much >bigger. (And the .config variable is an exponent, not linear, so it gets exciting fast.) >In fact, you could overrun the stack directly, with say CONFIG_NODES_SHIFT = 14. > Thanks :-) This is better not to use "big" structure on stack. >> Also because of the limit space on stack, recursive function is not welcome in >> kernel neither. Am I right? >> >Yes, that is correct. > >thanks, >-- >John Hubbard >NVIDIA -- Wei Yang Help you, Help me