Skip to contentSkip to conversation

f2fs: add a new function to support for merging contiguous read

PATCH Superseded Chao Yu 3 participants 6 messages Nov 16, 2013 – Nov 19, 2013

Subsystems (2)
lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH v2 1/2 f2fs: add a new function to support for merging contiguous read

For better read performance, we add a new function to support for merging contiguous read as the one for write.

v1-->v2:
o add declarations here as Gu Zheng suggested.

---
 fs/f2fs/data.c |   45 +++++++++++++++++++++++++++++++++++++++++++++
 fs/f2fs/f2fs.h |    4 ++++
 2 files changed, 49 insertions(+)
fs/f2fs/data.c +45 -0
index aa3438c..18107cb 100644
@@ -404,6 +404,51 @@ int f2fs_readpage(struct f2fs_sb_info *sbi, struct page *page,
 	return 0;
 }
 
+void f2fs_submit_read_bio(struct f2fs_sb_info *sbi, int rw)
+{
+	down_read(&sbi->bio_sem);
+	if (sbi->read_bio) {
+		submit_bio(rw, sbi->read_bio);
+		sbi->read_bio = NULL;
+	}
+	up_read(&sbi->bio_sem);
+}
+
+void submit_read_page(struct f2fs_sb_info *sbi, struct page *page,
+					block_t blk_addr, int rw)
+{
+	struct block_device *bdev = sbi->sb->s_bdev;
+	int bio_blocks;
+
+	verify_block_addr(sbi, blk_addr);
+
+	down_read(&sbi->bio_sem);
+
+	if (sbi->read_bio && sbi->last_read_block != blk_addr - 1) {
+		submit_bio(rw, sbi->read_bio);
+		sbi->read_bio = NULL;
+	}
+
+alloc_new:
+	if (sbi->read_bio == NULL) {
+		bio_blocks = MAX_BIO_BLOCKS(max_hw_blocks(sbi));
+		sbi->read_bio = f2fs_bio_alloc(bdev, bio_blocks);
+		sbi->read_bio->bi_sector = SECTOR_FROM_BLOCK(sbi, blk_addr);
+		sbi->read_bio->bi_end_io = read_end_io;
+	}
+
+	if (bio_add_page(sbi->read_bio, page, PAGE_CACHE_SIZE, 0) <
+							PAGE_CACHE_SIZE) {
+		submit_bio(rw, sbi->read_bio);
+		sbi->read_bio = NULL;
+		goto alloc_new;
+	}
+
+	sbi->last_read_block = blk_addr;
+
+	up_read(&sbi->bio_sem);
+}
+
 /*
  * This function should be used by the data read flow only where it
  * does not check the "create" flag that indicates block allocation.
fs/f2fs/f2fs.h +4 -0
index 89dc750..bfe9d87 100644
@@ -359,6 +359,8 @@ struct f2fs_sb_info {
 
 	/* for segment-related operations */
 	struct f2fs_sm_info *sm_info;		/* segment manager */
+	struct bio *read_bio;			/* read bios to merge */
+	sector_t last_read_block;		/* last read block number */
 	struct bio *bio[NR_PAGE_TYPE];		/* bios to merge */
 	sector_t last_block_in_bio[NR_PAGE_TYPE];	/* last block number */
 	struct rw_semaphore bio_sem;		/* IO semaphore */
@@ -1111,6 +1113,8 @@ 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 do_write_data_page(struct page *);
 
 /*
Signature · 9 lines
1.7.9.5


------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
#1 lore raw

Hi Chao,

2013-11-16 (토), 14:14 +0800, Chao Yu:

Quoted 1 line

For better read performance, we add a new function to support for merging contiguous read as the one for write.

Please consider 80 columns for the description.
I cannot fix this at every time though. :(

Quoted 16 lines

v1-->v2:
o add declarations here as Gu Zheng suggested.

---
 fs/f2fs/data.c |   45 +++++++++++++++++++++++++++++++++++++++++++++
 fs/f2fs/f2fs.h |    4 ++++
 2 files changed, 49 insertions(+)
fs/f2fs/data.c +0 -0
index aa3438c..18107cb 100644

fs/f2fs/data.c int f2fs_readpage(struct f2fs_sb_info *sbi, struct page *page, · line 409

Quoted 6 lines
fs/f2fs/data.c +3 -0
@@ -404,6 +404,51 @@ int f2fs_readpage(struct f2fs_sb_info *sbi, struct page *page,
 	return 0;
 }
 
+void f2fs_submit_read_bio(struct f2fs_sb_info *sbi, int rw)
+{
+	down_read(&sbi->bio_sem);

Is there any reason to use down_read()?
It seems that we need to declare sbi->bio_read and sbi->bio_write instead of sbi->bio_sem.
In addition to that, we need to use down_write(&sbi->bio_read) here.

fs/f2fs/data.c int f2fs_readpage(struct f2fs_sb_info *sbi, struct page *page, · line 414

Quoted 5 lines
fs/f2fs/data.c +5 -0
+	if (sbi->read_bio) {
+		submit_bio(rw, sbi->read_bio);
+		sbi->read_bio = NULL;
+	}
+	up_read(&sbi->bio_sem);

up_write(&sbi->bio_read);

fs/f2fs/data.c int f2fs_readpage(struct f2fs_sb_info *sbi, struct page *page, · line 425

Quoted 11 lines
fs/f2fs/data.c +11 -0
+}
+
+void submit_read_page(struct f2fs_sb_info *sbi, struct page *page,
+					block_t blk_addr, int rw)
+{
+	struct block_device *bdev = sbi->sb->s_bdev;
+	int bio_blocks;
+
+	verify_block_addr(sbi, blk_addr);
+
+	down_read(&sbi->bio_sem);

down_write(&sbi->bio_read);

Quoted 14 lines
fs/f2fs/data.c +14 -0
+
+	if (sbi->read_bio && sbi->last_read_block != blk_addr - 1) {
+		submit_bio(rw, sbi->read_bio);
+		sbi->read_bio = NULL;
+	}
+
+alloc_new:
+	if (sbi->read_bio == NULL) {
+		bio_blocks = MAX_BIO_BLOCKS(max_hw_blocks(sbi));
+		sbi->read_bio = f2fs_bio_alloc(bdev, bio_blocks);
+		sbi->read_bio->bi_sector = SECTOR_FROM_BLOCK(sbi, blk_addr);
+		sbi->read_bio->bi_end_io = read_end_io;
+	}
+

fs/f2fs/data.c int f2fs_readpage(struct f2fs_sb_info *sbi, struct page *page, · line 449

Quoted 10 lines
fs/f2fs/data.c +10 -0
+	if (bio_add_page(sbi->read_bio, page, PAGE_CACHE_SIZE, 0) <
+							PAGE_CACHE_SIZE) {
+		submit_bio(rw, sbi->read_bio);
+		sbi->read_bio = NULL;
+		goto alloc_new;
+	}
+
+	sbi->last_read_block = blk_addr;
+
+	up_read(&sbi->bio_sem);

up_write(&sbi->bio_read);

Quoted 27 lines
fs/f2fs/data.c +2 -0
+}
+
 /*
  * This function should be used by the data read flow only where it
  * does not check the "create" flag that indicates block allocation.
fs/f2fs/f2fs.h +4 -0
index 89dc750..bfe9d87 100644
@@ -359,6 +359,8 @@ struct f2fs_sb_info {
 
 	/* for segment-related operations */
 	struct f2fs_sm_info *sm_info;		/* segment manager */
+	struct bio *read_bio;			/* read bios to merge */
+	sector_t last_read_block;		/* last read block number */
 	struct bio *bio[NR_PAGE_TYPE];		/* bios to merge */
 	sector_t last_block_in_bio[NR_PAGE_TYPE];	/* last block number */
 	struct rw_semaphore bio_sem;		/* IO semaphore */
@@ -1111,6 +1113,8 @@ 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 do_write_data_page(struct page *);
 
 /*
Signature · 7 lines
Jaegeuk Kim
Samsung

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#2 lore raw

Hi Kim,

Quoted 7 lines

-----Original Message-----
From: Jaegeuk Kim [mailto:[email protected]]
Sent: Monday, November 18, 2013 8:29 AM
To: Chao Yu
Cc: [email protected]; [email protected]; [email protected]; 谭姝
Subject: Re: [f2fs-dev] [PATCH V2 1/2] f2fs: add a new function to support for merging contiguous read

Quoted 7 lines

Hi Chao,

2013-11-16 (토), 14:14 +0800, Chao Yu:

Quoted 1 line

For better read performance, we add a new function to support for merging contiguous read as the one for write.

Please consider 80 columns for the description.
I cannot fix this at every time though. :(

Got it, sorry about my carelessness in previous patch.

Quoted 20 lines
Quoted 20 lines

v1-->v2:
o add declarations here as Gu Zheng suggested.

---
 fs/f2fs/data.c |   45 +++++++++++++++++++++++++++++++++++++++++++++
 fs/f2fs/f2fs.h |    4 ++++
 2 files changed, 49 insertions(+)
fs/f2fs/data.c +0 -0
index aa3438c..18107cb 100644
@@ -404,6 +404,51 @@ int f2fs_readpage(struct f2fs_sb_info *sbi, struct page *page,
 	return 0;
 }
 
Quoted 5 lines

fs/f2fs/data.c int f2fs_readpage(struct f2fs_sb_info *sbi, struct page *page, · line 409

Quoted 3 lines
fs/f2fs/data.c +3 -0
+void f2fs_submit_read_bio(struct f2fs_sb_info *sbi, int rw)
+{
+	down_read(&sbi->bio_sem);

Is there any reason to use down_read()?

Isn't that we use bio_sem to let w/r or w/w submitting be mutex?

Quoted 3 lines

It seems that we need to declare sbi->bio_read and sbi->bio_write instead of sbi->bio_sem.
In addition to that, we need to use down_write(&sbi->bio_read) here.

If so, it looks similar between (struct rw_semaphore) sbi->bio_read and (struct bio *) sbi->read_bio.
How about using read_bio_sem/rbio_sem to differentiate from sbi->read_bio?

Quoted 76 lines

fs/f2fs/data.c int f2fs_readpage(struct f2fs_sb_info *sbi, struct page *page, · line 414

Quoted 6 lines
fs/f2fs/data.c +5 -0
+	if (sbi->read_bio) {
+		submit_bio(rw, sbi->read_bio);
+		sbi->read_bio = NULL;
+	}
+	up_read(&sbi->bio_sem);

up_write(&sbi->bio_read);

fs/f2fs/data.c int f2fs_readpage(struct f2fs_sb_info *sbi, struct page *page, · line 425

Quoted 11 lines
fs/f2fs/data.c +11 -0
+}
+
+void submit_read_page(struct f2fs_sb_info *sbi, struct page *page,
+					block_t blk_addr, int rw)
+{
+	struct block_device *bdev = sbi->sb->s_bdev;
+	int bio_blocks;
+
+	verify_block_addr(sbi, blk_addr);
+
+	down_read(&sbi->bio_sem);

down_write(&sbi->bio_read);

Quoted 14 lines
fs/f2fs/data.c +14 -0
+
+	if (sbi->read_bio && sbi->last_read_block != blk_addr - 1) {
+		submit_bio(rw, sbi->read_bio);
+		sbi->read_bio = NULL;
+	}
+
+alloc_new:
+	if (sbi->read_bio == NULL) {
+		bio_blocks = MAX_BIO_BLOCKS(max_hw_blocks(sbi));
+		sbi->read_bio = f2fs_bio_alloc(bdev, bio_blocks);
+		sbi->read_bio->bi_sector = SECTOR_FROM_BLOCK(sbi, blk_addr);
+		sbi->read_bio->bi_end_io = read_end_io;
+	}
+

fs/f2fs/data.c int f2fs_readpage(struct f2fs_sb_info *sbi, struct page *page, · line 449

Quoted 10 lines
fs/f2fs/data.c +10 -0
+	if (bio_add_page(sbi->read_bio, page, PAGE_CACHE_SIZE, 0) <
+							PAGE_CACHE_SIZE) {
+		submit_bio(rw, sbi->read_bio);
+		sbi->read_bio = NULL;
+		goto alloc_new;
+	}
+
+	sbi->last_read_block = blk_addr;
+
+	up_read(&sbi->bio_sem);

up_write(&sbi->bio_read);

Quoted 26 lines
fs/f2fs/data.c +2 -0
+}
+
 /*
  * This function should be used by the data read flow only where it
  * does not check the "create" flag that indicates block allocation.
fs/f2fs/f2fs.h +4 -0
index 89dc750..bfe9d87 100644
@@ -359,6 +359,8 @@ struct f2fs_sb_info {
 
 	/* for segment-related operations */
 	struct f2fs_sm_info *sm_info;		/* segment manager */
+	struct bio *read_bio;			/* read bios to merge */
+	sector_t last_read_block;		/* last read block number */
 	struct bio *bio[NR_PAGE_TYPE];		/* bios to merge */
 	sector_t last_block_in_bio[NR_PAGE_TYPE];	/* last block number */
 	struct rw_semaphore bio_sem;		/* IO semaphore */
@@ -1111,6 +1113,8 @@ 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 do_write_data_page(struct page *);
 
Quoted 5 lines

fs/f2fs/f2fs.h struct page *find_data_page(struct inode *, pgoff_t, bool); · line 1120

Quoted 1 line
fs/f2fs/f2fs.h +0 -0
 /*

--
Jaegeuk Kim
Samsung

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

#3 lore raw

Hi,

2013-11-18 (월), 09:37 +0800, Chao Yu:

Quoted 39 lines

Hi Kim,

Quoted 7 lines

-----Original Message-----
From: Jaegeuk Kim [mailto:[email protected]]
Sent: Monday, November 18, 2013 8:29 AM
To: Chao Yu
Cc: [email protected]; [email protected]; [email protected]; 谭姝
Subject: Re: [f2fs-dev] [PATCH V2 1/2] f2fs: add a new function to support for merging contiguous read

Quoted 7 lines

Hi Chao,

2013-11-16 (토), 14:14 +0800, Chao Yu:

Quoted 1 line

For better read performance, we add a new function to support for merging contiguous read as the one for write.

Please consider 80 columns for the description.
I cannot fix this at every time though. :(

Got it, sorry about my carelessness in previous patch.

Quoted 20 lines
Quoted 20 lines

v1-->v2:
o add declarations here as Gu Zheng suggested.

---
 fs/f2fs/data.c |   45 +++++++++++++++++++++++++++++++++++++++++++++
 fs/f2fs/f2fs.h |    4 ++++
 2 files changed, 49 insertions(+)
fs/f2fs/data.c +0 -0
index aa3438c..18107cb 100644
@@ -404,6 +404,51 @@ int f2fs_readpage(struct f2fs_sb_info *sbi, struct page *page,
 	return 0;
 }
 
Quoted 7 lines
Quoted 5 lines

fs/f2fs/data.c int f2fs_readpage(struct f2fs_sb_info *sbi, struct page *page, · line 409

Quoted 3 lines
fs/f2fs/data.c +3 -0
+void f2fs_submit_read_bio(struct f2fs_sb_info *sbi, int rw)
+{
+	down_read(&sbi->bio_sem);

Is there any reason to use down_read()?

Isn't that we use bio_sem to let w/r or w/w submitting be mutex?

As I examined the bio_sem, I think we don't need to use a semaphore for read and write IOs.
Just it is enough to use a mutex for writes only.

Quoted 9 lines
Quoted 4 lines

It seems that we need to declare sbi->bio_read and sbi->bio_write instead of sbi->bio_sem.
In addition to that, we need to use down_write(&sbi->bio_read) here.

If so, it looks similar between (struct rw_semaphore) sbi->bio_read and (struct bio *) sbi->read_bio.
How about using read_bio_sem/rbio_sem to differentiate from sbi->read_bio?

I think sbi->write_mutex and sbi->read_mutex are much better.

Could you refer the following patches?
Thanks,

Signature · 15 lines
Jaegeuk Kim
Samsung



------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
#4 lore raw
Quoted 48 lines · Jaegeuk Kim

Hi,

2013-11-18 (월), 09:37 +0800, Chao Yu:

Quoted 45 lines

Hi Kim,

Quoted 7 lines

-----Original Message-----
From: Jaegeuk Kim [mailto:[email protected]]
Sent: Monday, November 18, 2013 8:29 AM
To: Chao Yu
Cc: [email protected]; [email protected]; [email protected]; 谭姝
Subject: Re: [f2fs-dev] [PATCH V2 1/2] f2fs: add a new function to support for merging contiguous read

Quoted 7 lines

Hi Chao,

2013-11-16 (토), 14:14 +0800, Chao Yu:

Quoted 1 line

For better read performance, we add a new function to support for merging contiguous read as the one for write.

Please consider 80 columns for the description.
I cannot fix this at every time though. :(

Got it, sorry about my carelessness in previous patch.

Quoted 25 lines
Quoted 17 lines

v1-->v2:
o add declarations here as Gu Zheng suggested.

---
 fs/f2fs/data.c |   45 +++++++++++++++++++++++++++++++++++++++++++++
 fs/f2fs/f2fs.h |    4 ++++
 2 files changed, 49 insertions(+)
fs/f2fs/data.c +0 -0
index aa3438c..18107cb 100644

fs/f2fs/data.c int f2fs_readpage(struct f2fs_sb_info *sbi, struct page *page, · line 409

Quoted 6 lines
fs/f2fs/data.c +3 -0
@@ -404,6 +404,51 @@ int f2fs_readpage(struct f2fs_sb_info *sbi, struct page *page,
 	return 0;
 }
 
+void f2fs_submit_read_bio(struct f2fs_sb_info *sbi, int rw)
+{
+	down_read(&sbi->bio_sem);

Is there any reason to use down_read()?

Quoted 5 lines
Quoted 1 line

Isn't that we use bio_sem to let w/r or w/w submitting be mutex?

As I examined the bio_sem, I think we don't need to use a semaphore for read and write IOs.
Just it is enough to use a mutex for writes only.

Agree. Mutex is more suitable here, we just want to protect the write bio related fields in the write patch, no relations to read.

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

It seems that we need to declare sbi->bio_read and sbi->bio_write instead of sbi->bio_sem.
In addition to that, we need to use down_write(&sbi->bio_read) here.

Quoted 6 lines
Quoted 4 lines

If so, it looks similar between (struct rw_semaphore) sbi->bio_read and (struct bio *) sbi->read_bio.
How about using read_bio_sem/rbio_sem to differentiate from sbi->read_bio?

I think sbi->write_mutex and sbi->read_mutex are much better.

It's more reasonable and readable.

Thanks,
Gu

Quoted 4 lines

Could you refer the following patches?
Thanks,

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

author
#5 lore raw
In reply to Jaegeuk Kim

Hi

Quoted 62 lines

-----Original Message-----
From: Jaegeuk Kim [mailto:[email protected]]
Sent: Monday, November 18, 2013 5:11 PM
To: Chao Yu
Cc: [email protected]; [email protected]; [email protected]; '谭姝'
Subject: RE: [f2fs-dev] [PATCH V2 1/2] f2fs: add a new function to support for merging contiguous read

Hi,

2013-11-18 (월), 09:37 +0800, Chao Yu:

Quoted 7 lines

Hi Kim,

Quoted 5 lines

-----Original Message-----
From: Jaegeuk Kim [mailto:[email protected]]
Sent: Monday, November 18, 2013 8:29 AM
To: Chao Yu
Cc: [email protected]; [email protected];

[email protected]; 谭姝

Quoted 1 line
Quoted 1 line

Subject: Re: [f2fs-dev] [PATCH V2 1/2] f2fs: add a new function to support for

merging contiguous read

Quoted 5 lines
Quoted 5 lines

Hi Chao,

2013-11-16 (토), 14:14 +0800, Chao Yu:

Quoted 1 line

For better read performance, we add a new function to support for merging

contiguous read as the one for write.

Quoted 15 lines
Quoted 3 lines

Please consider 80 columns for the description.
I cannot fix this at every time though. :(

Got it, sorry about my carelessness in previous patch.

Quoted 9 lines
Quoted 9 lines

v1-->v2:
o add declarations here as Gu Zheng suggested.

---
 fs/f2fs/data.c |   45

+++++++++++++++++++++++++++++++++++++++++++++

Quoted 8 lines
Quoted 8 lines

fs/f2fs/data.c int f2fs_readpage(struct f2fs_sb_info *sbi, struct

Quoted 8 lines
 fs/f2fs/f2fs.h |    4 ++++
 2 files changed, 49 insertions(+)
fs/f2fs/data.c +0 -0
index aa3438c..18107cb 100644
@@ -404,6 +404,51 @@ int f2fs_readpage(struct f2fs_sb_info *sbi, struct

page *page,

Quoted 9 lines
Quoted 8 lines

fs/f2fs/data.c int f2fs_readpage(struct f2fs_sb_info *sbi, struct page *page, · line 409

Quoted 6 lines
fs/f2fs/data.c +3 -0
 	return 0;
 }
 
+void f2fs_submit_read_bio(struct f2fs_sb_info *sbi, int rw)
+{
+	down_read(&sbi->bio_sem);

Is there any reason to use down_read()?

Quoted 5 lines
Quoted 1 line

Isn't that we use bio_sem to let w/r or w/w submitting be mutex?

As I examined the bio_sem, I think we don't need to use a semaphore for read and write IOs.
Just it is enough to use a mutex for writes only.

Agreed, it could also improve efficiency of read/write request concurrent.

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

It seems that we need to declare sbi->bio_read and sbi->bio_write instead of sbi->bio_sem.
In addition to that, we need to use down_write(&sbi->bio_read) here.

Quoted 8 lines
Quoted 4 lines

If so, it looks similar between (struct rw_semaphore) sbi->bio_read and (struct bio *) sbi->read_bio.
How about using read_bio_sem/rbio_sem to differentiate from sbi->read_bio?

I think sbi->write_mutex and sbi->read_mutex are much better.

Could you refer the following patches?

It's better, I will refer your patch.
And how about this following patch to reduce race of write_mutex between DATA/NODE/META writer?

Quoted 5 lines

Thanks,

--
Jaegeuk Kim
Samsung

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel