mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Cc: Albert Cahalan <acahalan@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: 2048 CPUs [was: Re: New filesystem for Linux]
Date: Wed, 8 Nov 2006 00:14:56 +0100	[thread overview]
Message-ID: <20061107231456.GB7796@elf.ucw.cz> (raw)
In-Reply-To: <Pine.LNX.4.64.0611072328220.10497@artax.karlin.mff.cuni.cz>

Hi!

> >Lets say time-spent-outside-spinlock == time-spent-in-spinlock and
> >number-of-cpus == 2.
> >
> >1 < 2 , so it should livelock according to you...
> 
> There is off-by-one bug in the condition. It should be:
> (time_spent_in_spinlock + time_spent_outside_spinlock) / 
> time_spent_in_spinlock < number_of_cpus
> 
> ... or if you divide it by time_spent_in_spinlock:
> time_spent_outside_spinlock / time_spent_in_spinlock + 1 < number_of_cpus
> 
> >...but afaict this should work okay. Even if spinlocks are very
> >unfair, as long as time-outside and time-inside comes in big chunks,
> >it should work.
> >
> >If you are unlucky, one cpu may stall for a while, but... I see no
> >livelock.
> 
> If some rogue threads (and it may not even be intetional) call the same 
> syscall stressing the one spinlock all the time, other syscalls needing 
> the same spinlock may stall.

Fortunately, they'll unstall with probability of 1... so no, I do not
think this is real problem.

If someone takes semaphore in syscall (we do), same problem may
happen, right...? Without need for 2048 cpus. Maybe semaphores/mutexes
are fair (or mostly fair) these days, but rwlocks may not be or
something.

									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2006-11-07 23:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <787b0d920611041154l69db46abv4c8c467809ada57c@mail.gmail.com>
2006-11-04 22:36 ` Mikulas Patocka
     [not found]   ` <787b0d920611050802o460a4000r5ce154e589732a02@mail.gmail.com>
2006-11-06  1:47     ` Mikulas Patocka
2006-11-07 21:26   ` Pavel Machek
2006-11-07 22:36     ` Mikulas Patocka
2006-11-07 23:14       ` Pavel Machek [this message]
2006-11-08 18:26         ` Mikulas Patocka
2006-11-10  9:03           ` Pavel Machek
2006-11-10 15:20             ` Mikulas Patocka
2006-11-10 16:20               ` Alan Cox
2006-11-12 14:28               ` Pavel Machek
2006-11-12 20:07                 ` Mikulas Patocka
2006-11-14  6:24                   ` Albert Cahalan
2006-11-08  3:04   ` David Chinner

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=20061107231456.GB7796@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=acahalan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikulas@artax.karlin.mff.cuni.cz \
    /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

all inboxes | Powered by JetHome®