[dns-operations] Truncation query
Florian Weimer
fweimer at redhat.com
Mon Mar 20 08:41:54 UTC 2017
On 03/17/2017 07:25 PM, Tony Finch wrote:
> Florian Weimer <fweimer at redhat.com> wrote:
>>
>> I"m going to use MSG_PEEK and MSG_TRUNC to get an accurate size from the
>> kernel and allocate a suitable sized buffer using malloc. But that's probably
>> not a good choice for high-performance servers.
>
> Is there any reason not to allocate a 64KB buffer when the resolver
> context is initialized, and let the kernel donate pages to the buffer
> if/when that becomes necessary?
Every thread in the system currently has its own resolver context,
whether or not it currently uses the resolver. Adding a persistent 64
KiB buffer to that (and thus to every thread) doesn't seem such a great
idea. On 32-bit systems it would even break quite a few applications
because they are already tuned to be closed to the address space limit.
(Not that I personally care much about 32-bit anymore, but actively
breaking backwards compatibility seems a bit much.)
Florian
More information about the dns-operations
mailing list