All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Xenomai <xenomai@xenomai.org>
Subject: [Xenomai] [PATCH 0/1] rtdm: get spinlocks to lock the scheduler
Date: Fri, 12 Oct 2012 08:24:25 +0200	[thread overview]
Message-ID: <5077B799.5000408@xenomai.org> (raw)


Hi,

here is the second attempt to try and allow drivers to wake-up threads
in the middle of spinlock sections. The idea is to try and have a
lighter version of __xnpod_lock_sched/__xnpod_unlock_sched and use that
in the RTDM spinlocks.

The lighter version of __xnpod_lock_sched/__xnpod_unlock_sched uses a
status bit, and a preemption count in the scheduler structure, but as we
want to allow a thread to suspend itself when the scheduler is locked,
when this happens, we save the preemption count in the thread structure,
and clear the preemption count and scheduler bit, they get restore in
xnpod_schedule/xnshadow epilogue when waking-up such a thread.

We have to keep the thread XNLOCK bit, it is more or less part of the
ABI (for instance, it is possible to create a thread with this bit set,
and the scheduler is locked immediately when this thread is first
scheduled). I guess we can completely remove it in -forge though.

I have failed to modify xnlock services to also use the scheduler lock,
xnheap_init is called before the scheduler is initialized, and takes an
xnlock.

Regards.

-- 
                                                                Gilles.


             reply	other threads:[~2012-10-12  6:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-12  6:24 Gilles Chanteperdrix [this message]
2012-10-12  6:26 ` [Xenomai] [PATCH 1/1] rtdm: get spinlocks to lock the scheduler Gilles Chanteperdrix
2012-10-12  6:51   ` Gilles Chanteperdrix
2012-10-12  9:38     ` 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=5077B799.5000408@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.