Re: Some bugs in swap_state.c

Chirayu Patel (chirayu@wipro.tcpn.com)
Mon, 23 Mar 1998 20:37:00 +0530 (GMT+0530)


On Sun, 22 Mar 1998, Benjamin C.R. LaHaise wrote:

> > 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.

This function will concern only the swap cache pages. and if you see the
code...free_page(addr) is free_pages (addr, 0) which eventually does a
free_pages_ok(map_nr, 0) call the same as done in __free_pages.

I found that the free_pages is quite tolerant and will ignore calls to
free an already freed. But I need confirmation on this......

> > 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.

Ok!

> > 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.

So, when are this debugging checks suppossed to be removed? :-)

-- Chirayu

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