Re: [RFC] An idea for general kernel post-processing automation in FreeBSD

Hans Petter Selasky <[email protected]>
Newsgroups gmane.os.freebsd.architechture
Message-ID <[email protected]>
On 5/21/23 23:24, Mark Millard wrote:
> DEFINE_MUTEX is defined in:
> 
> # grep -r "define.*DEFINE_MUTEX"/usr/main-src/sys/  | more
> /usr/main-src/sys/compat/linuxkpi/common/include/linux/mutex.h:#define  DEFINE_MUTEX(lock)

Hi Mark,

The mutex structure declared is still "static" and local to the C-file. 
There is no issue.

If we could have a SX_STATIC_INIT() macro in FreeBSD, this would be a 
better solution, and would also save the crunch associated by SYSINITs. 
The LinuxKPI does not use Witness on these locks, because Linux has a 
bad habit of not destroying them, so FreeBSD Witness objects would leak 
and cause other problems when modules are reloaded for example. If 
witness is not needed, there is little use from sx_init(). It almost 
does nothing.

--HPS
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.