Received: by 10.192.165.156 with SMTP id m28csp209782imm; Sun, 15 Apr 2018 21:15:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+jVh78i3uZiHlHVkMmIjpBWbLfVMU1odGF+ympPt7GKfi2f3DKaI3ipYynT8cOEcFdAwFv X-Received: by 10.99.123.76 with SMTP id k12mr11393393pgn.86.1523852143565; Sun, 15 Apr 2018 21:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523852143; cv=none; d=google.com; s=arc-20160816; b=gs2NiKO0DgRhQKvBSlanAY/BK/bW5xcMezmMFPyH8a0o/M7hc1NMTi2We3x+t4r04y c+utbWtaCzX1TbJDmSALfGaG81IU138VGQw/KAohIX+K0lOeLw8Q809K6cm+k/ughXxi zZs23uYO+JRTVpHyxjtO/rMHX+F9ABfr2Kd1HFjsGhWHWJvPEbUCiNcXnHT6oBtZCsHO FM1/B8nOj2v1j4L3MmSNovfrJKC5FtoONgQB8y4ur5RqlzkhyQTPTBURHPcvki0qntaS QSxRRseSGz52Sxa+qRiaoIkStFFCVfKPaNpyLkDigVfxKXxEXQ2t8QN5oGcA6ivieQxV XyHQ== 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=NYU+lYIf9nzx/tBiUx/4g9vgdMJHOg13IDOlZ/WHrkY=; b=NWERWZa90VgjRLahfMROXeZ1ROCjIXJTO6NjqzWm9sfePy80h5caftxbXhuRPeTxuq vvAUdETjbUCSVxoLjVmecBORhPAViEYCoWjQlfdNIFdX3dJev3NC1YiSUUmDt5AfwtQl fH8DlBTOWfm6vjM6VJa1ZcWUj1gWWuS9F8PSW+nAa9aGZfxwu6HnlJEJ4ipb7ybFwVCR UvlZ0tHmc+YvdlCUKpeNrhtjJIk/9O0vD9g+q8HCadNtgJj6B6tcZCMzcNbLjdNx+JLD lWxpJqF6tfdXdV74zKV9IiEGKIMOcsK0Tu0nbzMPfy7qksVBhtd59YlqgaZATUGz0pyk 5oYg== 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 g4si8821871pgr.72.2018.04.15.21.15.29; Sun, 15 Apr 2018 21:15:43 -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 S1753393AbeDPEMi (ORCPT + 99 others); Mon, 16 Apr 2018 00:12:38 -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 S1751893AbeDPEKX (ORCPT ); Mon, 16 Apr 2018 00:10:23 -0400 Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id BABA2356; Mon, 16 Apr 2018 00:10:11 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id B7CEE1F3; 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 16/25] staging: lustre: libcfs: rename cpumask_var_t variables to *_mask Date: Mon, 16 Apr 2018 00:09:58 -0400 Message-Id: <1523851807-16573-17-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 Because we handle both cpu mask as well as core identifiers it can easily be confused. To avoid this rename various cpumask_var_t to have appended *_mask to their names. Signed-off-by: Dmitry Eremin Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8703 Reviewed-on: https://review.whamcloud.com/23222 Reviewed-by: Amir Shehata Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/lnet/libcfs/linux/linux-cpu.c | 62 +++++++++++----------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c index b985b3d..ae5ff58 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c @@ -685,23 +685,23 @@ int cfs_cpt_bind(struct cfs_cpt_table *cptab, int cpt) * We always prefer to choose CPU in the same core/socket. */ static int cfs_cpt_choose_ncpus(struct cfs_cpt_table *cptab, int cpt, - cpumask_t *node, int number) + cpumask_t *node_mask, int number) { - cpumask_var_t socket; - cpumask_var_t core; + cpumask_var_t socket_mask; + cpumask_var_t core_mask; int rc = 0; int cpu; LASSERT(number > 0); - if (number >= cpumask_weight(node)) { - while (!cpumask_empty(node)) { - cpu = cpumask_first(node); + if (number >= cpumask_weight(node_mask)) { + while (!cpumask_empty(node_mask)) { + cpu = cpumask_first(node_mask); rc = cfs_cpt_set_cpu(cptab, cpt, cpu); if (!rc) return -EINVAL; - cpumask_clear_cpu(cpu, node); + cpumask_clear_cpu(cpu, node_mask); } return 0; } @@ -711,34 +711,34 @@ static int cfs_cpt_choose_ncpus(struct cfs_cpt_table *cptab, int cpt, * As we cannot initialize a cpumask_var_t, we need * to alloc both before we can risk trying to free either */ - if (!zalloc_cpumask_var(&socket, GFP_NOFS)) + if (!zalloc_cpumask_var(&socket_mask, GFP_NOFS)) rc = -ENOMEM; - if (!zalloc_cpumask_var(&core, GFP_NOFS)) + if (!zalloc_cpumask_var(&core_mask, GFP_NOFS)) rc = -ENOMEM; if (rc) goto out; - while (!cpumask_empty(node)) { - cpu = cpumask_first(node); + while (!cpumask_empty(node_mask)) { + cpu = cpumask_first(node_mask); /* get cpumask for cores in the same socket */ - cpumask_copy(socket, topology_core_cpumask(cpu)); - cpumask_and(socket, socket, node); + cpumask_copy(socket_mask, topology_core_cpumask(cpu)); + cpumask_and(socket_mask, socket_mask, node_mask); - LASSERT(!cpumask_empty(socket)); + LASSERT(!cpumask_empty(socket_mask)); - while (!cpumask_empty(socket)) { + while (!cpumask_empty(socket_mask)) { int i; /* get cpumask for hts in the same core */ - cpumask_copy(core, topology_sibling_cpumask(cpu)); - cpumask_and(core, core, node); + cpumask_copy(core_mask, topology_sibling_cpumask(cpu)); + cpumask_and(core_mask, core_mask, node_mask); - LASSERT(!cpumask_empty(core)); + LASSERT(!cpumask_empty(core_mask)); - for_each_cpu(i, core) { - cpumask_clear_cpu(i, socket); - cpumask_clear_cpu(i, node); + for_each_cpu(i, core_mask) { + cpumask_clear_cpu(i, socket_mask); + cpumask_clear_cpu(i, node_mask); rc = cfs_cpt_set_cpu(cptab, cpt, i); if (!rc) { @@ -749,13 +749,13 @@ static int cfs_cpt_choose_ncpus(struct cfs_cpt_table *cptab, int cpt, if (!--number) goto out; } - cpu = cpumask_first(socket); + cpu = cpumask_first(socket_mask); } } out: - free_cpumask_var(socket); - free_cpumask_var(core); + free_cpumask_var(socket_mask); + free_cpumask_var(core_mask); return rc; } @@ -806,7 +806,7 @@ static int cfs_cpt_num_estimate(void) static struct cfs_cpt_table *cfs_cpt_table_create(int ncpt) { struct cfs_cpt_table *cptab = NULL; - cpumask_var_t mask; + cpumask_var_t node_mask; int cpt = 0; int num; int rc; @@ -839,15 +839,15 @@ static struct cfs_cpt_table *cfs_cpt_table_create(int ncpt) goto failed; } - if (!zalloc_cpumask_var(&mask, GFP_NOFS)) { + if (!zalloc_cpumask_var(&node_mask, GFP_NOFS)) { CERROR("Failed to allocate scratch cpumask\n"); goto failed; } for_each_online_node(i) { - cpumask_copy(mask, cpumask_of_node(i)); + cpumask_copy(node_mask, cpumask_of_node(i)); - while (!cpumask_empty(mask)) { + while (!cpumask_empty(node_mask)) { struct cfs_cpu_partition *part; int n; @@ -864,7 +864,7 @@ static struct cfs_cpt_table *cfs_cpt_table_create(int ncpt) n = num - cpumask_weight(part->cpt_cpumask); LASSERT(n > 0); - rc = cfs_cpt_choose_ncpus(cptab, cpt, mask, n); + rc = cfs_cpt_choose_ncpus(cptab, cpt, node_mask, n); if (rc < 0) goto failed_mask; @@ -882,12 +882,12 @@ static struct cfs_cpt_table *cfs_cpt_table_create(int ncpt) goto failed_mask; } - free_cpumask_var(mask); + free_cpumask_var(node_mask); return cptab; failed_mask: - free_cpumask_var(mask); + free_cpumask_var(node_mask); failed: CERROR("Failed to setup CPU-partition-table with %d CPU-partitions, online HW nodes: %d, HW cpus: %d.\n", ncpt, num_online_nodes(), num_online_cpus()); -- 1.8.3.1