lkml.org 
[lkml]   [1999]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: how does generic_file_read work with page_cache?
> From: "Peter J. Braam" <braam@cs.cmu.edu>
> Date: Wed, 22 Sep 1999 03:39:07 +0000

[snip]

> - functions reading the page do a page_get -- but there is no page_put,
> instead they call the un-understandable page_cache_release.
>
> Below in the snippet from generic_page read, the normal path does:
>
> get_page(page)
> if all is well copy the data from the page
> page_cache_release(page)
>
> But the latter is in fact __free_page(page) which is defined in
> page_alloc.c and is very appropriately labeled as "You really aren't
> expected to understand this".
>
> - What does that function do with the page?
> - Who sets back the page count, which was increased by get_page?
> - How can I operate with pages in a file system?

yeah, that is somewhat silly. it should have been put_page(page) rather
than page_cache_release(page) if only for clarity. anyway, put_page
is also #defined to be __free_page.
it's __free_page which decrements the page count. if the count drops to zero,
then __free_page really frees the page i.e. puts it back into the free page
list, merging with buddy if possible, etc.

ganesh

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.127 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site