Philipp Rumpf writes:
> > Yeah, forget that. It won't work. But what should work is if rmmod does:
> > - if refcount != 0, fail
>
> This isn't really necessary - the common case is the refcount is 0
> for explicit calls, so you don't need to check twice.
It's not required, but it's cheap, and it would give us a fast failure
path. It's worth the few extra instructions.
> > - launch N-1 RT threads which just hog their CPUs
>
> Are RT processes really safe ? kernel threads are, AFAICT
Should be. If you set SCHED_FIFO and give a process the highest
priority, then you are guaranteed that once that process gets the CPU,
it will not be switched out until it relinquishes it (block on I/O,
sleep or exit).
Just make sure you mlockall current and future pages, and do a dry-run
of the RT functions.
> > - wait for RT threads to start (use a pipe, say)
>
> Or, if you want to be on the safe side and use kernel threads, an
> atomic_t.
I don't think kernel threads are any safer (provided you take
precautions).
> > - if refcount != 0, kill RT threads and fail
> > - remove module
> > - kill RT threads and exit with success.
>
> So, except for the RT thread vs kernel thread issue and the
> duplicated refcount check it's exactly what the patch Rusty, Andrew
> Morton, and I came up with does.
Yep. Just my solution doesn't require any kernel hacks. It's all in
user-space, so doesn't permanently consume RAM.
Regards,
Richard....
Permanent: rgooch@atnf.csiro.au
Current: rgooch@ras.ucalgary.ca
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Mon Jun 26 2000 - 21:00:05 EST