Maxime Villard | 18 Apr 10:30 2014

Inconsistency with COMPAT_10

Hi all,
I think there's an inconsistency with COMPAT_10 in the open() syscall:

----------------- kern/vfs_syscalls.c - l.1631 ------------------

#ifdef COMPAT_10	/* XXX: and perhaps later */
	if (path == NULL) {
		pb = pathbuf_create(".");
		if (pb == NULL)
			return ENOMEM;
	} else
		error = pathbuf_copyin(path, &pb);
		if (error)
			return error;


------------ compat/netbsd32/netbsd32_netbsd.c - l.240 ----------

	if (SCARG(&ua, path) != NULL) {
		error = pathbuf_copyin(SCARG(&ua, path), &pb);
		if (error)
			return error;
	} else {
		pb = pathbuf_create(".");
		if (pb == NULL)
			return ENOMEM;
(Continue reading)

Ilia Zykov | 11 Apr 10:13 2014

Why does the fs_lookup need?

Please, help me!
I don't understand fundamental thing.
And can't find info about this.

VFS	- VFS/VNODE level and all functions VOP_READ, namei ...
RFS	- File System level and all functions fs_lookup, fs_read ...		
LOOKUP() - namei, VOP_LOOKUP ...

I don't understand why now LOOKUP() is implemented on the two levels - RFS and VFS.
LOOKUP() and VFS – RFS API, very complicated, historically(when UNIX had 
only one FS and hadn't readdir() at all), it is clear how it happened, 
but it is unclear why has not changed?

fs_lookup() - now have RFS functionality and many VFS too(getnewvnode() ...),
in many cases it opens file, catalog... when real fs_open()... does nothing.

Why don't use, for example, the algorithm described below,
I understand that it is necessary to make changes in the VFS – RFS API,
but it is significantly offset by the creation of new simplification FSs,
significant reduction of duplicated code, and clear separation
VFS and RFS levels.

I am taking interest possibility make so in theory.
Every opinion can help me.

How LOOKUP() should works(IMHO):

1. RFS shouldn't have fs_lookup() at all, and this level shouldn't
(Continue reading)

Ilia Zykov | 8 Apr 19:15 2014

Rewrite kernfs and procfs.

I desire become a NetBSD developer and develop this project.
Sorry to disturb, maybe I need anything else.

Also little patch, that removes unusable hack(any more, see below) from kernfs and
returns its work.

kernfs can't works from this commit(Wed Feb 13 14:03:48 2013 UTC):

Make the spec_node table implementation private to spec_vnops.c.
To retrieve a spec_node, two new lookup functions (by device or by mount)
are implemented.  Both return a referenced vnode, for an opened block device
the opened vnode is returned so further diagnostic checks "vp == ... sd_bdevvp"
will not fire.  Otherwise any vnode matching the criteria gets returned.
No objections on tech-kern.

 kernfs_subr.c  |   31 +++++--------------------------
 kernfs_vnops.c |   21 ++++++++-------------
 2 files changed, 13 insertions(+), 39 deletions(-)


Attachment (kernfs.01.patch): text/x-patch, 3075 bytes
$NetBSD: membership-app.txt,v 1.1 2012/12/16 17:31:59 tron Exp $

NetBSD Foundation Membership Application Form

This form should be filled out by the applicant, with help from his or
(Continue reading)

Thor Lancelot Simon | 8 Apr 06:25 2014

Changes to make /dev/*random better sooner

Attached are the changes from the tls-earlyentropy branch, which tries
to make the output of /dev/random less predictable -- particularly for
an attacker outside the box -- earlier.

I intend to merge these soon.  Comment would be much appreciated.

The commit messages from this branch:

Log Message:
RNDVERBOSE kernel for testing.

Log Message:
LZF in the kernel.  As an entropy estimator for now but it's very small, and
we could use it for ipcomp, for hibernation, for paging, for core dumps, etc.

Log Message:
Entropy estimation changes:

1) Avoid wraparound problems with delta estimator by making estimation
   framework 64-bit.

2) Adjust rnd_counter to always return a 64-bit value, accordingly.

3) Make delta estimator generic and create two instances: delta-time and

4) Add LZF estimator -- used mostly to protect us against injection of
   bulk data we think is random but is really constant.

5) Allow value and time estimation/collection to be controlled separately.
(Continue reading)

J. Hannken-Illjes | 6 Apr 12:14 2014

Vnode API change: add global vnode cache

Currently all file systems have to implement their own cache of
vnode / fs node pairs.  Most file systems use a copy and pasted
version of ufs_ihash.

So add a global vnode cache with lookup and remove:

 * Lookup a vnode / fs node pair by key and return it referenced through vpp.
vcache_lookup(struct mount *mp, void *key, size_t key_len, struct vnode **vpp)

 * Remove a vnode / fs node pair from the cache.
vcache_remove(struct mount *mp, void *key, size_t key_len)

On cache miss vcache_lookup() will call a new vfs operation:

 * Read an inode from disk and initialize this vnode / inode pair.
 * Caller assures no other thread will try to load this inode.
vfs_load_node(struct mount *mp, struct vnode *vp,
    const void *key, size_t key_len, void **new_key)

to load and initialize this vnode / fs node pair.  The vnode cache
guarantees this call to be exclusive, no other thread will try to
(Continue reading)

Manuel Bouyer | 3 Apr 17:51 2014

MBUFTRACE panic (KASSERT off < percpu_nextoff)

trying to debug
I built a kernel with MBUFTRACE (this is netbsd-6 of december).
I got this almost immediatly:

panic: kernel diagnostic assertion "off < percpu_nextoff" failed: file "../../..
/../kern/subr_percpu.c", line 76 
cpu0: Begin traceback...
kern_assert() at netbsd:kern_assert+0x48
percpu_offset() at netbsd:percpu_offset+0x4b
percpu_getref() at netbsd:percpu_getref+0x40
m_claim() at netbsd:m_claim+0x44
m_claimm() at netbsd:m_claimm+0x1d
ether_input() at netbsd:ether_input+0x33
carp_input() at netbsd:carp_input+0x7f
ether_input() at netbsd:ether_input+0x1c4
ether_input() at netbsd:ether_input+0x3c7
wm_intr() at netbsd:wm_intr+0x40e
intr_biglock_wrapper() at netbsd:intr_biglock_wrapper+0x1d
Xintr_ioapic_level1() at netbsd:Xintr_ioapic_level1+0xf2
--- interrupt ---
x86_pause() at netbsd:x86_pause+0x2
callout_softclock() at netbsd:callout_softclock+0x390
softint_dispatch() at netbsd:softint_dispatch+0xd9
DDB lost frame for netbsd:Xsoftintr+0x4f, trying 0xfffffe800100fd70
Xsoftintr() at netbsd:Xsoftintr+0x4f
--- interrupt ---

any idea ?
(Continue reading)

D'Arcy J.M. Cain | 1 Apr 16:03 2014

HP Proliant won't reboot

I am having a strange error.  I just picked up a HP Proliant G5 and
installed NetBSD 6.1.3 AMD64 on it.  Everything is fine as far as
installing and running goes but when I reboot it goes through most of
the stuff, detaches a bunch of devices and then says "rebooting" and
stops.  NumLock doesn't change the light and the system won't respond
to the keyboard or the network.  Luckily it has already unmounted the
drive so I can safely power cycle but that's going to be extremely
inconvenient in a lights out situation.

Anyone ever seen this?  Anyone know where to start debugging this?

Attached is my dmesg.


D'Arcy J.M. Cain <darcy <at>> IM:darcy <at> Vex.Net
Attachment (dmesg.dusty): application/octet-stream, 16 KiB
Adam Ciarciński | 29 Mar 20:54 2014

Kernel panic when trying to mount non-existing file-system


If I build custom kernel with some file-systems disabled (commented out in config), and then try to mount
that kind of file-system, the kernel panics. That is true at least for PROCFS and PTYFS. And that's for
-current for at least a month.

Is that intentional?

Kind regards,
Dennis Ferguson | 28 Mar 23:16 2014

Proposal for kernel clock changes

I would like to rework the clock support in the kernel a bit to correct
some deficiencies which exist now, and to provide new functionality.  The
issues I would like to try to address include:

- It has become common for systems to include clocks which are unsuitable
  for use as the time source for the system clock but which are none-the-less
  useful because they are the timestamp source for (hardware) measurements of
  external events.  The most frequently encountered example of this may be the
  counter included in many Ethernet MAC chips which is sampled when IEEE 1588
  packets are sent and received; many systems may have more than one of these.
  Peripherals which hardware timestamp other types of events (e.g. signal
  transitions, like the PPS output of a GPS receiver) are often found in
  integrated SoCs, as are devices which use a free-running counter to generate

  Making all of these "measurement" clocks useful to the system seems to
  require two things.  It first requires that each of these clocks be visible
  to and indepently adjustable via a clock adjustment interface.  The only
  thing one can do with accurate-in-time external events which are measured
  with a particular clock is to use the information to adjust that particular
  clock into synchronization, so each such clock must be independently

  The second requirement is that it must be possible to measure the times
  of independent pairs of clocks in the system against each other as
  precisely as possible, perhaps with a sequence of the form

    read clock A
    read clock B
    read clock A
(Continue reading)

Matt Thomas | 27 Mar 03:32 2014

asymmetric smp

I recently ordered an ODROID-XU Lite to help beat on the my ARM MP code.

However, it has a quirk that I don't think our scheduler will deal with.

It has 4 Cortex-A15 cores  <at>  1.4Ghz and 4 Cortex-A7 cores  <at>  1.2Ghz.  Even if the frequencies weren't
different, the A15 cores at least twice as fast per cycle than the A7.  That asymmetry is going to cause havoc
with the scheduler.  In terms of power, the A7s use a lot less than the A15s so if you can keep the work on the A7s
and leave the A15s sleeping, you'll extend your battery life a lot.

It should also be noted the A15s have different cache structure than the A7s as well.

There is no hyperthreading so that headache.

Imagine doing a build, you might want to keep the shells and the like on the A7 while letting A15s get the
compiler/assembler/loader (more compute intensive).

David Holland | 27 Mar 02:03 2014

nanosleep accuracy

Can someone who's familiar with the timecounter code (that is, not me)
look at this and see if we can steal their fixes?


David A. Holland
dholland <at>