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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 0496FC433DB for ; Tue, 5 Jan 2021 07:28:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 76FFA22581 for ; Tue, 5 Jan 2021 07:28:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 76FFA22581 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B3EDD8D005A; Tue, 5 Jan 2021 02:28:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AC7DA8D0036; Tue, 5 Jan 2021 02:28:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B6B28D005A; Tue, 5 Jan 2021 02:28:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0115.hostedemail.com [216.40.44.115]) by kanga.kvack.org (Postfix) with ESMTP id 812548D0036 for ; Tue, 5 Jan 2021 02:28:54 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 361D93499 for ; Tue, 5 Jan 2021 07:28:54 +0000 (UTC) X-FDA: 77670894588.19.knot37_2d0d35c274d7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 1B9081AD1BA for ; Tue, 5 Jan 2021 07:28:54 +0000 (UTC) X-HE-Tag: knot37_2d0d35c274d7 X-Filterd-Recvd-Size: 2536 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Tue, 5 Jan 2021 07:28:53 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1609831732; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=g9zfEk0l26Pj9jVk+ZnFzhiYCe3O/uNUfabTjYpZ0pI=; b=O8XhB7eIBzACYLM2Dgoz+gj1TLmBC4qIJjlMV+xyHgp1HhKl+ArLNtjOB3rErPFOq47yZz ipKQZ6/N3rDpPkphSxOSFshWB9urjTn49ipzHnrErvl3uvWt3AC8lxAgIV+KuAQp51tCpG toTTdMnp6JqXhDyFBb1oqI7Ku0YFotg= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 35D5FAA35; Tue, 5 Jan 2021 07:28:52 +0000 (UTC) Date: Tue, 5 Jan 2021 08:28:51 +0100 From: Michal Hocko To: Andrew Morton Cc: Matthew Wilcox , Hui Su , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/page_alloc: remove the static for local variable node_order Message-ID: <20210105072851.GO13207@dhcp22.suse.cz> References: <20201230114014.GA1934427@ubuntu-A520I-AC> <20201230124233.GE28221@casper.infradead.org> <20210104152357.d56d10e0443bae984a174f18@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210104152357.d56d10e0443bae984a174f18@linux-foundation.org> 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 Mon 04-01-21 15:23:57, Andrew Morton wrote: > On Wed, 30 Dec 2020 12:42:33 +0000 Matthew Wilcox wrote: > > > On Wed, Dec 30, 2020 at 07:40:14PM +0800, Hui Su wrote: > > > local variable node_order do not need the static here. > > > > It bloody well does. It can be up to 2^10 entries on x86 (and larger > > on others) That's 4kB which you've now moved onto the stack. > > That being said, could we kmalloc the scratch area in > __build_all_zonelists()? And maybe remove that static spinlock? I am not sure we can (e.g. early init code) but even if we could, what would be an advantage. This code is called very seldom with a very shallow stacks so using the stack allocation sounds like the easiest thing to do. > (what blocks node and cpu hotplug in there??) Memory hotplug is excluded by the caller when it matters (e.g. no locking for the early init). -- Michal Hocko SUSE Labs