All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sitsofe Wheeler <sitsofe@gmail.com>
To: Matt Freel <matt.freel@broadcom.com>
Cc: Erwan Velu <evelu@redhat.com>, fio <fio@vger.kernel.org>
Subject: Re: Proper way to shut down FIO in Linux
Date: Sat, 17 Mar 2018 06:34:51 +0000	[thread overview]
Message-ID: <CALjAwxi2WtkSLG6v7sMWWoWZVSOqGahiX3aYRT6Fuh23_K8HGw@mail.gmail.com> (raw)
In-Reply-To: <7d4b20a37c7c500d6565a76db6481a40@mail.gmail.com>

Matt,

You didn't include the fio line you are running which cause the
problem. That sort of thing is useful extra information - see
https://github.com/axboe/fio/blob/master/REPORTING-BUGS .

1. Which file are we talking about? For example if a job is abandoned
due to it hanging you start skipping past code like this:

backend.c
2497         if (!fio_abort) {
2498                 __show_run_stats();
2499                 if (write_bw_log) {
2500                         for (i = 0; i < DDIR_RWDIR_CNT; i++) {
2501                                 struct io_log *log = agg_io_log[i];
2502
2503                                 flush_log(log, false);
2504                                 free_log(log);
2505                         }
2506                 }
2507         }

So that's an example of a log file won't necessarily be flushed if a
job is believed to be stuck. There are also logs that may not be
written if the job itself is stuck in the running state:

1525 static void *thread_main(void *data)
1526 {
[...]
1755
1756         while (keep_running(td)) {
[...]
1853         }
1854
[...]
1882         td_writeout_logs(td, true);

So I wouldn't depend on all the logs being correct if you have stuck
jobs that end up being abandoned. With regard to a) the general stats
might be OK but you're going to potentially have data at the end of
them that's indeterminate depending on why the job became stuck and
since we don't know the thread is dead the "final" stats might be
pulled while the job is in the middle of changing them...

2. What you're doing will send a kill to all fio processes which may
mean that when in process mode fio's child jobs get signalled before
the main job. You might things get better if you just the main fio
backend thread and let that then send the kill message to the other
processes.

Nonetheless, it would be useful to know the minimal fio command line
that generates the hangs you are referring to. If we had that then we
might be able to make things more robust by debugging the problem.

On 14 March 2018 at 15:07, Matt Freel <matt.freel@broadcom.com> wrote:
> I'm using it to generate IO -- not necessarily as a benchmark.  I'm running
> IO, taking some other measurements, then killing it to kick off a different
> workload.  The time it needs to run is not constant -- it depends on a bunch
> of different things.
>
> -----Original Message-----
> From: Erwan Velu <evelu@redhat.com>
> Sent: Wednesday, March 14, 2018 12:47 AM
> To: Matt Freel <matt.freel@broadcom.com>
> Cc: fio@vger.kernel.org
> Subject: Re: Proper way to shut down FIO in Linux
>
> Hey,
>
> Why do you want to kill fio ? That sounds weird to me.
>
> If you need to run your benchmark on constant time then use time_based &
> runtime instructions.
>
> ----- Mail original -----
> De: "Matt Freel" <matt.freel@broadcom.com>
> À: fio@vger.kernel.org
> Envoyé: Mardi 13 Mars 2018 19:56:10
> Objet: Proper way to shut down FIO in Linux
>
> I'm using FIO to run IOs to a number of block devices.  I'm looking for the
> proper way to shut down all the threads that are spawned.
>
> I'm doing the following:
>
> /usr/bin/pkill --signal INT fio
>
> Most of the time this works fine, but I do have cases where some of the FIO
> processes remain open.  Eventually I get a 300s timeout and then they're
> killed.
>
> A couple questions:
>
> 1.      When these threads have to be ungracefully killed, do the results
> still get counted in the output file?
> a.      I'm using JSON output file
> 2.      Is there a better way I should be killing all the threads?

-- 
Sitsofe | http://sucs.org/~sits/

  reply	other threads:[~2018-03-17  6:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-13 18:56 Proper way to shut down FIO in Linux Matt Freel
2018-03-14  6:46 ` Erwan Velu
2018-03-14 15:07   ` Matt Freel
2018-03-17  6:34     ` Sitsofe Wheeler [this message]
2018-03-21 14:36 ` Jens Axboe
2018-03-21 14:39   ` Matt Freel

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=CALjAwxi2WtkSLG6v7sMWWoWZVSOqGahiX3aYRT6Fuh23_K8HGw@mail.gmail.com \
    --to=sitsofe@gmail.com \
    --cc=evelu@redhat.com \
    --cc=fio@vger.kernel.org \
    --cc=matt.freel@broadcom.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.
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.