Skip to contentSkip to conversation

can I replace spin lock of stripe with mutex?

DISCUSSION Neil Brown 1 participant 1 message Oct 25, 2008 1 message not in the archive MD RAID

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Neil Brown

author
#1 lore raw
Quoted 7 lines · On Friday October 24, [email protected] wrote:

hi, neil:
I want to use hardware engine to do XOR. The driver is based on interrupt way, which will cause sleep. I found that in handle_stripe function spin lock of a stripe is used during donging XOR. Since between spin_lock and spin_unlock, sleep is not allowed, I want to replace it with mutex, does it make sense?

What kernel version are you looking at?
I ask because for quite some months (years?) we have had explicit support for hardware based xor using the "async_tx" extension to the async-crypto API.
See crypto/async_tx/ and drivers/dma/

That is a much more complete approach. Just changing the lock type would not really help, there are other reasons why we cannot sleep in that code.

NeilBrown