From owner-freebsd-current@freebsd.org Sun Jan 31 11:33:16 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4536CA73B80 for ; Sun, 31 Jan 2016 11:33:16 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03A0A5F4; Sun, 31 Jan 2016 11:33:16 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aPqFi-000KCN-Vd; Sun, 31 Jan 2016 14:33:11 +0300 Date: Sun, 31 Jan 2016 14:33:10 +0300 From: Slawa Olhovchenkov To: mokhi Cc: Warner Losh , Ian Lepore , FreeBSD Current Subject: Re: thread-unsafety problems as spl*() ones are NOP Message-ID: <20160131113310.GU37895@zxy.spb.ru> References: <1454188175.32550.3.camel@freebsd.org> <37EC2460-9C4D-46D4-91A1-FA6CE7B0BFB1@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2016 11:33:16 -0000 On Sun, Jan 31, 2016 at 10:00:51AM +0330, mokhi wrote: > @imp: > i exactly mean (Okay not so exact but very near ;D) what you said. > after analyzing kbd.c functions (eg, kbd_realloc_array()) i concluded > there are race conditions (and at result in some places there are > un-protected data too) > > i don't mean to blindly replace splXXX() with locks, but the places i > see race-conds. > Also i should say there are manythings i dunno well or i dont have > deep understanding of them and that's why im here to ask (ie what > special condition Giant-Lock makes here [i should care about] and what > is MPSAFE basically) > i'd happy if you answer me those question too :D I think god explainig can be found in VMS Device Support Manual, Section 3 (for example http://odl.sysworks.biz/disk$cddoc04mar21/decw$book/d32va114.p63.decw$book#186). splXXX is analouge of VMS IPL 1-15 and have same purpose. Or The Design and Implementation of the 4.3BSD UNIX Operating System (Chapter 3.3). Also you can look in FreeBSD repo, stable/2.2 branch, sys/i386/include/spl.h