public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Nick Garnett <nickg@ecoscentric.com>
To: Erik Christiansen <erik@dd.nec.com.au>
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] Disabling interrupts when locking the scheduler
Date: Fri, 03 Jun 2005 09:37:00 -0000	[thread overview]
Message-ID: <m3d5r37pcw.fsf@xl5.calivar.com> (raw)
In-Reply-To: <20050603084643.GC716@dd.nec.com.au>

Erik Christiansen <erik@dd.nec.com.au> writes:

> The possibility of disabling interrupts when locking the scheduler seems
> built into the calling sequence:
> 
> Cyg_Scheduler::lock()            <-- Generates no code, anywhere. *1
>    inc_sched_lock()
>       HAL_SMP_SCHEDLOCK_INC
>          HAL_DISABLE_INTERRUPTS  <-- Disables interrupts, if invoked.
> 
> While ref/kernel-interrupts.html confirms that interrupts are normally not
> disabled, for improved interrupt latency, the code is there, if I can just
> figure out how to turn it on. It's not conditionals, but seems to be
> inheritance which causes Cyg_Scheduler::lock() to be excluded.
> 
> Has anyone tried this before?
> 
> (I'd prefer to enable the latent code, rather than just poke a
> HAL_DISABLE_INTERRUPTS in front of Cyg_Scheduler::lock() in 66
> places, and repeat for enabling.)
> 
> *1) No timeslicing, CYGSEM_HAL_USE_ROM_MONITOR == 1.

Why do you want to do this?

eCos is carefully designed not to disable interrupts unnecessarily. It
will probably fail catastrophically if interrupts are disabled during
the scheduler lock periods.

The interrupt disable you have found is only part of the SMP code, and
is matched by a HAL_RESTORE_INTERRUPTS() at the end of the
HAL_SMP_SCHEDLOCK_INC() macro. So interrupts are disabled for a very
short period, inside that macro.


-- 
Nick Garnett                                     eCos Kernel Architect
http://www.ecoscentric.com                The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  reply	other threads:[~2005-06-03  9:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-03  8:48 Erik Christiansen
2005-06-03  9:37 ` Nick Garnett [this message]
2005-06-06  8:50   ` Erik Christiansen

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=m3d5r37pcw.fsf@xl5.calivar.com \
    --to=nickg@ecoscentric.com \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=erik@dd.nec.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).