From owner-freebsd-current@freebsd.org Sat Jan 30 18:25:24 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 0415DA72DE7 for ; Sat, 30 Jan 2016 18:25:24 +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 B801015B5 for ; Sat, 30 Jan 2016 18:25:23 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aPaD3-000Nlp-Bk; Sat, 30 Jan 2016 21:25:21 +0300 Date: Sat, 30 Jan 2016 21:25:21 +0300 From: Slawa Olhovchenkov To: mokhi Cc: freebsd-current@freebsd.org Subject: Re: thread-unsafety problems as spl*() ones are NOP Message-ID: <20160130182521.GM88527@zxy.spb.ru> References: <20160130180256.GT37895@zxy.spb.ru> 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: Sat, 30 Jan 2016 18:25:24 -0000 On Sat, Jan 30, 2016 at 09:42:13PM +0330, mokhi wrote: > i currently only wanna do patch on kbd.c (because i'm sure there is a > thread-unsafety) > and i don't want to add anything to spltty() nor splx(), i just wanna > add things under where they've been used. > isn't problem with using mutex/spin/lock/unlock etc there? yes. currenly spltty act as mutex_lock(&spltty_mutex), like global lock for all used files. this is also inter-files lock, not only lock inside only kbd.c. you need patch all files. all using spltty need to remove simultaneously.