From: David Woodhouse <dwmw2@infradead.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Greg Ungerer <gerg@snapgear.com>,
linux-kernel@vger.kernel.org,
David McCullough <davidm@snapgear.com>
Subject: Re: [PATCH]: uClinux (MMU-less) patches against 2.5.28
Date: Fri, 26 Jul 2002 17:27:55 +0100 [thread overview]
Message-ID: <9267.1027700875@redhat.com> (raw)
In-Reply-To: <1027704478.14660.66.camel@irongate.swansea.linux.org.uk>
> Also a page can be locked because another I/O read is pending on it
> (ie its already in someone elses read/page in handling and currently
> has invalid data).
If it has invalid data, then it's not an XIP page -- it's in RAM. XIP pages
are either present or not present because the chip is otherwise occupied --
in neither case do they need to be locked for I/O.
> You would need to be sure we never ended up with deadlocks for any case
> where we have
> process 1 copying page X from flash 2 to flash 1 page Y
> process 2 copying page Y from flash 1 to flash 2 page X
> With jffs2 and temporary buffering I guess it works out.
Buffering is required for other reasons, and it's what saves us here. The
thing that'll do the 'write lock' on the flash is the raw flash write
operation, and that can't take a userspace pointer, it takes a kernel
pointer. So we were buffering anyway (yes we could have locked it down and
used it directly but we don't).
So you get process 1 doing copy_from_user which reads from flash 2, then
passing the buffer into the write function for flash 1. And process 2 doing
the converse. Each drops the read lock before getting a write lock -- in
fact the page was never _locked_, it could be paged back out again to allow
writes to happen between each byte that copy_from_user() fetched.
--
dwmw2
next prev parent reply other threads:[~2002-07-26 16:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-25 6:56 [PATCH]: uClinux (MMU-less) patches against 2.5.28 Greg Ungerer
2002-07-25 14:52 ` David Woodhouse
2002-07-26 0:08 ` Greg Ungerer
2002-07-26 1:20 ` Greg Ungerer
2002-07-26 8:19 ` David Woodhouse
2002-07-26 9:39 ` David Woodhouse
2002-07-26 9:58 ` David Woodhouse
2002-07-26 14:03 ` David Woodhouse
2002-07-26 16:01 ` David Woodhouse
2002-07-26 16:27 ` David Woodhouse [this message]
2002-07-26 17:27 ` Alan Cox
2002-07-26 17:11 ` Alan Cox
2002-07-26 14:50 ` Alan Cox
2002-07-26 10:56 ` Alan Cox
2002-07-26 10:39 ` Alan Cox
2002-07-26 15:08 ` gerg
2002-07-26 15:45 ` 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=9267.1027700875@redhat.com \
--to=dwmw2@infradead.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=davidm@snapgear.com \
--cc=gerg@snapgear.com \
--cc=linux-kernel@vger.kernel.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.