public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] POSIX message queues
@ 2002-09-04 16:03 Manfred Spraul
  0 siblings, 0 replies; 20+ messages in thread
From: Manfred Spraul @ 2002-09-04 16:03 UTC (permalink / raw)
  To: mingo; +Cc: linux-kernel

Ingo wrote:
> On Sun, 1 Sep 2002, Amos Waterland wrote:
> 
>> That is the fundamental problem with a userspace shared memory
>> implementation: write permissions on a message queue should grant
>> mq_send(), but write permissions on shared memory grant a lot more than
>> just that.
> 
> is it really a problem? As long as the read and write queues are separated
> per sender, all that can happen is that a sender is allowed to read his
> own messages - that is not an exciting capability.
> 
Messages with the same prio are ordered - a separated per sender queue 
would break SuS.

--	
	Manfred


^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: [PATCH] POSIX message queues
@ 2002-08-29 21:53 pwaechtler
  2002-08-30  9:48 ` Amos Waterland
  2002-08-31 12:53 ` Krzysztof Benedyczak
  0 siblings, 2 replies; 20+ messages in thread
From: pwaechtler @ 2002-08-29 21:53 UTC (permalink / raw)
  To: golbi; +Cc: linux-kernel

some comments as asked for:

I know that it's nowhere stated, but POSIX mqueues are perfectly 
designed to be
implemented in userspace with locking facilities provided by the system.

With PROCESS_SHARED mutexes and condvars in NGPT we have that - and I am
in the process in converting the mmap() based implementation of
Richard Stevens in UNPv2 onto Linux.

The messages are stored in shmem and the library routines access the 
structures
with proper locking. I am not very happy about the fact, that with 
futexes the whole
cooperating system get stuck when 1 process crashes inside a critical 
region
(yes, then your system is screwed anyway).
BUT the messages are not copied between user- and kernelspace like they 
are
in SysV  msgsnd.

POSIX mqueues have "kernel persistence", i.e. they live until 
mq_unlink() is called.
They do not vanish with the creator on exit().
Without rlimits you can easily consume all available kernel memory (DoS) 
by creating
a mqueue and filling it with garbage.

When implemented in kernel space, you have to create a thread with the 
brand new
sys_clone_startup (or whatever name it gets) as notification 
(SIGEV_THREAD) - which
is SCOPE_SYSTEM, no control about this and not always what is desired.





^ permalink raw reply	[flat|nested] 20+ messages in thread
* [PATCH] POSIX message queues
@ 2002-08-27 21:48 Krzysztof Benedyczak
  2002-08-27 22:16 ` Christoph Hellwig
  0 siblings, 1 reply; 20+ messages in thread
From: Krzysztof Benedyczak @ 2002-08-27 21:48 UTC (permalink / raw)
  To: linux-kernel

Hello,

We have written (Michal Wronski & me) a patch for 2.4.18 & 2.4.19 kernel
adding POSIX message queues (mq_* family functions). In difference to
standard SysV message queues (msgsnd() etc) they allow to send messages
with different priorities, support asynchronous receive and more.

As patches are quite large here is URL to our page:
http://www.mat.uni.torun.pl/~wrona/posix_ipc

and direct links:
http://www.mat.uni.torun.pl/~wrona/posix_ipc/mqueue_patch-2.4.18.tar.gz
http://www.mat.uni.torun.pl/~wrona/posix_ipc/mqueue_patch-2.4.19.tar.gz

also there is an appropriate library:
http://www.mat.uni.torun.pl/~wrona/posix_ipc/mqueue_lib-2.0.tar.gz

I'd like to point out some issues:

1) Architecture & syscall - We have added support only for i386. But the
only one thing which is arch. dependent is a new system call. So porting
it is fairly simply. We haven't done it only because we are afraid of
making some silly bugs without any possibility to test. We know that
_new_ system call is rather "undesirable", but we can add invoking of our
code to e.g. ipc syscall.

2) SMP - I'm not SMP specialist and so everything touching SMP is done in
the simplest way. Meaning: it can be done more efficient. Also
there can be bugs - we don't have SMP box to test it on (during academic
year it can change).


Awaiting comments, feedbacks, etc. (especially about above two points)

Krzysiek Benedyczak


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2002-09-08 21:56 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-04 16:03 [PATCH] POSIX message queues Manfred Spraul
  -- strict thread matches above, loose matches on Subject: below --
2002-08-29 21:53 pwaechtler
2002-08-30  9:48 ` Amos Waterland
2002-08-31 11:43   ` pwaechtler
2002-08-31 13:14     ` Krzysztof Benedyczak
2002-09-01  0:22     ` Amos Waterland
2002-09-01  1:50   ` Amos Waterland
2002-09-04 11:13     ` Ingo Molnar
2002-09-06 10:04       ` Pavel Machek
2002-09-07 14:16         ` pwaechtler
2002-09-06 22:48       ` Amos Waterland
2002-09-07 14:11         ` pwaechtler
2002-09-07 15:17           ` Ingo Molnar
2002-09-08 22:00             ` Amos Waterland
2002-08-31 12:53 ` Krzysztof Benedyczak
2002-09-07 14:39   ` pwaechtler
2002-08-27 21:48 Krzysztof Benedyczak
2002-08-27 22:16 ` Christoph Hellwig
2002-08-31 13:28   ` Krzysztof Benedyczak
2002-09-01  7:24     ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox