lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Sun, 22 Oct 2006 02:16:19 -0700
From:	Paul Jackson <pj@....com>
To:	dino@...ibm.com
Cc:	Simon.Derr@...l.net, linux-kernel@...r.kernel.org
Subject: Re: [RFC] Cpuset: remove useless sched domain line

> >  	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 <pj@....com> 1.925.600.0401
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ