Date: Thu, 26 Jan 2006 10:24:49 +0800 From: David Xu <davidxu@freebsd.org> To: Julian Elischer <julian@elischer.org> Cc: =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= <des@des.no>, arch@freebsd.org Subject: Re: vfs_aio.c is still not safe Message-ID: <43D832F1.6040602@freebsd.org> In-Reply-To: <43D825C2.4000004@elischer.org> References: <43D6C3A5.4060100@freebsd.org> <86k6coodch.fsf@xps.des.no> <43D812F7.50808@freebsd.org> <43D825C2.4000004@elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Julian Elischer wrote: > > David Xu wrote: > >> Dag-Erling Smørgrav wrote: >> >>> 3) Rewrite the aio code to use kthreads attached to each process, so >>> problems with one process's aio does not propagate to other >>> processes. >>> >>> >>> >> This is not a complete solution, it shifts the problem to another side, >> allow user to kill process. > > > A kernel thread cannot be "killed" by the user. it can only > agree to kill itself. > By attaching kthreads to each process, there still has an serious issue, if I allow max queued AIO requests to be 1000 (sysctl can adjust this), then I will allow 1000 aio threads to be created and be blocked for each process, otherwise, it defeats the purpose of aio, this is why aio thread should not be blocked on sockets, fifo, pipe, and then they can be reused. Using fixed number of aio threads for disk file is ok, since disk data will be availble in foreseeable period. If a user process got a signal which will bring it down, thread_single() call in exit1() should cause the kthreads to exit, this can be done. This also reminds me another problem, if all user threads exited by calling e.g: thr_exit or kse_exit, now, these kthreads should exit too, so the code should be adjusted,not only ptrace code.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43D832F1.6040602>