Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 May 2012 11:26:18 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org
Subject:   Re: svn commit: r235480 - in stable/9/sys: dev/usb geom geom/mountver i386/conf kern sys
Message-ID:  <4FB364AA.2070505@FreeBSD.org>
In-Reply-To: <20120515203832.GE2358@deviant.kiev.zoral.com.ua>
References:  <201205151721.q4FHLlgq097452@svn.freebsd.org> <20120515182747.GD2358@deviant.kiev.zoral.com.ua> <4FB2B7C5.2080604@FreeBSD.org> <20120515203832.GE2358@deviant.kiev.zoral.com.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
on 15/05/2012 23:38 Konstantin Belousov said the following:
> On Tue, May 15, 2012 at 11:08:37PM +0300, Andriy Gapon wrote:
>> on 15/05/2012 21:27 Konstantin Belousov said the following:
>>> Did you verified that there is a gap between td_lk_slocks and
>>> td_blocked an all tier-1 architectures large enough to adopt
>>> td_stopsched without changing the layout of struct thread after the new
>>> member ?
>> 
>> I haven't verified that. but I presumed that the gap was either 2 bytes
>> on 32-bit architectures or 6 bytes on 64-bit ones. What is the proper and
>> doable way of verifying this?
> I think that p sizeof(struct thread) from gdb on previous and current 
> version of the kernel would be a good indicator. If sizes differ, it is 
> bad.
> 
> To be completely sure, calculate offset of the next member in the
> structure: in gdb, p &(((struct thread *)0)->td_blocked) for previous and
> current kernels.

This sounds a bit laborious.  It really did :-) Until I realized that tier-1
is just i386 and amd64.
So, I've just verified that neither the size nor the offset change on either
platform.
Thanks again!

>> 
>>> If not, this breaks KBI.
>> 
>> I can just revert the commit to not risk an obscure breakage. What would
>> you suggest?
> Move the new member to the end of the struct thread, and do explicit 
> zeroing on the thread allocation, if commit changed the layout.

As Attilio said, this wouldn't be much better than just reverting the change.

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FB364AA.2070505>