Message ID | 20141024.133249.71272218161411159.davem@davemloft.net |
---|---|
State | Accepted |
Delegated to: | David Miller |
Headers | show |
On Fri, Oct 24, 2014 at 10:32 AM, David Miller <davem@davemloft.net> wrote: > > It's really idiotic to have a weak symbolled fallback that just > returns zero, and causes this kind of bug. There should be no > backup implementation and the link should fail if the architecture > fails to provide __get_user_pages_fast() and supports transparent > hugepages. Agreed. I think the weak fallback is for the "no hugepages support" case, but that does sound very annoying and fragile. Linus -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, 24 Oct 2014 12:47:48 -0700 Linus Torvalds <torvalds@linux-foundation.org> wrote: > On Fri, Oct 24, 2014 at 10:32 AM, David Miller <davem@davemloft.net> wrote: > > > > It's really idiotic to have a weak symbolled fallback that just > > returns zero, and causes this kind of bug. There should be no > > backup implementation and the link should fail if the architecture > > fails to provide __get_user_pages_fast() and supports transparent > > hugepages. > > Agreed. I think the weak fallback is for the "no hugepages support" > case, but that does sound very annoying and fragile. > Yup. I'm thinking the get_user_pages_fast() and __get_user_pages_fast() in mm/util.c should be made non-weak and moved to mm/nommu.c. With that change, MMU architctures will need to either define CONFIG_HAVE_GENERIC_RCU_GUP or implement their own versions. Perhaps sparc should be defining CONFIG_HAVE_GENERIC_RCU_GUP. We really should switch x86 to the generic version - from a quick read it looks like it will work without needing any changes. Steve, thoughts? -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Andrew Morton <akpm@linux-foundation.org> Date: Mon, 27 Oct 2014 14:09:38 -0700 > Perhaps sparc should be defining CONFIG_HAVE_GENERIC_RCU_GUP. > > We really should switch x86 to the generic version - from a quick read > it looks like it will work without needing any changes. > > Steve, thoughts? We need to add the necessary hooks to the generic code so that x86 doesn't so specualtive gets and instead do direct increments, otherwise it's a performance regression, and then sparc can make use of that as well. -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Mon, Oct 27, 2014 at 06:43:27PM -0400, David Miller wrote: > From: Andrew Morton <akpm@linux-foundation.org> > Date: Mon, 27 Oct 2014 14:09:38 -0700 > > > Perhaps sparc should be defining CONFIG_HAVE_GENERIC_RCU_GUP. > > > > We really should switch x86 to the generic version - from a quick read > > it looks like it will work without needing any changes. > > > > Steve, thoughts? > > We need to add the necessary hooks to the generic code so that x86 > doesn't so specualtive gets and instead do direct increments, > otherwise it's a performance regression, and then sparc can make use > of that as well. Agreed, I think x86 may require a helper to read 64-bit ptes (as it can't do that atomically). Also I think there's some subtlety in the way access_ok works that should be checked. The overall structure of the code looks the same to me, and I think it would be beneficial to extend then use the generic version for x86. Cheers,