public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: ipc semaphore optimization
Date: Fri, 27 Jun 2003 21:43:11 +0200	[thread overview]
Message-ID: <3EFC9E4F.9070405@colorfullife.com> (raw)

Chen wrote:

>What we are proposing here is to merge the portion of the code in the
>bottom part of sys_semtimedop() (code that gets executed when a sleeping
>process gets woken up) into update_queue() function.  The benefit is two
>folds: (1) is to reduce redundant calls to try_atomic_semop() and (2) to
>increase efficiency of finding eligible processes to wake up and higher
>concurrency for multiple wake-ups.
>  
>
Interesting. I'm not sure if you noticed it, but your patch backs out a 
change from Christoph Rohland from 1998, probably from SAP DB benchmarking:

linux/ipc/sem.c:
 * - The previous code had two flaws:
 *   1) It actively gave the semaphore to the next waiting process
 *      sleeping on the semaphore. Since this process did not have the
 *      cpu this led to many unnecessary context switches and bad
 *      performance. Now we only check which process should be able to
 *      get the semaphore and if this process wants to reduce some
 *      semaphore value we simply wake it up without doing the
 *      operation. So it has to try to get it later. Thus e.g. the
 *      running process may reacquire the semaphore during the current
 *      time slice. If it only waits for zero or increases the semaphore,
 *      we do the operation in advance and wake it up.

Perhaps the O(1) scheduler is better at handling the thread switches 
than the old scheduler. Could you include an update of the comments into 
your patch?

--
    Manfred


             reply	other threads:[~2003-06-27 19:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-27 19:43 Manfred Spraul [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-07-01 16:36 ipc semaphore optimization Chen, Kenneth W
2003-06-27 22:48 Chen, Kenneth W
2003-06-27 20:22 Chen, Kenneth W
2003-06-27 18:03 Margit Schubert-While
2003-06-27 17:13 Chen, Kenneth W

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=3EFC9E4F.9070405@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=kenneth.w.chen@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /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