<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/fs/devfs/devfs_devs.c, branch releng/8.0</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERIC</title>
<updated>2009-06-05T14:55:22+00:00</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2009-06-05T14:55:22+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=bcf11e8d0048006ba97cb460a134cc23290428b2'/>
<id>bcf11e8d0048006ba97cb460a134cc23290428b2</id>
<content type='text'>
and used in a large number of files, but also because an increasing number
of incorrect uses of MAC calls were sneaking in due to copy-and-paste of
MAC-aware code without the associated opt_mac.h include.

Discussed with:	pjd
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
and used in a large number of files, but also because an increasing number
of incorrect uses of MAC calls were sneaking in due to copy-and-paste of
MAC-aware code without the associated opt_mac.h include.

Discussed with:	pjd
</pre>
</div>
</content>
</entry>
<entry>
<title>Mark most often used sysctl's as MPSAFE.</title>
<updated>2009-01-28T19:58:05+00:00</updated>
<author>
<name>Ed Schouten</name>
<email>ed@FreeBSD.org</email>
</author>
<published>2009-01-28T19:58:05+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f3b86a5fd795dcbd10dde01e27493718dd262179'/>
<id>f3b86a5fd795dcbd10dde01e27493718dd262179</id>
<content type='text'>
After running a `make buildkernel', I noticed most of the Giant locks in
sysctl are only caused by a very small amount of sysctl's:

- sysctl.name2oid. This one is locked by SYSCTL_LOCK, just like
  sysctl.oidfmt.

- kern.ident, kern.osrelease, kern.version, etc. These are just constant
  strings.

- kern.arandom, used by the stack protector. It is already protected by
  arc4_mtx.

I also saw the following sysctl's show up. Not as often as the ones
above, but still quite often:

- security.jail.jailed. Also mark security.jail.list as MPSAFE. They
  don't need locking or already use allprison_lock.

- kern.devname, used by devname(3), ttyname(3), etc.

This seems to reduce Giant locking inside sysctl by ~75% in my primitive
test setup.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After running a `make buildkernel', I noticed most of the Giant locks in
sysctl are only caused by a very small amount of sysctl's:

- sysctl.name2oid. This one is locked by SYSCTL_LOCK, just like
  sysctl.oidfmt.

- kern.ident, kern.osrelease, kern.version, etc. These are just constant
  strings.

- kern.arandom, used by the stack protector. It is already protected by
  arc4_mtx.

I also saw the following sysctl's show up. Not as often as the ones
above, but still quite often:

- security.jail.jailed. Also mark security.jail.list as MPSAFE. They
  don't need locking or already use allprison_lock.

- kern.devname, used by devname(3), ttyname(3), etc.

This seems to reduce Giant locking inside sysctl by ~75% in my primitive
test setup.
</pre>
</div>
</content>
</entry>
<entry>
<title>Already initialize the vfs timestamps inside the cdev upon allocation.</title>
<updated>2008-09-21T14:02:43+00:00</updated>
<author>
<name>Ed Schouten</name>
<email>ed@FreeBSD.org</email>
</author>
<published>2008-09-21T14:02:43+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=219cc94999d992712ee736fff4884a94d84acceb'/>
<id>219cc94999d992712ee736fff4884a94d84acceb</id>
<content type='text'>
In the MPSAFE TTY branch I noticed the vfs timestamps inside devfs were
allocated with 0, where the getattr() routine bumps the timestamps to
boottime if the value is below 3600. The reason why it has been designed
like this, is because timestamps during boot are likely to be invalid.

This means that device nodes that are created on demand (posix_openpt())
have timestamps with a value of boottime, which is not what we want.
Solve this by calling vfs_timestamp() inside devfs_alloc().

Discussed with:	kib
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the MPSAFE TTY branch I noticed the vfs timestamps inside devfs were
allocated with 0, where the getattr() routine bumps the timestamps to
boottime if the value is below 3600. The reason why it has been designed
like this, is because timestamps during boot are likely to be invalid.

This means that device nodes that are created on demand (posix_openpt())
have timestamps with a value of boottime, which is not what we want.
Solve this by calling vfs_timestamp() inside devfs_alloc().

Discussed with:	kib
</pre>
</div>
</content>
</entry>
<entry>
<title>Struct cdev is always the member of the struct cdev_priv. When devfs</title>
<updated>2008-06-16T17:34:59+00:00</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2008-06-16T17:34:59+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=05427aafc6de1e9f752cd413178ea1bbac7b62ac'/>
<id>05427aafc6de1e9f752cd413178ea1bbac7b62ac</id>
<content type='text'>
needed to promote cdev to cdev_priv, the si_priv pointer was followed.

Use member2struct() to calculate address of the wrapping cdev_priv.
Rename si_priv to __si_reserved.

Tested by:	pho
Reviewed by:	ed
MFC after:	2 weeks
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
needed to promote cdev to cdev_priv, the si_priv pointer was followed.

Use member2struct() to calculate address of the wrapping cdev_priv.
Rename si_priv to __si_reserved.

Tested by:	pho
Reviewed by:	ed
MFC after:	2 weeks
</pre>
</div>
</content>
</entry>
<entry>
<title>VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used in</title>
<updated>2008-01-13T14:44:15+00:00</updated>
<author>
<name>Attilio Rao</name>
<email>attilio@FreeBSD.org</email>
</author>
<published>2008-01-13T14:44:15+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=22db15c06f1fbc66b47c8c931bbe291b9fd23d45'/>
<id>22db15c06f1fbc66b47c8c931bbe291b9fd23d45</id>
<content type='text'>
conjuction with 'thread' argument passing which is always curthread.
Remove the unuseful extra-argument and pass explicitly curthread to lower
layer functions, when necessary.

KPI results broken by this change, which should affect several ports, so
version bumping and manpage update will be further committed.

Tested by: kris, pho, Diego Sardina &lt;siarodx at gmail dot com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
conjuction with 'thread' argument passing which is always curthread.
Remove the unuseful extra-argument and pass explicitly curthread to lower
layer functions, when necessary.

KPI results broken by this change, which should affect several ports, so
version bumping and manpage update will be further committed.

Tested by: kris, pho, Diego Sardina &lt;siarodx at gmail dot com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vn_lock() is currently only used with the 'curthread' passed as argument.</title>
<updated>2008-01-10T01:10:58+00:00</updated>
<author>
<name>Attilio Rao</name>
<email>attilio@FreeBSD.org</email>
</author>
<published>2008-01-10T01:10:58+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=cb05b60a8982e5497cd30449710deb2f4be653d4'/>
<id>cb05b60a8982e5497cd30449710deb2f4be653d4</id>
<content type='text'>
Remove this argument and pass curthread directly to underlying
VOP_LOCK1() VFS method. This modify makes the code cleaner and in
particular remove an annoying dependence helping next lockmgr() cleanup.
KPI results, obviously, changed.

Manpage and FreeBSD_version will be updated through further commits.

As a side note, would be valuable to say that next commits will address
a similar cleanup about VFS methods, in particular vop_lock1 and
vop_unlock.

Tested by:	Diego Sardina &lt;siarodx at gmail dot com&gt;,
		Andrea Di Pasquale &lt;whyx dot it at gmail dot com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove this argument and pass curthread directly to underlying
VOP_LOCK1() VFS method. This modify makes the code cleaner and in
particular remove an annoying dependence helping next lockmgr() cleanup.
KPI results, obviously, changed.

Manpage and FreeBSD_version will be updated through further commits.

As a side note, would be valuable to say that next commits will address
a similar cleanup about VFS methods, in particular vop_lock1 and
vop_unlock.

Tested by:	Diego Sardina &lt;siarodx at gmail dot com&gt;,
		Andrea Di Pasquale &lt;whyx dot it at gmail dot com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge first in a series of TrustedBSD MAC Framework KPI changes</title>
<updated>2007-10-24T19:04:04+00:00</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2007-10-24T19:04:04+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=30d239bc4c510432e65a84fa1c14ed67a3ab1c92'/>
<id>30d239bc4c510432e65a84fa1c14ed67a3ab1c92</id>
<content type='text'>
from Mac OS X Leopard--rationalize naming for entry points to
the following general forms:

  mac_&lt;object&gt;_&lt;method/action&gt;
  mac_&lt;object&gt;_check_&lt;method/action&gt;

The previous naming scheme was inconsistent and mostly
reversed from the new scheme.  Also, make object types more
consistent and remove spaces from object types that contain
multiple parts ("posix_sem" -&gt; "posixsem") to make mechanical
parsing easier.  Introduce a new "netinet" object type for
certain IPv4/IPv6-related methods.  Also simplify, slightly,
some entry point names.

All MAC policy modules will need to be recompiled, and modules
not updates as part of this commit will need to be modified to
conform to the new KPI.

Sponsored by:	SPARTA (original patches against Mac OS X)
Obtained from:	TrustedBSD Project, Apple Computer
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
from Mac OS X Leopard--rationalize naming for entry points to
the following general forms:

  mac_&lt;object&gt;_&lt;method/action&gt;
  mac_&lt;object&gt;_check_&lt;method/action&gt;

The previous naming scheme was inconsistent and mostly
reversed from the new scheme.  Also, make object types more
consistent and remove spaces from object types that contain
multiple parts ("posix_sem" -&gt; "posixsem") to make mechanical
parsing easier.  Introduce a new "netinet" object type for
certain IPv4/IPv6-related methods.  Also simplify, slightly,
some entry point names.

All MAC policy modules will need to be recompiled, and modules
not updates as part of this commit will need to be modified to
conform to the new KPI.

Sponsored by:	SPARTA (original patches against Mac OS X)
Obtained from:	TrustedBSD Project, Apple Computer
</pre>
</div>
</content>
</entry>
<entry>
<title>Rename mac*devfsdirent*() to mac*devfs*() to synchronize with SEDarwin,</title>
<updated>2007-04-23T13:36:54+00:00</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2007-04-23T13:36:54+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=305759909e4d09b2016bcc57f650a09cee23955d'/>
<id>305759909e4d09b2016bcc57f650a09cee23955d</id>
<content type='text'>
where similar data structures exist to support devfs and the MAC
Framework, but are named differently.

Obtained from:	TrustedBSD Project
Sponsored by:	SPARTA, Inc.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
where similar data structures exist to support devfs and the MAC
Framework, but are named differently.

Obtained from:	TrustedBSD Project
Sponsored by:	SPARTA, Inc.
</pre>
</div>
</content>
</entry>
<entry>
<title>Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.h</title>
<updated>2006-10-22T11:52:19+00:00</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2006-10-22T11:52:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=aed557087269cd052aa76cc15af4a1fd70cbbf24'/>
<id>aed557087269cd052aa76cc15af4a1fd70cbbf24</id>
<content type='text'>
begun with a repo-copy of mac.h to mac_framework.h.  sys/mac.h now
contains the userspace and user&lt;-&gt;kernel API and definitions, with all
in-kernel interfaces moved to mac_framework.h, which is now included
across most of the kernel instead.

This change is the first step in a larger cleanup and sweep of MAC
Framework interfaces in the kernel, and will not be MFC'd.

Obtained from:	TrustedBSD Project
Sponsored by:	SPARTA
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
begun with a repo-copy of mac.h to mac_framework.h.  sys/mac.h now
contains the userspace and user&lt;-&gt;kernel API and definitions, with all
in-kernel interfaces moved to mac_framework.h, which is now included
across most of the kernel instead.

This change is the first step in a larger cleanup and sweep of MAC
Framework interfaces in the kernel, and will not be MFC'd.

Obtained from:	TrustedBSD Project
Sponsored by:	SPARTA
</pre>
</div>
</content>
</entry>
<entry>
<title>Properly lock the vnode around vgone() calls.</title>
<updated>2006-10-18T11:17:14+00:00</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2006-10-18T11:17:14+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=828d6d12daac382a1d435b43d1bb18c7da52364e'/>
<id>828d6d12daac382a1d435b43d1bb18c7da52364e</id>
<content type='text'>
Unlock the vnode in devfs_close() while calling into the driver d_close()
routine.

devfs_revoke() changes by:	ups
Reviewed and bugfixes by:	tegge
Tested by:	mbr, Peter Holm
Approved by:	pjd (mentor)
MFC after:	1 week
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Unlock the vnode in devfs_close() while calling into the driver d_close()
routine.

devfs_revoke() changes by:	ups
Reviewed and bugfixes by:	tegge
Tested by:	mbr, Peter Holm
Approved by:	pjd (mentor)
MFC after:	1 week
</pre>
</div>
</content>
</entry>
</feed>
