public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: Krzysztof Benedyczak <golbi@mat.uni.torun.pl>
Cc: linux-kernel@vger.kernel.org, Michal Wronski <wrona@mat.uni.torun.pl>
Subject: Re: [PATCH] POSIX message queues, 2.5.50
Date: Sun, 01 Dec 2002 16:16:38 +0100	[thread overview]
Message-ID: <3DEA27D6.4000501@colorfullife.com> (raw)
In-Reply-To: Pine.GSO.4.40.0212011435000.7409-100000@anna

Krzysztof Benedyczak wrote:

>wait_event is rather not good as I don't have condition to check - in that
>case I just place process in a queue and wait for wake_up.
>But I agree that it is ugly - I used it only as a quick fix for one bug.
>Now I think I have good solution but I have to test it first.
>  
>
The bad thing is that you use __add_wait_queue() and call the wait queue 
locking functions yourself. This is not needed. The only function that 
was permitted to do that is sleep_on(), and that will die soon. I've 
quoted sleep_on as a reminder to kill that code in kernel/sched.c.
Just use add_wait_queue() instead of the internal functions. Or 
prepare_to_wait/finish_wait, that has a slighly lower locking overhead.

Btw, could you explain how your message priority implementation works?

If I understand it correctly, wq_add maintains a priority sorted linked 
list. wq_sleep() waits until the process becomes the first entry in the 
priority queue.
- You use the pid value as the thread identifier - why? Usually the task 
struct pointer is used within the kernel.
-  Is it correct that wq_wakeup wakes up all processes that sleep in 
wq_send, and then the highest priority process continues? What about 
waking up just the highest priority process? Look at the wakeup code in 
ipc/msg.c - it implement message types that way. The sender looks 
through the list of waiting receivers, and directly sends the message to 
the right receiver [pipelined_send()]

--
    Manfred





  reply	other threads:[~2002-12-01 15:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-01 10:33 [PATCH] POSIX message queues, 2.5.50 Manfred Spraul
2002-12-01 11:28 ` Russell King
2002-12-01 14:34 ` Krzysztof Benedyczak
2002-12-01 15:16   ` Manfred Spraul [this message]
2002-12-02 20:27     ` Krzysztof Benedyczak
  -- strict thread matches above, loose matches on Subject: below --
2002-11-30 17:30 Krzysztof Benedyczak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3DEA27D6.4000501@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=golbi@mat.uni.torun.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wrona@mat.uni.torun.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox