Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3447692imm; Tue, 29 May 2018 07:26:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZplLVvEfdsQXh0L3WUNJVJKa7qFF5qKw5bKipxifYnGbX54ZO0WRFG7JCWpTrwrkjWjsKuZ X-Received: by 2002:a17:902:a60e:: with SMTP id u14-v6mr17671404plq.233.1527603960495; Tue, 29 May 2018 07:26:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527603960; cv=none; d=google.com; s=arc-20160816; b=S37YKHEXIZhB0AhGTSqNZlQbsN0Hpw1cW6+URQRBHFyRGwPOI6LclJD8Lr/pC17QJp ScZvVR4xP0/VAw1AVoeZc/xrU5rqDAKwlDGJORbD20O4zYvD/RfdJhKgsSEmQwT56GeQ ePXI74jsgRym1OYYW3ApLPSB97Up78NnPPuY9dRzyDsC/ivQC8nTZY62mAeGIIyN9j02 PaN2WZ3fCqfw3eAgeyPDzvln7O0c46mZp49QU0SgwqEwOMW9O4TeFjbYrAbolZpUOlvb e8MbB9SihnxLFbSUrXpV8WyVyQQhDAY7G7KVhkYxL/ok8FrgOjSxLaaiuWDJZV/QyBbX BLhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=GYIEGsJa1YyB/LKTqPMKBoB9YW4gIwKSSnRlYxmkhpk=; b=1Dd3jlyUiivrq9QWPbSjUvN90dMLx0ZQgonRVE3Xym0bcM+KCYeiaw168Bckv7rdVV 1fdS6yeoCHh9BWZrIrxW1PmCw16Ff0+7ld2x6Q50IlE7RTI1LUJtBm/g7yh3ogfZSAoM +VlpTMvm2zaZ/10Q8m+UwleQ4TnDr+OZjIt/hKEa2FNR2PmPe17eLMKGXGG5qBtDB1qo Z6ZmVrGUtz7sz3l3iwsvehQ7ddtctDWl7tryviv+xjZoK+lcemRrcnXJNrexls7gTx6v x9j1R4qAMzVfy1ZTD2uD2tU2M0T9nk4WVFnJRgL78Djdfi/8uXpJLF1ieMiEnvgj0qc4 /qKw== ARC-Authentication-Results: i=1; mx.google.com; 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 r63-v6si31780736plb.366.2018.05.29.07.25.46; Tue, 29 May 2018 07:26:00 -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; 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 S935243AbeE2OWd (ORCPT + 99 others); Tue, 29 May 2018 10:22:33 -0400 Received: from smtp4.ccs.ornl.gov ([160.91.203.40]:38208 "EHLO smtp4.ccs.ornl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935220AbeE2OWa (ORCPT ); Tue, 29 May 2018 10:22:30 -0400 Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp4.ccs.ornl.gov (Postfix) with ESMTP id E804B10052CD; Tue, 29 May 2018 10:22:06 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id E5D582C1; Tue, 29 May 2018 10:22:06 -0400 (EDT) From: James Simmons To: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger , Oleg Drokin , NeilBrown Cc: Linux Kernel Mailing List , Lustre Development List , Dmitry Eremin , James Simmons Subject: [PATCH v2 14/25] staging: lustre: libcfs: use int type for CPT identification. Date: Tue, 29 May 2018 10:21:54 -0400 Message-Id: <1527603725-30560-15-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1527603725-30560-1-git-send-email-jsimmons@infradead.org> References: <1527603725-30560-1-git-send-email-jsimmons@infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dmitry Eremin Use int type for CPT identification to match the linux kernel CPU identification. Signed-off-by: Dmitry Eremin Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8703 Reviewed-on: https://review.whamcloud.com/23304 Reviewed-by: James Simmons Reviewed-by: Doug Oucharek Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- Changelog: v1) Initial patch v2) Rebased patch to handle recent libcfs changes drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h | 8 ++++---- drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h index 2c97adf..9f4ba9d 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h @@ -90,7 +90,7 @@ struct cfs_cpu_partition { /* NUMA distance between CPTs */ unsigned int *cpt_distance; /* spread rotor for NUMA allocator */ - unsigned int cpt_spread_rotor; + int cpt_spread_rotor; }; #endif /* CONFIG_SMP */ @@ -98,11 +98,11 @@ struct cfs_cpu_partition { struct cfs_cpt_table { #ifdef CONFIG_SMP /* spread rotor for NUMA allocator */ - unsigned int ctb_spread_rotor; + int ctb_spread_rotor; /* maximum NUMA distance between all nodes in table */ unsigned int ctb_distance; /* # of CPU partitions */ - unsigned int ctb_nparts; + int ctb_nparts; /* partitions tables */ struct cfs_cpu_partition *ctb_parts; /* shadow HW CPU to CPU partition ID */ @@ -128,7 +128,7 @@ struct cfs_cpt_table { /** * create a cfs_cpt_table with \a ncpt number of partitions */ -struct cfs_cpt_table *cfs_cpt_table_alloc(unsigned int ncpt); +struct cfs_cpt_table *cfs_cpt_table_alloc(int ncpt); /** * return cpumask of CPU partition \a cpt */ diff --git a/drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c b/drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c index fab6675..14d5791 100644 --- a/drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c +++ b/drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c @@ -69,7 +69,7 @@ module_param(cpu_pattern, charp, 0444); MODULE_PARM_DESC(cpu_pattern, "CPU partitions pattern"); -struct cfs_cpt_table *cfs_cpt_table_alloc(unsigned int ncpt) +struct cfs_cpt_table *cfs_cpt_table_alloc(int ncpt) { struct cfs_cpt_table *cptab; int i; @@ -784,13 +784,13 @@ static int cfs_cpt_choose_ncpus(struct cfs_cpt_table *cptab, int cpt, return rc; } -#define CPT_WEIGHT_MIN 4u +#define CPT_WEIGHT_MIN 4 -static unsigned int cfs_cpt_num_estimate(void) +static int cfs_cpt_num_estimate(void) { - unsigned int nnode = num_online_nodes(); - unsigned int ncpu = num_online_cpus(); - unsigned int ncpt; + int nnode = num_online_nodes(); + int ncpu = num_online_cpus(); + int ncpt; if (ncpu <= CPT_WEIGHT_MIN) { ncpt = 1; @@ -820,7 +820,7 @@ static unsigned int cfs_cpt_num_estimate(void) /* config many CPU partitions on 32-bit system could consume * too much memory */ - ncpt = min(2U, ncpt); + ncpt = min(2, ncpt); #endif while (ncpu % ncpt) ncpt--; /* worst case is 1 */ -- 1.8.3.1