From: omar ramirez <or.rmz1@gmail.com>
To: linux-mm@kvack.org
Subject: __get_free_pages page count increment
Date: Tue, 14 Jul 2009 19:02:49 -0500 [thread overview]
Message-ID: <983c694e0907141702t39bebefdr4024720f0a6dc4e1@mail.gmail.com> (raw)
Hi,
I have been digging about __get_free_pages function, and wanted to now
why only the first page reserved with this function increments the
page count and for the other they are marked as 0.
So here it is what I'm doing, I'm reserving a chunk of pages (using
__get_free_pages) in a display driver, then I pass that through
userspace to a dsp driver to decode a video file and return the buffer
to display.
The buffer is mapped in the dsp, which also follows the get_page
approach but it goes page-by-page on the buffer, incrementing the page
count for all of the pages (so now first page count from the buffer
will be 2 <display, dsp>, but for the rest it will be 1 <dsp>).
The issue comes once those pages are unmapped from the dsp driver,
because it will do a page_cache_release on all the reserved pages
(which leave the count as it was before, first page 1 <display> and
the rest as 0).
This will throw the BUG: bad page state error because the count is
being marked as 0 for the process using that buffer.
So my question is, is it ok that the page count is NOT incremented for
all but first page of __get_free_pages?
Thanks in advance,
omar
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2009-07-14 23:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-15 0:02 omar ramirez [this message]
2009-07-15 2:30 ` __get_free_pages page count increment Alexey Korolev
2009-07-15 20:26 ` omar ramirez
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=983c694e0907141702t39bebefdr4024720f0a6dc4e1@mail.gmail.com \
--to=or.rmz1@gmail.com \
--cc=linux-mm@kvack.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).