Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Mar 2016 12:41:14 +0100
From:      Hans Petter Selasky <hps@selasky.org>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r296320 - in head/sys: kern sys
Message-ID:  <56D822DA.2080309@selasky.org>
In-Reply-To: <20160303112716.GO67250@kib.kiev.ua>
References:  <201603021846.u22IkHWM010861@repo.freebsd.org> <56D81918.6020403@selasky.org> <20160303112716.GO67250@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?56D822DA.2080309>