linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* consistent_free re-revisited
@ 2002-09-11 21:45 Todd Poynor
  2002-09-12  3:26 ` David Gibson
  0 siblings, 1 reply; 10+ messages in thread
From: Todd Poynor @ 2002-09-11 21:45 UTC (permalink / raw)
  To: linuxppc-dev


The APIs for consistent_free have diverged between PPC and ARM.  It has,
at least in the past, been a goal to keep the APIs in sync.

Revisiting this is prompted by a couple of new platforms recently added
(Xilinx Virtex II Pro and IBM 405LP/Beech) that use consistent_alloc for
framebuffers mmap'ed to X servers.  It would be nice (but is hardly a
critical need) if consistent_alloc/free would set/clear the reserved bit
on the struct page's allocated, such that the returned memory can be
mmap'ed to userspace without the driver explicitly setting these bits, a
la ARM.

On PPC this is complicated by the fact that consistent_free does not
take a size parameter, describing the size of the allocated area, nor a
dma_handle parameter, which ARM uses to derive struct page's.

Furthermore, consistent_alloc does not fill out vm_struct fields for the
VM area that map it to the struct pages, so consistent_free can't use
those to derive the physical pages.  And neither can vfree(), which is
what consistent_free() calls to do its work.  And so consistent_free()
does not free the physical pages allocated by consistent_alloc(), which
is a potentially more serious matter (although I suppose consistent_free
isn't normally in heavy use, but hi-res framebuffers can get large).

Setting/clearing reserved bits and init'ing the vm_struct fields such
that physical pages are reclaimed by vfree() can be accomplished without
API changes, at the expense of intruding into private VM data structures
and inefficiency of allocating an array of struct page pointers to
describe a contiguous chunk of memory.  So it seems preferable to add
the size and dma_handle params to consistent_free and do the physical
page freeing there (and update the drivers that call it).  Comments?
Thanks,


--
Todd


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

end of thread, other threads:[~2002-09-12 21:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-11 21:45 consistent_free re-revisited Todd Poynor
2002-09-12  3:26 ` David Gibson
2002-09-12 14:29   ` Tom Rini
2002-09-12  7:23     ` Benjamin Herrenschmidt
2002-09-12 14:51       ` Tom Rini
2002-09-12  7:49         ` Benjamin Herrenschmidt
2002-09-12 15:23           ` Tom Rini
2002-09-12  8:08             ` Benjamin Herrenschmidt
2002-09-12 17:05     ` Matt Porter
2002-09-12 21:33   ` Todd Poynor

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).