Re: Scavenging SRTs in scavenge_one

2018-06-22 Thread Ömer Sinan Ağacan
OK, finally everything makes sense I think. I was very confused by the code and previous emails where you said: > Large objects can only be primitive objects, like MUT_ARR_PTRS, allocated by > the RTS, and none of these have SRTs. I was pointing out that this is not entirely correct; we allocate

Re: Scavenging SRTs in scavenge_one

2018-06-21 Thread Simon Marlow
When scavenge_one() sees a STACK, it calls scavenge_stack() which traverses the stack frames, including their SRTs. So I don't understand what's going wrong for you - how are the SRTs not being traversed? Cheers Simon On 21 June 2018 at 11:58, Ömer Sinan Ağacan wrote: > Here's an example

Re: Scavenging SRTs in scavenge_one

2018-06-21 Thread Ömer Sinan Ağacan
Here's an example where we allocate a large (4K) stack: >>> bt #0 allocateMightFail (cap=0x7f366808cfc0 , n=4096) at rts/sm/Storage.c:876 #1 0x7f3667e4a85d in allocate (cap=0x7f366808cfc0 , n=4096) at rts/sm/Storage.c:849 #2 0x7f3667e16f46 in threadStackOverflow

Re: Scavenging SRTs in scavenge_one

2018-06-21 Thread Ömer Sinan Ağacan
> Large objects can only be primitive objects, like MUT_ARR_PTRS, allocated by > the RTS, and none of these have SRTs. Is is not possible to allocate a large STACK? I'm currently observing this in gdb: >>> call *Bdescr(0x4200ec9000) $2 = { start = 0x4200ec9000, free =

Re: Scavenging SRTs in scavenge_one

2018-05-02 Thread Ömer Sinan Ağacan
Thanks Simon, this is really helpful. > If you look at scavenge_fun_srt() and co, you'll see that they return > immediately if !major_gc. Thanks for pointing this out -- I didn't realize it's returning early when !major_gc and this caused a lot of confusion. Now everything makes sense. I'll add

Re: Scavenging SRTs in scavenge_one

2018-05-01 Thread Simon Marlow
Your explanation is basically right. scavenge_one() is only used for a non-major collection, where we aren't traversing SRTs. Admittedly this is a subtle point that could almost certainly be documented better, I probably just overlooked it. More inline: On 1 May 2018 at 10:26, Ömer Sinan Ağacan

Re: Scavenging SRTs in scavenge_one

2018-05-01 Thread Ömer Sinan Ağacan
I have an idea but it doesn't explain everything; SRTs are used to collect CAFs, and CAFs are always added to the oldest generation's mut_list when allocated [1]. When we're scavenging a mut_list we know we're not doing a major GC, and because mut_list of oldest generation has all the newly

Scavenging SRTs in scavenge_one

2018-03-28 Thread Ben Gamari
Hi Simon, I'm a bit confused by scavenge_one; namely it doesn't scavenge SRTs. It appears that it is primarily used for remembered set entries but it's not at all clear why this means that we can safely ignore SRTs (e.g. in the FUN and THUNK cases). Can you shed some light on this? Cheers, -