* Mapped pages handling in shrink_cache()
@ 2001-12-29 10:17 alad
2001-12-29 10:58 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: alad @ 2001-12-29 10:17 UTC (permalink / raw)
To: linux-kernel
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 <<<<<
}
I am reading 2.4.16
-- Amol
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Mapped pages handling in shrink_cache()
2001-12-29 10:17 Mapped pages handling in shrink_cache() alad
@ 2001-12-29 10:58 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2001-12-29 10:58 UTC (permalink / raw)
To: alad; +Cc: linux-kernel
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().
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-12-29 11:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-29 10:17 Mapped pages handling in shrink_cache() alad
2001-12-29 10:58 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox