lkml.org 
[lkml]   [2011]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 00/40] Staging: hv: Driver cleanup
Date


> -----Original Message-----
> From: Christoph Hellwig [mailto:hch@infradead.org]
> Sent: Friday, July 01, 2011 4:22 AM
> To: KY Srinivasan
> Cc: Christoph Hellwig; gregkh@suse.de; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; virtualization@lists.osdl.org
> Subject: Re: [PATCH 00/40] Staging: hv: Driver cleanup
>
> On Thu, Jun 30, 2011 at 11:28:27PM +0000, KY Srinivasan wrote:
> > > On Wed, Jun 29, 2011 at 07:38:21AM -0700, K. Y. Srinivasan wrote:
> > > > Further cleanup of the hv drivers:
> > > >
> > > > 1) Cleanup the reference counting mess for both stor and net devices.
> > >
> > > I really don't understand the need for reference counting on the storage
> > > side, especially now that you only have a SCSI driver. The SCSI
> > > midlayer does proper counting on it's objects (Scsi_Host, scsi_device,
> > > scsi_cmnd), so you'll get that for free given that SCSI drivers just
> > > piggyback on the midlayer lifetime rules.
> >
> > The reference counting allows us to properly deal with messages coming back
> from the host
> > to the guest with a racing remove of the device. I am told these messages could
> potentially be
> > not a response to a message sent from the guest.
>
> To deal with that the scsi subsystem has a two stage teardown for the
> SCSI host. First you call scsi_remove_host, at which point no new I/O
> to it can be started. After that you can wait for all outstanding
> messages, and finally you do a scsi_host_put to drop the long-term
> reference to it, and eventually free it.

That is what I have currently implemented both on the stor as well
as the net side with regards to the device specific objects hanging off of
struct hv_device (the ext field). If it is ok with you, I want to do what you
had suggested earlier. Keep the patches as they are with regards to
reference counting for now. We can always simplify the code later.

Regards,

K. Y


\
 
 \ /
  Last update: 2011-07-01 15:33    [W:0.048 / U:3.604 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site