From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Tue, 12 Apr 2005 13:28:26 -0400 From: jmk@plan9.bell-labs.com To: 9fans@cse.psu.edu Subject: Re: [9fans] page fault with lock held In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 367d6ab8-ead0-11e9-9d60-3106f5b1d025 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