Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3482607imu; Sun, 11 Nov 2018 16:06:57 -0800 (PST) X-Google-Smtp-Source: AJdET5cgoX6vE7LM/qRO28o+zfdo1jjg6xJqsroAFN/Rnk3LSAGnkD9ha48UFz8X3WHbK0pPljIK X-Received: by 2002:a17:902:380c:: with SMTP id l12-v6mr17852872plc.37.1541981217568; Sun, 11 Nov 2018 16:06:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981217; cv=none; d=google.com; s=arc-20160816; b=F+0mmBjvKpzi4/fmST82vICAe/OcA8W2Y7DaEcq0/S/3FOafyBTV6EOi2v3iYcZ/iH UjoMjtej6l3+CEOdgMme3vp/auXGnDytf9aYlDzcM1m4P/bKSuYb0kR1sntPMQrcyPfv U8Ny+A0QEpn7Ng4tt1Q5o5YgFP6avUBru+xL05i/2Q2ST5lJf5S36nk5HxxQJBnFNlV+ OnsC7yP8XOH+9OL52TFez3S9yySx3twnGGSShMeLgSVJEXRkPCRzg4pXNaRCF5M5VvE0 AI+ox3u6NaSziuXfB14Plgx/UPivSIcLonioSmm8CnSrsEBhkU0uyHwOkyXbNiMgS92S L2cA== 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=cbN/wjPRZ7R1z5FWTZIOMNVfRlJ16gYXC2x6E1lD9SQ=; b=zqGXplEBQ2TWlhrqX12wrPVWKm1ZT4cSy27Wmdi90VhTJ23wgHlHhp068oyZ1C8Klu LI6bUE0jaMCicdJ/UlfZhxIq3zH/wr3UNWglLHZKCkhpkO4IfYv2PI+e/UG/G6FSkb4F BOCR1grcJWPiJr4YDXL8ZjetQeS507MC6wQwUX0VZLfs1cOSsfCBKPWKKneiKKjuRQcz hV2kM8VxXZKmtc/FcuUS1gT1tx9sgdzm1t34Y9IwUu2C4lkXX65ysgdVQTIzvFATz19v /vox+axwbmO3CIq3nk0GzO54s0ppZ93n1q8lrcTlZxkDUtsyi/ZzjEmyGzFi47IiuO/p KZyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YVA8q5xt; 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 d82-v6si17043735pfe.190.2018.11.11.16.06.42; Sun, 11 Nov 2018 16:06:57 -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=YVA8q5xt; 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 S1732106AbeKLJ4r (ORCPT + 99 others); Mon, 12 Nov 2018 04:56:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:33864 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731830AbeKLIRj (ORCPT ); Mon, 12 Nov 2018 03:17:39 -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 F071E22360; Sun, 11 Nov 2018 22:27:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975264; bh=G0xTNfAdlF31xeduZTzyhb63sCFhet0szjMb0tfETDM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YVA8q5xt+ByNsGRaJd6/sajuL3UrT6KSaQtckycPYNlp6Q9G2Qy24D89CnI1kG3Gl OFXMclcCzISgTc8ngz+czgz+EeyfWXg3tdH+h088YZAcBIuMzSmTN0fsc+2L42gA7z vW/tc085iSa37hWPYHnsZ4ll05Y3VS8tY0BHHbbw= 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.19 153/361] Drivers: hv: vmbus: Use cpumask_var_t for on-stack cpu mask Date: Sun, 11 Nov 2018 14:18:20 -0800 Message-Id: <20181111221641.889573256@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@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.19-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 @@ -606,16 +606,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; @@ -653,7 +655,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; @@ -671,10 +673,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; } @@ -704,6 +706,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)