Re: 2.6.17-rc1-mm1: mlockall() regression on x86_64

From: Andrew Morton
Date: Tue Apr 04 2006 - 18:26:23 EST


"Rafael J. Wysocki" <rjw@xxxxxxx> wrote:
>
> On Tuesday 04 April 2006 10:45, Andrew Morton wrote:
> >
> > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.17-rc1/2.6.17-rc1-mm1/
>
> With this kernel mlockall(MCL_CURRENT | MCL_FUTURE) returns -EFAULT if called
> by root (unconditionally, it seems) on x86_64.
>
> On my box the output of:
>
> #include <sys/mman.h>
> #include <stdio.h>
> #include <string.h>
> #include <errno.h>
>
> int main()
> {
> int ret;
>
> ret = mlockall(MCL_CURRENT | MCL_FUTURE);
> if (ret < 0)
> printf("%s\n", strerror(errno));
>
> return 0;
> }
>
> is "Bad address", if run by root.
>

Yes, me too. It works OK on x86_32.

It's due to mm-posix-memory-lock.patch. I'd guess that
make_pages_present() is returning -EFAULT for some reason.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/