[Mono-dev] mach kernel support for sgen

2010-06-17 Thread Geoff Norton
I learned recently that one of our long standing issues one mach kernels 
(darwin specifically) that we chalked up to a bug in their implementation 
(specifically signal coalescing) is in fact a unfounded assumption by us.  
Guaranteeing 1 deliver per signal, (and infact the sem_init issue that plagued 
us historically) is only guaranteed for RT signals in POSIX Realtime Extension. 
 As such I've started undertaking to move our runtime away from signals for 
thread managment on darwin and to use mach ports instead.  With some help from 
Rodrigo, I got sgen playing nicely with mach ports last night for STW.  This 
cuts about 50% off our sys time doing GC intensive benchmarks.

I've introduced a new set of helpers into utils for mach support and arch 
specific backends for x86 and amd64.  It currently is only tested on apple, and 
certainly wont work anywhere else due to 
mono_mach_arch_get_tls_value_from_thread being 100% apple specific.  Once we 
figure out what changes the runtime team would like to see I'll look at porting 
it to arm.

After getting these changes incubated, I'd like to start looking at moving our 
Thread.Abort/Interrupt/Suspend semantics to mach ports, as well as sdb's STW 
semantics.

Comments?



sgen-mach.diff
Description: Binary data

-g

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] mach kernel support for sgen

2010-06-17 Thread Tom Philpot
Would any of these changes make a difference on the currently shipping garbage 
collector? Is this something that could be back-ported?

Thanks,
Tom

On Jun 17, 2010, at 7:54 AM, Geoff Norton wrote:

> I learned recently that one of our long standing issues one mach kernels 
> (darwin specifically) that we chalked up to a bug in their implementation 
> (specifically signal coalescing) is in fact a unfounded assumption by us.  
> Guaranteeing 1 deliver per signal, (and infact the sem_init issue that 
> plagued us historically) is only guaranteed for RT signals in POSIX Realtime 
> Extension.  As such I've started undertaking to move our runtime away from 
> signals for thread managment on darwin and to use mach ports instead.  With 
> some help from Rodrigo, I got sgen playing nicely with mach ports last night 
> for STW.  This cuts about 50% off our sys time doing GC intensive benchmarks.
> 
> I've introduced a new set of helpers into utils for mach support and arch 
> specific backends for x86 and amd64.  It currently is only tested on apple, 
> and certainly wont work anywhere else due to 
> mono_mach_arch_get_tls_value_from_thread being 100% apple specific.  Once we 
> figure out what changes the runtime team would like to see I'll look at 
> porting it to arm.
> 
> After getting these changes incubated, I'd like to start looking at moving 
> our Thread.Abort/Interrupt/Suspend semantics to mach ports, as well as sdb's 
> STW semantics.
> 
> Comments?
> 
> 

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] mach kernel support for sgen

2010-06-17 Thread Geoff Norton
The boehm GC already uses mach ports for suspend/resume.

-g

On 2010-06-17, at 4:26 PM, Tom Philpot wrote:

> Would any of these changes make a difference on the currently shipping 
> garbage collector? Is this something that could be back-ported?
> 
> Thanks,
> Tom
> 
> On Jun 17, 2010, at 7:54 AM, Geoff Norton wrote:
> 
>> I learned recently that one of our long standing issues one mach kernels 
>> (darwin specifically) that we chalked up to a bug in their implementation 
>> (specifically signal coalescing) is in fact a unfounded assumption by us.  
>> Guaranteeing 1 deliver per signal, (and infact the sem_init issue that 
>> plagued us historically) is only guaranteed for RT signals in POSIX Realtime 
>> Extension.  As such I've started undertaking to move our runtime away from 
>> signals for thread managment on darwin and to use mach ports instead.  With 
>> some help from Rodrigo, I got sgen playing nicely with mach ports last night 
>> for STW.  This cuts about 50% off our sys time doing GC intensive benchmarks.
>> 
>> I've introduced a new set of helpers into utils for mach support and arch 
>> specific backends for x86 and amd64.  It currently is only tested on apple, 
>> and certainly wont work anywhere else due to 
>> mono_mach_arch_get_tls_value_from_thread being 100% apple specific.  Once we 
>> figure out what changes the runtime team would like to see I'll look at 
>> porting it to arm.
>> 
>> After getting these changes incubated, I'd like to start looking at moving 
>> our Thread.Abort/Interrupt/Suspend semantics to mach ports, as well as sdb's 
>> STW semantics.
>> 
>> Comments?
>> 
>> 
> 

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] mach kernel support for sgen

2010-06-17 Thread Mark Probst
On Thu, Jun 17, 2010 at 4:54 PM, Geoff Norton  wrote:
> Comments?

Why is it necessary to have mono_ wrappers for arch-neutral Mach
functions, like mach_port_deallocate()?

It would be nice to have at least the larger Mach-centric parts in a
separate file sgen-mach.c, or sgen-os-mach.c.  The whole
thread_handshake() function should go there.  I'm taking every
opportunity to split the huge sgen-gc.c file into more managable
chunks.

Have you tried to provoke the restarting logic, to check whether it
actually works?  I remember a case where for some reason it didn't
work, resulting in a very hard to reproduce bug.

I can't say much about the Mach-centric parts of the patch, but you're
the authority there, anyway.  The SGen parts, apart from my comments,
look good to me.

Mark
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] mach kernel support for sgen

2010-06-17 Thread Zoltan Varga
Hi,

It would be nice to have at least the larger Mach-centric parts in a
> separate file sgen-mach.c, or sgen-os-mach.c.  The whole
> thread_handshake() function should go there.  I'm taking every
> opportunity to split the huge sgen-gc.c file into more managable
> chunks.
>
>
I think that should start with putting the definitions into a header file,
instead of include-ing
.c files into each other, which is kinda gross.

 Zoltan
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] mach kernel support for sgen

2010-06-17 Thread Geoff Norton

On 2010-06-17, at 7:01 PM, Zoltan Varga wrote:

> Hi,
> 
> It would be nice to have at least the larger Mach-centric parts in a
> separate file sgen-mach.c, or sgen-os-mach.c.  The whole
> thread_handshake() function should go there.  I'm taking every
> opportunity to split the huge sgen-gc.c file into more managable
> chunks.
> 
> 
> I think that should start with putting the definitions into a header file, 
> instead of include-ing
> .c files into each other, which is kinda gross.

Here's an updated patch reflecting Mark's changes and _starting_ the move into 
header files rather than #include-ing the .c's in.  Things are still a ugly in 
that regard, but this should put us on the right path.

Comments?

-g

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] mach kernel support for sgen

2010-06-18 Thread Geoff Norton
This time with the actual patch.-g

sgen-mach.diff
Description: Binary data
On 2010-06-17, at 11:56 PM, Geoff Norton wrote:On 2010-06-17, at 7:01 PM, Zoltan Varga wrote:Hi,
It would be nice to have at least the larger Mach-centric parts in a
separate file sgen-mach.c, or sgen-os-mach.c.  The whole
thread_handshake() function should go there.  I'm taking every
opportunity to split the huge sgen-gc.c file into more managable
chunks.
I think that should start with putting the definitions into a header file, instead of include-ing.c files into each other, which is kinda gross.Here's an updated patch reflecting Mark's changes and _starting_ the move into header files rather than #include-ing the .c's in.  Things are still a ugly in that regard, but this should put us on the right path.Comments?-g___Mono-devel-list mailing listMono-devel-list@lists.ximian.comhttp://lists.ximian.com/mailman/listinfo/mono-devel-list___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] mach kernel support for sgen

2010-06-22 Thread Mark Probst
On Sat, Jun 19, 2010 at 2:07 AM, Geoff Norton  wrote:
> This time with the actual patch.

The patch doesn't include sgen-os-*.c, but since they only consist of
mono_sgen_thread_handshake() there's not much that can go wrong.
Other than that it looks perfect SGen-wise!  Thanks!

Mark
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list