Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3436548imu; Sun, 11 Nov 2018 15:04:19 -0800 (PST) X-Google-Smtp-Source: AJdET5fCl+aH+re2BRJ27Pj3l6rbTn6zDNUFXHkokuJ3mMFFfCnhUONlEE/WKbaV3XEWJBlUBUFI X-Received: by 2002:a62:1dd5:: with SMTP id d204-v6mr17489178pfd.157.1541977459601; Sun, 11 Nov 2018 15:04:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541977459; cv=none; d=google.com; s=arc-20160816; b=p5XMt9RBdMDyc18jBmdymD9K8WzeK1hkz1OfB0Adnqeeon+41ZWaa0vTDUZbqONR+y fuAM8GcDBCCAdEXVKraO9hAQrSjWPU4Xpwd9+Tu7lu7Tn2Cw6LL2KTDi/63m3uZwgyo5 ccmua0V3GnHbet7VH5At/FhVjIKtu9HKHrZ4NhT5aNGufpFjifzd8TmZpHu33ibML5Yj BlpBZf6i1AD7mepKP33NvAQc4Wu1jXEwMpLQQTkeolyF7Aj2VUSndXxjZBnNwEv0/F29 KIpssY668kMuQ70pG0Wc6WFqqhVEuj9fz+KXq2MhG3svnWAQhJDSVEGcD248F1l5ieO7 7vkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8mbdG5Zqe5myqY1T7IRXo6HGPjLCbcb9lATrff5jIBA=; b=yfBlX2Gddo2IFPvrTw//FIVglyRkdo8aWpyV66Oa3XpqXdPkrCITVueWbsHE72M9iW ykR20LHzlYuFRw1/Bh03b1xyqckGTXoIRWx8sHiCGwOOeWkZ4/4X9F0o3iM3E0M/JDc4 uTk/KCoHt5Siw8R3OUVrnVm6pLquQPYRjoZyA4nJBqk+Woi9QWPd3uvWdirjG9tpyx6X +Uq5cgVLN28DtdS5BJFXy3ufMvFhjU1/BAEikj1Ga1/7sats9NoqQcVEom0OhacJj+I4 NkPfn69Ec+E4dcfZSOhOIACmlAqPQeBWvuCQJ8lp9QyF7izChc3eCHdSZZCNh6n+XSQu JZEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OHCsSsW4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id be8-v6si15146419plb.143.2018.11.11.15.04.04; Sun, 11 Nov 2018 15:04:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OHCsSsW4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390626AbeKLIW1 (ORCPT + 99 others); Mon, 12 Nov 2018 03:22:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:51200 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390595AbeKLIW0 (ORCPT ); Mon, 12 Nov 2018 03:22:26 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 67F3C21582; Sun, 11 Nov 2018 22:32:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975549; bh=3+Uu3f6xuLGSvosqd+/k89ftVYCyE4JsEUr9HFj9Dyk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OHCsSsW4LZkYB+HMEXAk9yHwZt6QtgkgTIGp+jAiXkJzgPtsZkbShtVvdQdWVGBgr YKoD/OyaFI+aaB2oLRZLPQS0yZASyXIPHmowtPAePfvpKN3DjEN10PEW7kVt2fz0Yv 0tWarobCJ1vgVFpPR57G/jJ9E1IMnFti/DD7KOJg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dexuan Cui , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Stable@vger.kernel.org, Sasha Levin Subject: [PATCH 4.14 087/222] Drivers: hv: vmbus: Use cpumask_var_t for on-stack cpu mask Date: Sun, 11 Nov 2018 14:23:04 -0800 Message-Id: <20181111221655.782780587@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dexuan Cui [ Upstream commit 25355252607ca288f329ee033f387764883393f6 ] A cpumask structure on the stack can cause a warning with CONFIG_NR_CPUS=8192 (e.g. Ubuntu 16.04 and 18.04 use this): drivers/hv//channel_mgmt.c: In function ‘init_vp_index’: drivers/hv//channel_mgmt.c:702:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=] Nowadays it looks most distros enable CONFIG_CPUMASK_OFFSTACK=y, and hence we can work around the warning by using cpumask_var_t. Signed-off-by: Dexuan Cui Cc: K. Y. Srinivasan Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/hv/channel_mgmt.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -599,16 +599,18 @@ static void init_vp_index(struct vmbus_c bool perf_chn = vmbus_devs[dev_type].perf_device; struct vmbus_channel *primary = channel->primary_channel; int next_node; - struct cpumask available_mask; + cpumask_var_t available_mask; struct cpumask *alloced_mask; if ((vmbus_proto_version == VERSION_WS2008) || - (vmbus_proto_version == VERSION_WIN7) || (!perf_chn)) { + (vmbus_proto_version == VERSION_WIN7) || (!perf_chn) || + !alloc_cpumask_var(&available_mask, GFP_KERNEL)) { /* * Prior to win8, all channel interrupts are * delivered on cpu 0. * Also if the channel is not a performance critical * channel, bind it to cpu 0. + * In case alloc_cpumask_var() fails, bind it to cpu 0. */ channel->numa_node = 0; channel->target_cpu = 0; @@ -646,7 +648,7 @@ static void init_vp_index(struct vmbus_c cpumask_clear(alloced_mask); } - cpumask_xor(&available_mask, alloced_mask, + cpumask_xor(available_mask, alloced_mask, cpumask_of_node(primary->numa_node)); cur_cpu = -1; @@ -664,10 +666,10 @@ static void init_vp_index(struct vmbus_c } while (true) { - cur_cpu = cpumask_next(cur_cpu, &available_mask); + cur_cpu = cpumask_next(cur_cpu, available_mask); if (cur_cpu >= nr_cpu_ids) { cur_cpu = -1; - cpumask_copy(&available_mask, + cpumask_copy(available_mask, cpumask_of_node(primary->numa_node)); continue; } @@ -697,6 +699,8 @@ static void init_vp_index(struct vmbus_c channel->target_cpu = cur_cpu; channel->target_vp = hv_cpu_number_to_vp_number(cur_cpu); + + free_cpumask_var(available_mask); } static void vmbus_wait_for_unload(void)