tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: vwakeup: neg numoutput



On Mon, Jun 30, 2008 at 10:01:52AM -0700, Bill Stouder-Studenmund wrote:
> On Sun, Jun 29, 2008 at 11:14:01PM +0200, Manuel Bouyer wrote:
> > On Sun, Jun 29, 2008 at 02:03:18PM -0600, Greg Oster wrote:
> > > > Its done it to me 4 or 5 times now.  Trying to scp or rdist about 7GB 
> > > > of /usr/pkg and /usr/local to the domU, it gets about 1 or 2 GB 
> > > > transferred then the dom0 panics :-(
> > > 
> > > In both xbdback_xenbus.c and xbdback.c we have this code:
> > > 
> > >   if ((xbd_io->xio_buf.b_flags & B_READ) == 0)
> > >           xbd_io->xio_buf.b_vp->v_numoutput++;
> > > 
> > > Should this not read:
> > > 
> > >   if ((xbd_io->xio_buf.b_flags & B_READ) == 0) {
> > >           mutex_enter(&xbd_io->xio_buf.b_vp->v_interlock);
> > >           xbd_io->xio_buf.b_vp->v_numoutput++;
> > >           mutex_exit(&xbd_io->xio_buf.b_vp->v_interlock);
> > >         }
> > > 
> > > (or somesuch) to properly update v_numoutput ?  Most other changes
> > > to v_numoutput are holding the vp->v_interlock, but if this one is, 
> > > I'm completely missing how it's doing it...
> > 
> > I think you're right, the interlock is not taken here.
> > But we have a problem: at this point we are in interrupt context.
> > Can we take this mutex from interrupt context ?
> 
> Would this be a good candidate for the atomic update operations? That way 
> you don't need a lock.

Could be, but then it needs to be updated atomically everywhere.

-- 
Manuel Bouyer, LIP6, Universite Paris VI.           
Manuel.Bouyer%lip6.fr@localhost
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index