lkml.org 
[lkml]   [1998]   [Mar]   [22]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateSun, 22 Mar 1998 10:51:28 -0500 (EST)
From"Benjamin C.R. LaHaise" <>
SubjectRe: Some bugs in swap_state.c
On Sun, 22 Mar 1998, Chirayu Patel wrote:

> Hi,
> 
> I was going through the swap_state.c code and would like to report the    
> following bugs/suggestions.
> 
> 1. There is a call to free_page (addr) at the end of the function     
> free_page_and_swap_cache (unsigned long addr). Since we are calling
> __free_page (page) in remove_from_swap_cache this call is not correct. Can
> anyone tell me hte problems which can be caused due to freeing a page
> which is already freed. Are the necessary checks for this in place?

Ummmm, are you sure?  Remember that page-cache pages will have a use count
beginning at 2.
> 2. Function find_in_swap_cache(struct page *page) dosent seem to be used
> anywhere, so might as well remove it from the file. The name also dosent
> make any sense.     

Looks good -- must've been a leftover from Stephen's swap cache cleanup.

> 3. I have removed a trivial check from the function lookup_swap_cache as  
> it seems to be unnecessary after the call to find_page.
...

It is a debugging/stanity check item -> without the comparison of
page->inode against &swapper_inode, the check is not so useful.

		-ben


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 12:41    [W:18.413 / U:0.000 seconds]
©2003-2008 Jasper Spaans