/* Called within get_online_cpus(). Needs to call cgroup_lock() before calling generate_sched_domains().  */
static int cpuset_track_online_cpus(struct notifier_block *unused_nb, unsigned long phase, void *unused_cpu)
/* Called within get_online_cpus(). Needs to call cgroup_lock() before calling generate_sched_domains().  */
static int cpuset_track_online_cpus(struct notifier_block *unused_nb, unsigned long phase, void *unused_cpu)
{
	struct sched_domain_attr *attr;
	cpumask_var_t *doms;
	int ndoms;
	switch (phase) {
	case CPU_ONLINE:
	case CPU_ONLINE_FROZEN:
	case CPU_DOWN_PREPARE:
	case CPU_DOWN_PREPARE_FROZEN:
	case CPU_DOWN_FAILED:
	case CPU_DOWN_FAILED_FROZEN:
		break;
	default:
		return NOTIFY_DONE;
	}
	cgroup_lock();
	mutex_lock(&callback_mutex);
	cpumask_copy(top_cpuset.cpus_allowed, cpu_active_mask);
	mutex_unlock(&callback_mutex);
	scan_for_empty_cpusets(&top_cpuset);
	ndoms = generate_sched_domains(&doms, &attr);
	cgroup_unlock();
	partition_sched_domains(ndoms, doms, attr);
	return NOTIFY_OK;
}