public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Fengguang Wu <wfg@mail.ustc.edu.cn>
To: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	jfs-discussion@lists.sourceforge.net,
	Nick Piggin <nickpiggin@yahoo.com.au>
Subject: Re: [PATCH] jfs: clear PAGECACHE_TAG_DIRTY for no-write pages
Date: Sat, 29 Dec 2007 10:21:04 +0800	[thread overview]
Message-ID: <398894876.20324@ustc.edu.cn> (raw)
Message-ID: <E1J8RJw-0001ge-DP@localhost> (raw)
In-Reply-To: <1198860794.13075.15.camel@norville.austin.ibm.com>

On Fri, Dec 28, 2007 at 10:53:14AM -0600, Dave Kleikamp wrote:


> ---
> 
> diff -Nurp linux-2.6.24-rc6-git5/fs/jfs/jfs_metapage.c linux/fs/jfs/jfs_metapage.c
> --- linux-2.6.24-rc6-git5/fs/jfs/jfs_metapage.c	2007-12-28 10:28:33.000000000 -0600
> +++ linux/fs/jfs/jfs_metapage.c	2007-12-28 10:37:30.000000000 -0600
> @@ -360,6 +360,7 @@ static int metapage_writepage(struct pag
>  	struct metapage *mp;
>  	int redirty = 0;
>  	sector_t lblock;
> +	int nr_underway = 0;
>  	sector_t pblock;
>  	sector_t next_block = 0;
>  	sector_t page_start;
> @@ -371,6 +372,7 @@ static int metapage_writepage(struct pag
>  		     (PAGE_CACHE_SHIFT - inode->i_blkbits);
>  	BUG_ON(!PageLocked(page));
>  	BUG_ON(PageWriteback(page));

This line should be moved below:
> +	set_page_writeback(page);

>  
>  	for (offset = 0; offset < PAGE_CACHE_SIZE; offset += PSIZE) {
>  		mp = page_to_mp(page, offset);
> @@ -413,11 +415,10 @@ static int metapage_writepage(struct pag
>  			if (!bio->bi_size)
>  				goto dump_bio;
>  			submit_bio(WRITE, bio);
> +			nr_underway++;
>  			bio = NULL;
> -		} else {
> -			set_page_writeback(page);
> +		} else
>  			inc_io(page);
> -		}
>  		xlen = (PAGE_CACHE_SIZE - offset) >> inode->i_blkbits;
>  		pblock = metapage_get_blocks(inode, lblock, &xlen);
>  		if (!pblock) {
> @@ -449,12 +450,16 @@ static int metapage_writepage(struct pag
>  			goto dump_bio;
>  
>  		submit_bio(WRITE, bio);
> +		nr_underway++;
>  	}
>  	if (redirty)
>  		redirty_page_for_writepage(wbc, page);
+       else
+               set_page_writeback(page);
>  
>  	unlock_page(page);
>  
> +	if (nr_underway == 0)
  +     if (nr_underway == 0 && redirty == 0)

> +		end_page_writeback(page);
> +
>  	return 0;
>  add_failed:
>  	/* We should never reach here, since we're only adding one vec */

Otherwise looks pretty good.

Reviewed-by: Fengguang Wu <wfg@mail.ustc.edu.cn>


  reply	other threads:[~2007-12-29  2:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1J8AC5-0002BE-RP@localhost>
2007-12-28  8:03 ` [PATCH] jfs: clear PAGECACHE_TAG_DIRTY for no-write pages Fengguang Wu
2007-12-28 11:33 ` Peter Zijlstra
     [not found]   ` <E1J8Dbo-0001e2-1T@localhost>
2007-12-28 11:42     ` Fengguang Wu
2007-12-28 16:25   ` Dave Kleikamp
2007-12-28 16:53     ` Dave Kleikamp
     [not found]       ` <E1J8RJw-0001ge-DP@localhost>
2007-12-29  2:21         ` Fengguang Wu [this message]
2007-12-29  4:50         ` Dave Kleikamp
     [not found]           ` <E1J8UbJ-0007Be-E3@localhost>
2007-12-29  5:51             ` Fengguang Wu
2007-12-29 15:20             ` Dave Kleikamp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=398894876.20324@ustc.edu.cn \
    --to=wfg@mail.ustc.edu.cn \
    --cc=akpm@linux-foundation.org \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=peterz@infradead.org \
    --cc=shaggy@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox