diff options
Diffstat (limited to 'kernel/cpuset.c')
| -rw-r--r-- | kernel/cpuset.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index b5cb469d2545..3cf2183b472d 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
| @@ -537,8 +537,7 @@ update_domain_attr_tree(struct sched_domain_attr *dattr, struct cpuset *c) | |||
| 537 | * element of the partition (one sched domain) to be passed to | 537 | * element of the partition (one sched domain) to be passed to |
| 538 | * partition_sched_domains(). | 538 | * partition_sched_domains(). |
| 539 | */ | 539 | */ |
| 540 | /* FIXME: see the FIXME in partition_sched_domains() */ | 540 | static int generate_sched_domains(cpumask_var_t **domains, |
| 541 | static int generate_sched_domains(struct cpumask **domains, | ||
| 542 | struct sched_domain_attr **attributes) | 541 | struct sched_domain_attr **attributes) |
| 543 | { | 542 | { |
| 544 | LIST_HEAD(q); /* queue of cpusets to be scanned */ | 543 | LIST_HEAD(q); /* queue of cpusets to be scanned */ |
| @@ -546,7 +545,7 @@ static int generate_sched_domains(struct cpumask **domains, | |||
| 546 | struct cpuset **csa; /* array of all cpuset ptrs */ | 545 | struct cpuset **csa; /* array of all cpuset ptrs */ |
| 547 | int csn; /* how many cpuset ptrs in csa so far */ | 546 | int csn; /* how many cpuset ptrs in csa so far */ |
| 548 | int i, j, k; /* indices for partition finding loops */ | 547 | int i, j, k; /* indices for partition finding loops */ |
| 549 | struct cpumask *doms; /* resulting partition; i.e. sched domains */ | 548 | cpumask_var_t *doms; /* resulting partition; i.e. sched domains */ |
| 550 | struct sched_domain_attr *dattr; /* attributes for custom domains */ | 549 | struct sched_domain_attr *dattr; /* attributes for custom domains */ |
| 551 | int ndoms = 0; /* number of sched domains in result */ | 550 | int ndoms = 0; /* number of sched domains in result */ |
| 552 | int nslot; /* next empty doms[] struct cpumask slot */ | 551 | int nslot; /* next empty doms[] struct cpumask slot */ |
| @@ -557,7 +556,8 @@ static int generate_sched_domains(struct cpumask **domains, | |||
| 557 | 556 | ||
| 558 | /* Special case for the 99% of systems with one, full, sched domain */ | 557 | /* Special case for the 99% of systems with one, full, sched domain */ |
| 559 | if (is_sched_load_balance(&top_cpuset)) { | 558 | if (is_sched_load_balance(&top_cpuset)) { |
| 560 | doms = kmalloc(cpumask_size(), GFP_KERNEL); | 559 | ndoms = 1; |
| 560 | doms = alloc_sched_domains(ndoms); | ||
| 561 | if (!doms) | 561 | if (!doms) |
| 562 | goto done; | 562 | goto done; |
| 563 | 563 | ||
| @@ -566,9 +566,8 @@ static int generate_sched_domains(struct cpumask **domains, | |||
| 566 | *dattr = SD_ATTR_INIT; | 566 | *dattr = SD_ATTR_INIT; |
| 567 | update_domain_attr_tree(dattr, &top_cpuset); | 567 | update_domain_attr_tree(dattr, &top_cpuset); |
| 568 | } | 568 | } |
| 569 | cpumask_copy(doms, top_cpuset.cpus_allowed); | 569 | cpumask_copy(doms[0], top_cpuset.cpus_allowed); |
| 570 | 570 | ||
| 571 | ndoms = 1; | ||
| 572 | goto done; | 571 | goto done; |
| 573 | } | 572 | } |
| 574 | 573 | ||
| @@ -636,7 +635,7 @@ restart: | |||
| 636 | * Now we know how many domains to create. | 635 | * Now we know how many domains to create. |
| 637 | * Convert <csn, csa> to <ndoms, doms> and populate cpu masks. | 636 | * Convert <csn, csa> to <ndoms, doms> and populate cpu masks. |
| 638 | */ | 637 | */ |
| 639 | doms = kmalloc(ndoms * cpumask_size(), GFP_KERNEL); | 638 | doms = alloc_sched_domains(ndoms); |
| 640 | if (!doms) | 639 | if (!doms) |
| 641 | goto done; | 640 | goto done; |
| 642 | 641 | ||
| @@ -656,7 +655,7 @@ restart: | |||
| 656 | continue; | 655 | continue; |
| 657 | } | 656 | } |
| 658 | 657 | ||
| 659 | dp = doms + nslot; | 658 | dp = doms[nslot]; |
| 660 | 659 | ||
| 661 | if (nslot == ndoms) { | 660 | if (nslot == ndoms) { |
| 662 | static int warnings = 10; | 661 | static int warnings = 10; |
| @@ -718,7 +717,7 @@ done: | |||
| 718 | static void do_rebuild_sched_domains(struct work_struct *unused) | 717 | static void do_rebuild_sched_domains(struct work_struct *unused) |
| 719 | { | 718 | { |
| 720 | struct sched_domain_attr *attr; | 719 | struct sched_domain_attr *attr; |
| 721 | struct cpumask *doms; | 720 | cpumask_var_t *doms; |
| 722 | int ndoms; | 721 | int ndoms; |
| 723 | 722 | ||
| 724 | get_online_cpus(); | 723 | get_online_cpus(); |
| @@ -2052,7 +2051,7 @@ static int cpuset_track_online_cpus(struct notifier_block *unused_nb, | |||
| 2052 | unsigned long phase, void *unused_cpu) | 2051 | unsigned long phase, void *unused_cpu) |
| 2053 | { | 2052 | { |
| 2054 | struct sched_domain_attr *attr; | 2053 | struct sched_domain_attr *attr; |
| 2055 | struct cpumask *doms; | 2054 | cpumask_var_t *doms; |
| 2056 | int ndoms; | 2055 | int ndoms; |
| 2057 | 2056 | ||
| 2058 | switch (phase) { | 2057 | switch (phase) { |
| @@ -2537,15 +2536,9 @@ const struct file_operations proc_cpuset_operations = { | |||
| 2537 | }; | 2536 | }; |
| 2538 | #endif /* CONFIG_PROC_PID_CPUSET */ | 2537 | #endif /* CONFIG_PROC_PID_CPUSET */ |
| 2539 | 2538 | ||
| 2540 | /* Display task cpus_allowed, mems_allowed in /proc/<pid>/status file. */ | 2539 | /* Display task mems_allowed in /proc/<pid>/status file. */ |
| 2541 | void cpuset_task_status_allowed(struct seq_file *m, struct task_struct *task) | 2540 | void cpuset_task_status_allowed(struct seq_file *m, struct task_struct *task) |
| 2542 | { | 2541 | { |
| 2543 | seq_printf(m, "Cpus_allowed:\t"); | ||
| 2544 | seq_cpumask(m, &task->cpus_allowed); | ||
| 2545 | seq_printf(m, "\n"); | ||
| 2546 | seq_printf(m, "Cpus_allowed_list:\t"); | ||
| 2547 | seq_cpumask_list(m, &task->cpus_allowed); | ||
| 2548 | seq_printf(m, "\n"); | ||
| 2549 | seq_printf(m, "Mems_allowed:\t"); | 2542 | seq_printf(m, "Mems_allowed:\t"); |
| 2550 | seq_nodemask(m, &task->mems_allowed); | 2543 | seq_nodemask(m, &task->mems_allowed); |
| 2551 | seq_printf(m, "\n"); | 2544 | seq_printf(m, "\n"); |
