From: "Alex Bennée" <alex.bennee@linaro.org>
To: Robert Foley <robert.foley@linaro.org>
Cc: peter.puhov@linaro.org, richard.henderson@linaro.org,
qemu-devel@nongnu.org
Subject: Re: [PATCH v3 0/6] Make the qemu_logfile handle thread safe.
Date: Wed, 20 Nov 2019 16:33:21 +0000 [thread overview]
Message-ID: <87mucqfqy6.fsf@linaro.org> (raw)
In-Reply-To: <20191118211528.3221-1-robert.foley@linaro.org>
Robert Foley <robert.foley@linaro.org> writes:
> This patch adds thread safety to the qemu_logfile handle. This now
> allows changing the logfile while logging is active, and also solves
> the issue of a seg fault while changing the logfile.
>
> This patch adds use of RCU for handling the swap out of the
> old qemu_logfile file descriptor.
>
> Also added a few tests for logfile including changing the logfile
> and closing the logfile.
>
> One change also added for a pre-existing double free issue in
> qemu_set_log_filename() uncovered with the new test.
>
> We also cleaned up the flow of code in qemu_set_log().
This all looks good to me. As we are in hardfreeze now I think it's best
we wait for the tree to open before submitting the PR. If no one else
wants to pick this up I'll put together a PR.
> ---
> v3
> - This version of the patch incorporates a few minor changes.
> - Change patch which adds qemu_logfile_mutex to remove the
> asserts that mutex is initialized, instead we will rely
> on the constructor.
> - Also added details to commit for patch adding mutex to explain some
> unavoidable temporary ugliness that we cleanup in a later patch.
> - Change qemu_log_lock() to unconditionally hold the rcu_read_lock()
> until qemu_log_unlock().
> - Also changed one use case in target/tilegx/translate.c
> to eliminate use of qemu_log_lock()/unlock().
> ---
> v2
> - This version of the patch adds some cleanup of code in
> qemu_set_log().
> - Also changed the order of patches to move our fix for the
> double free issue in qemu_set_log_filename() up to the beginning
> of the patch.
> ---
> v1
> - This version of the patch incorporates changes
> from the first round of review.
> - It also includes a fix for an issue in
> qemu_set_log_filename(). This issue was uncovered
> by the test added for this patch.
> ---
>
> Robert Foley (6):
> Fix double free issue in qemu_set_log_filename().
> Cleaned up flow of code in qemu_set_log(), to simplify and clarify.
> Add a mutex to guarantee single writer to qemu_logfile handle.
> qemu_log_lock/unlock now preserves the qemu_logfile handle.
> Add use of RCU for qemu_logfile.
> Added tests for close and change of logfile.
>
> accel/tcg/cpu-exec.c | 4 +-
> accel/tcg/translate-all.c | 4 +-
> accel/tcg/translator.c | 4 +-
> exec.c | 4 +-
> hw/net/can/can_sja1000.c | 4 +-
> include/exec/log.h | 33 +++++++++--
> include/qemu/log.h | 48 +++++++++++++---
> net/can/can_socketcan.c | 5 +-
> target/cris/translate.c | 4 +-
> target/i386/translate.c | 5 +-
> target/lm32/translate.c | 4 +-
> target/microblaze/translate.c | 4 +-
> target/nios2/translate.c | 4 +-
> target/tilegx/translate.c | 6 --
> target/unicore32/translate.c | 4 +-
> tcg/tcg.c | 28 ++++++----
> tests/test-logging.c | 80 +++++++++++++++++++++++++++
> util/log.c | 100 ++++++++++++++++++++++++++--------
> 18 files changed, 268 insertions(+), 77 deletions(-)
--
Alex Bennée
prev parent reply other threads:[~2019-11-20 16:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-18 21:15 [PATCH v3 0/6] Make the qemu_logfile handle thread safe Robert Foley
2019-11-18 21:15 ` [PATCH v3 1/6] Fix double free issue in qemu_set_log_filename() Robert Foley
2019-11-18 21:15 ` [PATCH v3 2/6] Cleaned up flow of code in qemu_set_log(), to simplify and clarify Robert Foley
2019-11-18 21:15 ` [PATCH v3 3/6] Add a mutex to guarantee single writer to qemu_logfile handle Robert Foley
2019-11-18 21:15 ` [PATCH v3 4/6] qemu_log_lock/unlock now preserves the " Robert Foley
2019-11-18 21:15 ` [PATCH v3 5/6] Add use of RCU for qemu_logfile Robert Foley
2019-11-18 21:15 ` [PATCH v3 6/6] Added tests for close and change of logfile Robert Foley
2019-11-20 16:33 ` Alex Bennée [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=87mucqfqy6.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=peter.puhov@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=robert.foley@linaro.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.