Re: [f2fs-dev] [PATCH V2 1/2] f2fs: add a new function to supportfor merging contiguous read
From: Gu Zheng
Date: Mon Nov 18 2013 - 05:31:24 EST
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.kim@xxxxxxxxxxx]
>>> Sent: Monday, November 18, 2013 8:29 AM
>>> To: Chao Yu
>>> Cc: linux-fsdevel@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; linux-f2fs-devel@xxxxxxxxxxxxxxxxxxxxx; èå
>>> 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.yu@xxxxxxxxxxx>
>>>> Acked-by: Gu Zheng <guz.fnst@xxxxxxxxxxxxxx>
>>>> ---
>>>> 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,
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/