Browse Source

Parse proximity config file

Serj Kalichev 10 years ago
parent
commit
2319f07c39
3 changed files with 8 additions and 8 deletions
  1. 5 4
      irq.c
  2. 2 3
      pxm.c
  3. 1 1
      pxm.h

+ 5 - 4
irq.c

@@ -134,14 +134,15 @@ static int parse_local_cpus(lub_list_t *irqs, const char *sysfs_path,
 		return -1;
 
 	/* Find proximity in config file. */
-	if (!pxm_search(pxms, sysfs_path, cpumask)) {
-char buf[NR_CPUS + 1];
+	if (!pxm_search(pxms, sysfs_path, &cpumask)) {
+/*char buf[NR_CPUS + 1];
 cpumask_scnprintf(buf, sizeof(buf), cpumask);
 printf("!!!!!! %s %s\n", sysfs_path, buf);
-/*		cpus_clear(irq->local_cpus);
+		cpus_clear(irq->local_cpus);
 		cpus_or(irq->local_cpus, irq->local_cpus, cpumask);
-*/		cpus_setall(irq->local_cpus);
+		cpus_setall(irq->local_cpus);
 		cpus_and(irq->local_cpus, irq->local_cpus, cpumask);
+*/		irq->local_cpus = cpumask;
 		return 0;
 	}
 

+ 2 - 3
pxm.c

@@ -80,7 +80,7 @@ int show_pxms(lub_list_t *pxms)
 	return 0;
 }
 
-int pxm_search(lub_list_t *pxms, const char *addr, cpumask_t cpumask)
+int pxm_search(lub_list_t *pxms, const char *addr, cpumask_t *cpumask)
 {
 	lub_list_node_t *iter;
 	int maxaddr = 0;
@@ -99,8 +99,7 @@ int pxm_search(lub_list_t *pxms, const char *addr, cpumask_t cpumask)
 		if (maxaddr >= len)
 			continue;
 		maxaddr = len;
-		cpus_clear(cpumask);
-		cpus_or(cpumask, cpumask, pxm->cpumask);
+		*cpumask = pxm->cpumask;
 	}
 
 	if (!maxaddr)

+ 1 - 1
pxm.h

@@ -11,7 +11,7 @@ typedef struct pxm_s pxm_t;
 
 int pxm_list_free(lub_list_t *pxms);
 int show_pxms(lub_list_t *pxms);
-int pxm_search(lub_list_t *pxms, const char *addr, cpumask_t cpumask);
+int pxm_search(lub_list_t *pxms, const char *addr, cpumask_t *cpumask);
 int parse_pxm_config(const char *fname, lub_list_t *pxms, lub_list_t *numas);
 
 #endif