Meeting on irc.gnome.org:#gtk-devel Meeting started December 6 2005 16:00 EST In attendence: Matthias Clasen (mclasen), Federico Mena Quintero (federico), Tim Janik (rambokid), Manish Singh (yosh), Michael Natterer (mitch), Emanuelle Bassi (ebassi), Mart Raudsepp (leio) hey, its time already ok, I only have half an hour today first topic: glib 2.10 I deprecated GMemChunk yesterday, and ported GTK+ head to g_slice of course, yesterday evening I realized that we need GTK 2.8 to work with glib 2.10 when you register a GTypeInfo for a certain struct size, does the allocation at instantiation go through g_slice? yes has anyone seen whether the heap is smaller after an app boots up? federico: always. n_preallocs needs to be deprecated as well. rambokid: you mean just updating the docs to say that its ignored ? mclasen: yeah. i think there is no more deprecation we can do here. I think thats fine rambokid: I'd love to see a scatter plot that shows time vs. size of each allocation federico: not sure i understand you X axis is wall time Y axis is size of allocations each time you allocate something, you put a dot in the chart but if you put too many dots at the same point, the paper will tear... * federico sprinkles some cantor dust on mclasen federico: do you do that just for the current g_slice code? federico: or for g_malloc? and with what application? rambokid: *shrug* probably... though doing it for g_malloc wouldn't hurt, either rambokid: typical big app with lots of objects - nautilus, evolution... rambokid: cache-wise, I guess we won't do any worse than if everything just went through glibc malloc() like i'm just not sure that graphs provides a lot of useful information ;) are two small mallocs of different sizes contiguous in memory? no not small ones. the glibc malloc implementation is actually ptmalloc2 which uses different types of bins (cache buckets basically) pango has a shitload of small allocations of possibly different sizes - how many cache lines will we use to measure a string? ok, so I get from this discussion that we really need to do more measurements... To facilitate that, I want to do another glib 2.9 release this week Do we have any outstanding things that should go in before, or can I do it tomorrow ? mclasen: the sorted inserts i think giving us tomorrow to get that nailed and a few test cases would be good. ok, then it'll be Friday, since I'm unavailble on Thursday great and I should probably also do a gtk 2.8 release soon, to get the fix for memchunk deprecation out in a release do we have a --disable-gslice or something, for valgrind? federico: no. i'm pondering an env var as suggested on gtk-devel-list though. rambokid: an env var would be even better - I hate having to recompile glib/gtk to get debugging stuff mclasen: yes, that gtk+-2.8 release needs to be out before or in sync with the new glib release that deprecats memchunks federico: exactly. kinda like MALLOC_CHECK_ rambokid: the slab allocator paper mentions cache = slab_cache_new ("some-subsystem", 42) rambokid: i.e. you pass a string that identifies that particular cache federico: g_slice_ doesn't have any statistics or debugging facilities currently. rambokid: that would be really nice for debugging, though right now everything goes through the same centralized cache... basically memchunks weren#t good at that either, and for gmem.c i wrote g_mem_profiling_table and no one ever used it as far as i figured. was it ever publicized? or was there a case where you found a bug using that? rambokid: I used it a bit, fwiw federico: having that same centralized cache is actually what buys as speed and memory-efficiency ;) having instrumentability would be nice - but then we also need nice examples of how to put it into use federico: the profiling table is in glib. you can simply set gmem to use profiling allocation functions before calling any other glib function rambokid: not for gslice :) no. haven't written anything like that for gslice, as i said already ;) that's what I'm saying. We should have profiling stuff before the API is frozen. ah. sorry. didn#t get that part. actually, just looking at allocation sizes / frequencies just for GObjects would be pretty interesting federico: ok, i suggest you send an API proposal for that to gtk-devel then, so we can discuss the details and its merit. widget-happy apps would love that * federico looks at vektor rambokid: do you know if linux has a signal or something to indicate memory pressure? i.e. something we could use to free full magazines? I don't think it does unfortunately not in user space. that is one of the nice things in the kernel allocator, but we can't replicate it. the "kernel allocator" from the slab paper i meant of course. looks like this makes a good case to prod the kernel people for such a mechanism :) it wouldn't be very hard federico: heh, sounds like a brave undertaking. i'd support it however. well, implementation wise. kernel politicswise I dunno ;) yosh: dunno, you can't safely access the glib structures from a signal handler. it'd at least be tricky to get this right, especially in MT context. federico: i think this'd even make a lot of sense in the context of embedded devices. yosh: AIX has such a signal, I think who would get signalled if memory is tight ? the biggest memory hog ? rambokid: I meant on the kernel end. the actual response implementation in glib would need some thought mclasen: everyone mclasen: free some magazines, compact your caches, perform GC (windows does that), etc. yosh: i think it's even non-.trivial on the kernel end. would you signal ona certain threshold? currently the kernel signals (kills) if it runs out of memory which would obviously be too late to ask user programs to voloutarily release memory. rambokid: iirc the kernel has some thresholds already yosh: we could have fd = pipe(); g_set_fd_to_notify_when_sigmemory_comes_in (fd); g_io_add_watch (fd, tell_glib_to_compact_gslice) federico: there could be notification API in glib to compact even more. federico: yes, that was my first thought as well ok, to make this short, is anyone really going to turn this into an actual proposal for the kernel people? so let's implement that and while waiting for the kernel get its act together, let's have glib set up a 10-second timeout to emit that signal :) (someone say yes now, and we can move on ;) * rambokid shoots federico in the ... naah, but behave from now on! ;) I can talk to some of our kernel people rambokid: I can probably goad the mono guys to get a push ok, novel and red hat takes that on then. next topic... ;) I need to leave about now, so you get to pick your next topic on your own... ok, done then. everybody can do naked table dance once mclasen has left. * mclasen leaves hurriedly * federico wiggles his b00ty * mitch looks away federico: please, don't. :-) * mitch takes out the felt pen caution, dude my b00ty has airborne defense mechanisms haha i sign faster than my shadow anyway do we have an API freeze date for gtk.next? I want to get volunteers to implement the must-have APIs that we have been missing for years gtk_radio_button_gimme_selected_id() etc. we have a date for glib API freeze and i don't want to have an API freeze for gtk just yet, because mitch and i have still a load of API TODOs for gtk. (that also means we're unlikely to volounteer for even more API todos ;) rambokid: what sort of stuff do you have? federico: this is what we're working on for some time: http://maemo.org/maemowiki/MaemoGtk26Contributions basically sorting out / applying / backfolding gtk-2.6.10-maemo-code-bp.diff.gz as linked on that page. oooh, nice mmeeks will like the display close stuff display close stuff is a good example for things still in progress ;) it's marked as close on the maemo wiki, as far I can see closed* but I can probably take your word over the wiki :) leio: yes, it's marked closed because the grunt work is applied but lots of small needed fixes keep popping up. ask mitch about that ;) anyway what's left in glib? is gslice documented now? yes I'm first concerned about runtime screen changes in the X side thanks to mclasen mostly rambokid: so all gslice allocations are on 2*sizeof(void*) boundaries? yes what if I want 4-byte allocations? you loose. with malloc as well. hmm, true I just wonder if it would be good to expose an allocator with pretty much the same API as the one in the paper where you can specify the alignment, create your own caches, etc. not for general use, but for very particular problems leio: screen changes? that works fine leio: it did work fine before I suppose I mixed it with display changes i did as well. the vmem resource allocator logic is also very nice. we don't have too many use cases for that though, and g_slice doesn't implement the page allocator described in that paper, so that API wouldn't easily be provided on top of g_slice can you arbitrarily plug a CRT into a laptop and have it work? (and put/drag gtk+ stuff onto it) leio: there are no dynamic screens, unfortunately leio: could do that by opening a new x server rambokid: I haven't got to the vmem part of the papers yet - is that gimme_unused_int_in_range()? kind of, yes. aight, dynamic screens is what I meant, sorry for the slight confusion federico: basically, if you have so specialiced needs, you might be best off fetching libumem and linking it into your program i'd guess. rambokid: heh, yeah :) federico: the aix signal is apparently called SIGDANGER good name :) heh Meeting ended 17:29 EST