Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1219770lqb; Thu, 18 Apr 2024 03:55:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXuv9KpMNStryWtix9fALvgdEdgESxQWnt0I4N0zI0jJKbVbZjtTmd5dufXIrucfq9BUhVMmHs6yxr1kFiUtmqGViCABmZTW4XcN6lSsg== X-Google-Smtp-Source: AGHT+IF55IzxBtTKaFytfTfUOp9qNfgG10h3eLBYfSNvSJ8utLffhAGUrFVqrdsCiioh2lyoN1Yw X-Received: by 2002:a05:6a20:3ca7:b0:1a7:5e8f:8707 with SMTP id b39-20020a056a203ca700b001a75e8f8707mr3324469pzj.26.1713437721245; Thu, 18 Apr 2024 03:55:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713437721; cv=pass; d=google.com; s=arc-20160816; b=KfMqImgMqqXh9AtVlL93X7kwT2xyMSJmViFHmWeo4h4WQrl0xGPNS7ZiU+jjQh+HoO TeJpNKW/iEXHXe4x4PT7FI9uJuFF0u8JsmvgsmEOQs1RByTDrdSt3U8k9dMBEde1Cy4k gfjrhSzWPaS3/3Vyl71LCt7xFGA9qBcThBgSduGL3dA0F48vAQhIC/AjW/HMcrW3WTMS ErCLWTxG3qo0ceVoPPnm4cd8ic9eyyDAdU9wrXqLYdcq0tVDDRA8vo7oITkiGtRINXC+ 6Up+Lnvdph4j5Xk6tUFn80Wb2Rgub+97lHI3QTmOd7bPNhHr7kOCjdp62RXF6KJ7VCAy kGew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=Tf6sW6cX3NHOSHFFnDR71OAieakNEhcTqAsgODxsibA=; fh=wqGtaQRaft9D0zUHMyMQXhnocNBrwjPdMyctoUHVbL0=; b=rDX6Cl8R+aj868g+qTYrXRrR9T8X2r6qvzUibOPW1d/52ieoy2pfGdifmeQjkviGHt GmIBbVHyEUrifb5paAMtQbcLuv8G29VDQ/O25gvgoq+of47KcFgQeSOT5DW4aPQ8KdhJ aswC3f5PpqCLXrhk51clj6W6GRGIOSUKWFGiykLC28W50YGDGFv5LsJl5ywZGmNrdhGZ DLu0I60HMHThemYXMsF0eBN5rp2W1IFOlq56flCZEmvpSINwriUTIgBl7Ab5/DIYveyc kPF1C39O9qq5UMJ9f3M8nLOMgoONDKAgiYcHc4jqHTNhxawrqBHBjlwqTjf4b1pJc/KK W3+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=shingroup.cn dmarc=pass fromdomain=shingroup.cn); spf=pass (google.com: domain of linux-kernel+bounces-149917-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149917-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=shingroup.cn Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id c4-20020a637244000000b005dc4f115f26si1144160pgn.537.2024.04.18.03.55.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 03:55:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149917-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=shingroup.cn dmarc=pass fromdomain=shingroup.cn); spf=pass (google.com: domain of linux-kernel+bounces-149917-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149917-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=shingroup.cn Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 18EAAB23AD2 for ; Thu, 18 Apr 2024 10:52:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0267F15F321; Thu, 18 Apr 2024 10:51:03 +0000 (UTC) Received: from smtpbgbr2.qq.com (smtpbgbr2.qq.com [54.207.22.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 159C915E5CE; Thu, 18 Apr 2024 10:50:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.207.22.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713437462; cv=none; b=hylpwdp5Nmazadiy0OgZjvezRkcTczcn4uaMWnF/kjSgU2QdXoeHi2tN8eSd2zE/dz2dVfWzWubYQ5JUIYj49c+2MmnxHf5xCVgWkkCA8NCzEFMTd0ALezpgolBY9i3Fsb4LycBj8iimo49r5xYOwv7pb9ZccsXke9CSjybAigI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713437462; c=relaxed/simple; bh=WBVRxLIdWKwIhWvkYX40p+kNDCgLtSNi083tiZeIF84=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fnRGtYme9OVMocRXu5P/61iDzIDzpyYMKdc05qVxdV/JEflcRHKX4Rih3BUoAIOBoq82/O9r42rEkkUzQJJhkvMS0oHzxfbebZw6XDPiBppb6nzcum53yrE+y/BFzvvbBFWyGu1htL9n06V+SGyNaouJRJF6SmSSorVzGE//ee0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shingroup.cn; spf=pass smtp.mailfrom=shingroup.cn; arc=none smtp.client-ip=54.207.22.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shingroup.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shingroup.cn X-QQ-mid: bizesmtp84t1713437427tx0r3mqm X-QQ-Originating-IP: rYl7aVSFMInFEJldnKJN23SbhrmIjafTmB1/3rjQe6U= Received: from localhost ( [112.0.147.129]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 18 Apr 2024 18:50:26 +0800 (CST) X-QQ-SSF: 01400000000000903000000A0000000 X-QQ-FEAT: W+onFc5Tw4NcMRc6QjsEEEWUHz1Dtd6wntwnHBFMv84a1FNBfmtd9FZStN0R2 pRuiVh5Lt5J9wTXP4CQmlu//N65YJM560JYcenFgkSZ05ACquRteIQyqZt1kfSIv4ssg1ay krqKI7k0wgODYU+qmaUu7fRFfxU1JW/zuD17MH8q1dH++dnPS5aeboX1rlXwNgZjUC5HgvB 0ulamcokuYP3VI82BzrOpn1EyPKaOOQSyxtZot6ZPtCw4Wzw6e3WRcCT+jMctf2mGslBL58 WaDY4mt3Zyk+QPpmu9Q3FkB/OcGubiqIxXVxwTrbOpcTeJTKYWc6EH97Xmji9YyYvo77Fdj hU/7frTVLIfTSI0j1/j8+gyNXLmO79tUHpXe+HLldtbKd0RQ4P4mPvauZ0x9Q4cS9Yb3Yjh giPuUAwE5DZckGRWffT69w== X-QQ-GoodBg: 2 X-BIZMAIL-ID: 17361949652161301272 From: Dawei Li To: davem@davemloft.net, andreas@gaisler.com Cc: sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, Dawei Li Subject: [PATCH 5/5] sparc: Remove on-stack cpumask var Date: Thu, 18 Apr 2024 18:49:49 +0800 Message-Id: <20240418104949.3606645-6-dawei.li@shingroup.cn> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240418104949.3606645-1-dawei.li@shingroup.cn> References: <20240418104949.3606645-1-dawei.li@shingroup.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:shingroup.cn:qybglogicsvrgz:qybglogicsvrgz5a-1 In general it's preferable to avoid placing cpumasks on the stack, as for large values of NR_CPUS these can consume significant amounts of stack space and make stack overflows more likely. Since the cpumask var resides in __init function, which means it's free of any concurrenct access, it can be safely marked with static to get rid of allocation on stack. while at it, mark it with __initdata to keep it from persistently consumed memory. Signed-off-by: Dawei Li --- arch/sparc/mm/init_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 1ca9054d9b97..088d9c103dcc 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c @@ -1438,7 +1438,7 @@ static int __init numa_attach_mlgroup(struct mdesc_handle *md, u64 grp, static int __init numa_parse_mdesc_group(struct mdesc_handle *md, u64 grp, int index) { - cpumask_t mask; + static cpumask_t mask __initdata; int cpu; numa_parse_mdesc_group_cpus(md, grp, &mask); -- 2.27.0