Due to the problems with a 7–stable machine, I had a look at some unmerged fixes for ZFS (58 changes not merged).
I backported some of those changes from 8-stable to 7-stable, I have this running on one 7-stable machine. I would like to get some more feedback for it (even an “it works for me” would be great). The main part of this change is that the FreeBSD taskqueue is used now instead of the opensolaris one (and some other changes which may improve the ZFS experience).
It would also be nice if someone could have a look at the FIRST_THREAD_IN_PROC part. Can there be more than one thread at this place (I do not think so) and I should use FOREACH_THREAD_IN_PROC_instead?
How to apply:
- cd /usr/src/
- fetch http://www.Leidinger.net/FreeBSD/test/releng7_zfs_merge3.diff
- fetch http://www.Leidinger.net/FreeBSD/test/opensolaris_taskq.c
- fetch http://www.Leidinger.net/FreeBSD/test/taskq.h
- mv taskq.h sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h
- mv opensolaris_taskq.c sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c
- patch –p 0 –quiet <releng7_zfs_merge3.diff
- ignore the 2 .rej files
- rm –f sys/cddl/compat/opensolaris/sys/taskq_impl.h*
- rm –f sys/cddl/compat/opensolaris/sys/taskq.h*
- rm –f sys/cddl/contrib/opensolaris/uts/common/os/taskq.c*
- rebuild kernel
I do not list all of those 16 of 58 outstanding patches which are covered here, a detailed list can be found on the stable and fs mailinglists.
GD Star Rating
loading…
GD Star Rating
loading…
Tags: c patch,
compat,
impl,
kernel,
mailinglists,
mv,
opensolaris,
stable machine,
sys,
zfs —
The 7–stable system on which I have stability problems after an update from 7.1 to 7.2/7-stable is now semi-stable.
The watchdog reboots after one minute of no reaction (currently it is able to run 3 – 4 hours), and the jails come up without problems now.
The problem with the jails was, that e.g. the mysql–server startup went into the STOP state because TTY-input was “requested”. I solved the problem by using /dev/null as input on jail-startup. On –current I do not see this behavior (I have a 9–current system with a lot of jails which reboots every X days, and there mysql does not go into the STOP state).
I also start the jails in the background, so that one blocking jail does not block everything (done like in –current).
To say this with code:
--- /usr/src/etc/rc.d/jail 2009-02-07 15:04:35.000000000 +0100
+++ /etc/rc.d/jail 2009-12-16 17:03:12.000000000 +0100
@@ -556,7 +556,8 @@
fi
_tmp_jail=${_tmp_dir}/jail.$$
eval ${_setfib} jail ${_flags} -i ${_rootdir} ${_hostname}
- \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1
+ \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 \
+ </dev/null
if [ "$?" -eq 0 ] ; then
_jail_id=$(head -1 ${_tmp_jail})
@@ -623,4 +624,4 @@
if [ -n "$*" ]; then
jail_list="$*"
fi
-run_rc_command "${cmd}"
+run_rc_command "${cmd}" &
I also identified 57 patches for ZFS which are in 8-stable, but not in 7-stable (I do not think they could solve the deadlock, but I do not really know, and now that there is one FS on ZFS, I would like to get as much fixed as possible). Some of them should be merged, some would be nice to merge, and some I do not care much about (but if they are easy to merge, why not…). I already have all revisions and the corresponding commit logs available in an email-draft.
Now I just need to write a little bit of text and find some people willing to help (some of the changes need a review if they are applicable to 7-stable, and everything should be tested on a scratch-box).
GD Star Rating
loading…
GD Star Rating
loading…
Tags: 000000000,
current system,
deadlock,
jails,
mysql server,
server startup,
stability problems,
stable system,
watchdog,
zfs —
On the machine where I host this blog, I have/had some stability problems.
Last week I updated the machine from FreeBSD 7.1-pX to 7.2-p5 (GENERIC kernel in both cases). 5 – 10 Minutes after the reboot into the new version the machine had a deadlock. After some roadblocks (ordering a KVM-switch from the hoster, the KVM-switch not working with a proxy (during lunchtime at work), a broken video-capture of the KVM-switch and a replacement on Monday morning to not pay the WE-fees), I spend a big part of the night to get it stable. I tried disabling SMP, enabling INVARIANTS and WITNESS, changing the scheduler, cutting the software mirror (to rule out a mismatch between the content of the disks after all the hard reboots) and updating to 7-stable.
Unfortunately nothing helped.
Googling a little bit around (it is a AMD Dual–Core system with NVidia MCP61 chipset) was leading me to a post on the mailinglists from 2008 which talks about an issue with the buffer cache. I do not know if this is still an issue (I have send a email to kib@ to ask about it), and my scenario is not the same as the one which is described in the mail, but because of this I decided to switch one of the two UFS mirrors to ZFS.
The first boot into the ZFS caused again a reboot after some minutes (I do not know if it was because of a memory exhausted panic, or because of a deadlock), but as I did not tune the kernel for ZFS I am tempted to believe that I should not count that. Now, after tuning the kernel (increasing the kmem_size to 700M, no prefetching, limiting the ARC to 40M) it is up since nearly 2h (as of this writting… crossing fingers). Before it was not able to survive more than some minutes with just the jail for the mails up. Now I not only have the mail-jail up, but also the jail for the blog (one jail still disabled, but I will take care about that after this post).
I do not know if only increasing the kmem_size would have helped with the problem, but as I was testing a GENERIC kernel + gmirror module in the beginning, I expected that the auto-tuning of this value should have been enough for such a simple setup (2GB RAM, 2 disks with 3 partitions each, one partition pair for root, one for swap, one for the jails).
I hope that I stabilized the system now. It may be the case that I will test some patches in case someone comes up with something, so do not be surprised if the blog and email to me is a little bit flaky.
GD Star Rating
loading…
GD Star Rating
loading…
Tags: amd dual core,
buffer cache,
core system,
generic kernel,
invariants,
mailinglists,
prefetching,
software mirror,
stability problems,
switch one —
Our bug with savepnpc which causes the post-command to start one minute after the pre-command even if the backup is not done yet is now hopefully near the resolution point. We opened a problem report for this in July, this week we where told that there is a patch for it available. The bad part is, that it is available since 3 weeks and nobody told us. The good part is, that we have it installed on a machine now to see if it helps (all zones there seem to be OK, but we have zones where it sometimes works and sometimes fails, so we are not 100% sure, but we hope the best). We where told that it will be included in Networker 7.5.1.8.
Our other issues are now at least not in a helpdesk-loop anymore, they seem to have reached the developers now.
GD Star Rating
loading…
GD Star Rating
loading…
Tags: bugs,
developers,
resolution point —
This WE I was told that FreeNAS seems to want to move from FreeBSD to Linux (since then it seems there could be a linux and a FreeBSD version). One of the reasons seems to be a missing sensors framework.
As I was committing a port of the OpenBSD sensors framework (produced as part of the Google Summer of Code 2007) to FreeBSD and had to remove it afterwards because one committer complained very loudly, I was asked what the status of this is.
The short status is: Nobody is doing something about it.
Before I explain the long status, I give a short overview what this sensors framework is:
- a kernel API which allows to add sensors
- an interface for the userland to query the sensor data
- some basic userland code to show and log the sensor info
The API and the query interface are more or less independent. For the userland code it was more a logging infrastructure than a real monitoring solution. The reason was the real monitoring solutions already exist (Nagios, snmpd, …) and can be adapted to query the sensors. Ideally a query in userland should be handled by a library instead of directly accessing the sysctl interface, this way the kernel<->userland interface would be abstracted away (and could b replaced as needs arise). This was not done, it was something to be done later (Rome was not build in a day).
The userland interface also only cared about dumb sensors (those which you need to query manually to get the information), smart sensors (those which are able to send events themself) where not taken care about in the sense of really sending sensor-triggered events, but the kernel API allowed to add such sensors. The sysctl interface has no way of sending events, but FreeBSD already has an event interface (devd is taking care about it). It would have been not a problem to send events via this channel and let an userland library take care about the delivery together with other sensor-data in userland.
And now the long status is:
PHK complained loudly about it. First he said he did not look at it but he complained that is not good regardless. After a lot of nagging from me he had a look at it and was not happy about the time stuff in it (short: the FreeBSD timecounter code is better). This was not a problem in my opinion, we could have disabled this part without problems. After such an offer from me, he complained that the sensors framework uses the sysctl interface instead of an entry in /dev.
At this point in time already several userland utilities used the sysctl framework to query for status data in the kernel. So there was already precedence for such an use of it. Later some more such uses where added too (e.g. the procstat stuff by core team member Robert Watson).
I saved some of the corresponding mails (to public mailing lists) in a mbox file, read the mess yourself if you want.
The bottom line is: Several committers (even some which we could call high profile committers) told me that they do not see a problem in the use of the sysctl interface. They do not seem to want to tell it in public (nobody of them voiced their opinion in the thread, so do not ask me who those people are). I am not interested in investing more of my spare time into fighting windmills (it looks like this to me).
So, if someone is intersted in the code, r172631 has it. In the perforce repository you can maybe find some sensors. I think most of it can still be used without much changes.
If someone tries it with a more recent FreeBSD, please drop me a note if it just applies fine, or a patch (or an URL to it) if it needs some modifications. Who knows, maybe in a future project it may be useful for me.
If there is enough interest by several people, I can even put up a wiki page where those people can coordinate, but that is most probably all I am willing to invest further into this (at least in my unpaid time).
GD Star Rating
loading…
GD Star Rating
loading…
Tags: devd,
freebsd version,
google,
kernel api,
query interface,
sensor data,
short overview,
smart sensors,
snmpd,
sysctl interface —