All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Remove wrapper functions from linux-cpu
@ 2015-11-02 17:48 Shivani Bhardwaj
  2015-11-02 17:49 ` [PATCH 1/3] Staging: lustre: linux-cpu: Remove wrapper function Shivani Bhardwaj
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shivani Bhardwaj @ 2015-11-02 17:48 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

This patchset removes unnecessary wrapper functions and replaces their calls
with the appropriate functions.
After applying this patch, code becomes cleaner.

Shivani Bhardwaj (3):
  Staging: lustre: linux-cpu: Remove wrapper function
  Staging: lustre: linux-cpu: Drop wrapper function
  Staging: lustre: linux-cpu: Remove unnecessary wrapper function

 .../staging/lustre/lustre/libcfs/linux/linux-cpu.c | 30 +++++-----------------
 1 file changed, 7 insertions(+), 23 deletions(-)

-- 
2.1.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] Staging: lustre: linux-cpu: Remove wrapper function
  2015-11-02 17:48 [PATCH 0/3] Remove wrapper functions from linux-cpu Shivani Bhardwaj
@ 2015-11-02 17:49 ` Shivani Bhardwaj
  2015-11-02 17:49 ` [PATCH 2/3] Staging: lustre: linux-cpu: Drop " Shivani Bhardwaj
  2015-11-02 17:49 ` [PATCH 3/3] Staging: lustre: linux-cpu: Remove unnecessary " Shivani Bhardwaj
  2 siblings, 0 replies; 4+ messages in thread
From: Shivani Bhardwaj @ 2015-11-02 17:49 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

Remove the function cfs_cpu_core_siblings() and replace its calls with
the function it wrapped.

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
---
 drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c
index 2097364..bd7a9ef 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c
@@ -78,12 +78,6 @@ struct cfs_cpt_data {
 
 static struct cfs_cpt_data	cpt_data;
 
-static void cfs_cpu_core_siblings(int cpu, cpumask_t *mask)
-{
-	/* return cpumask of cores in the same socket */
-	cpumask_copy(mask, topology_core_cpumask(cpu));
-}
-
 /* return cpumask of HTs in the same core */
 static void cfs_cpu_ht_siblings(int cpu, cpumask_t *mask)
 {
@@ -643,7 +637,7 @@ cfs_cpt_choose_ncpus(struct cfs_cpt_table *cptab, int cpt,
 		cpu = cpumask_first(node);
 
 		/* get cpumask for cores in the same socket */
-		cfs_cpu_core_siblings(cpu, socket);
+		cpumask_copy(socket, topology_core_cpumask(cpu));
 		cpumask_and(socket, socket, node);
 
 		LASSERT(!cpumask_empty(socket));
-- 
2.1.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] Staging: lustre: linux-cpu: Drop wrapper function
  2015-11-02 17:48 [PATCH 0/3] Remove wrapper functions from linux-cpu Shivani Bhardwaj
  2015-11-02 17:49 ` [PATCH 1/3] Staging: lustre: linux-cpu: Remove wrapper function Shivani Bhardwaj
@ 2015-11-02 17:49 ` Shivani Bhardwaj
  2015-11-02 17:49 ` [PATCH 3/3] Staging: lustre: linux-cpu: Remove unnecessary " Shivani Bhardwaj
  2 siblings, 0 replies; 4+ messages in thread
From: Shivani Bhardwaj @ 2015-11-02 17:49 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

Remove the function cfs_cpu_ht_siblings() and replace all its calls with
the function it wrapped.

Siigned-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
---
 drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c
index bd7a9ef..df6c049 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c
@@ -78,12 +78,6 @@ struct cfs_cpt_data {
 
 static struct cfs_cpt_data	cpt_data;
 
-/* return cpumask of HTs in the same core */
-static void cfs_cpu_ht_siblings(int cpu, cpumask_t *mask)
-{
-	cpumask_copy(mask, topology_sibling_cpumask(cpu));
-}
-
 static void cfs_node_to_cpumask(int node, cpumask_t *mask)
 {
 	cpumask_copy(mask, cpumask_of_node(node));
@@ -646,7 +640,7 @@ cfs_cpt_choose_ncpus(struct cfs_cpt_table *cptab, int cpt,
 			int     i;
 
 			/* get cpumask for hts in the same core */
-			cfs_cpu_ht_siblings(cpu, core);
+			cpumask_copy(core, topology_sibling_cpumask(cpu));
 			cpumask_and(core, core, node);
 
 			LASSERT(!cpumask_empty(core));
@@ -962,7 +956,8 @@ cfs_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu)
 
 		mutex_lock(&cpt_data.cpt_mutex);
 		/* if all HTs in a core are offline, it may break affinity */
-		cfs_cpu_ht_siblings(cpu, cpt_data.cpt_cpumask);
+		cpumask_copy(cpt_data.cpt_cpumask,
+			     topology_sibling_cpumask(cpu));
 		warn = cpumask_any_and(cpt_data.cpt_cpumask,
 				       cpu_online_mask) >= nr_cpu_ids;
 		mutex_unlock(&cpt_data.cpt_mutex);
-- 
2.1.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] Staging: lustre: linux-cpu: Remove unnecessary wrapper function
  2015-11-02 17:48 [PATCH 0/3] Remove wrapper functions from linux-cpu Shivani Bhardwaj
  2015-11-02 17:49 ` [PATCH 1/3] Staging: lustre: linux-cpu: Remove wrapper function Shivani Bhardwaj
  2015-11-02 17:49 ` [PATCH 2/3] Staging: lustre: linux-cpu: Drop " Shivani Bhardwaj
@ 2015-11-02 17:49 ` Shivani Bhardwaj
  2 siblings, 0 replies; 4+ messages in thread
From: Shivani Bhardwaj @ 2015-11-02 17:49 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

Remove the function cfs_node_to_cpumask() and replace all its calls with
the function it wrapped.

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
---
 drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c
index df6c049..58a4034 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c
@@ -78,11 +78,6 @@ struct cfs_cpt_data {
 
 static struct cfs_cpt_data	cpt_data;
 
-static void cfs_node_to_cpumask(int node, cpumask_t *mask)
-{
-	cpumask_copy(mask, cpumask_of_node(node));
-}
-
 void
 cfs_cpt_table_free(struct cfs_cpt_table *cptab)
 {
@@ -414,7 +409,7 @@ cfs_cpt_set_node(struct cfs_cpt_table *cptab, int cpt, int node)
 	mutex_lock(&cpt_data.cpt_mutex);
 
 	mask = cpt_data.cpt_cpumask;
-	cfs_node_to_cpumask(node, mask);
+	cpumask_copy(mask, cpumask_of_node(node));
 
 	rc = cfs_cpt_set_cpumask(cptab, cpt, mask);
 
@@ -438,7 +433,7 @@ cfs_cpt_unset_node(struct cfs_cpt_table *cptab, int cpt, int node)
 	mutex_lock(&cpt_data.cpt_mutex);
 
 	mask = cpt_data.cpt_cpumask;
-	cfs_node_to_cpumask(node, mask);
+	cpumask_copy(mask, cpumask_of_node(node));
 
 	cfs_cpt_unset_cpumask(cptab, cpt, mask);
 
@@ -757,7 +752,7 @@ cfs_cpt_table_create(int ncpt)
 	}
 
 	for_each_online_node(i) {
-		cfs_node_to_cpumask(i, mask);
+		cpumask_copy(mask, cpumask_of_node(i));
 
 		while (!cpumask_empty(mask)) {
 			struct cfs_cpu_partition *part;
-- 
2.1.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-02 17:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-02 17:48 [PATCH 0/3] Remove wrapper functions from linux-cpu Shivani Bhardwaj
2015-11-02 17:49 ` [PATCH 1/3] Staging: lustre: linux-cpu: Remove wrapper function Shivani Bhardwaj
2015-11-02 17:49 ` [PATCH 2/3] Staging: lustre: linux-cpu: Drop " Shivani Bhardwaj
2015-11-02 17:49 ` [PATCH 3/3] Staging: lustre: linux-cpu: Remove unnecessary " Shivani Bhardwaj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.