mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tony Krowiak <akrowiak@linux.ibm.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Halil Pasic <pasic@linux.ibm.com>,
	linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
	pasic@linux.vnet.ibm.com, jjherne@linux.ibm.com
Subject: Re: [PATCH] s390/vfio-ap: do not use open locks during VFIO_GROUP_NOTIFY_SET_KVM notification
Date: Tue, 6 Jul 2021 18:43:39 -0400	[thread overview]
Message-ID: <f958be51-a5fd-a755-f1de-a580f9ccbace@linux.ibm.com> (raw)
In-Reply-To: <20210706134939.GX4459@nvidia.com>



On 7/6/21 9:49 AM, Jason Gunthorpe wrote:
> On Tue, Jul 06, 2021 at 09:39:29AM -0400, Tony Krowiak wrote:
>>
>> On 7/5/21 10:13 AM, Jason Gunthorpe wrote:
>>> On Thu, Jul 01, 2021 at 10:28:52AM -0400, Tony Krowiak wrote:
>>>
>>>>> I think Jason was talking about open coding locks in general.
>>>> That may be so, but his comments were in support of his
>>>> statement that the  mutex + wait_queue did not resolve
>>>> the issue reported vai the lockdep splat because it turned
>>>> off lockdep.
>>> Rgiht, if this used to be proper locks and lockdep complained then
>>> whatever potential deadlock it found is not magically removed by going
>>> to a wait_queue. It just removes the lockdep annotations that would
>>> identify the issue early.
>>>
>>> This is why people should not open code locks, it completely defeats
>>> lockdep. That alone is merit enough for this patch.
>> When you use the phrase "open code locks", to what are you
>> specifically referring? I am confused by the use of the phrase
>> "open code" in this context because open coding, at least as
>> I understand it, has to do with data analysis.
> "open code" here means you write the algorithm of a standard lock in
> your own functions instead of calling the standard library.
>
> Testing/setting the busy and sleeping on a wait_event is exactly a
> standard lock.
>
> Ie if I write
>
>     for (len = 0; str[len] != 0; len++)
>             ;
>
> Then I have open coded strlen()
>
> Jason

Thanks for the explanation.



  reply	other threads:[~2021-07-06 22:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-25 22:07 Tony Krowiak
2021-06-28 17:34 ` Jason Gunthorpe
2021-06-28 18:20   ` Tony Krowiak
2021-06-28 18:22     ` Jason Gunthorpe
2021-06-28 18:27       ` Tony Krowiak
2021-06-28 20:29 ` Halil Pasic
2021-06-30 14:31   ` Tony Krowiak
2021-06-30 22:39     ` Halil Pasic
2021-07-01 14:28       ` Tony Krowiak
2021-07-05 14:13         ` Jason Gunthorpe
2021-07-06 13:39           ` Tony Krowiak
2021-07-06 13:49             ` Jason Gunthorpe
2021-07-06 22:43               ` Tony Krowiak [this message]
2021-06-29 13:21 ` Jason J. Herne
2021-06-30 11:55   ` Jason Gunthorpe

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=f958be51-a5fd-a755-f1de-a580f9ccbace@linux.ibm.com \
    --to=akrowiak@linux.ibm.com \
    --cc=jgg@nvidia.com \
    --cc=jjherne@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=pasic@linux.ibm.com \
    --cc=pasic@linux.vnet.ibm.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

all inboxes | Powered by JetHome®