This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ia64 tls support


Hi,
looking at your TLS patches, it looks like this is exactly what we need
to reduce overhead of thread safe profiling as implemented by Zdenek's
patch.  I guess the runtime overhead can be fine now, so only major
problem I see is the memory overhead (or runtime overhead at thread
creation).

I see that it does not scale very well for large programs, having 3MBs
per thread overhead for GCC, for Mozilla it can be even more.  What I
was thinking about is to create just pointer per function and allocate
table when function is invoked first time.  Then the static overhead
will be number_of_function*4 that should be considerably fewer + one
conditional in function profile + function call at cold path.

Does this sound sane?

Concerning the second alternative - having atomic/thread safe increments
on counters, can you show me example how this can be done on i386?
Perhaps I am missing something important, but I don't see way to do so
atomically without spinlock that would mean loop for each counter...

Perhaps we can just give up the idea of inlined counters and do function
calls then. THis seems to be way used by some other compilers for
profiling, but performance wise I would like to avoid it.

Honza


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]