public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Omar Sandoval <osandov@osandov.com>
To: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Linux Block Layer Mailinglist <linux-block@vger.kernel.org>,
	Omar Sandoval <osandov@fb.com>
Subject: Re: [PATCH blktests 2/2] block/011: Perform PCI reset while doing IO
Date: Mon, 26 Jun 2017 14:27:24 -0700	[thread overview]
Message-ID: <20170626212724.GF6710@vader.dhcp.thefacebook.com> (raw)
In-Reply-To: <20170623142951.17189-2-jthumshirn@suse.de>

On Fri, Jun 23, 2017 at 04:29:51PM +0200, Johannes Thumshirn wrote:
> From: Omar Sandoval <osandov@fb.com>
> 
> This test-case performs I/O with fio while doing PCI disable/enable
> cycles.
> 
> In the results we don't care for I/O errors but for hiccups in dmesg only.
> 
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> ---
>  tests/block/011     | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>  tests/block/011.out |  2 ++
>  2 files changed, 56 insertions(+)
>  create mode 100755 tests/block/011
>  create mode 100644 tests/block/011.out
> 
> diff --git a/tests/block/011 b/tests/block/011
> new file mode 100755
> index 000000000000..b0de35816d48
> --- /dev/null
> +++ b/tests/block/011
> @@ -0,0 +1,54 @@
> +#!/bin/bash
> +#
> +# Do disable PCI device while doing I/O to it
> +#
> +# Copyright (C) 2017 Johannes Thumshirn <jthumshirn@suse.de>
> +#
> +# This program is free software: you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation, either version 3 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +
> +DESCRIPTION="disable PCI device while doing I/O"
> +TIMED=1
> +
> +requires() {
> +	_have_fio
> +}
> +
> +device_requires() {
> +	_test_dev_is_pci
> +}
> +
> +test_device() {
> +	echo "Running ${TEST_NAME}"
> +
> +	pdev=$(_get_pci_dev_from_blkdev)
> +
> +	if _test_dev_is_rotational; then
> +		size="32m"
> +	else
> +		size="1g"
> +	fi
> +
> +	# start fio job
> +	_run_fio --bs=4k --rw=randread --norandommap \
> +		--name=reads --filename="$TEST_DEV" --size="$size" \
> +		--numjobs=8 --direct=1 2>/dev/null &
> +
> +	while kill -0 $! 2>/dev/null; do
> +		echo 0 > "/sys/bus/pci/devices/${pdev}/enable"
> +		sleep .2
> +		echo 1 > "/sys/bus/pci/devices/${pdev}/enable"

Test looks good, but one question: do you want another sleep .2 here?
Like this, you immediately disable it after enabling it, but maybe
that's what you want :)

> +	done
> +
> +	echo "Test complete"
> +}
> diff --git a/tests/block/011.out b/tests/block/011.out
> new file mode 100644
> index 000000000000..8e067df63097
> --- /dev/null
> +++ b/tests/block/011.out
> @@ -0,0 +1,2 @@
> +Running block/011
> +Test complete
> -- 
> 2.12.3
> 

  parent reply	other threads:[~2017-06-26 21:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-23 14:29 [PATCH blktests 1/2] rc: add helpers to handle PCI test devices Johannes Thumshirn
2017-06-23 14:29 ` [PATCH blktests 2/2] block/011: Perform PCI reset while doing IO Johannes Thumshirn
2017-06-23 15:36   ` Jens Axboe
2017-06-26 14:06     ` Johannes Thumshirn
2017-06-26 14:25       ` Jens Axboe
2017-06-26 21:29         ` Omar Sandoval
2017-06-26 21:45           ` Jens Axboe
2017-06-26 21:27   ` Omar Sandoval [this message]
2017-06-27  6:49     ` Johannes Thumshirn
2017-06-26 21:31 ` [PATCH blktests 1/2] rc: add helpers to handle PCI test devices Omar Sandoval

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=20170626212724.GF6710@vader.dhcp.thefacebook.com \
    --to=osandov@osandov.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-block@vger.kernel.org \
    --cc=osandov@fb.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox