linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug in processing dependencies by async_tx_submit() ?
@ 2007-10-31 16:21 Yuri Tikhonov
  2007-11-01  3:01 ` Dan Williams
  0 siblings, 1 reply; 6+ messages in thread
From: Yuri Tikhonov @ 2007-10-31 16:21 UTC (permalink / raw)
  To: Williams, Dan J
  Cc: Dan Williams, Neil Brown, Wolfgang Denk, Detlev Zundel,
	linux-raid


 Hello Dan,

 I've run into a problem with the h/w accelerated RAID-5 driver (on the 
ppc440spe-based board). After some investigations I've come to conclusion 
that the issue is with the async_tx_submit() implementation in ASYNC_TX.

 Let's we have the following 3 dependent operations: OP1, OP2, OP3. The OP1 
operation has to be run on one, DMA0, channel, OP2 and OP3 operations have to 
be run on another, DMA1, channel. OP2 has to be run after completion of OP1, 
OP3 - after completion of OP2. I. e. :

 OP1 (DMA0) <--- OP2 (DMA1) <--- OP3 (DMA1).

 With the current implementation of async_tx_submit() we have the following 
picture when we sequentially call async_tx_submit() to submit these 3 
operations:

- the OP2 operation will *not be* submitted to the h/w channel, but, because 
of the (OP1->chan != OP2->chan) condition, will be put to depend_list of OP1; 
and it's RIGHT;

- the OP3 operation will *be* submitted to the h/w channel, because OP2 & OP3 
do not conform the (OP2->chan != OP3->chan) condition. Thus OP3 will be put 
to the h/w channel *before* its parent, OP2; and it's WRONG.

 It looks more logical for me to check in async_tx_submit() - does the dep_tx 
operation (on which the current tx operation is dependent on) depend on some 
other operation itself. If dep_tx depends on some other operation then, 
regardless of the channel on which tx has to be run, we should not put tx to 
the h/w but bind it to depend_list of dep_tx instead. Why there are no such 
algorithms in async_tx_submit() ?

 As far as the RAID-5 h/w accelerated driver is concerned this means that with 
the current implementation of async_tx_submit(), for example, the (PREXOR + 
BIODRAIN) combination works incorrectly for the cases when BIODRAIN is split 
into a sequence of MEMCPY operations and there are two different channels for 
XOR and COPY operations: only one, the first, MEMCPY will wait until 
completion of PREXOR, but all the others MEMCPYs of this BIODRAIN will be put 
into the h/w channel right away. Is it correct ? I think - not.

 Regards, Yuri

-- 
Yuri Tikhonov, Senior Software Engineer
Emcraft Systems, www.emcraft.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-11-12  8:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-31 16:21 Bug in processing dependencies by async_tx_submit() ? Yuri Tikhonov
2007-11-01  3:01 ` Dan Williams
2007-11-01 10:00   ` Yuri Tikhonov
2007-11-02  0:36     ` Dan Williams
2007-11-02  8:13       ` Yuri Tikhonov
2007-11-12  8:46       ` Re[2]: " Yuri Tikhonov

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).