From owner-cvs-src@FreeBSD.ORG Thu Mar 3 23:44:30 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5002716A4CE; Thu, 3 Mar 2005 23:44:30 +0000 (GMT) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id B78E643D5C; Thu, 3 Mar 2005 23:44:29 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.11] (junior-wifi.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.13.1/8.13.1) with ESMTP id j23NkTZe007087; Thu, 3 Mar 2005 16:46:29 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <4227A0D6.8040404@samsco.org> Date: Thu, 03 Mar 2005 16:42:14 -0700 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.5) Gecko/20050218 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Xu References: <200503021343.j22DhpQ3075008@repoman.freebsd.org> <200503020915.28512.jhb@FreeBSD.org> <4226446B.7020406@freebsd.org> <20050303033115.GA13174@VARK.MIT.EDU> <42269DB0.6070107@freebsd.org> <20050303052902.GA14011@VARK.MIT.EDU> <422771E9.6070405@elischer.org> <42279C72.2000208@freebsd.org> <42279EE9.3020905@samsco.org> <4227A094.5030600@freebsd.org> In-Reply-To: <4227A094.5030600@freebsd.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on pooker.samsco.org cc: src-committers@freebsd.org cc: John Baldwin cc: cvs-src@freebsd.org cc: cvs-all@freebsd.org cc: Julian Elischer cc: David Schultz Subject: Re: cvs commit: src/sys/kern kern_sig.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Mar 2005 23:44:30 -0000 David Xu wrote: > Scott Long wrote: > >> David Xu wrote: >> >>> Julian Elischer wrote: >>> >>>>> >>>>> >>>>>>> The alternative, of course, is to just fix the code that assumes >>>>>>> that swapping doesn't exist. >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> First find all code written in such way, but it is not that easy. >>>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> True. If we changed msleep() to disable swapping by default, then >>>>> we wouldn't have to worry about correctness problems related to >>>>> missing some. >>>>> >>>>> >>>> >>>> adding the flag to ENABLE swapping would be ABI compatible. >>>> >>>> >>> how about adding a PNOSWAP to msleep ? but I won't trust the kernel >>> under swapping, because they can not give me 100% guarantee, my >>> machine crashes several times per-month, even when fscking at boot time, >>> mostly it is a page fault. >>> >>> David Xu >>> >>> >>> >>> >>> >> >> An msleep/tsleep option doesn't solve the problem because the the msleep >> might happen several layers down from where the stack abuse is taking >> place, and thus the caller would have no idea that it's needed. > > > But it at least can help a piece of code managed by a single guy. > It's still of limited value. I'd rather the effort be put into diagnostics development. Also, regarding your objections to PHOLD, I thought that the proc lock was a leaf mutex. Where are you seeing LORs with it? >> The fix >> for sigwait() is easy and can be applied without hacking in new options >> that have limited value. I don't argue that similar problems might >> exist elsewhere, but swappable kstacks have been part of BSD since >> before most of us knew where the power switch was on our Ataris, so it's >> likely not to be a wide-spread and fundamental problem in the code. I'd >> be in favor of adding diagnostics that help catch these problems and >> report them, but just throwing away kstack swapping in leiu of taking >> the 2 minutes to fix sigwait() is pretty silly. >> > Yes, sigwait is simple, but my umtx code is also broken by this silly > swapping > code, now I have to fill malloc/free/retry/lock_order_reversal_work_around > all over the code. Can you provide a reference? It turns out the fixing sigwait() can be done without any mallocs at all, maybe the same can be done for umtx. Scott