[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210611174150.GX1002214@nvidia.com>
Date: Fri, 11 Jun 2021 14:41:50 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: David Hildenbrand <david@...hat.com>
Cc: Tony Krowiak <akrowiak@...ux.ibm.com>, linux-s390@...r.kernel.org,
linux-kernel@...r.kernel.org, borntraeger@...ibm.com,
cohuck@...hat.com, pasic@...ux.vnet.ibm.com, jjherne@...ux.ibm.com,
alex.williamson@...hat.com, kwankhede@...dia.com,
frankja@...ux.ibm.com, imbrenda@...ux.ibm.com, hca@...ux.ibm.com
Subject: Re: [PATCH 2/3] s390/vfio-ap: introduce two new r/w locks to replace
wait_queue_head_t
On Fri, Jun 11, 2021 at 07:11:50PM +0200, David Hildenbrand wrote:
> > Also, not convinced down_write_trylock() is appropriate from a sysfs
> > callback, it should block and wait, surely? Otherwise userspace gets
> > random racy failures depending on what the kernel is doing??
>
> It might we worth exploring lock_device_hotplug_sysfs() which does a
>
> "return restart_syscall()" with some delay.
The ideal design from a sysfs should be a single
down_write_killable().
restart_syscall will just create a weird spinlock that is hopefully
unlikely to spin :\
Jason
Powered by blists - more mailing lists