Thread (78 messages) flat view 78 messages, 4 authors, 2015-09-23

Re: [PATCH v2 09/30] cxlflash: Fix to stop interrupt processing on remove

From: Matthew R. Ochs <hidden>
Date: 2015-09-17 16:55:34
Also in: linux-scsi

On Sep 17, 2015, at 6:58 AM, David Laight [off-list ref] =
wrote:
=20
From: Linuxppc-dev Matthew R. Ochs
quoted
Sent: 16 September 2015 22:28
Interrupt processing can run in parallel to a remove operation. This
can lead to a condition where the interrupt handler is processing =
with
quoted
memory that has been freed.
=20
To avoid processing an interrupt while memory may be yanked, check =
for
quoted
removal while in the interrupt handler. Bail when removal is =
imminent.
=20
On the face of it this just reduces the size of the window somewhat.
Agreed.
=20
What happens if the interrupt routine reads the flag just before it is =
set
(so is processing the entry that is being removed) and is then (say)
interrupted by a higher priority interrupt that takes longer to =
execute than
the remove code?
Understood. To completely close we'd need to either introduce a lock or =
a
reciprocal flag/count such that the remove doesn't make forward progress
until after interrupt processing has completed. I can look at =
introducing such
a mechanism in a later patch to fully remove the exposure.


-matt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help