Skip to contentSkip to conversation

FIXME in hfi1/user_exp_rcv.c

DISCUSSION Dean Luick 3 participants 4 messages Oct 13, 2022 – Oct 14, 2022 InfiniBand

lore
Share & tools
lore
maintainer
#1 lore raw
Quoted 7 lines · Dean Luick

Hi Jason,

I am looking at the FIXME you left in hfi1/user_exp_rcv.c with git commit 3889551db212

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

#2 lore raw
Quoted 5 lines · Jason Gunthorpe
Quoted 4 lines · Dean Luick

Hi Jason,

I am looking at the FIXME you left in hfi1/user_exp_rcv.c with git commit 3889551db212

Quoted 8 lines
Quoted 3 lines

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

maintainer
#3 lore raw
Quoted 10 lines · Dennis Dalessandro
Quoted 9 lines · Jason Gunthorpe
Quoted 7 lines · Dean Luick

Hi Jason,

I am looking at the FIXME you left in hfi1/user_exp_rcv.c with git commit 3889551db212

Can you please explain in more detail what made you add the FIXME and what may be "racy"?

Quoted 7 lines
Quoted 4 lines

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