public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: passt-dev@passt.top, Laurent Vivier <lvivier@redhat.com>
Subject: Re: [PATCH v2] log: setlogmask(0) can actually result in a system call, don't use it
Date: Mon, 5 Feb 2024 15:16:57 +1100	[thread overview]
Message-ID: <ZcBhOWYWNDoxUwTN@zatzit> (raw)
In-Reply-To: <20240202230601.2574107-1-sbrivio@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1183 bytes --]

On Sat, Feb 03, 2024 at 12:06:01AM +0100, Stefano Brivio wrote:
> Before commit 32d07f5e59f2 ("passt, pasta: Completely avoid dynamic
> memory allocation"), we didn't store the current log mask in a
> variable, and we fetched it using setlogmask(0) wherever needed.
> 
> But after that commit, we can use our log_mask copy instead. And we
> should: with recent glibc versions, setlogmask(0) actually results in
> a system call, which causes a substantial overhead with high transfer
> rates: we use setlogmask(0) even to decide we don't want to print
> debug messages.
> 
> Now that we rely on log_mask in early stages, before setlogmask() is
> called, we need to initialise that variable to the special LOG_EMERG
> mask value right away: define LOG_EARLY to make this clearer, and,
> while at it, group conditions in vlogmsg() into something more terse.
> 
> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2024-02-05  5:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-02 23:06 [PATCH v2] log: setlogmask(0) can actually result in a system call, don't use it Stefano Brivio
2024-02-05  4:16 ` David Gibson [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=ZcBhOWYWNDoxUwTN@zatzit \
    --to=david@gibson.dropbear.id.au \
    --cc=lvivier@redhat.com \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).