Received: by 10.192.165.156 with SMTP id m28csp208293imm; Sun, 15 Apr 2018 21:13:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/kjOqItYDtCpElnW5eYEUSZ6N7/PHPkvWRLxT1rApPerv8tSJjNxMSgcAYdGVTUBdJ8Wj4 X-Received: by 2002:a17:902:2a43:: with SMTP id i61-v6mr14146469plb.54.1523852003092; Sun, 15 Apr 2018 21:13:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523852003; cv=none; d=google.com; s=arc-20160816; b=hvjF/kvJGVFAuWyVHkd2LJChywSwGswuqqvj287hDdBSZh8o04OPxCxyw15pGtbKzb LD0WvAHLgWbYtOB2pJjl4b2BvR5crTLGiCXYzSRMFU77rVjqAAqYFIPaBPpbxqK3MdQ4 g77MxGHkPej89V+vas5ZNCm39gHA9/yxW+WssrSqpEUS5Gwt7rn7M1STSsv/M6BoF9Bq Xyk6mYvd+6taq4iLeSNU4bEZ06p3erz4xbf9CfmGaiA7QwBmdd8CVwr7GmRZYBoCNuka D6BkXG89/5IgubhQ5lZqGdLgIGTpYloD+GCuzY2ffJbC7fBdQpC/uuM4R/f7ZPiBm6do Ommw== 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=PMKTu+4e2RlH1VOSpDp0xAT+Kygq6VSAciHxl4lEKMg=; b=m6RFR03pCl2fzt7Gt6I8btDuzJtT6Ld+7CH7Uu9VpioZbsCK7aAjCmTvG/tJhj0ljL ZYuH+F8SOZs/CmIhatTzlyVNm+UiWaRMYKEp/glu4/WZG+xar6GKhOr8oeimSqJNXhmK 3yfvkGf/lDe/PmQdvu3GK7whN8KoaVZw6XMiNDP0z2RsSs1t25Uu2DwBo8OcMCEFQ/JR i3DWBB8JV2ZKJxLDBMrmZFqqaSoHTdOE/bH6U7ZELcMP48r/9GXiWYtY4g1mHL1aDiG4 mzI3DIUcND55Y0ed+wbUpdIsBgDe3jqLedSsyRf8KpmKTyGm8pbZ6aQGsPMgVHAs40o7 TaMg== 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 j63si1849178pfc.351.2018.04.15.21.13.09; Sun, 15 Apr 2018 21:13:23 -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 S1753087AbeDPEK1 (ORCPT + 99 others); Mon, 16 Apr 2018 00:10:27 -0400 Received: from smtp3.ccs.ornl.gov ([160.91.203.39]:36400 "EHLO smtp3.ccs.ornl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751114AbeDPEKW (ORCPT ); Mon, 16 Apr 2018 00:10:22 -0400 Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id ACD4734F; Mon, 16 Apr 2018 00:10:11 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id AAD5E1F3; Mon, 16 Apr 2018 00:10:11 -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 13/25] staging: lustre: libcfs: use int type for CPT identification. Date: Mon, 16 Apr 2018 00:09:55 -0400 Message-Id: <1523851807-16573-14-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1523851807-16573-1-git-send-email-jsimmons@infradead.org> References: <1523851807-16573-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 --- drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h | 2 +- .../staging/lustre/include/linux/libcfs/linux/linux-cpu.h | 6 +++--- drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c | 2 +- drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c | 14 +++++++------- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h index bda81ab..19a3489 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h @@ -108,7 +108,7 @@ static inline int cfs_cpt_table_print(struct cfs_cpt_table *cptab, char *buf, /** * 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); /** * print distance information of cpt-table */ diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h index 4ac1670..b3bc4e7 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h @@ -55,17 +55,17 @@ 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; }; /** descriptor for CPU partitions */ struct cfs_cpt_table { /* 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 */ diff --git a/drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c b/drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c index f9fcbb1..5d7d44d 100644 --- a/drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c +++ b/drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c @@ -43,7 +43,7 @@ #define CFS_CPT_DISTANCE 1 /* Arbitrary positive value */ -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; diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c index 5c9cdf4..1669669 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c @@ -88,7 +88,7 @@ void cfs_cpt_table_free(struct cfs_cpt_table *cptab) } EXPORT_SYMBOL(cfs_cpt_table_free); -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; @@ -759,13 +759,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; @@ -795,7 +795,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