From: Patrick McHardy <kaber@trash.net>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev <netdev@vger.kernel.org>,
Netfilter Development Mailinglist
<netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH nf-next] ipt_LOG: add bufferisation to call printk() once
Date: Mon, 04 Oct 2010 20:58:23 +0200 [thread overview]
Message-ID: <4CAA23CF.80904@trash.net> (raw)
In-Reply-To: <1286032059.2582.2338.camel@edumazet-laptop>
Am 02.10.2010 17:07, schrieb Eric Dumazet:
> ipt_LOG & ip6t_LOG use lot of calls to printk() and use a lock in a hope
> several cpus wont mix their output in syslog.
>
> printk() being very expensive [1], its better to call it once, on a
> prebuilt and complete line. Also, with mixed IPv4 and IPv6 trafic,
> separate IPv4/IPv6 locks dont avoid garbage.
>
> I used an allocation of a 1024 bytes structure, sort of seq_printf() but
> with a fixed size limit.
> Use a static buffer if dynamic allocation failed.
>
> Emit a once time alert if buffer size happens to be too short.
>
> [1]: printk() has various features like printk_delay()...
Nice work, applied, thanks Eric.
prev parent reply other threads:[~2010-10-04 18:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-02 15:07 [PATCH nf-next] ipt_LOG: add bufferisation to call printk() once Eric Dumazet
2010-10-04 18:58 ` Patrick McHardy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CAA23CF.80904@trash.net \
--to=kaber@trash.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.