From: David Woodhouse <dwmw2@infradead.org>
To: Nick Garnett <nickg@ecoscentric.com>
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] RE : [ECOS] Is JFFS2 thread-safe?
Date: Sat, 29 Nov 2003 19:40:00 -0000 [thread overview]
Message-ID: <1070134810.15826.14.camel@lapdancer.baythorne.internal> (raw)
In-Reply-To: <m3oeuv6utl.fsf@miso.calivar.com>
On Sat, 2003-11-29 at 15:47 +0000, Nick Garnett wrote:
> For these reasons, making spin_lock() et al use the scheduler lock is
> probably a bad idea, it would have an effect on the whole system if
> they were held for long periods of time.
OK. That was a brain fart on my part -- in Linux without preemptive
scheduling, you mustn't sleep with spinlocks held, and with preemptive
scheduling a spin_lock() prevents preemption... I was applying that same
'knowledge' and thinking that preemption would lead to deadlock as it
would under Linux. That's obviously bogus.
We use spin_lock() in JFFS2 as a short-lived lightweight mutex; we could
map it to eCos spinlocks or mutexes as you see fit -- as long as it's
mapped to _something_ in the case where preemptive scheduling happens,
I'm happy. Only in the absence of preemption is it safe in its current
'do {} while(0)' form.
Having tidied up most of the interface between core JFFS2 code and the
eCos-specific parts, the latter could really do with some TLC from
someone who knows eCos a lot better than I do.
--
dwmw2
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
next prev parent reply other threads:[~2003-11-29 19:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-26 9:15 Vincent Catros
2003-11-27 0:27 ` David Woodhouse
2003-11-27 9:12 ` [ECOS] RE : " Vincent Catros
2003-11-27 9:36 ` [ECOS] " David Woodhouse
2003-11-27 10:00 ` [ECOS] RE : " Vincent Catros
2003-11-27 10:24 ` [ECOS] " David Woodhouse
2003-11-28 11:14 ` [ECOS] " David Woodhouse
[not found] ` <1070018876.10048.35.camel@hades.cambridge.redhat.com>
2003-11-28 16:09 ` David Woodhouse
2003-11-29 14:54 ` Gary Thomas
2003-11-29 15:46 ` David Woodhouse
2003-11-29 15:47 ` Nick Garnett
2003-11-29 19:40 ` David Woodhouse [this message]
2003-11-27 17:02 ` Vincent Catros
2003-11-28 11:09 ` [ECOS] " David Woodhouse
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=1070134810.15826.14.camel@lapdancer.baythorne.internal \
--to=dwmw2@infradead.org \
--cc=ecos-discuss@sources.redhat.com \
--cc=nickg@ecoscentric.com \
/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).