In commit e9c7469bb4f502dafc092166201bea1ad5fc0fbf:
Tejun Heo introduced "implment REQ_FLUSH/FUA support".
But for direct-write-blocks, it maybe for other purpose which like the
regular file.
And this flag will set STRIPE_PREREAD_ACTIVE which decreaed the change
to full write.
But this patch remove REQ_SYNC only judging the WRITE_ODIRECT,it will
contail regular file.So it maybe not correctly.
How can difference odriect_write between regular file or block file?
Signed-off-by: Jianpeng Ma <redacted>
---
drivers/md/raid5.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
In commit e9c7469bb4f502dafc092166201bea1ad5fc0fbf:
Tejun Heo introduced "implment REQ_FLUSH/FUA support".
But for direct-write-blocks, it maybe for other purpose which like the
regular file.
And this flag will set STRIPE_PREREAD_ACTIVE which decreaed the change
to full write.
But this patch remove REQ_SYNC only judging the WRITE_ODIRECT,it will
contail regular file.So it maybe not correctly.
How can difference odriect_write between regular file or block file?
Hi,
I think you are saying the when REQ_SYNC is used with O_DIRECT writes it is
having a negative effect on throughput because it allows the stripe to be
processed immediately without waiting for more requests to be added to the
stripe.
Normal 'sync' requests use WRITE_SYNC which includes "REQ_NOIDLE" which means
/* don't anticipate more IO after this one */
O_DIRECT request use WRITE_ODIRECT which does not include this flag.
So maybe we should simply change raid5 to only set STRIPE_PREREAD_ACTIVE if
REQ_NOIDLE is set on the bio. I think this would have the same effect as
what you are trying to achieve.
Could you please try that and see if it has the desired effect on
performance?
Thanks,
NeilBrown
i.e. something like this:
In commit e9c7469bb4f502dafc092166201bea1ad5fc0fbf:
Tejun Heo introduced "implment REQ_FLUSH/FUA support".
But for direct-write-blocks, it maybe for other purpose which like the
regular file.
And this flag will set STRIPE_PREREAD_ACTIVE which decreaed the change
to full write.
But this patch remove REQ_SYNC only judging the WRITE_ODIRECT,it will
contail regular file.So it maybe not correctly.
How can difference odriect_write between regular file or block file?
Hi,
I think you are saying the when REQ_SYNC is used with O_DIRECT writes it is
having a negative effect on throughput because it allows the stripe to be
processed immediately without waiting for more requests to be added to the
stripe.
Normal 'sync' requests use WRITE_SYNC which includes "REQ_NOIDLE" which means
/* don't anticipate more IO after this one */
O_DIRECT request use WRITE_ODIRECT which does not include this flag.
So maybe we should simply change raid5 to only set STRIPE_PREREAD_ACTIVE if
REQ_NOIDLE is set on the bio. I think this would have the same effect as
what you are trying to achieve.
Yes, thanks. my object is to so.But i didn't notice the REQ_NOIDLE so i used the REQ_FLAG.
I'll tested and resend the patch.
quoted hunk
Could you please try that and see if it has the desired effect on
performance?
Thanks,
NeilBrown
i.e. something like this:
In commit e9c7469bb4f502dafc092166201bea1ad5fc0fbf:
Tejun Heo introduced "implment REQ_FLUSH/FUA support".
But for direct-write-blocks, it maybe for other purpose which like the
regular file.
And this flag will set STRIPE_PREREAD_ACTIVE which decreaed the change
to full write.
But this patch remove REQ_SYNC only judging the WRITE_ODIRECT,it will
contail regular file.So it maybe not correctly.
How can difference odriect_write between regular file or block file?
Hi,
I think you are saying the when REQ_SYNC is used with O_DIRECT writes it is
having a negative effect on throughput because it allows the stripe to be
processed immediately without waiting for more requests to be added to the
stripe.
Normal 'sync' requests use WRITE_SYNC which includes "REQ_NOIDLE" which means
/* don't anticipate more IO after this one */
O_DIRECT request use WRITE_ODIRECT which does not include this flag.
Using REQ_NOIDEL to difference odirect and sync.Why not using:
+ if (bi->bi_rw & WRITE_ODIRECT)
+ bi->bi_rw &= ~REQ_SYNC;
The flag WRITE_ODIRECT is only used in odirect-write.
So maybe we should simply change raid5 to only set STRIPE_PREREAD_ACTIVE if
REQ_NOIDLE is set on the bio. I think this would have the same effect as
what you are trying to achieve.
Could you please try that and see if it has the desired effect on
performance?
In commit e9c7469bb4f502dafc092166201bea1ad5fc0fbf:
Tejun Heo introduced "implment REQ_FLUSH/FUA support".
But for direct-write-blocks, it maybe for other purpose which like the
regular file.
And this flag will set STRIPE_PREREAD_ACTIVE which decreaed the change
to full write.
But this patch remove REQ_SYNC only judging the WRITE_ODIRECT,it will
contail regular file.So it maybe not correctly.
How can difference odriect_write between regular file or block file?
Hi,
I think you are saying the when REQ_SYNC is used with O_DIRECT writes it is
having a negative effect on throughput because it allows the stripe to be
processed immediately without waiting for more requests to be added to the
stripe.
Normal 'sync' requests use WRITE_SYNC which includes "REQ_NOIDLE" which means
/* don't anticipate more IO after this one */
O_DIRECT request use WRITE_ODIRECT which does not include this flag.
Using REQ_NOIDEL to difference odirect and sync.Why not using:
+ if (bi->bi_rw & WRITE_ODIRECT)
+ bi->bi_rw &= ~REQ_SYNC;
Because that code is wrong. WRITE_ODIRECT is not one flag, it is two flags
'or'ed together. So this code does not do what you expect.
The flag WRITE_ODIRECT is only used in odirect-write.
quoted
So maybe we should simply change raid5 to only set STRIPE_PREREAD_ACTIVE if
REQ_NOIDLE is set on the bio. I think this would have the same effect as
what you are trying to achieve.
Could you please try that and see if it has the desired effect on
performance?
I tested and the performance is the same.
"The same" as what? The same are your original patch, or the same as without
any patch?
NeilBrown
Normal 'sync' requests use WRITE_SYNC which includes "REQ_NOIDLE" which means
/* don't anticipate more IO after this one */
O_DIRECT request use WRITE_ODIRECT which does not include this flag.
quoted
Using REQ_NOIDEL to difference odirect and sync.Why not using:
+ if (bi->bi_rw & WRITE_ODIRECT)
+ bi->bi_rw &= ~REQ_SYNC;
Because that code is wrong. WRITE_ODIRECT is not one flag, it is two flags
'or'ed together. So this code does not do what you expect.
No, I used those code test and it's ok.
The code used & not &&.
Maybe I wrong?
Normal 'sync' requests use WRITE_SYNC which includes "REQ_NOIDLE" which means
/* don't anticipate more IO after this one */
O_DIRECT request use WRITE_ODIRECT which does not include this flag.
quoted
Using REQ_NOIDEL to difference odirect and sync.Why not using:
+ if (bi->bi_rw & WRITE_ODIRECT)
+ bi->bi_rw &= ~REQ_SYNC;
Because that code is wrong. WRITE_ODIRECT is not one flag, it is two flags
'or'ed together. So this code does not do what you expect.
No, I used those code test and it's ok.
The code used & not &&.
Maybe I wrong?
Think about it...
#define REQ_WRITE (1 << __REQ_WRITE)
#define REQ_SYNC (1 << __REQ_SYNC)
#define RW_MASK REQ_WRITE
#define WRITE RW_MASK
#define WRITE_ODIRECT (WRITE | REQ_SYNC)
So
(bi->bi_rw & WRITE_ODIRECT)
will be true if either REQ_WRITE or REQ_SYNC are set in bi_rw
So whenever REQ_SYNC is set, your code clears the flag.
So your code is functionally identical to
bi->bi_rw &= ~REQ_SYNC;
NeilBrown
Normal 'sync' requests use WRITE_SYNC which includes "REQ_NOIDLE" which means
/* don't anticipate more IO after this one */
O_DIRECT request use WRITE_ODIRECT which does not include this flag.
quoted
Using REQ_NOIDEL to difference odirect and sync.Why not using:
+ if (bi->bi_rw & WRITE_ODIRECT)
+ bi->bi_rw &= ~REQ_SYNC;
Because that code is wrong. WRITE_ODIRECT is not one flag, it is two flags
'or'ed together. So this code does not do what you expect.
No, I used those code test and it's ok.
The code used & not &&.
Maybe I wrong?
Think about it...
#define REQ_WRITE (1 << __REQ_WRITE)
#define REQ_SYNC (1 << __REQ_SYNC)
#define RW_MASK REQ_WRITE
#define WRITE RW_MASK
#define WRITE_ODIRECT (WRITE | REQ_SYNC)
So
(bi->bi_rw & WRITE_ODIRECT)
will be true if either REQ_WRITE or REQ_SYNC are set in bi_rw
So whenever REQ_SYNC is set, your code clears the flag.
So your code is functionally identical to
bi->bi_rw &= ~REQ_SYNC;
NeilBrown
Yes, thanks your time.I maked a stupid mistake.
I'll corrected by your suggestion and resend to you.