* FIXME in hfi1/user_exp_rcv.c
@ 2022-10-13 12:59 Dean Luick
2022-10-13 13:21 ` Jason Gunthorpe
0 siblings, 1 reply; 4+ messages in thread
From: Dean Luick @ 2022-10-13 12:59 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: linux-rdma
Hi Jason,
I am looking at the FIXME you left in hfi1/user_exp_rcv.c with git commit 3889551db212
Link: https://lore.kernel.org/r/20191112202231.3856-7-jgg@ziepe.ca
Can you please explain in more detail what made you add the FIXME and what may be "racy"?
-Dean
External recipient
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: FIXME in hfi1/user_exp_rcv.c
2022-10-13 12:59 FIXME in hfi1/user_exp_rcv.c Dean Luick
@ 2022-10-13 13:21 ` Jason Gunthorpe
2022-10-13 13:48 ` Dennis Dalessandro
0 siblings, 1 reply; 4+ messages in thread
From: Jason Gunthorpe @ 2022-10-13 13:21 UTC (permalink / raw)
To: Dean Luick; +Cc: linux-rdma
On Thu, Oct 13, 2022 at 07:59:52AM -0500, Dean Luick wrote:
> Hi Jason,
>
> I am looking at the FIXME you left in hfi1/user_exp_rcv.c with git commit 3889551db212
>
> Link: https://lore.kernel.org/r/20191112202231.3856-7-jgg@ziepe.ca
>
> Can you please explain in more detail what made you add the FIXME and what may be "racy"?
The comment seems self explanatory, the ordering is upposed to have
mmu_interval_read_begin() done before the page tables are read, not
after - since we already have a page list at this point it can't be
right.
Jason
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: FIXME in hfi1/user_exp_rcv.c
2022-10-13 13:21 ` Jason Gunthorpe
@ 2022-10-13 13:48 ` Dennis Dalessandro
2022-10-14 13:08 ` Jason Gunthorpe
0 siblings, 1 reply; 4+ messages in thread
From: Dennis Dalessandro @ 2022-10-13 13:48 UTC (permalink / raw)
To: Jason Gunthorpe, Dean Luick; +Cc: linux-rdma
On 10/13/22 9:21 AM, Jason Gunthorpe wrote:
> On Thu, Oct 13, 2022 at 07:59:52AM -0500, Dean Luick wrote:
>> Hi Jason,
>>
>> I am looking at the FIXME you left in hfi1/user_exp_rcv.c with git commit 3889551db212
>>
>> Link: https://lore.kernel.org/r/20191112202231.3856-7-jgg@ziepe.ca
>>
>> Can you please explain in more detail what made you add the FIXME and what may be "racy"?
>
> The comment seems self explanatory, the ordering is upposed to have
> mmu_interval_read_begin() done before the page tables are read, not
> after - since we already have a page list at this point it can't be
> right.
Is the race you are worried about here when a user proc tries to free the memory
before we get done handling the IOCTL to set up the recvs?
-Denny
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: FIXME in hfi1/user_exp_rcv.c
2022-10-13 13:48 ` Dennis Dalessandro
@ 2022-10-14 13:08 ` Jason Gunthorpe
0 siblings, 0 replies; 4+ messages in thread
From: Jason Gunthorpe @ 2022-10-14 13:08 UTC (permalink / raw)
To: Dennis Dalessandro; +Cc: Dean Luick, linux-rdma
On Thu, Oct 13, 2022 at 09:48:29AM -0400, Dennis Dalessandro wrote:
> On 10/13/22 9:21 AM, Jason Gunthorpe wrote:
> > On Thu, Oct 13, 2022 at 07:59:52AM -0500, Dean Luick wrote:
> >> Hi Jason,
> >>
> >> I am looking at the FIXME you left in hfi1/user_exp_rcv.c with git commit 3889551db212
> >>
> >> Link: https://lore.kernel.org/r/20191112202231.3856-7-jgg@ziepe.ca
> >>
> >> Can you please explain in more detail what made you add the FIXME and what may be "racy"?
> >
> > The comment seems self explanatory, the ordering is upposed to have
> > mmu_interval_read_begin() done before the page tables are read, not
> > after - since we already have a page list at this point it can't be
> > right.
>
> Is the race you are worried about here when a user proc tries to free the memory
> before we get done handling the IOCTL to set up the recvs?
The mechanism of mmu notifiers allows coherently reading the page
table with a notification when the read becomes invalid. If you don't
order things properly then it just doesn't work as advertised.
Jason
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-10-14 13:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-13 12:59 FIXME in hfi1/user_exp_rcv.c Dean Luick
2022-10-13 13:21 ` Jason Gunthorpe
2022-10-13 13:48 ` Dennis Dalessandro
2022-10-14 13:08 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox