lkml.org 
[lkml]   [2001]   [Dec]   [29]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateSat, 29 Dec 2001 02:58:17 -0800
FromAndrew Morton <>
SubjectRe: Mapped pages handling in shrink_cache()
alad@hss.hns.com wrote:
> 
> Hi, In the following code from shrink_cache()
> 
>           if (PageDirty(page) && is_page_cache_freeable(page) && page->mapping)
> {
>                .
>                .
>                .
> 
>                int (*writepage)(struct page *);
> 
>                writepage = page->mapping->a_ops->writepage;
>                if ((gfp_mask & __GFP_FS) && writepage) {
>                     ClearPageDirty(page);
>                     SetPageLaunder(page);
>                     page_cache_get(page);
>                     spin_unlock(&pagemap_lru_lock);
> 
>                     writepage(page);
>                     page_cache_release(page);
> 
>                     spin_lock(&pagemap_lru_lock);
>                     continue;      <<<<<<< shouldn't the page be unlocked before
>  continuing with the next page <<<<<
>                }
> 

The page is unlocked when IO completes, in interrupt context.
See end_buffer_io_async().
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:14    [from the cache]
©2003-2008