All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Sitsofe Wheeler <sitsofe@gmail.com>
Cc: Rob Scheepens <rob.scheepens@nutanix.com>,
	David Knierim <knierim@nutanix.com>,
	Rebecca Cran <rebecca@bluestop.org>, fio <fio@vger.kernel.org>
Subject: Re: Windows: FIO randomly hangs using attached script
Date: Fri, 9 Mar 2018 07:55:32 -0700	[thread overview]
Message-ID: <406902be-f4ce-c4f4-4e16-ee9caf8c0bcf@kernel.dk> (raw)
In-Reply-To: <CALjAwxg1SzQV9ss9jjqry8_MLgDfPYq9QdbA5eVZi-PkmSEAKA@mail.gmail.com>

On 3/9/18 7:40 AM, Sitsofe Wheeler wrote:
> On 8 March 2018 at 16:18, Jens Axboe <axboe@kernel.dk> wrote:
>> Does the below patch make a difference?
>>
>>
>> diff --git a/mutex.c b/mutex.c
>> index 63229eda09d6..acc88dc33b98 100644
>> --- a/mutex.c
>> +++ b/mutex.c
>> @@ -240,10 +240,11 @@ void fio_mutex_up(struct fio_mutex *mutex)
>>         if (!mutex->value && mutex->waiters)
>>                 do_wake = 1;
>>         mutex->value++;
>> -       pthread_mutex_unlock(&mutex->lock);
>>
>>         if (do_wake)
>>                 pthread_cond_signal(&mutex->cond);
>> +
>> +       pthread_mutex_unlock(&mutex->lock);
>>  }
>>
>>  void fio_rwlock_write(struct fio_rwlock *lock)
> 
> It pains me to say this (because POSIX says such rejigging just
> changes the scheduling order) but yes your patch makes a difference.
> The following job would trigger the deadlock problem within 10 minutes
> for me:

In some implementations it's actually mandated to have the wakeup
within the lock, which seems to be the case here. It's a shame,
since it's clearly suboptimal (from a scalability point of view)
to have to hold the lock while issuing a wakeup for a process
that's going to grab the same lock.

I'll commit the patch. Thanks a lot for all your hard work on this
one, let's hope that was it...

-- 
Jens Axboe



  reply	other threads:[~2018-03-09 14:55 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-06  1:23 Windows: FIO randomly hangs using attached script Rebecca Cran
2018-03-06 16:35 ` Sitsofe Wheeler
2018-03-06 20:01   ` Rebecca Cran
2018-03-07  6:00     ` Sitsofe Wheeler
2018-03-07 15:33       ` David Knierim
2018-03-07 15:39         ` Rob Scheepens
2018-03-07 16:01           ` Sitsofe Wheeler
2018-03-07 16:03             ` Rebecca Cran
2018-03-07 16:05             ` Rob Scheepens
2018-03-07 16:09               ` Rebecca Cran
2018-03-08 10:51           ` Rob Scheepens
2018-03-08 12:28             ` Sitsofe Wheeler
2018-03-08 12:39               ` Rob Scheepens
2018-03-08 14:35                 ` Rob Scheepens
2018-03-08 14:38                   ` Rob Scheepens
2018-03-08 15:15                     ` Sitsofe Wheeler
2018-03-08 15:13                   ` Sitsofe Wheeler
2018-03-08 15:45                     ` Rob Scheepens
2018-03-08 15:47                       ` Sitsofe Wheeler
2018-03-08 15:46                     ` Sitsofe Wheeler
2018-03-08 15:59                       ` Sitsofe Wheeler
2018-03-08 16:18                         ` Jens Axboe
2018-03-09 14:40                           ` Sitsofe Wheeler
2018-03-09 14:55                             ` Jens Axboe [this message]
2018-03-16  8:13                               ` Sitsofe Wheeler
2018-05-01 14:41                                 ` Rob Scheepens
2018-05-01 14:42                                   ` Jens Axboe
2018-05-01 14:58                                   ` Sitsofe Wheeler
2018-03-08 22:44                         ` Sitsofe Wheeler
2018-03-06 21:53 ` Jens Axboe
2018-03-06 22:35   ` Rebecca Cran

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=406902be-f4ce-c4f4-4e16-ee9caf8c0bcf@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    --cc=knierim@nutanix.com \
    --cc=rebecca@bluestop.org \
    --cc=rob.scheepens@nutanix.com \
    --cc=sitsofe@gmail.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.