lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANejiEWecb58G--=mwez+A4Ra6nJ0qOHGMcJA-nOGH=jmGA3qQ@mail.gmail.com>
Date:	Wed, 21 Mar 2012 09:22:46 +0800
From:	Shaohua Li <shli@...nel.org>
To:	Vivek Goyal <vgoyal@...hat.com>
Cc:	linux-kernel@...r.kernel.org, linux-raid@...r.kernel.org,
	neilb@...e.de, axboe@...nel.dk, martin.petersen@...cle.com
Subject: Re: [patch v2 2/6] blk: dont allow discard request merge temporarily

2012/3/21 Vivek Goyal <vgoyal@...hat.com>:
> On Fri, Mar 16, 2012 at 03:32:15PM +0800, Shaohua Li wrote:
>> Didn't allow discard request merge temporarily, as SCSI layer isn't ready
>> for discard merge as Martin Petersen pointed out. This isn't fair for
>> non-scsi device, but looks this is the only way I can do currently.
>>
>> We should have the same issue before, but maybe because discard merge is
>> very rare case. But now raid0/10 makes the merge quite possible, so we need
>> disable it explicitly.
>>
>> Signed-off-by: Shaohua Li <shli@...ionio.com>
>> ---
>>  include/linux/blkdev.h |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> Index: linux/include/linux/blkdev.h
>> ===================================================================
>> --- linux.orig/include/linux/blkdev.h 2012-03-14 09:20:06.787261188 +0800
>> +++ linux/include/linux/blkdev.h      2012-03-14 09:20:47.797261248 +0800
>> @@ -575,7 +575,7 @@ static inline void blk_clear_queue_full(
>>   * it already be started by driver.
>>   */
>>  #define RQ_NOMERGE_FLAGS     \
>> -     (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA)
>> +     (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA | REQ_DISCARD)
>>  #define rq_mergeable(rq)     \
>>       (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \
>>        (((rq)->cmd_flags & REQ_DISCARD) || \
>
> I think you will need to do little more cleanup to make discard
> unmergeable.
>
> - Change rq_mergeable(rq)
> - Change attempt_merge() and get rid of special conditions of allowing
>  discard merge.
>
> Martin had a bigger patch where he wanted to cleanup many discard specific
> condition checks.
>
> As you are just focusing on disabling merging for discard requests, you
> might as well just pick the relevant pieces from the patch.
>
> http://www.spinics.net/lists/linux-scsi/msg57779.html
Thanks for pointing out the thread. I didn't think disabling discard merging
permanently is a good idea. We can't do the merge because that code isn't
ready (actually just for driver of SCSI). Enabling discard merge is required
for device with slow discard (and very helpful for raid), so I just want a
temporarily disabling for the merge. Just changing RQ_NOMERGE_FLAGS
is an easy workaround for this goal.

Thanks,
Shaohua
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ