lkml.org 
[lkml]   [1999]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: oops if free a locked page
On Tue, 22 Jun 1999, Linus Torvalds wrote:

>No, it's often ok (in fact quite common) to free a page that is locked.

Yes I see your point.

Right now I am using a put_page_refcount to decrease the page count
without calling free_pages by hand when I know I have some additional
refcount that can't trigger the page to be released for real, this way for
example I issue a put_page_refcount(2, page) in truncate_inode_pages
instead of a __free_page in try_to_free_buffers and two __free_pages in
truncate_inode_pages. Since I can't run free_pages I don't run freepages
anymore in try_to_free_buffers and I left the caller to discover if it has
to free the page for real or not (freepages only remove the buffer heads
from the page, start I/O and tell to the caller what it did). The caller
then will unlock the page before freeing the page for real, or it will go
ahead in the inode path only issuing a put_page_refcount(1, page). (so far
it compiles :)

Andrea Arcangeli


-
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:52    [W:0.154 / U:0.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site