All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] [PATCH 1/1] rtdm: get spinlocks to lock the scheduler
Date: Fri, 12 Oct 2012 11:38:57 +0200	[thread overview]
Message-ID: <5077E531.5050507@xenomai.org> (raw)
In-Reply-To: <5077BDEF.6070307@xenomai.org>

On 10/12/2012 08:51 AM, Gilles Chanteperdrix wrote:
> On 10/12/2012 08:26 AM, Gilles Chanteperdrix wrote:
> 
>> In a context where callbacks are called with spinlocks held, it is not
>> possible for drivers callbacks to wake up threads without holding any
>> spinlock. So, we need a mechanism to lock the scheduler when a spinlock
>> is grabbed. As xnpod_lock_sched/xnpod_unlock_sched may be a bit heavy
>> weight for this case, we try and reimplement a lighter version.
> 
> 
> There is a concurrence issue if, say, xnpod_suspend_thread or
> xnpod_reset_thread is called on another cpu while the thread which holds
> the scheduler lock is using an rtdm spinlock. I guess the rtdm spinlocks
> have to take the nklock to serialize access to the scheduler structures,
> so, use xnpod_lock_sched/xnpod_unlock_sched instead of
> __xnpod_lock_sched / __xnpod_unlock_sched.

Doesn't work either. So, handling the scheduler lock has to take place
in xnpod_schedule. What we can simply do is add a shortcut for this case
in __xnpod_schedule.

-- 
					    Gilles.


  reply	other threads:[~2012-10-12  9:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-12  6:24 [Xenomai] [PATCH 0/1] rtdm: get spinlocks to lock the scheduler Gilles Chanteperdrix
2012-10-12  6:26 ` [Xenomai] [PATCH 1/1] " Gilles Chanteperdrix
2012-10-12  6:51   ` Gilles Chanteperdrix
2012-10-12  9:38     ` Gilles Chanteperdrix [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-10-13 11:27 [Xenomai] [PATCH 0/1 v3] " Gilles Chanteperdrix
2012-10-13 11:30 ` [Xenomai] [PATCH 1/1] " Gilles Chanteperdrix
2012-10-19  4:50   ` Gilles Chanteperdrix

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=5077E531.5050507@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.