Re: [PATCH] modified segq for 2.5

Andrew Morton
2002-09-09T20:57:22Z

Andrew Morton wrote:
>
> Rik van Riel wrote:
> >
> > ...
> > > > Hmmm indeed, I forgot this. Note that IO completion state is
> > > > too late, since then you'll have already pushed other pages
> > > > out to the inactive list...
> > >
> > > OK. So how would you like to handle those pages?
> >
> > Move them to the inactive list the moment we're done writing
> > them, that is, the moment we move on to the next page. We
> > wouldn't want to move the last page from /var/log/messages to
> > the inactive list all the time ;)
>
> The moment "who" has done writing them? Some writeout
> comes in via shrink_foo() and a ton of writeout comes in
> via balance_dirty_pages(), pdflush, etc.
>
> Do we need to distinguish between the various contexts?

Forget I said that.

I added this:

--- 2.5.34/fs/mpage.c~segq Mon Sep 9 13:53:25 2002
+++ 2.5.34-akpm/fs/mpage.c Mon Sep 9 13:54:07 2002
@@ -583,10 +583,9 @@ mpage_writepages(struct address_space *m
bio = mpage_writepage(bio, page, get_block,
&last_block_in_bio, &ret);
}
- if ((current->flags & PF_MEMALLOC) &&
- !PageActive(page) && PageLRU(page)) {
+ if (PageActive(page) && PageLRU(page)) {
if (!pagevec_add(&pvec, page))
- pagevec_deactivate_inactive(&pvec);
+ pagevec_deactivate_active(&pvec);
page = NULL;
}
if (ret == -EAGAIN && page) {
@@ -612,7 +611,7 @@ mpage_writepages(struct address_space *m
* Leave any remaining dirty pages on ->io_pages
*/
write_unlock(&mapping->page_lock);
- pagevec_deactivate_inactive(&pvec);
+ pagevec_deactivate_active(&pvec);
if (bio)
mpage_bio_submit(WRITE, bio);
return ret;