g_file_replace_contents_async() can fsync on caller thread
This was found while doing GNOME Shell tuning on RHEL 7. So that is with some backports for Shell 3.28.3, and GLib 2.56.1.
When asynchronously writing a GVariant file to disk using g_file_replace_contents_async()
, I was seeing this:
SELF TOTAL FUNCTION
[ 0.00%] [ 100.00%] [Everything]
[ 0.00%] [ 100.00%] [gnome-shell]
[ 0.00%] [ 100.00%] _start
[ 0.00%] [ 100.00%] __libc_start_main
[ 0.00%] [ 100.00%] main
[ 0.00%] [ 100.00%] meta_run
[ 0.00%] [ 100.00%] g_main_loop_run
[ 0.00%] [ 100.00%] g_main_context_iterate.isra.22
[ 0.00%] [ 100.00%] g_main_context_dispatch
[ 0.00%] [ 100.00%] g_source_destroy_internal
[ 0.00%] [ 100.00%] g_source_callback_unref
[ 0.00%] [ 100.00%] g_object_unref
[ 0.00%] [ 100.00%] g_output_stream_dispose
[ 0.00%] [ 100.00%] g_output_stream_close
[ 0.00%] [ 100.00%] g_output_stream_internal_close
[ 0.00%] [ 100.00%] _g_local_file_output_stream_really_close
[ 0.00%] [ 100.00%] fsync
[ 100.00%] [ 100.00%] do_backtrace
A simple test case does not exhibit this behavior, so I'm not sure how it get there yet.
Edited by Christian Hergert