Re: [RFC] Cpuset: remove useless sched domain line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> >  	if (!is_cpu_exclusive(cur)) {
> > -		cpus_or(pspan, pspan, cur->cpus_allowed);
> >  		if (cpus_equal(pspan, cur->cpus_allowed))
> >  			return;
> >  		cspan = CPU_MASK_NONE;
> 
> 
> I dont think this is a valid optimization. What we are checking here
> is if a previously exclusive cpuset has been changed to a non-exclusive one
> (echo 0 > cpu_exclusive), we then OR all the cpus in the current cpuset
> to the parent cpuset. We then rebuild a sched domain to include all of the cpus
> in the current cpuset and those in the parent not part of exclusive children


Not that it matters, but I don't think you need to OR in the current cpuset
cpus to the parents cpus (pspan) here, because they are already in pspan.

Look at the surrounding code:

        pspan = par->cpus_allowed;
        list_for_each_entry(c, &par->children, sibling) {
                if (is_cpu_exclusive(c))
                        cpus_andnot(pspan, pspan, c->cpus_allowed);
        }
        if (!is_cpu_exclusive(cur)) {
		cpus_or(pspan, pspan, cur->cpus_allowed);
                if (cpus_equal(pspan, cur->cpus_allowed))
                        return;
                cspan = CPU_MASK_NONE;

'pspan' starts out with all the parents cpus, which must be a superset
of currents cpus (cur->cpus_allowed.)

Then we subtract (cpus_andnot) from pspan the cpus in the cpu_exclusive
siblings of current.  Since current is not cpu_exclusive, and since the
cpus of its cpu_exclusive sibling cpusets cannot overlap with currents
cpus, we could not have subtracted any current cpu from pspan.

So pspan is still a superset of currents cpus.

So OR'ing in currents cpus to pspan is a no-op.

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <[email protected]> 1.925.600.0401
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux