All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Yu <chao2.yu@samsung.com>
To: 'Jaegeuk Kim' <jaegeuk.kim@samsung.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH] f2fs: refactor bio-related operations
Date: Mon, 02 Dec 2013 12:47:11 +0800	[thread overview]
Message-ID: <000101ceef19$ae149b50$0a3dd1f0$@samsung.com> (raw)
In-Reply-To: <1385792739-31405-1-git-send-email-jaegeuk.kim@samsung.com>

Hi,

Some comments as following.

> -----Original Message-----
> From: Jaegeuk Kim [mailto:jaegeuk.kim@samsung.com]
> Sent: Saturday, November 30, 2013 2:26 PM
> Cc: linux-fsdevel@vger.kernel.org; linux-kernel@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net
> Subject: [f2fs-dev] [PATCH] f2fs: refactor bio-related operations
> 

[snip]

> +void f2fs_submit_page_mbio(struct f2fs_sb_info *sbi, struct page *page,
> +			block_t blk_addr, enum page_type type, int rw)
> +{
> +	enum page_type btype = PAGE_TYPE_OF_BIO(type);
> +	struct block_device *bdev = sbi->sb->s_bdev;
> +	struct f2fs_bio_info *io;
> +	int bio_blocks;
> +
> +	io = is_read_io(rw) ? &sbi->read_io : &sbi->write_io[btype];
> +
> +	verify_block_addr(sbi, blk_addr);
> +
> +	mutex_lock(&io->io_mutex);
> +
> +	if (!is_read_io(rw))
> +		inc_page_count(sbi, F2FS_WRITEBACK);
> +
> +	if (io->bio && io->last_block_in_bio != blk_addr - 1)
> +		__submit_merged_bio(sbi, io, type, true, rw);
> +alloc_new:
> +	if (io->bio == NULL) {
> +		bio_blocks = MAX_BIO_BLOCKS(max_hw_blocks(sbi));
> +		io->bio = __bio_alloc(bdev, bio_blocks);
> +		io->bio->bi_sector = SECTOR_FROM_BLOCK(sbi, blk_addr);
> +		io->bio->bi_end_io = is_read_io(rw) ? f2fs_read_end_io :
> +							f2fs_write_end_io;
> +		/*
> +		 * The end_io will be assigned at the sumbission phase.
> +		 * Until then, let bio_add_page() merge consecutive IOs as much
> +		 * as possible.
> +		 */
> +	}
> +
> +	if (bio_add_page(io->bio, page, PAGE_CACHE_SIZE, 0) <
> +							PAGE_CACHE_SIZE) {
> +		__submit_merged_bio(sbi, io, type, true, rw);
> +		io->bio = NULL;

We should remove the redundant code " io->bio = NULL;" here,
because __submit_merged_bio does the same job.

[snip]

>  /*
>   * data.c
>   */
> +void f2fs_submit_merged_bio(struct f2fs_sb_info *, enum page_type, bool, int);
> +int f2fs_submit_page_bio(struct f2fs_sb_info *, struct page *, block_t, int);

Redundant to the following code.

> +void f2fs_submit_page_mbio(struct f2fs_sb_info *, struct page *, block_t,
> +							enum page_type, int);
>  int reserve_new_block(struct dnode_of_data *);
>  int f2fs_reserve_block(struct dnode_of_data *, pgoff_t);
>  void update_extent_cache(block_t, struct dnode_of_data *);
>  struct page *find_data_page(struct inode *, pgoff_t, bool);
>  struct page *get_lock_data_page(struct inode *, pgoff_t);
>  struct page *get_new_data_page(struct inode *, struct page *, pgoff_t, bool);
> -int f2fs_readpage(struct f2fs_sb_info *, struct page *, block_t, int);
> -void f2fs_submit_read_bio(struct f2fs_sb_info *, int);
> -void submit_read_page(struct f2fs_sb_info *, struct page *, block_t, int);
> +int f2fs_submit_page_bio(struct f2fs_sb_info *, struct page *, block_t, int);

Here.

[snip]


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk

WARNING: multiple messages have this Message-ID (diff)
From: Chao Yu <chao2.yu@samsung.com>
To: "'Jaegeuk Kim'" <jaegeuk.kim@samsung.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, 谭姝 <shu.tan@samsung.com>
Subject: RE: [f2fs-dev] [PATCH] f2fs: refactor bio-related operations
Date: Mon, 02 Dec 2013 12:47:11 +0800	[thread overview]
Message-ID: <000101ceef19$ae149b50$0a3dd1f0$@samsung.com> (raw)
In-Reply-To: <1385792739-31405-1-git-send-email-jaegeuk.kim@samsung.com>

Hi,

Some comments as following.

> -----Original Message-----
> From: Jaegeuk Kim [mailto:jaegeuk.kim@samsung.com]
> Sent: Saturday, November 30, 2013 2:26 PM
> Cc: linux-fsdevel@vger.kernel.org; linux-kernel@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net
> Subject: [f2fs-dev] [PATCH] f2fs: refactor bio-related operations
> 

[snip]

> +void f2fs_submit_page_mbio(struct f2fs_sb_info *sbi, struct page *page,
> +			block_t blk_addr, enum page_type type, int rw)
> +{
> +	enum page_type btype = PAGE_TYPE_OF_BIO(type);
> +	struct block_device *bdev = sbi->sb->s_bdev;
> +	struct f2fs_bio_info *io;
> +	int bio_blocks;
> +
> +	io = is_read_io(rw) ? &sbi->read_io : &sbi->write_io[btype];
> +
> +	verify_block_addr(sbi, blk_addr);
> +
> +	mutex_lock(&io->io_mutex);
> +
> +	if (!is_read_io(rw))
> +		inc_page_count(sbi, F2FS_WRITEBACK);
> +
> +	if (io->bio && io->last_block_in_bio != blk_addr - 1)
> +		__submit_merged_bio(sbi, io, type, true, rw);
> +alloc_new:
> +	if (io->bio == NULL) {
> +		bio_blocks = MAX_BIO_BLOCKS(max_hw_blocks(sbi));
> +		io->bio = __bio_alloc(bdev, bio_blocks);
> +		io->bio->bi_sector = SECTOR_FROM_BLOCK(sbi, blk_addr);
> +		io->bio->bi_end_io = is_read_io(rw) ? f2fs_read_end_io :
> +							f2fs_write_end_io;
> +		/*
> +		 * The end_io will be assigned at the sumbission phase.
> +		 * Until then, let bio_add_page() merge consecutive IOs as much
> +		 * as possible.
> +		 */
> +	}
> +
> +	if (bio_add_page(io->bio, page, PAGE_CACHE_SIZE, 0) <
> +							PAGE_CACHE_SIZE) {
> +		__submit_merged_bio(sbi, io, type, true, rw);
> +		io->bio = NULL;

We should remove the redundant code " io->bio = NULL;" here,
because __submit_merged_bio does the same job.

[snip]

>  /*
>   * data.c
>   */
> +void f2fs_submit_merged_bio(struct f2fs_sb_info *, enum page_type, bool, int);
> +int f2fs_submit_page_bio(struct f2fs_sb_info *, struct page *, block_t, int);

Redundant to the following code.

> +void f2fs_submit_page_mbio(struct f2fs_sb_info *, struct page *, block_t,
> +							enum page_type, int);
>  int reserve_new_block(struct dnode_of_data *);
>  int f2fs_reserve_block(struct dnode_of_data *, pgoff_t);
>  void update_extent_cache(block_t, struct dnode_of_data *);
>  struct page *find_data_page(struct inode *, pgoff_t, bool);
>  struct page *get_lock_data_page(struct inode *, pgoff_t);
>  struct page *get_new_data_page(struct inode *, struct page *, pgoff_t, bool);
> -int f2fs_readpage(struct f2fs_sb_info *, struct page *, block_t, int);
> -void f2fs_submit_read_bio(struct f2fs_sb_info *, int);
> -void submit_read_page(struct f2fs_sb_info *, struct page *, block_t, int);
> +int f2fs_submit_page_bio(struct f2fs_sb_info *, struct page *, block_t, int);

Here.

[snip]


  parent reply	other threads:[~2013-12-02  4:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-30  6:25 [PATCH] f2fs: refactor bio-related operations Jaegeuk Kim
2013-11-30  6:25 ` Jaegeuk Kim
2013-12-02  2:55 ` Gu Zheng
2013-12-02  4:47 ` Chao Yu [this message]
2013-12-02  4:47   ` [f2fs-dev] " Chao Yu
2013-12-02  8:24   ` Jaegeuk Kim
2013-12-02  8:24     ` Jaegeuk Kim
2013-12-02  8:27 ` [PATCH v2] " Jaegeuk Kim
2013-12-02  9:37   ` [f2fs-dev] " Chao Yu
2013-12-04  6:01   ` Chao Yu
2013-12-04  8:10     ` Jaegeuk Kim
2013-12-04  8:22       ` Chao Yu

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='000101ceef19$ae149b50$0a3dd1f0$@samsung.com' \
    --to=chao2.yu@samsung.com \
    --cc=jaegeuk.kim@samsung.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.