lkml.org 
[lkml]   [2006]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] add execute_in_process_context() API
From
Date
On Thu, 2006-02-09 at 00:30 +0900, Tejun wrote:
> I haven't really looked at the code carefully, but I think one work
> struct + atomic counter (say pending_reap_cnt) should do it.
> queue_work() guarantees the work is run at least once after the call, so
> bumping pending_reap_cnt and queueing the work in target reap and
> reaping pending_reap_cnt times in the work should work.

Actually, no, unfortunately that doesn't work (and I did actually try
it). The problem is that the target_reap actually removes the target
from the sysfs namespace. So, if the reap is still pending but you
cannot find the target, you'll allocate one, but then you may be racing
to add it to the namespace (i.e. a quick succession of scsi
remove-single-device followed by scsi add-single-device of the same
H/C/T/L shows this). If you lose the race, the add fails because the
namespace is already occupied. And, unfortunately, the device_del that
does the namespace removal requires user context ...

James


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-02-08 16:39    [W:0.052 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site