On 11/18/2013 05:11 PM, Jaegeuk Kim wrote:

> Hi,
> 
> 2013-11-18 (월), 09:37 +0800, Chao Yu:
>> Hi Kim,
>>
>>> -----Original Message-----
>>> From: Jaegeuk Kim [mailto:jaegeuk....@samsung.com]
>>> Sent: Monday, November 18, 2013 8:29 AM
>>> To: Chao Yu
>>> Cc: linux-fsde...@vger.kernel.org; linux-ker...@vger.kernel.org; 
>>> linux-f2fs-devel@lists.sourceforge.net; 谭姝
>>> Subject: Re: [f2fs-dev] [PATCH V2 1/2] f2fs: add a new function to support 
>>> for merging contiguous read
>>>
>>> Hi Chao,
>>>
>>> 2013-11-16 (토), 14:14 +0800, Chao Yu:
>>>> 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.
>>
>>>
>>>>
>>>> v1-->v2:
>>>>  o add declarations here as Gu Zheng suggested.
>>>>
>>>> Signed-off-by: Chao Yu <chao2...@samsung.com>
>>>> Acked-by: Gu Zheng <guz.f...@cn.fujitsu.com>
>>>> ---
>>>>  fs/f2fs/data.c |   45 +++++++++++++++++++++++++++++++++++++++++++++
>>>>  fs/f2fs/f2fs.h |    4 ++++
>>>>  2 files changed, 49 insertions(+)
>>>>
>>>> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
>>>> index aa3438c..18107cb 100644
>>>> --- a/fs/f2fs/data.c
>>>> +++ b/fs/f2fs/data.c
>>>> @@ -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()?
>>
>> 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.

> 
>>
>>> 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.

It's more reasonable and readable.

Thanks,
Gu

> 
> 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
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to