From owner-freebsd-arch@FreeBSD.ORG Thu Jan 26 20:40:45 2006 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9872816A422; Thu, 26 Jan 2006 20:40:45 +0000 (GMT) (envelope-from julian@elischer.org) Received: from a50.ironport.com (a50.ironport.com [63.251.108.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id E850743D4C; Thu, 26 Jan 2006 20:40:44 +0000 (GMT) (envelope-from julian@elischer.org) Received: from unknown (HELO [10.251.17.229]) ([10.251.17.229]) by a50.ironport.com with ESMTP; 26 Jan 2006 12:40:44 -0800 Message-ID: <43D933CC.4090505@elischer.org> Date: Thu, 26 Jan 2006 12:40:44 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.11) Gecko/20050727 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Xu References: <43D6C3A5.4060100@freebsd.org> <86k6coodch.fsf@xps.des.no> <43D812F7.50808@freebsd.org> <43D825C2.4000004@elischer.org> <43D832F1.6040602@freebsd.org> In-Reply-To: <43D832F1.6040602@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= , arch@freebsd.org Subject: Re: vfs_aio.c is still not safe X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2006 20:40:45 -0000 David Xu wrote: > 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. I was thinking that we would use the same scheme and code used for the current AIO just that the threads would be attached to the requesting process instead of the AIO process. i.e. not just one thread per request. > > 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.