« Return to Thread: 3.9.5: much improved threading

Re: 3.9.5: much improved threading

by j murphy :: Rate this Message:

Reply to Author | View in Thread


--- On Fri, 12/12/08, Clint Whaley <whaley@...> wrote:

> From: Clint Whaley <whaley@...>
> Subject: [atlas-devel] 3.9.5: much improved threading
> To: math-atlas-devel@...
> Date: Friday, December 12, 2008, 1:21 AM
> Guys,
>
> I have finally gotten 3.9.5 out the door.  It's been
> several months, but I've
> actually been busy the whole time.  The big news is that I
> finally finished
> a complete rewrite of ATLAS's threading system.  You
> will see only a small
> difference for 2-processor machines, but on 4 and 8
> processor machines,
> the new threaded code can more than double your performance
> (assuming you
> aren't on a loser OS like MacOS X or FreeBSD, that
> don't posses processor
> affinity).:

Clint:

I'm glad to see that you have a new version of atlas, and I'm looking
forward to trying it out.  Thank you for your efforts.

Regarding your comments about processor affinity in FreeBSD, from:

http://svn.freebsd.org/viewvc/base?view=revision&revision=176730

"Author: jeff
Date: Sun Mar 2 07:39:22 2008 UTC (9 months, 1 week ago)
Log Message: Add cpuset, an api for thread to cpu binding and cpu resource grouping
and assignment.
 - Add a reference to a struct cpuset in each thread that is inherited from
   the thread that created it.
 - Release the reference when the thread is destroyed.
 - Add prototypes for syscalls and macros for manipulating cpusets in
   sys/cpuset.h
 - Add syscalls to create, get, and set new numbered cpusets:
   cpuset(), cpuset_{get,set}id()
 - Add syscalls for getting and setting affinity masks for cpusets or
   individual threads: cpuid_{get,set}affinity()
 - Add types for the 'level' and 'which' parameters for the cpuset.  This
   will permit expansion of the api to cover cpu masks for other objects
   identifiable with an id_t integer.  For example, IRQs and Jails may be
   coming soon.
 - The root set 0 contains all valid cpus.  All thread initially belong to
   cpuset 1.  This permits migrating all threads off of certain cpus to
   reserve them for special applications.

Sponsored by:   Nokia
Discussed with: arch, rwatson, brooks, davidxu, deischen
Reviewed by:    antoine"

and from:

http://svn.freebsd.org/viewvc/base?view=revision&revision=180808

"Author: jhb
Date: Fri Jul 25 17:46:01 2008 UTC (4 months, 2 weeks ago)
Log Message: MFC: Add cpuset, an api for thread to cpu binding and cpu resource grouping
and assignment.  This is mostly synched up with what is in HEAD with the
following exceptions:
- I didn't MFC any of the interrupt binding stuff as it requires other
  changes and I figured this change was large enough as it is.
- The sched_affinity() implementation for ULE in HEAD depends on the newer
  CPU topology stuff as well as other changes in ULE.  Rather than
  backport all of that, I implemented sched_affinity() using the existing
  CPU topology and ULE code in 7.x.  Thus, any bugs in the ULE affinity
  stuff in 7 are purely my fault and not Jeff's.

Note that, just as in HEAD, cpusets currently don't work on SCHED_4BSD (the
syscalls will succeed, but they don't have any effect).

Tested by:      brooks, ps"

So I think that the functionality that you want, or something close to it,
has been present for some time in the development branches 7.1-STABLE,
7-STABLE, and 8-CURRENT of FreeBSD (which many people have been running,
not just active FreeBSD developers), and will be present in all releases
starting with 7.1, which should be out in a matter of weeks.

As you can see from the above, the authors of the slightly different
implementations in 8-CURRENT and 7*-STABLE are, respectively, Jeff
Roberson (jeff@...) and John Baldwin (jhb@...).  They may
be willing to help you with questions about how to best use their work.
(Jeff is also the primary author of the new ULE scheduler which is now the
default on the FreeBSD branches I mentioned above, and which must be used
with these tools.)

Or you can look at:

http://www.FreeBSD.org/cgi/man.cgi?query=cpuset&sektion=1&apropos=0&manpath=FreeBSD+8-current
http://www.freebsd.org/cgi/man.cgi?query=cpuset_getaffinity&sektion=2&manpath=FreeBSD+8-current
http://www.freebsd.org/cgi/man.cgi?query=cpuset_getid&sektion=2&manpath=FreeBSD+8-current

and the code in the FreeBSD Subversion or CVS repositories.

Few people know more than you do how difficult it is to keep up with the
developments in many different operating systems, and to write code that
works well on all of them. Knowing this, I am surprised that you are not
more chary of describing FreeBSD as a "loser OS" just because you believe
(erroneously, as it turns out) that it lacks one feature that you want to
use.  You may point to earlier implementations in other operating systems,
and say that FreeBSD came late to the table, but then this is true of your
own code, isn't it?

By the way, NetBSD has had similar functionality in their 5_BETA and
-current branches since the end of June of this year:

http://netbsd.gw.com/cgi-bin/man-cgi?affinity++NetBSD-current
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libpthread/?only_with_tag=MAIN

Regards,
         J. Murphy


     

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Math-atlas-devel mailing list
Math-atlas-devel@...
https://lists.sourceforge.net/lists/listinfo/math-atlas-devel

 « Return to Thread: 3.9.5: much improved threading