public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.de>
To: fdmanana@gmail.com, Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: fstests <fstests@vger.kernel.org>,
	linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 2/2] fstests: btrfs: Introduce stress test for deadlock between snapshot delete and other read-write operations
Date: Thu, 10 Jan 2019 21:59:28 +0800	[thread overview]
Message-ID: <cddf660e-779a-e278-83b7-e54f010374b7@suse.de> (raw)
In-Reply-To: <CAL3q7H7st9hhNhgQf-pt--LOMMvzoJU6Mz7jSrq8oUtKGzXPDg@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2167 bytes --]



On 2019/1/10 下午9:53, Filipe Manana wrote:
[snip]
>>>> +# Workaround to handle killed workload with unreturned syscall
>>>> +sync
>>>
>>> I can't understand that comment, nor why the call to sync (probably
>>> most readers won't either).
>>> What do you mean by "unreturned syscall"? It hangs, blocked? Because
>>> of the deadlock? How does the sync makes it "return"?
>>
>> I mean normal "btrfs subvolume create/delete" ioctl syscalls.
>>
>>>
>>> When you say killed workload, you mean though the kill commands above?
>>> For all pids or just some in particular?
>>
>> For the workload, it will be a forked bash process, and then executing
>> "btrfs" program.
>> While "btrfs subvolume create/delete" could call ioctl and fall into
>> kernel space, kill/wait for the bash process could return before the
>> ioctl returned.
>>
>> So here we try to call sync which will commit current transaction, more
>> or less wait for unfinished "btrfs" ioctls to return.
>>
>> Or should I change to the more common loop of check "btrfs" process and
>> wait?
> 
> Doing something like the following seems to be what you need:
> 
> https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/commit/?id=d0ec5f5af9479137526b73b8b4f48ef028444ffc

Thanks a lot!

It's much better than my ugly workaround.

I'll update the patch to address all your comment.

Thanks,
Qu

> 
> 
>>
>> Thanks,
>> Qu
>>
>>>
>>>> +
>>>> +# success, all done
>>>> +echo "Silence is golden"
>>>> +
>>>> +status=0
>>>> +exit
>>>> diff --git a/tests/btrfs/179.out b/tests/btrfs/179.out
>>>> new file mode 100644
>>>> index 000000000000..cb9eba3d34b1
>>>> --- /dev/null
>>>> +++ b/tests/btrfs/179.out
>>>> @@ -0,0 +1,2 @@
>>>> +QA output created by 179
>>>> +Silence is golden
>>>> diff --git a/tests/btrfs/group b/tests/btrfs/group
>>>> index 04c0254aa4bf..46dd3c9523c2 100644
>>>> --- a/tests/btrfs/group
>>>> +++ b/tests/btrfs/group
>>>> @@ -181,3 +181,4 @@
>>>>  176 auto quick swap volume
>>>>  177 auto quick swap balance
>>>>  178 auto quick send
>>>> +179 auto qgroup dangerous
>>>> --
>>>> 2.20.1
>>>>
>>>
>>>
>>
> 
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-01-10 13:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-10  6:14 [PATCH 1/2] fstests: btrfs: Make seed device test cases into their own group Qu Wenruo
2019-01-10  6:14 ` [PATCH 2/2] fstests: btrfs: Introduce stress test for deadlock between snapshot delete and other read-write operations Qu Wenruo
2019-01-10 12:08   ` Filipe Manana
2019-01-10 13:49     ` Qu Wenruo
2019-01-10 13:53       ` Filipe Manana
2019-01-10 13:59         ` Qu Wenruo [this message]
2019-01-10  6:17 ` [PATCH 1/2] fstests: btrfs: Make seed device test cases into their own group Anand Jain

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=cddf660e-779a-e278-83b7-e54f010374b7@suse.de \
    --to=wqu@suse.de \
    --cc=fdmanana@gmail.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.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