All of lore.kernel.org
 help / color / mirror / Atom feed
* building blktap as a module
@ 2006-10-16  9:48 Jan Beulich
  2006-10-16 10:31 ` Keir Fraser
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2006-10-16  9:48 UTC (permalink / raw)
  To: xen-devel

While drivers/xen/Kconfig has been changed to allow blktap to be a module,
its Makefile doesn't and, if fixed, it needs a symbol not currently exported
(zap_page_range). I thought I saw discussion of this on the list, but wasn't
able to find it in the archives. So - does anyone care to fix this (i.e. replace
the calls to zap_page_range() by exported functionality) or should I just
post a patch fixing the Makefile and exporting zap_page_range?

Thanks, Jan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: building blktap as a module
  2006-10-16  9:48 building blktap as a module Jan Beulich
@ 2006-10-16 10:31 ` Keir Fraser
  2006-10-16 11:45   ` Gerd Hoffmann
  0 siblings, 1 reply; 5+ messages in thread
From: Keir Fraser @ 2006-10-16 10:31 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Andrew Warfield

On 16/10/06 10:48, "Jan Beulich" <jbeulich@novell.com> wrote:

> While drivers/xen/Kconfig has been changed to allow blktap to be a module,
> its Makefile doesn't and, if fixed, it needs a symbol not currently exported
> (zap_page_range). I thought I saw discussion of this on the list, but wasn't
> able to find it in the archives. So - does anyone care to fix this (i.e.
> replace
> the calls to zap_page_range() by exported functionality) or should I just
> post a patch fixing the Makefile and exporting zap_page_range?

The uses of zap_page_range look dubious to me.
 1. The one in blktap_release() - why? Standard semantics is for mmap
regions to exist beyond the closing of the mapping device. Doesn't make much
sense to do that here, but then again not really any need to explicitly
disallow it (and add extra code to enforce).
 2. Blktap_mmap() -- the mm subsystem will zap the range anyway on failure.
No need to do it in the driver.
 3. The loop unmaps the pages the proper way (unmap_grant). The
zap_page_range() here is entirely unnecessary afaics.

 -- Keir

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: building blktap as a module
  2006-10-16 10:31 ` Keir Fraser
@ 2006-10-16 11:45   ` Gerd Hoffmann
  2006-10-16 12:56     ` Keir Fraser
  0 siblings, 1 reply; 5+ messages in thread
From: Gerd Hoffmann @ 2006-10-16 11:45 UTC (permalink / raw)
  To: Keir Fraser; +Cc: Andrew Warfield, xen-devel, Jan Beulich

  Hi,

>  1. The one in blktap_release() - why? Standard semantics is for mmap
> regions to exist beyond the closing of the mapping device. Doesn't make much
> sense to do that here, but then again not really any need to explicitly
> disallow it (and add extra code to enforce).

The linux kernel does call the drivers release() method when the last
reference is gone.  If you call close() with mappings still being
active, then ->release() is _not_ called when you close the file handle
but when the last mapping is unmapped.  Thus there is no point in trying
to handle active mappings there ;)

cheers,

  Gerd

-- 
Gerd Hoffmann <kraxel@suse.de>
http://www.suse.de/~kraxel/julika-dora.jpeg

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: building blktap as a module
  2006-10-16 11:45   ` Gerd Hoffmann
@ 2006-10-16 12:56     ` Keir Fraser
  2006-10-16 14:07       ` Gerd Hoffmann
  0 siblings, 1 reply; 5+ messages in thread
From: Keir Fraser @ 2006-10-16 12:56 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Andrew Warfield, xen-devel, Jan Beulich




On 16/10/06 12:45, "Gerd Hoffmann" <kraxel@suse.de> wrote:

>>  1. The one in blktap_release() - why? Standard semantics is for mmap
>> regions to exist beyond the closing of the mapping device. Doesn't make much
>> sense to do that here, but then again not really any need to explicitly
>> disallow it (and add extra code to enforce).
> 
> The linux kernel does call the drivers release() method when the last
> reference is gone.  If you call close() with mappings still being
> active, then ->release() is _not_ called when you close the file handle
> but when the last mapping is unmapped.  Thus there is no point in trying
> to handle active mappings there ;)

I.e., they'll have been unmapped already? As you say, either way the zap is
not needed...

 -- Keir

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: building blktap as a module
  2006-10-16 12:56     ` Keir Fraser
@ 2006-10-16 14:07       ` Gerd Hoffmann
  0 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2006-10-16 14:07 UTC (permalink / raw)
  To: Keir Fraser; +Cc: Andrew Warfield, xen-devel, Jan Beulich

Keir Fraser wrote:
> 
> 
> On 16/10/06 12:45, "Gerd Hoffmann" <kraxel@suse.de> wrote:
> 
>> The linux kernel does call the drivers release() method when the last
>> reference is gone.  If you call close() with mappings still being
>> active, then ->release() is _not_ called when you close the file handle
>> but when the last mapping is unmapped.  Thus there is no point in trying
>> to handle active mappings there ;)
> 
> I.e., they'll have been unmapped already?

Yes.

> As you say, either way the zap is
> not needed...

Yep, I just wanted to fill in some more background info ...

cheers,

  Gerd

-- 
Gerd Hoffmann <kraxel@suse.de>
http://www.suse.de/~kraxel/julika-dora.jpeg

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-10-16 14:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-16  9:48 building blktap as a module Jan Beulich
2006-10-16 10:31 ` Keir Fraser
2006-10-16 11:45   ` Gerd Hoffmann
2006-10-16 12:56     ` Keir Fraser
2006-10-16 14:07       ` Gerd Hoffmann

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.