linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: John Hubbard <jhubbard@nvidia.com>
To: Alistair Popple <apopple@nvidia.com>
Cc: <akpm@linux-foundation.org>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>, <david@redhat.com>,
	<daniel.vetter@ffwll.ch>, <dan.j.williams@intel.com>,
	<gregkh@linuxfoundation.org>, <jglisse@redhat.com>,
	<bsingharora@gmail.com>,
	kernel test robot <oliver.sang@intel.com>
Subject: Re: [PATCH v3] kernel/resource: Fix locking in request_free_mem_region
Date: Mon, 29 Mar 2021 22:17:41 -0700	[thread overview]
Message-ID: <4738a7e1-ec62-0b11-28df-e81c0f904f84@nvidia.com> (raw)
In-Reply-To: <7635785.yHxt4vaozm@nvdebian>

On 3/29/21 9:59 PM, Alistair Popple wrote:
...
>>>    		res->desc = IORES_DESC_DEVICE_PRIVATE_MEMORY;
>>> +		if (dev) {
>>> +			dr->parent = &iomem_resource;
>>> +			dr->start = addr;
>>> +			dr->n = size;
>>> +			devres_add(dev, dr);
>>> +		}
>>> +
>>> +		write_unlock(&resource_lock);
>>> +		revoke_iomem(res);
>>
>> This is new, and not mentioned in the commit log, and therefore quite
>> surprising. It seems like the right thing to do but it also seems like a
>> different fix! I'm not saying that it should be a separate patch, but it
>> does seem worth loudly mentioning in the commit log, yes?
> 
> This isn't a different fix though, it is just about maintaining the original
> behaviour which called revoke_iomem() after dropping the lock. I inadvertently
> switched this around in the initial patch such that revoke_iomem() got called
> with the lock, leading to deadlock on x86 with CONFIG_IO_STRICT_DEVMEM=y.
> 
> This does change the order of revoke_iomem() and devres_add() slightly, but as
> far as I can tell that shouldn't be an issue. Can call that out in the commit
> log.

Maybe that's why it looked like a change to me. I do think it's worth mentioning.


thanks,
-- 
John Hubbard
NVIDIA


      reply	other threads:[~2021-03-30  5:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30  0:38 Alistair Popple
2021-03-30  3:42 ` John Hubbard
2021-03-30  4:59   ` Alistair Popple
2021-03-30  5:17     ` John Hubbard [this message]

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=4738a7e1-ec62-0b11-28df-e81c0f904f84@nvidia.com \
    --to=jhubbard@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=apopple@nvidia.com \
    --cc=bsingharora@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=david@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jglisse@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=oliver.sang@intel.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