* linux-raid raid5 delaying write
@ 2010-01-07 12:18 dong wu
2010-01-07 17:44 ` Dan Williams
0 siblings, 1 reply; 2+ messages in thread
From: dong wu @ 2010-01-07 12:18 UTC (permalink / raw)
To: linux-raid
hello,
In the source code,in order to collect multiple write requests,first
add the requests to delayed_list,
then use plug/unplug to wait.During the waiting time,if other requests
arrive to full a stripe_head buffer,
then compute parity and send write request to low level to deal.
If not so, the requests will be set pre-read mark
stripe_preread_active,then send pre-read request to low level.
I want to know if up level send read request and later a write request
arrive to write the same place of read request before,
will the read request be canceled and return the data of write request?
Best Regards
Dong Wu
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: linux-raid raid5 delaying write
2010-01-07 12:18 linux-raid raid5 delaying write dong wu
@ 2010-01-07 17:44 ` Dan Williams
0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2010-01-07 17:44 UTC (permalink / raw)
To: dong wu; +Cc: linux-raid
On Thu, Jan 7, 2010 at 5:18 AM, dong wu <dongwucs@gmail.com> wrote:
> hello,
> In the source code,in order to collect multiple write requests,first
> add the requests to delayed_list,
> then use plug/unplug to wait.During the waiting time,if other requests
> arrive to full a stripe_head buffer,
> then compute parity and send write request to low level to deal.
> If not so, the requests will be set pre-read mark
> stripe_preread_active,then send pre-read request to low level.
> I want to know if up level send read request and later a write request
> arrive to write the same place of read request before,
> will the read request be canceled and return the data of write request?
No, it is up to the filesystem or whatever code is above the RAID to
enforce ordering. In order to guarantee that a read returns the data
from a previous write you either need to wait for the write to
complete, or with recent kernels send a barrier request to flush the
write.
--
Dan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-01-07 17:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-07 12:18 linux-raid raid5 delaying write dong wu
2010-01-07 17:44 ` Dan Williams
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).