Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14388499pxu; Mon, 4 Jan 2021 23:31:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzoG5KYUBC+X1xMAjs9WNxCUuw8r8QhR3CeVvNnp+4OfkFYPAo5PjRJivMoL8+zuE9ze3A7 X-Received: by 2002:a05:6402:3074:: with SMTP id bs20mr74258751edb.365.1609831868747; Mon, 04 Jan 2021 23:31:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609831868; cv=none; d=google.com; s=arc-20160816; b=pEJf2e5zZ0eRWimVjJU/O+Ketf6yxV6qQTQ8jx23Xe0t6j1Ykg7zxPqPceADUyDUzf 5XoYq71H+O5vPQbKgQ+IddNTpoSC/+CoUshXeWk/IYzu06I7tlT2kpE+dJDLsi/I6RNQ 0TA9PJwFrBo2hqaCk+1X6GeurF8WJELoCL+tdd7UJePKUdLUFzTpZ/M4IbJ89RZGID5t 9FdjuXUIEbgTafHRwyeBX0y8pJJ0q8yX0qcYNFi9AdR0Pt/1F+AxncO7JWwwl+T3mRk3 CU8hlz+tq9cT5wkR24daOoITSpzvpMHLyBdZ8Lm89GWq2D+OsyDj2WUODlYTpR+TONiF wUQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=g9zfEk0l26Pj9jVk+ZnFzhiYCe3O/uNUfabTjYpZ0pI=; b=tntRO7HvpsFZgBd9f/mQ4R7Byky/q0zQZ0OqgwXZx1vgvvgzdip0CRGFpQkNQ5ONzp aNtAaCqcYFFfmLVZzEbaLSp01jmH2C7G5d1CnH25RSDgh9I5cG3mxOg1IyXY/A/9iA5N 9GuVVEoXpD/AdIqAogJJ/iwUOXYaZ8uCAjibSYJjhxuhO6Mq0fZAJ9kb5jtY/KB+l9ub 5jCrCerXnTow8DsjBF61zQ6CZG92m891RrrqG096i4MCcIANBPDg4bsaIgigEEXc9wuM yz8OfzFE3Ut4Yuybo+8WMdOS9LsCzoZMK7rW8uFrNEjTY7jnj92XPR7l1vRWWWy7SgfK zwrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=O8XhB7eI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d5si28418301ejk.389.2021.01.04.23.30.45; Mon, 04 Jan 2021 23:31:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=O8XhB7eI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725843AbhAEH3j (ORCPT + 99 others); Tue, 5 Jan 2021 02:29:39 -0500 Received: from mx2.suse.de ([195.135.220.15]:60630 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725710AbhAEH3i (ORCPT ); Tue, 5 Jan 2021 02:29:38 -0500 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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