Messages in this thread | | | Date | Sun, 21 Jun 2009 21:26:05 +0200 (CEST) | From | Thomas Gleixner <> | Subject | Re: [GIT PULL] core kernel fixes |
| |
Linus,
On Sun, 21 Jun 2009, Linus Torvalds wrote: > So just doing a "make_sure_its_writable()" and using handle_fault() is the > right thing to do. Because it's what get_user_fast() would have done too, > except it would have gone through first the fast case, and failed, then > the slow case, and failed the lookup there, and then the slow case would > have done that handle_mm_fault() in the end anyway. > > In fact, since you're not actually interested in the page, you _could_ > just do > > get_user_pages(tsk, mm, uaddr, 4, 1, 0, NULL, NULL); > > where a NULL "pages" pointer already tells get_user_pages() that you're > not interested. > > That's at least cleaner than doing a "gup_fast()" (which isn't fast), and > then freeing the page that you weren't even interested in.
Yes, you are right. The retry fixup path is after the fault and we should go through handle_mm_fault as long as we do not have a general available nondestructive counterpart of get_user().
I confused myself by twisting my brain whether we can simplify or even get rid of the whole retry business.
Sorry, I did not express myself very well - looking for more than an hour into the futex code definitely hurts your brain. It's worse than the drugs you suspected we're on. :)
Thanks,
tglx
| |