linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Todd Poynor <tpoynor@mvista.com>
To: linuxppc-dev <linuxppc-dev@lists.linuxppc.org>
Subject: consistent_free re-revisited
Date: Wed, 11 Sep 2002 14:45:31 -0700	[thread overview]
Message-ID: <3D7FB97B.9060301@mvista.com> (raw)


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/

             reply	other threads:[~2002-09-11 21:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-11 21:45 Todd Poynor [this message]
2002-09-12  3:26 ` consistent_free re-revisited 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D7FB97B.9060301@mvista.com \
    --to=tpoynor@mvista.com \
    --cc=linuxppc-dev@lists.linuxppc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).