Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jan 2016 10:03:49 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Boris Astardzhiev <boris.astardzhiev@gmail.com>
Cc:        Adrian Chadd <adrian.chadd@gmail.com>, Mark Delany <c2h@romeo.emu.st>, FreeBSD Net <freebsd-net@freebsd.org>
Subject:   Re: Does FreeBSD have sendmmsg or recvmmsg system calls?
Message-ID:  <20160113080349.GC72455@kib.kiev.ua>
In-Reply-To: <CAP=KkTwG0SVUmrBuWm33EC-tG4tMTdF5rLZQ_u6G1=-ujnfjkA@mail.gmail.com>
References:  <CAP=KkTzFUDsZwDDLD3n97xJW0qLVZMPduZGSX%2BeXC3UuLpVjMg@mail.gmail.com> <20160107161213.GZ3625@kib.kiev.ua> <CA%2BhQ2%2Bg6OB3MmZrW5hzNSnkcqKaKf1XGDraHfWXtSrowxKuL5g@mail.gmail.com> <20160107192840.GF3625@kib.kiev.ua> <20160108172323.W1815@besplex.bde.org> <20160108075815.3243.qmail@f5-external.bushwire.net> <CAJ-VmonYPhcN-gikuYQU_k5GaTAqTijoxR_0ORV4BZqsHMRJSg@mail.gmail.com> <20160108204606.G2420@besplex.bde.org> <CAJ-Vmom26mukSv3JmsmNiAONvpc6f1bQ%2BujO25qefGHY=5przA@mail.gmail.com> <CAP=KkTwG0SVUmrBuWm33EC-tG4tMTdF5rLZQ_u6G1=-ujnfjkA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jan 12, 2016 at 04:53:25PM +0200, Boris Astardzhiev wrote:
> Hello again,
> 
> In my spare time I did the following simple libc-only implementation of the
> syscalls.
> I did some tests in a VM adapting these experiments:
> https://blog.cloudflare.com/how-to-receive-a-million-packets/
> 
> Any comments about the diff are greatly appreciated.
Please find below.

This implementation has some strangeness, like NOASM and PSEUDO in makefile,
which I cannot find a purpose for.

Big issue with the implementation is the interposing stuff, why do you
need it at all ?  Is it to correctly handle cancellation, to not fall
into sleepable syscall when previous loop step was cancelled ?

If yes, you _can_ use pthread_testcancel(3) etc in libc.  Libc provides
stubs for them with trivial implementation, which is reset to the real
one if libthr is loaded.  Then you can simplify your patch significantly,
avoiding the need for interposing and writing the loops both in libc and
libthr.

BTW, do you have tests for the cancellation of the new functions ?

Again, the patch lacks man page updates.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160113080349.GC72455>