9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Sam <sah@softcardsystems.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] page fault with lock held
Date: Tue, 12 Apr 2005 13:23:54 -0500	[thread overview]
Message-ID: <Pine.LNX.4.60.0504121222350.9022@athena> (raw)
In-Reply-To: <b0d473d59e11b59bb5c6771f7678ad35@plan9.bell-labs.com>

I didn't fit into devsd because the device names (sdXn) weren't
helpful and I need the ability to do extra control processing
I couldn't see how to get from devsd.

e.g.,

I currently have devices named aoe{major}.{minor};
the blade in shelf 10, slot 9 is aoe10.9/.  This
addressing mechanism is much easier to understand
than any sd controller to ethernet controller
mapping I could think up.

Telling devaoe to start using interface ether0 is
done with:

echo bind /net/ether0 >aoectl

There's also an aoeevents file our raid/lvm
software can monitor (for device retransmits, eg).

The interface is still rather pliable as I'm trying to
figure out what will work best.

For each system I've written an aoe driver someone has
asked why I didn't fit into the current code.  It always
turns out that it's easier to cut a new one than bend the
existing code to make it work.  Disk drivers don't typically
have to worry about multiple outstanding requests,
retransmission timeouts, or anytime device discovery.
This isn't to say they don't do command queueing or
support hot plugging, it's just not usually something
I can fit into.

Thanks for the lock tip -

Sam

On Tue, 12 Apr 2005 jmk@plan9.bell-labs.com wrote:

> no, you should not be holding a spinlock when trying that.
> why is your driver trying to copy directly to user space,
> isn't it a subdevice of devsd? (i'm not saying that's the way
> to do it, just curious).
>
> On Tue Apr 12 13:20:53 EDT 2005, sah@softcardsystems.com wrote:
>> Hello 9fans,
>>
>> I'm testing my AoE driver and have hit something curious.
>>
>> On devaoe.c read, after getting the sectors from the
>> remote disk and when trying to copy the data to the
>> user process using memmove, I get a write page fault.
>> At the time, I happen to be holding a spinlock over
>> the device structure, which causes both
>> port/fault.c:/^fault/ and port/fault.c/^seg/ (via qlock)
>> to squawk at me about up->nlocks.ref > 0.
>>
>> The user address in question is 7fffaedc.  Firstly, does
>> this address seem appropriate and secondly, is dropping
>> the spinlock during the memmove appropriate?
>>
>> All signs point to yes, but I'd like some reassurance.
>>
>> Cheers,
>>
>> Sam
>


  parent reply	other threads:[~2005-04-12 18:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-12 17:13 Sam
2005-04-12 17:28 ` jmk
2005-04-12 17:31   ` Russ Cox
2005-04-12 17:37     ` Brantley Coile
     [not found]     ` <154c5e08c9c69f0f288db9ae8050a015@coraid.com>
2005-04-12 17:47       ` Russ Cox
2005-04-12 17:48   ` Charles Forsyth
2005-04-12 18:23   ` Sam [this message]
2005-04-12 20:33     ` geoff
2005-04-12 20:41       ` Dan Cross
2005-04-12 20:58         ` Russ Cox
2005-04-13 13:13           ` Dan Cross
2005-04-13 13:20             ` Brantley Coile
2005-04-13 18:48               ` Tim Newsham
2005-04-13 21:09                 ` Dan Cross
2005-04-12 22:07       ` Christopher Nielsen
2005-04-12 22:57         ` Brantley Coile
2005-04-13  7:46           ` Charles Forsyth

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=Pine.LNX.4.60.0504121222350.9022@athena \
    --to=sah@softcardsystems.com \
    --cc=9fans@cse.psu.edu \
    /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 NNTP newsgroup(s).