Re: [HACKERS] MemoryContext reset/delete callbacks

2015-02-27 Thread Tom Lane
Andres Freund writes: > On 2015-02-26 19:28:50 -0500, Tom Lane wrote: >> 1. I used ilists for the linked list of callback requests. This creates a >> dependency from memory contexts to lib/ilist. That's all right at the >> moment since lib/ilist does no memory allocation, but it might be >> logi

Re: [HACKERS] MemoryContext reset/delete callbacks

2015-02-27 Thread Robert Haas
On Thu, Feb 26, 2015 at 9:34 PM, Tom Lane wrote: > Andres Freund writes: >> It's a bit sad to push AllocSetContextData onto four cachelines from the >> current three... That stuff is hot. But I don't really see a way around >> it right now. And it seems like it'd give us more amunition to improve

Re: [HACKERS] MemoryContext reset/delete callbacks

2015-02-26 Thread Tom Lane
Andres Freund writes: > It's a bit sad to push AllocSetContextData onto four cachelines from the > current three... That stuff is hot. But I don't really see a way around > it right now. And it seems like it'd give us more amunition to improve > things than the small loss of speed it implies. Meh

Re: [HACKERS] MemoryContext reset/delete callbacks

2015-02-26 Thread Andres Freund
On 2015-02-27 01:54:27 +0100, Andres Freund wrote: > On 2015-02-26 19:28:50 -0500, Tom Lane wrote: > > /* > > *** typedef struct MemoryContextData > > *** 59,72 > > MemoryContext firstchild; /* head of linked list of children */ > > MemoryContext nextchild;/

Re: [HACKERS] MemoryContext reset/delete callbacks

2015-02-26 Thread Andres Freund
Hi, On 2015-02-26 19:28:50 -0500, Tom Lane wrote: > We discussed this idea a couple weeks ago. Hm, didn't follow that discussion. > The core of it is that when a memory context is being deleted, you > might want something extra to happen beyond just pfree'ing everything > in the context. I've c