Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp171550imd; Wed, 31 Oct 2018 16:45:40 -0700 (PDT) X-Google-Smtp-Source: AJdET5fJ+MEK2B8rmhvLmyv5bPSgPYDnhCmRIOomMqmyb+UsgDa0JIdAhj/NRuOXLacppn3cLRPq X-Received: by 2002:a17:902:a58c:: with SMTP id az12-v6mr5302836plb.266.1541029540462; Wed, 31 Oct 2018 16:45:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029540; cv=none; d=google.com; s=arc-20160816; b=QRpiMUBra1h55rI22LnCNVFFmODnbtcDasbyyT5QAclkQ1sk4B9VEBVPtH6YUD/sKI 525rwKe6dpKupjzc+SiW2qEO2zdlnfUb/FgSYpcxxn9Poesc3IR9OUpQUWm7bCR8tpNt K5Jm/OH2xBv4z5fIdut0HAgEBR1jJBbl4C0lsytA5djHXnLwMxOJ+UXLtPASaySmUCDc aThbJGQbMBjNYKY00AU3ytJx4h0wSQE2FzqcjEAA289yHpiqb+jsOUdnhNL1gW2NS5TM O0q/H26nBjS8Ra1VPgHBPyw7VKJxqdeRMjQ0foRaXrZHBZBcSppJcdMQO20UHqB0D9nq tyag== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nd1ljOqJGa2U6dvI0MD9SY1tt6DifqcNcliOeY8EMBY=; b=frvMVVGXRT7Aa7z3SoXWQiJDfoRX8Sl0/1Vkuzmhikn3Kl/wD8/xbeU4SK89YngaW5 DZDdg97Mo+b8kHpUI267ZCzlCE2Nztb50ckV3vv/AgQ+/4UYXqxsu3iKlTg5olMr8csg tebHKnJm/QjPAohaWwjARAu2iJaLIkyGmpUxLSa4BQu4fetpbczIWWoMbKntZflIgKAa 44QGvg9z9GeUXzY5UzMCO3V0RuIVg7qyCNZzxOk+Z++fqHHDyXO1USIajQL344MrdB7y GvwMqh9dEmE7dpFo2YWp6u0kC9mZ3Atm7+H8dccfyQ5ygOou/2BdvPXLXDZH2S7euhu5 Z1Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OJL6djfw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 20-v6si28830099pfk.287.2018.10.31.16.45.25; Wed, 31 Oct 2018 16:45:40 -0700 (PDT) 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=OJL6djfw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728958AbeKAIHb (ORCPT + 99 others); Thu, 1 Nov 2018 04:07:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:55346 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728910AbeKAIHa (ORCPT ); Thu, 1 Nov 2018 04:07:30 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0CFFA20854; Wed, 31 Oct 2018 23:07:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027239; bh=++X5Yn8sFko6tNfAWfirVz2VbCNRT51+Q+00y68Xhaw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OJL6djfwna06yq3AT+3hESalb//3rV31LA3i3XLmM3gaktsty8wcSWxHoWMgl7ySl cdC8MbbxGNxi8Lt9RThsjOon700Qa0Vg0+uThrc+kxLTp8Ty9nuQgqxkAIM6A7mmjD yqBXKoNJCikrgseAnfSmAy3MA3F2iL4r53246YDg= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dexuan Cui , "K . Y . Srinivasan" , Haiyang Zhang , Stephen Hemminger , Stable@vger.kernel.org, Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL 4.19 108/146] Drivers: hv: vmbus: Use cpumask_var_t for on-stack cpu mask Date: Wed, 31 Oct 2018 19:05:03 -0400 Message-Id: <20181031230541.28822-108-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> 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 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 --- drivers/hv/channel_mgmt.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 0f0e091c117c..c4a1ebcfffb6 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -606,16 +606,18 @@ static void init_vp_index(struct vmbus_channel *channel, u16 dev_type) 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_channel *channel, u16 dev_type) 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_channel *channel, u16 dev_type) } 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_channel *channel, u16 dev_type) 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) -- 2.17.1