public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Gu Zheng <guz.fnst@cn.fujitsu.com>
To: jaegeuk.kim@samsung.com
Cc: "Chao Yu" <chao2.yu@samsung.com>,
	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 V2 1/2] f2fs: add a new function to support for merging contiguous read
Date: Mon, 18 Nov 2013 18:10:30 +0800	[thread overview]
Message-ID: <5289E796.1030506@cn.fujitsu.com> (raw)
In-Reply-To: <1384765870.26319.16.camel@kjgkr>

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@samsung.com]
>>> Sent: Monday, November 18, 2013 8:29 AM
>>> To: Chao Yu
>>> Cc: linux-fsdevel@vger.kernel.org; linux-kernel@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.yu@samsung.com>
>>>> Acked-by: Gu Zheng <guz.fnst@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,
> 



  reply	other threads:[~2013-11-18 10:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-16  6:14 [f2fs-dev] [PATCH V2 1/2] f2fs: add a new function to support for merging contiguous read Chao Yu
2013-11-18  0:29 ` Jaegeuk Kim
2013-11-18  1:37   ` Chao Yu
2013-11-18  9:11     ` Jaegeuk Kim
2013-11-18 10:10       ` Gu Zheng [this message]
2013-11-19  1:41       ` 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=5289E796.1030506@cn.fujitsu.com \
    --to=guz.fnst@cn.fujitsu.com \
    --cc=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 \
    --cc=shu.tan@samsung.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