From owner-svn-src-head@freebsd.org Thu Mar 3 11:38:40 2016 Return-Path: Delivered-To: svn-src-head@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 78BF2A93F23; Thu, 3 Mar 2016 11:38:40 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (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 4436E24E; Thu, 3 Mar 2016 11:38:40 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 5378F1FE022; Thu, 3 Mar 2016 12:38:36 +0100 (CET) Subject: Re: svn commit: r296320 - in head/sys: kern sys To: Konstantin Belousov References: <201603021846.u22IkHWM010861@repo.freebsd.org> <56D81918.6020403@selasky.org> <20160303112716.GO67250@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <56D822DA.2080309@selasky.org> Date: Thu, 3 Mar 2016 12:41:14 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160303112716.GO67250@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Mar 2016 11:38:40 -0000 On 03/03/16 12:27, Konstantin Belousov wrote: > On Thu, Mar 03, 2016 at 11:59:36AM +0100, Hans Petter Selasky wrote: >> >I believe all of these callout quirks can be avoided by using a spinlock >> >to proctect the thread callout like done in projects/hps_head. Has >> >anyone tried to reproduce the issue with projects/hps_head, before >> >making this patch? > I did not looked at your branch, but I do not like this coupling between > callbacks and thread locks. Even more, this probably cannot make work > since thread lock is not some fixed lock at all, and introducing one > more spinlock for the coupling is excessive. > Hi, My thought about this is that the condition in question is rather rare, and we can trade the addition thread sleep state with a spin lock. My good feeling is that a spin-lock will be better off than the task-switch for this rare case. To implement my approach it requires some minor updating that callout_init_mtx() will accept a spin-lock type mutex. --HPS