* Re: [PATCH] blktrace: readahead support
@ 2006-07-10 5:46 Milton Miller
2006-07-10 5:53 ` Nathan Scott
2006-07-10 6:24 ` Jens Axboe
0 siblings, 2 replies; 3+ messages in thread
From: Milton Miller @ 2006-07-10 5:46 UTC (permalink / raw)
To: Nathan Scott, Jens Axboe; +Cc: linux-kernel
Looking at the commit
Date: Thu, 6 Jul 2006 08:03:28 +0000 (+0200)
X-Git-Url: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=40359ccb836866435b03a0cb57345002b587d875
> --- a/block/blktrace.c
> +++ b/block/blktrace.c
..
> @@ -79,6 +79,8 @@ static u32 bio_act[3] __read_mostly = {
> (((rw) & (1 << BIO_RW_BARRIER)) >> (BIO_RW_BARRIER - 0))
> #define trace_sync_bit(rw) \
> (((rw) & (1 << BIO_RW_SYNC)) >> (BIO_RW_SYNC - 1))
> +#define trace_ahead_bit(rw) \
> + (((rw) & (1 << BIO_RW_AHEAD)) << (BIO_RW_AHEAD - 0))
>
> /*
> * The worker for the various blk_add_trace*() types. Fills out a
Than doesn't make sense, we are using the bit position in the BIO_RW_
name space twice instead of factoring it out like the other uses.
Looking at include/linux/bio.h line 147 we find
#define BIO_RW_AHEAD 1
So this is moving it from bit 1 (value 2) to bit 2 (value 4).
I think the shift should be << (2 - BIO_RW_AHEAD).
milton
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] blktrace: readahead support
2006-07-10 5:46 [PATCH] blktrace: readahead support Milton Miller
@ 2006-07-10 5:53 ` Nathan Scott
2006-07-10 6:24 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Nathan Scott @ 2006-07-10 5:53 UTC (permalink / raw)
To: Milton Miller; +Cc: Jens Axboe, linux-kernel
On Mon, Jul 10, 2006 at 12:46:03AM -0500, Milton Miller wrote:
> > +#define trace_ahead_bit(rw) \
> > + (((rw) & (1 << BIO_RW_AHEAD)) << (BIO_RW_AHEAD - 0))
> ...
> I think the shift should be << (2 - BIO_RW_AHEAD).
Quite possibly. As long as it ends up in slot 4 in that array still..
which it will.
cheers.
--
Nathan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] blktrace: readahead support
2006-07-10 5:46 [PATCH] blktrace: readahead support Milton Miller
2006-07-10 5:53 ` Nathan Scott
@ 2006-07-10 6:24 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2006-07-10 6:24 UTC (permalink / raw)
To: Milton Miller; +Cc: Nathan Scott, linux-kernel
On Mon, Jul 10 2006, Milton Miller wrote:
> Looking at the commit
>
> Date: Thu, 6 Jul 2006 08:03:28 +0000 (+0200)
> X-Git-Url: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=40359ccb836866435b03a0cb57345002b587d875
>
> > --- a/block/blktrace.c
> > +++ b/block/blktrace.c
> ..
> > @@ -79,6 +79,8 @@ static u32 bio_act[3] __read_mostly = {
> > (((rw) & (1 << BIO_RW_BARRIER)) >> (BIO_RW_BARRIER - 0))
> > #define trace_sync_bit(rw) \
> > (((rw) & (1 << BIO_RW_SYNC)) >> (BIO_RW_SYNC - 1))
> > +#define trace_ahead_bit(rw) \
> > + (((rw) & (1 << BIO_RW_AHEAD)) << (BIO_RW_AHEAD - 0))
> >
> > /*
> > * The worker for the various blk_add_trace*() types. Fills out a
>
>
> Than doesn't make sense, we are using the bit position in the BIO_RW_
> name space twice instead of factoring it out like the other uses.
>
> Looking at include/linux/bio.h line 147 we find
> #define BIO_RW_AHEAD 1
>
> So this is moving it from bit 1 (value 2) to bit 2 (value 4).
>
> I think the shift should be << (2 - BIO_RW_AHEAD).
You are right, it's a little nonsensical right now. I'll get it fixed
up.
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-07-10 6:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-10 5:46 [PATCH] blktrace: readahead support Milton Miller
2006-07-10 5:53 ` Nathan Scott
2006-07-10 6:24 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox