Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp633058ybt; Wed, 17 Jun 2020 09:52:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFcBRLtNUkyjlAVD1CsKkltYbd9Wu+1AvJx8MPDVHvgSMbOEJ2C/+fVA6i/PETp+svtJ+v X-Received: by 2002:a50:d302:: with SMTP id g2mr101504edh.312.1592412756674; Wed, 17 Jun 2020 09:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592412756; cv=none; d=google.com; s=arc-20160816; b=YceCnPaMnt2EYFJHmdiNsZWgooiEzP2NH4wNudC7GAIAI+KhYkDcPvm4YOGykyMb/K L67ejgR1ZG0WH5SLLDYyYURZIzoVHeEGJm1x/4YtIdqdmEzv65zGzQAjMZSAbNfovitd P4Dp0quXBlFebQcJO9EmxiuC1yXpYby0b4MHgecfV2X+qzi6wPbFZedMaP+e3iVKkTw6 Or/05IfuXJTy2Eom5rtfZH992lqf9XQdc5Hq9g6OOwjZwL2PlONrfLTQzT+2Gb/XLfTy P/lXXQ+qwTUH4aR0UVmL8slr92SxBJD8bWEto1fuK4xGBW3bo96ovp7ejMCt+iozfJvS S3nw== 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=Vhjo2DvNhb4fwe0D/B0vMGUmFy8Bj8H1qzxao7sOgQg=; b=Ife9ooRpB0ckvL4nyM8SToRRk3jXDQTxBQ7ixx+Gew10BYKkHlcqBJcwy8JsK+6t2P briAgKxlueeQMUJwYIC2bb/t+Eu4SUv3I06ZUcrpGQ1TVo+V4DK52MPs9XtKBfno7+JD Y/aR/nAypN/p9vTzgYNATUcUSAvzF/38usltMtSFqzDMhSFZK0xT/5YlRrzORpFMluCA FnrX3LIw+3UoK9t3BNIti/a0KAWI1g99o4p1kszptanHrjfAwD5fiKAUwAmMOvfyl7uO iuU4JnGMrfUp+9WdUQI7p9yQf1BvBr+JyDmin8tMsOxeNPaD/YSm0xR5MAFzv4vV4hwU mgyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LpHwWg2H; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sb15si231106ejb.478.2020.06.17.09.52.14; Wed, 17 Jun 2020 09:52:36 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=LpHwWg2H; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726984AbgFQQr5 (ORCPT + 99 others); Wed, 17 Jun 2020 12:47:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726341AbgFQQrx (ORCPT ); Wed, 17 Jun 2020 12:47:53 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7722C06174E; Wed, 17 Jun 2020 09:47:52 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id b82so2531061wmb.1; Wed, 17 Jun 2020 09:47:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Vhjo2DvNhb4fwe0D/B0vMGUmFy8Bj8H1qzxao7sOgQg=; b=LpHwWg2HL33aOreTmN62CTkC4W70t0pqHf/MyQO04fb/9lSCHoH4GM5TFpWw9h2geA pxo0iZ8G9vqOQegSj9jEKDrWlIMEo/uutEM7twKFOdbQyyZVd7kO5DIeVCr0Kj/JcX1j eKk7bu8rhQvxd5y+Ll5dVumdueIMTbaGP2n6hRz7+2DqDs1I3kCdPIj3qCbvSg0CmeL1 VQVLzsnHowHVYGnOfSTMedHa4u8FsoUeTU2OK7fandNPKe/UrLgKqbaP5UF02PteTZ9K rHtr4WDRfbGoUhOaNHf4/JNVjQRUA2KCEQ4boKbbk/a9RC3u9NmtrlD4VKV91yPxq+Uz K54Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Vhjo2DvNhb4fwe0D/B0vMGUmFy8Bj8H1qzxao7sOgQg=; b=YncII8h6YZ/oHB+EYhfuksk1V0BEVY7coFlD2br8UxxGSM7lg8J5PJu+eI+czW3cvD NlUpjmFof3fcWjGb0NFKfL2FIUzcFSG7NQr1AXCwaBZhrhxP8GypqBwUmT3h38MQF18k yixH26/E4xvk1MQYDzjrW3+SABELEz3RSfK2S0rShS+OL94Y2/pkey7DYS9NWEgp0Zo7 3DYBx1BW6bWS8/8dCwmFKlQxSEUYQ3W0vPt5gVhuEyYN3UmQ58xZs387QbTigMOuWDpn P58E3KLEyn2tAqKo9VIc4UUoOhcg8JhoKZs0SerXA6PygSLfTGRKyk0A+MOJPSuaIGR7 dHzw== X-Gm-Message-State: AOAM530cnCN3RClkLxFZNmhOrbGXNbLKcZQoJoOBN7qdnNk4QfFYHBnA ZJaTi9waJVz3ixhoyvHBJZs= X-Received: by 2002:a1c:7215:: with SMTP id n21mr9351199wmc.10.1592412471280; Wed, 17 Jun 2020 09:47:51 -0700 (PDT) Received: from localhost.localdomain (ip-213-220-210-175.net.upcbroadband.cz. [213.220.210.175]) by smtp.gmail.com with ESMTPSA id g3sm199165wrb.46.2020.06.17.09.47.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 09:47:50 -0700 (PDT) From: "Andrea Parri (Microsoft)" To: "K . Y . Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Michael Kelley Cc: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, "Andrea Parri (Microsoft)" Subject: [PATCH 2/8] Drivers: hv: vmbus: Remove the numa_node field from the vmbus_channel struct Date: Wed, 17 Jun 2020 18:46:36 +0200 Message-Id: <20200617164642.37393-3-parri.andrea@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200617164642.37393-1-parri.andrea@gmail.com> References: <20200617164642.37393-1-parri.andrea@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The field is read only in numa_node_show() and it is already stored twice (after a call to cpu_to_node()) in target_cpu_store() and init_vp_index(); there is no need to "cache" its value in the channel data structure. Signed-off-by: Andrea Parri (Microsoft) --- drivers/hv/channel_mgmt.c | 2 -- drivers/hv/vmbus_drv.c | 3 +-- include/linux/hyperv.h | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 278e392218079..36dd8b6c544a4 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -702,7 +702,6 @@ static void init_vp_index(struct vmbus_channel *channel) * In case alloc_cpumask_var() fails, bind it to * VMBUS_CONNECT_CPU. */ - channel->numa_node = cpu_to_node(VMBUS_CONNECT_CPU); channel->target_cpu = VMBUS_CONNECT_CPU; if (perf_chn) hv_set_alloced_cpu(VMBUS_CONNECT_CPU); @@ -719,7 +718,6 @@ static void init_vp_index(struct vmbus_channel *channel) continue; break; } - channel->numa_node = numa_node; alloced_mask = &hv_context.hv_numa_map[numa_node]; if (cpumask_weight(alloced_mask) == diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 7e244727f5686..c3205f40d1415 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -226,7 +226,7 @@ static ssize_t numa_node_show(struct device *dev, if (!hv_dev->channel) return -ENODEV; - return sprintf(buf, "%d\n", hv_dev->channel->numa_node); + return sprintf(buf, "%d\n", cpu_to_node(hv_dev->channel->target_cpu)); } static DEVICE_ATTR_RO(numa_node); #endif @@ -1764,7 +1764,6 @@ static ssize_t target_cpu_store(struct vmbus_channel *channel, */ channel->target_cpu = target_cpu; - channel->numa_node = cpu_to_node(target_cpu); /* See init_vp_index(). */ if (hv_is_perf_channel(channel)) diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index 738efdb194b09..690394b79d727 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h @@ -812,7 +812,6 @@ struct vmbus_channel { * the earlier behavior. */ u32 target_cpu; - int numa_node; /* * Support for sub-channels. For high performance devices, * it will be useful to have multiple sub-channels to support -- 2.25.1