mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Paul McKenney <Paul.McKenney@us.ibm.com>
Cc: Andi Kleen <ak@suse.de>,
	linux-kernel@vger.kernel.org, lse-tech@lists.sourceforge.net,
	nigel@nrg.org, rusty@rustcorp.com.au
Subject: Re: [Lse-tech] Re: [PATCH for 2.5] preemptible kernel
Date: Sat, 7 Apr 2001 23:25:55 +0200	[thread overview]
Message-ID: <20010407232555.A1982@gruyere.muc.suse.de> (raw)
In-Reply-To: <OF37B0793C.6B15F182-ON88256A27.0007C3EF@LocalDomain>
In-Reply-To: <OF37B0793C.6B15F182-ON88256A27.0007C3EF@LocalDomain>; from Paul.McKenney@us.ibm.com on Fri, Apr 06, 2001 at 06:25:36PM -0700

On Fri, Apr 06, 2001 at 06:25:36PM -0700, Paul McKenney wrote:
> I see your point here, but need to think about it.  One question:
> isn't it the case that the alternative to using synchronize_kernel()
> is to protect the read side with explicit locks, which will themselves
> suppress preemption?  If so, why not just suppress preemption on the read
> side in preemptible kernels, and thus gain the simpler implementation
> of synchronize_kernel()?  You are not losing any preemption latency
> compared to a kernel that uses traditional locks, in fact, you should
> improve latency a bit since the lock operations are more expensive than
> are simple increments and decrements.  As usual, what am I missing
> here?  ;-)

You miss nothing I think. In fact it's already used (see below) 

> 
> > > 2.   Isn't it possible to get in trouble even on a UP if a task
> > >      is preempted in a critical region?  For example, suppose the
> > >      preempting task does a synchronize_kernel()?
> >
> > Ugly. I guess one way to solve it would be to readd the 2.2 scheduler
> > taskqueue, and just queue a scheduler callback in this case.
> 
> Another approach would be to define a "really low" priority that noone
> other than synchronize_kernel() was allowed to use.  Then the UP
> implementation of synchronize_kernel() could drop its priority to
> this level, yield the CPU, and know that all preempted tasks must
> have obtained and voluntarily yielded the CPU before synchronize_kernel()
> gets it back again.

That just would allow nasty starvation, e.g. when someone runs a cpu intensive
screensaver or a seti-at-home.

> 
> I still prefer suppressing preemption on the read side, though I
> suppose one could claim that this is only because I am -really-
> used to it.  ;-)

For a lot of reader cases non-preemption by threads is guaranteed anyways -- 
e.g.  anything that runs in interrupts, timers, tasklets and network softirq.  
I think that already covers a lot of interesting cases.


-Andi



  parent reply	other threads:[~2001-04-07 21:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-07  1:25 Paul McKenney
2001-04-07 19:59 ` Rusty Russell
2001-04-07 21:25 ` Andi Kleen [this message]
2001-04-07 23:54 [Lse-tech] " Paul McKenney
2001-04-10 15:21 ` Rusty Russell
2001-04-07 23:59 Paul McKenney
2001-04-09 12:46 bsuparna
2001-04-09 23:28 ` Nigel Gamble
2001-04-10 22:08 Paul McKenney
2001-04-10 23:49 ` Nigel Gamble
2001-04-11  4:08 Paul McKenney
2001-04-11  5:22 ` yodaiken
2001-04-11  8:37   ` Nigel Gamble
2001-04-11  8:19 ` Nigel Gamble
2001-04-22 13:38 Paul McKenney

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=20010407232555.A1982@gruyere.muc.suse.de \
    --to=ak@suse.de \
    --cc=Paul.McKenney@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lse-tech@lists.sourceforge.net \
    --cc=nigel@nrg.org \
    --cc=rusty@rustcorp.com.au \
    /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®