All of lore.kernel.org
 help / color / mirror / Atom feed
* fio and multithreading
@ 2010-11-09 17:39 Bart Van Assche
  2010-11-10 14:15 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2010-11-09 17:39 UTC (permalink / raw)
  To: Jens Axboe; +Cc: fio@vger.kernel.org

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

On Tue, Nov 9, 2010 at 2:16 PM, Jens Axboe <jaxboe@fusionio.com<mailto:jaxboe@fusionio.com>> wrote:
[ ... ]

This looks pretty straightforward - the file is created, but not filled
with a verifiable pattern. You want to run the workload with rw=write
at least once first, then you can use a read-only verify workload later
if you want.

Hello Jens,

Sorry for the confusion. Something else I came across is the global variable last_tv in gettime.c. As far as I can see this variable is shared over all fio threads and multiple threads can update this variable simultaneously ? I was surprised to see that the variable last_tv is updated non-atomically and without being protected by any kind of lock. Shouldn't such behavior be documented ?

And if my analysis is correct, the variable thread_data.runstate is also shared over threads. Will the code that reads that variable work correctly on a multiprocessor system that allows write reordering ? Or, in other words, have any assumptions been made about values written by a worker thread being available to the main thread as soon as the main thread notices that the thread state has been updated ?

Something else I noticed is that the function print_thread_status() is invoked from a SIGALRM signal handler, and that print_thread_status() invokes e.g. printf(). I'm afraid that that's not entirely POSIX-compliant: the POSIX specs define a limitative list of functions that may be invoked from signal handlers, and printf() is not included in that list. That list can be found e.g. here: <http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04> http://www.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html. I'm not sure though what the consequences are of invoking functions that are not async-signal-safe from a signal handler.

Bart.

[-- Attachment #2: Type: text/html, Size: 2280 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-11-10 14:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-09 17:39 fio and multithreading Bart Van Assche
2010-11-10 14:15 ` Jens Axboe

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.