<div dir="ltr">It looks like it was added to the -current kernel back on 2012/06/22. It could definitely be a bug in the implementation.<div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">--disable-recvmmsg seems to make it happy again.</span><br>
</div><div><br></div><div><font face="arial, sans-serif">ktruss for the original binary shows:</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"><div> 2538 1 nsd __clock_gettime50(0x3, 0x7f7fffffd6c0) = 0</div>
<div> 2538 1 nsd emul(netbsd)</div><div> 2538 1 nsd __gettimeofday50(0x7f7fffffd6d0, 0) = 0</div><div> 2538 1 nsd recvmmsg(0x3, 0x68cb80, 0x64, 0, 0) = 1</div><div> "\M-Q?\^A\0\0\^A\0\0\0\0\0\0\axxxxxxx\^Cyyy\^Cnet\0\0\^A\0\^A"</div>
<div> 2538 1 nsd sendmmsg(0x3, 0x68cb80, 0x1, 0) Err#35 EAGAIN</div><div> 2538 1 nsd issetugid() = 1</div><div> 2538 1 nsd open("/usr/share/nls/nls.alias.db", 0x400000, 0) Err#2 ENOENT</div>
<div> 2538 1 nsd open("/usr/share/nls/nls.alias", 0x400000, 0) = 8</div><div> 2538 1 nsd __fstat50(0x8, 0x7f7fffffcc70) = 0</div><div> 2538 1 nsd mmap(0, 0x5f0, 0x1, 0x2, 0x8, 0, 0) = 0x7f7ff7f65000</div>
<div> 2538 1 nsd close(0x8) = 0</div><div> 2538 1 nsd munmap(0x7f7ff7f65000, 0x5f0) = 0</div><div> 2538 1 nsd open("/usr/share/nls/C/<a href="http://libc.cat">libc.cat</a>", 0, 0x3a) = 8</div>
<div> 2538 1 nsd __fstat50(0x8, 0x7f7fffffccf0) = 0</div><div> 2538 1 nsd mmap(0, 0x10be, 0x1, 0x1, 0x8, 0, 0) = 0x7f7ff7f64000</div><div> 2538 1 nsd close(0x8) = 0</div><div>
2538 1 nsd munmap(0x7f7ff7f64000, 0x10be) = 0</div><div> 2538 1 nsd __gettimeofday50(0x7f7fffffc190, 0) = 0</div><div> 2538 1 nsd getpid() = 2538, 13362</div><div> 2538 1 nsd fcntl(0xa, 0x3, 0) = 2</div>
<div> 2538 1 nsd sendto(0xa, 0x7f7fffffc1b0, 0x75, 0, 0, 0) = 117</div><div> "<27>1 2013-12-03T03:42:32.309243+00:00 <a href="http://xxxxxxx.yyy.net">xxxxxxx.yyy.net</a> nsd 2538 - - s"</div>
<div><div> 2538 1 nsd getpid() = 2538, 13362</div><div> 2538 1 nsd __gettimeofday50(0x7f7fffffd320, 0) = 0</div><div> 2538 1 nsd write(0x2, 0x7f7fffffca10, 0x50) = 80</div>
<div> "[1386042152] nsd[2538]: error: sendmmsg failed: Resource temporarily "</div><div> 2538 1 nsd write(0x2, 0x652bc7, 0x1) = 1</div><div> "\n"</div></div><div><div> 2538 1 nsd __clock_gettime50(0x3, 0x7f7fffffd6c0) = 0</div>
<div> 2538 1 nsd __gettimeofday50(0x7f7fffffd6d0, 0) = 0</div><div> 2538 1 nsd __kevent50(0x7, 0x7f7ff7315000, 0, 0x7f7ff7316000, 0x40, 0) = 1</div><div> 2538 1 nsd __clock_gettime50(0x3, 0x7f7fffffd6c0) = 0</div>
<div> 2538 1 nsd __gettimeofday50(0x7f7fffffd6d0, 0) = 0</div><div> 2538 1 nsd recvmmsg(0x3, 0x68cb80, 0x64, 0, 0) Err#35 EAGAIN</div><div> 2538 1 nsd __clock_gettime50(0x3, 0x7f7fffffd6c0) = 0</div>
<div> 2538 1 nsd __gettimeofday50(0x7f7fffffd6d0, 0) = 0</div><div> 2538 1 nsd __kevent50(0x7, 0x7f7ff7315000, 0, 0x7f7ff7316000, 0x40, 0) = 1</div><div> 2538 1 nsd __clock_gettime50(0x3, 0x7f7fffffd6c0) = 0</div>
<div> 2538 1 nsd __gettimeofday50(0x7f7fffffd6d0, 0) = 0</div><div> 2538 1 nsd recvmmsg(0x3, 0x68cb80, 0x64, 0, 0) Err#35 EAGAIN</div></div><div><br></div><div>So the very first recvmmsg works, but then every sendmmsg and recvmmsg afterwards returns EAGAIN and the process goes into a loop.</div>
<div><br></div><div>-Dustin</div></font></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 29, 2013 at 3:49 AM, W.C.A. Wijngaards <span dir="ltr"><<a href="mailto:wouter@nlnetlabs.nl" target="_blank">wouter@nlnetlabs.nl</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
Hi Dustin,<br>
<br>
The NetBSD sendmmsg implementation must be completely new. Does the<br>
kernel really implement this system call, kernel bugs, or does EAGAIN<br>
really mean 'not yet implemented'? NSD simply calls sendmmsg, looks<br>
how many packets have been sent, and then tries again to send the<br>
remaining packets from the list. The OS could (conceivably) return 1<br>
every time and simply do its one-packet-send function every time, and<br>
never return EAGAIN (sendto does not give NSD EAGAIN when called<br>
packet-by-packet).<br>
<br>
The configure option --disable-recvmmsg can be used to disable the<br>
sendmmsg and recvmmsg calls at compile time.<br>
<br>
I thought NSD implements the sendmmsg calls 'right', but if somehow it<br>
is wrong, I would like to fix that.<br>
<br>
Best regards, Wouter<br>
<div><div class="h5"><br>
On 11/29/2013 01:29 AM, Dustin Marquess wrote:<br>
> On NetBSD 6.99.28-CURRENT, nsd 3.2.16 works fine, however nsd 4.0.0<br>
> is spinning chewing CPU. The logs show:<br>
><br>
> Nov 28 23:07:00 xxx nsd[466]: sendmmsg failed: Resource<br>
> temporarily unavailable<br>
><br>
> ktruss shows it getting EAGAIN from sendmmsg(2) over and over<br>
> again. According to the man page:<br>
><br>
> [EAGAIN|EWOULDBLOCK] The socket is marked non-blocking and the<br>
> requested operation would block.<br>
><br>
> Sounds like it's blocking when it shouldn't?<br>
><br>
> -Dustin<br>
><br>
><br>
</div></div>> _______________________________________________ nsd-users mailing<br>
> list nsd-users@NLnetLabs.nl<br>
> <a href="http://open.nlnetlabs.nl/mailman/listinfo/nsd-users" target="_blank">http://open.nlnetlabs.nl/mailman/listinfo/nsd-users</a><br>
><br>
<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.15 (GNU/Linux)<br>
Comment: Using GnuPG with Thunderbird - <a href="http://www.enigmail.net/" target="_blank">http://www.enigmail.net/</a><br>
<br>
iQIcBAEBAgAGBQJSmGNEAAoJEJ9vHC1+BF+NTWcP/j4KPu3X7YigGw5zlGyh2JPW<br>
5W0USzaxVGuE+PUtuFDRO710X0Z+OiKdmQLlNXVxSYMGmAUFx56ORZPnSjNIrWWi<br>
UsASG+1U0wMptbIAftum2P2/RghtbqTcRbeMv7dr7xwpJ7KP+eHgb4bxk//F9A6U<br>
L7zncaC24rHsxGZcSoXDwZ6lsKT20XEXYR/gEldvsqTasjxn1IDEkQ8MpUjTrmfL<br>
fF1PZ9s9I+od3oCuxSR4egLP/ARTDP9jrkN+1/VVZUBKF+RWVOayFPOLWd73og7+<br>
nD08ShYYN3tc40Z/3r3cJvm/VuQ56+NzW97dXHvGsV2Z5cSnwB24IQXWhpEHxhnn<br>
U2oK+kV9EtI/bj9VWjsoJBJgBuSXKbrt1agj6GhUkLiSFBpLN4+EIiAOkJcEtguv<br>
BO6VeSI5sKfe8zeBL7qLZb595l7/saXMo/scSbr4ikjy2Bxy3QeQ9ONgBjjOxY1n<br>
4RV1PwBxoVMrRa5JLdfpsq0ThJ/N7cqtx1J9a6ZddkYndK917JBLxc/DeJxfwukb<br>
KjBnjSmIdymST3431FUzbyUp46X2Br1Ro9SyfGG6wcTVl3+xRoYm1/BCtzZDwvh2<br>
+Yz2KKkXx+f0BZ/a/Eb7IY7z4QPQoOybL1KyTo3WBQ7+RHcPqNxt1v1tQkruhdQu<br>
nSQBKr1ctoxTsqjAWp5R<br>
=hO5t<br>
-----END PGP SIGNATURE-----<br>
_______________________________________________<br>
nsd-users mailing list<br>
nsd-users@NLnetLabs.nl<br>
<a href="http://open.nlnetlabs.nl/mailman/listinfo/nsd-users" target="_blank">http://open.nlnetlabs.nl/mailman/listinfo/nsd-users</a><br>
</blockquote></div><br></div>