Re: dynamically allocating chunks from shared memory

Поиск
Список
Период
Сортировка
От Markus Wanner
Тема Re: dynamically allocating chunks from shared memory
Дата
Msg-id 4C45F0F2.7090109@bluegap.ch
обсуждение исходный текст
Ответ на Re: dynamically allocating chunks from shared memory  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: dynamically allocating chunks from shared memory  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
Hi,

On 07/20/2010 08:23 PM, Robert Haas wrote:
> Well, you can't really fix that problem with this infrastructure,

No, but it would allow you to better use the existing amount of shared 
memory. Possibly avoiding the problem is certain scenarios.

> The failure might
> manifest itself in a totally different subsystem though, since the
> allocation that failed wouldn't necessarily be a heavyweight lock
> allocation, but some other allocation that failed as a result of space
> used by the heavyweight locks.

Yeah, that's a valid concern. Maybe it could be addressed by keeping 
track of usage of dynshmem per module, and somehow inform the user about 
the usage pattern in case of OOM.

> It would be more interesting

Sure, but then you'd definitely need a dynamic allocator, no?

> With respect to imessages specifically, what is the motivation for
> using shared memory rather than something like an SLRU?  The new
> LISTEN implementation uses an SLRU and handles variable-size messages,
> so it seems like it might be well-suited to this task.

Well, imessages predates the new LISTEN implementation by some moons. 
They are intended to replace (unix-ish) pipes between processes. I fail 
to see the immediate link between (S)LRU and inter-process message 
passing. It might be more useful for multiple LISTENers, but I bet it 
has slightly different semantics than imessages.

But to be honest, I don't know too much about the new LISTEN 
implementation. Do you think a loss-less 
(single)-process-to-(single)-process message passing system could be 
built on top of it?

> Incidentally, the link for the imessages patch on the CommitFest page
> points to http://archives.postgresql.org/message-id/ab0cd52a64e788f4ecb4515d1e6e4691@localhost
> - which is the dynamic shmem patch.  So I'm not sure where to find the
> latest imessages patch.

The archive doesn't display attachments very well. But the imessages 
patch is part of that mail. Maybe you still find it in your local mailbox?

In the archive view, it starts at the line that says:
*** src/backend/storage/ipc/imsg.c    dc149eef487eafb43409a78b8a33c70e7d3c2bfa

(and, well, the dynshmem stuff ends just before that line. Those were 
two .diff files attached, IIRC).

Regards

Markus Wanner


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [PATCH] Re: Adding XMLEXISTS to the grammar
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: dynamically allocating chunks from shared memory