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: <4A573FB9.2090202@kernel.org>
Date:	Fri, 10 Jul 2009 22:18:49 +0900
From:	Tejun Heo <tj@...nel.org>
To:	Christoph Hellwig <hch@...radead.org>
CC:	Boaz Harrosh <bharrosh@...asas.com>,
	Jens Axboe <jens.axboe@...cle.com>,
	Linux Kernel <linux-kernel@...r.kernel.org>,
	James Bottomley <James.Bottomley@...senPartnership.com>,
	linux-scsi <linux-scsi@...r.kernel.org>,
	Niel Lambrechts <niel.lambrechts@...il.com>,
	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>,
	Jens Axboe <axboe@...nel.dk>
Subject: Re: [PATCH 2/4] block: use the same failfast bits for bio and	request

Hello, Christoph.

Christoph Hellwig wrote:
> On Thu, Jul 09, 2009 at 09:45:24AM +0900, Tejun Heo wrote:
>> What's more disturbing to me is the different between RQ and BIO
>> flags.  __REQ_* are bit positions, REQ_* are masks while BIO_* are bit
>> positions.  Sadly it seems it's already too late to change that.  I
>> personally an not a big fan of simple accessors or flags defined as
>> bit positions.  They seem to obscure things without much benefit.
> 
> flags as bit positions generally only make sense if you use
> test/set/clear_bit, otherwise they just confuse things.

Another shortcoming of bit position flags is masking / multi flag
operations.  It's just awful.  I think it's always better to define
flags as masks even when it's used with test/set/clear_bit().  If such
usages are common enough, we can easily add test/set/clear_bit_mask().
The conversion from mask to bit would be constant most of the time and
it's not like fls/ffs() are expensive.

> And the accessors are pretty annoying, especially in the block
> layer.  Trying to find the places where a BIO flag has an actual
> effect is pretty painful due to the mix of the different flags and
> the accessors.

Yeap, fully agreed.

Thanks.

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