Re: [PATCH] remove PAGE_SIZE from headers_install
On Sun, Jul 15, Mike Frysinger wrote: > On 7/15/07, Olaf Hering <[EMAIL PROTECTED]> wrote: > >On Sat, Jul 14, Mike Frysinger wrote: > >> imo, asm/page.h should just go away for userspace. the attached patch > >> is what i've been using in Gentoo ... but somethings (like an arch or > >> two in glibc) still assume asm/page.h is OK. in general though, > >> considering asm/page.h has become so unreliable lately (a large number > >> of arches ifdef the whole thing out), most packages out there have > >> updated already to use the userspace interface from unistd.h. > > > >You need that signed-off thing, and dont forget to send it to > >[EMAIL PROTECTED] > > i honestly didnt think people would consider it for inclusion as it > was since i ripped out a lot more headers than just asm/page.h ;) Did you clean it up and submit it already for 2.6.23? Should someone else do it for you? - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
On Sun, Jul 15, Mike Frysinger wrote: On 7/15/07, Olaf Hering [EMAIL PROTECTED] wrote: On Sat, Jul 14, Mike Frysinger wrote: imo, asm/page.h should just go away for userspace. the attached patch is what i've been using in Gentoo ... but somethings (like an arch or two in glibc) still assume asm/page.h is OK. in general though, considering asm/page.h has become so unreliable lately (a large number of arches ifdef the whole thing out), most packages out there have updated already to use the userspace interface from unistd.h. You need that signed-off thing, and dont forget to send it to [EMAIL PROTECTED] i honestly didnt think people would consider it for inclusion as it was since i ripped out a lot more headers than just asm/page.h ;) Did you clean it up and submit it already for 2.6.23? Should someone else do it for you? - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
On Sun, 2007-07-15 at 02:20 -0500, Mike Frysinger wrote: > i honestly didnt think people would consider it for inclusion as it > was since i ripped out a lot more headers than just asm/page.h ;) So split it up into individual patches. It all looks good to me. -- dwmw2 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
On Sat, 2007-07-14 at 23:34 +0200, Olaf Hering wrote: > > I would think it would be better to not define it at all. Several > > architectures already don't have PAGE_SIZE visible to userspace in > > any way. > > i386 has it, so everyone uses it. PowerPC lacks it, so nothing we ship in Fedora relies upon it. Just kill it. Probably by leaving empty for now; we can remove it completely later. -- dwmw2 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
On Sat, Jul 14, Mike Frysinger wrote: > On 7/14/07, Olaf Hering <[EMAIL PROTECTED]> wrote: > >Declare PAGE_SIZE as getpagesize() for userspace. > >PAGE_SIZE is used in resource.h and shm.h > > > >define PAGE_SIZE in asm-generic/page.h > >guard get_order() with _ARCH_HAS_GET_ORDER for ia64 and xtensa > >include asm-generic/page.h in asm/page.h > >make asm/page.h nearly empty by moving the #ifdef guards up > >remove unneeded page.h export from frv > > imo, asm/page.h should just go away for userspace. the attached patch > is what i've been using in Gentoo ... but somethings (like an arch or > two in glibc) still assume asm/page.h is OK. in general though, > considering asm/page.h has become so unreliable lately (a large number > of arches ifdef the whole thing out), most packages out there have > updated already to use the userspace interface from unistd.h. > -mike nothing appears to use linux/shm.h and linux/resource.h strace-4.5.15 uses linux/a.out.h in #ifdef LINUXSPARC glibc uses asm/elf.h in sys/procfs.h, also in alpha and powerpc. kexec-tools use linux/elf.h psmisc and ltrace use linux/user.h glibc (for sh) and mono-debugger use asm/user.h And alot of asm/page.h users. Thats the upstream status today. What you do at home doesnt really matter. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
On 7/15/07, Olaf Hering <[EMAIL PROTECTED]> wrote: On Sat, Jul 14, Mike Frysinger wrote: > imo, asm/page.h should just go away for userspace. the attached patch > is what i've been using in Gentoo ... but somethings (like an arch or > two in glibc) still assume asm/page.h is OK. in general though, > considering asm/page.h has become so unreliable lately (a large number > of arches ifdef the whole thing out), most packages out there have > updated already to use the userspace interface from unistd.h. You need that signed-off thing, and dont forget to send it to [EMAIL PROTECTED] i honestly didnt think people would consider it for inclusion as it was since i ripped out a lot more headers than just asm/page.h ;) Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> -mike - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
On Sat, Jul 14, Mike Frysinger wrote: > imo, asm/page.h should just go away for userspace. the attached patch > is what i've been using in Gentoo ... but somethings (like an arch or > two in glibc) still assume asm/page.h is OK. in general though, > considering asm/page.h has become so unreliable lately (a large number > of arches ifdef the whole thing out), most packages out there have > updated already to use the userspace interface from unistd.h. You need that signed-off thing, and dont forget to send it to [EMAIL PROTECTED] - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
On Sat, Jul 14, Mike Frysinger wrote: imo, asm/page.h should just go away for userspace. the attached patch is what i've been using in Gentoo ... but somethings (like an arch or two in glibc) still assume asm/page.h is OK. in general though, considering asm/page.h has become so unreliable lately (a large number of arches ifdef the whole thing out), most packages out there have updated already to use the userspace interface from unistd.h. You need that signed-off thing, and dont forget to send it to [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
On 7/15/07, Olaf Hering [EMAIL PROTECTED] wrote: On Sat, Jul 14, Mike Frysinger wrote: imo, asm/page.h should just go away for userspace. the attached patch is what i've been using in Gentoo ... but somethings (like an arch or two in glibc) still assume asm/page.h is OK. in general though, considering asm/page.h has become so unreliable lately (a large number of arches ifdef the whole thing out), most packages out there have updated already to use the userspace interface from unistd.h. You need that signed-off thing, and dont forget to send it to [EMAIL PROTECTED] i honestly didnt think people would consider it for inclusion as it was since i ripped out a lot more headers than just asm/page.h ;) Signed-off-by: Mike Frysinger [EMAIL PROTECTED] -mike - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
On Sat, Jul 14, Mike Frysinger wrote: On 7/14/07, Olaf Hering [EMAIL PROTECTED] wrote: Declare PAGE_SIZE as getpagesize() for userspace. PAGE_SIZE is used in resource.h and shm.h define PAGE_SIZE in asm-generic/page.h guard get_order() with _ARCH_HAS_GET_ORDER for ia64 and xtensa include asm-generic/page.h in asm/page.h make asm/page.h nearly empty by moving the #ifdef guards up remove unneeded page.h export from frv imo, asm/page.h should just go away for userspace. the attached patch is what i've been using in Gentoo ... but somethings (like an arch or two in glibc) still assume asm/page.h is OK. in general though, considering asm/page.h has become so unreliable lately (a large number of arches ifdef the whole thing out), most packages out there have updated already to use the userspace interface from unistd.h. -mike nothing appears to use linux/shm.h and linux/resource.h strace-4.5.15 uses linux/a.out.h in #ifdef LINUXSPARC glibc uses asm/elf.h in sys/procfs.h, also in alpha and powerpc. kexec-tools use linux/elf.h psmisc and ltrace use linux/user.h glibc (for sh) and mono-debugger use asm/user.h And alot of asm/page.h users. Thats the upstream status today. What you do at home doesnt really matter. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
On Sat, 2007-07-14 at 23:34 +0200, Olaf Hering wrote: I would think it would be better to not define it at all. Several architectures already don't have PAGE_SIZE visible to userspace in any way. i386 has it, so everyone uses it. PowerPC lacks it, so nothing we ship in Fedora relies upon it. Just kill it. Probably by leaving asm/page.h empty for now; we can remove it completely later. -- dwmw2 - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
On Sun, 2007-07-15 at 02:20 -0500, Mike Frysinger wrote: i honestly didnt think people would consider it for inclusion as it was since i ripped out a lot more headers than just asm/page.h ;) So split it up into individual patches. It all looks good to me. -- dwmw2 - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
On 7/14/07, David Miller <[EMAIL PROTECTED]> wrote: From: "Albert Cahalan" <[EMAIL PROTECTED]> Date: Sat, 14 Jul 2007 22:48:57 -0400 > A real constant-value PAGE_SIZE is useful and doable. It's bogus to use it. The kernel can get recompiled to arbitrary page sizes on some architectures, so a constat page size assumption cannot work. Sure it can work. The ABI specifies limits on such things. Probably the most appropriate size is the one specified for alignment of ELF sections. If I remember right, it's 64 K for the PowerPC ABI. This allows for 64 K pages, even though many chips offer 4 K pages. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
From: "Albert Cahalan" <[EMAIL PROTECTED]> Date: Sat, 14 Jul 2007 22:48:57 -0400 > A real constant-value PAGE_SIZE is useful and doable. It's bogus to use it. The kernel can get recompiled to arbitrary page sizes on some architectures, so a constat page size assumption cannot work. > It's useful because a getpagesize() can't be used for numerous > things, such as setting the size of an array. Use dynamically allocated memory for the array then. This isn't programming 101. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
Albert Cahalan wrote: > > A real constant-value PAGE_SIZE is useful and doable. > > It's useful because a getpagesize() can't be used for numerous > things, such as setting the size of an array. > > It's doable, even on architectures that support multiple page > sizes, because ABIs specify alignment requirements. There are > two alignments of interest here: > > a. the smallest that mmap() will ever naturally return on any > correct implementation of the architecture's ABI ("naturally" > meaning that MAP_FIXED was not used) > > b. the smallest that mprotect() will tolerate on all > correct implementations of the architecture > > Pick either to be the Linux definition of PAGE_SIZE. > If you specify it to be one of these, people will mis-use it for the other. This is a bad idea. -hpa - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
Olaf Hering writes: On Sat, Jul 14, H. Peter Anvin wrote: Olaf Hering wrote: Declare PAGE_SIZE as getpagesize() for userspace. PAGE_SIZE is used in resource.h and shm.h I would think it would be better to not define it at all. Several architectures already don't have PAGE_SIZE visible to userspace in any way. i386 has it, so everyone uses it. Since i386 was the first architecture and is still probably the most common architecture (x86_64 being 30% AFAIK), i386 sets the standard for the Linux API. Several architectures are broken and thus suffering from incompatibility. A real constant-value PAGE_SIZE is useful and doable. It's useful because a getpagesize() can't be used for numerous things, such as setting the size of an array. It's doable, even on architectures that support multiple page sizes, because ABIs specify alignment requirements. There are two alignments of interest here: a. the smallest that mmap() will ever naturally return on any correct implementation of the architecture's ABI ("naturally" meaning that MAP_FIXED was not used) b. the smallest that mprotect() will tolerate on all correct implementations of the architecture Pick either to be the Linux definition of PAGE_SIZE. For example, if an architecture is specified to have a page size of at least 4 K but no more than 64 K, then mprotect() will only tolerate 64 K on all correct implementations of the architecture. The ABI might allow mmap() to naturally return 4 K aligned data, but might instead require 64 K alignment. Assuming 4 K, then the mmap() value doesn't match the mprotect() value. Either one will do as the value of PAGE_SIZE, as long as this is standardized in the way that breaks the least code. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
On 7/14/07, Olaf Hering <[EMAIL PROTECTED]> wrote: On Sat, Jul 14, H. Peter Anvin wrote: > Olaf Hering wrote: > > Declare PAGE_SIZE as getpagesize() for userspace. > > PAGE_SIZE is used in resource.h and shm.h > > I would think it would be better to not define it at all. Several > architectures already don't have PAGE_SIZE visible to userspace in any way. i386 has it, so everyone uses it. not anymore ... it's broken too many other architectures so anything that matters has switched off of it asm/user.h uses it for NBPG, which appears in gdb configure scripts. Maybe it doesnt trigger there because the sysconf SC_* macros match. the sourceware tree (binutils/gdb/etc...) bend over backwards to get a usable definition so not having NBPG available is fine ... there's one thing left which needs fixing and i have a patch that i need to commit for that other places where asm/page.h is used: util-linux configure scripts, strace, xorg-11, and alot more. Have to check if they really need it. those three packages you quote here i know have been fixed in the latest versions -mike - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
On Sat, 14 Jul 2007 14:12:57 -0700, H. Peter Anvin wrote: > Olaf Hering wrote: > > Declare PAGE_SIZE as getpagesize() for userspace. > > PAGE_SIZE is used in resource.h and shm.h > > I would think it would be better to not define it at all. Several > architectures already don't have PAGE_SIZE visible to userspace in any way. Furthermore, the kernel should /not/ export a would-be kernel interface by defining it in terms of a non-kernel interface. getpagesize() belongs to libc, and might not exist at all or have that form. Linux is not Solaris. There can be many different libcs in a system. /Mikael - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
On Sat, Jul 14, H. Peter Anvin wrote: > Olaf Hering wrote: > > Declare PAGE_SIZE as getpagesize() for userspace. > > PAGE_SIZE is used in resource.h and shm.h > > I would think it would be better to not define it at all. Several > architectures already don't have PAGE_SIZE visible to userspace in any way. i386 has it, so everyone uses it. asm/user.h uses it for NBPG, which appears in gdb configure scripts. Maybe it doesnt trigger there because the sysconf SC_* macros match. other places where asm/page.h is used: util-linux configure scripts, strace, xorg-11, and alot more. Have to check if they really need it. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
Olaf Hering wrote: > Declare PAGE_SIZE as getpagesize() for userspace. > PAGE_SIZE is used in resource.h and shm.h I would think it would be better to not define it at all. Several architectures already don't have PAGE_SIZE visible to userspace in any way. -hpa - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
On 7/14/07, Olaf Hering <[EMAIL PROTECTED]> wrote: Declare PAGE_SIZE as getpagesize() for userspace. PAGE_SIZE is used in resource.h and shm.h define PAGE_SIZE in asm-generic/page.h guard get_order() with _ARCH_HAS_GET_ORDER for ia64 and xtensa include asm-generic/page.h in asm/page.h make asm/page.h nearly empty by moving the #ifdef guards up remove unneeded page.h export from frv imo, asm/page.h should just go away for userspace. the attached patch is what i've been using in Gentoo ... but somethings (like an arch or two in glibc) still assume asm/page.h is OK. in general though, considering asm/page.h has become so unreliable lately (a large number of arches ifdef the whole thing out), most packages out there have updated already to use the userspace interface from unistd.h. -mike 10_all_remove-page-user-headers.patch Description: Binary data
Re: [PATCH] remove PAGE_SIZE from headers_install
On 7/14/07, Olaf Hering [EMAIL PROTECTED] wrote: Declare PAGE_SIZE as getpagesize() for userspace. PAGE_SIZE is used in resource.h and shm.h define PAGE_SIZE in asm-generic/page.h guard get_order() with _ARCH_HAS_GET_ORDER for ia64 and xtensa include asm-generic/page.h in asm/page.h make asm/page.h nearly empty by moving the #ifdef guards up remove unneeded page.h export from frv imo, asm/page.h should just go away for userspace. the attached patch is what i've been using in Gentoo ... but somethings (like an arch or two in glibc) still assume asm/page.h is OK. in general though, considering asm/page.h has become so unreliable lately (a large number of arches ifdef the whole thing out), most packages out there have updated already to use the userspace interface from unistd.h. -mike 10_all_remove-page-user-headers.patch Description: Binary data
Re: [PATCH] remove PAGE_SIZE from headers_install
Olaf Hering wrote: Declare PAGE_SIZE as getpagesize() for userspace. PAGE_SIZE is used in resource.h and shm.h I would think it would be better to not define it at all. Several architectures already don't have PAGE_SIZE visible to userspace in any way. -hpa - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
On Sat, Jul 14, H. Peter Anvin wrote: Olaf Hering wrote: Declare PAGE_SIZE as getpagesize() for userspace. PAGE_SIZE is used in resource.h and shm.h I would think it would be better to not define it at all. Several architectures already don't have PAGE_SIZE visible to userspace in any way. i386 has it, so everyone uses it. asm/user.h uses it for NBPG, which appears in gdb configure scripts. Maybe it doesnt trigger there because the sysconf SC_* macros match. other places where asm/page.h is used: util-linux configure scripts, strace, xorg-11, and alot more. Have to check if they really need it. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
On Sat, 14 Jul 2007 14:12:57 -0700, H. Peter Anvin wrote: Olaf Hering wrote: Declare PAGE_SIZE as getpagesize() for userspace. PAGE_SIZE is used in resource.h and shm.h I would think it would be better to not define it at all. Several architectures already don't have PAGE_SIZE visible to userspace in any way. Furthermore, the kernel should /not/ export a would-be kernel interface by defining it in terms of a non-kernel interface. getpagesize() belongs to libc, and might not exist at all or have that form. Linux is not Solaris. There can be many different libcs in a system. /Mikael - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
On 7/14/07, Olaf Hering [EMAIL PROTECTED] wrote: On Sat, Jul 14, H. Peter Anvin wrote: Olaf Hering wrote: Declare PAGE_SIZE as getpagesize() for userspace. PAGE_SIZE is used in resource.h and shm.h I would think it would be better to not define it at all. Several architectures already don't have PAGE_SIZE visible to userspace in any way. i386 has it, so everyone uses it. not anymore ... it's broken too many other architectures so anything that matters has switched off of it asm/user.h uses it for NBPG, which appears in gdb configure scripts. Maybe it doesnt trigger there because the sysconf SC_* macros match. the sourceware tree (binutils/gdb/etc...) bend over backwards to get a usable definition so not having NBPG available is fine ... there's one thing left which needs fixing and i have a patch that i need to commit for that other places where asm/page.h is used: util-linux configure scripts, strace, xorg-11, and alot more. Have to check if they really need it. those three packages you quote here i know have been fixed in the latest versions -mike - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
Olaf Hering writes: On Sat, Jul 14, H. Peter Anvin wrote: Olaf Hering wrote: Declare PAGE_SIZE as getpagesize() for userspace. PAGE_SIZE is used in resource.h and shm.h I would think it would be better to not define it at all. Several architectures already don't have PAGE_SIZE visible to userspace in any way. i386 has it, so everyone uses it. Since i386 was the first architecture and is still probably the most common architecture (x86_64 being 30% AFAIK), i386 sets the standard for the Linux API. Several architectures are broken and thus suffering from incompatibility. A real constant-value PAGE_SIZE is useful and doable. It's useful because a getpagesize() can't be used for numerous things, such as setting the size of an array. It's doable, even on architectures that support multiple page sizes, because ABIs specify alignment requirements. There are two alignments of interest here: a. the smallest that mmap() will ever naturally return on any correct implementation of the architecture's ABI (naturally meaning that MAP_FIXED was not used) b. the smallest that mprotect() will tolerate on all correct implementations of the architecture Pick either to be the Linux definition of PAGE_SIZE. For example, if an architecture is specified to have a page size of at least 4 K but no more than 64 K, then mprotect() will only tolerate 64 K on all correct implementations of the architecture. The ABI might allow mmap() to naturally return 4 K aligned data, but might instead require 64 K alignment. Assuming 4 K, then the mmap() value doesn't match the mprotect() value. Either one will do as the value of PAGE_SIZE, as long as this is standardized in the way that breaks the least code. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
Albert Cahalan wrote: A real constant-value PAGE_SIZE is useful and doable. It's useful because a getpagesize() can't be used for numerous things, such as setting the size of an array. It's doable, even on architectures that support multiple page sizes, because ABIs specify alignment requirements. There are two alignments of interest here: a. the smallest that mmap() will ever naturally return on any correct implementation of the architecture's ABI (naturally meaning that MAP_FIXED was not used) b. the smallest that mprotect() will tolerate on all correct implementations of the architecture Pick either to be the Linux definition of PAGE_SIZE. If you specify it to be one of these, people will mis-use it for the other. This is a bad idea. -hpa - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
From: Albert Cahalan [EMAIL PROTECTED] Date: Sat, 14 Jul 2007 22:48:57 -0400 A real constant-value PAGE_SIZE is useful and doable. It's bogus to use it. The kernel can get recompiled to arbitrary page sizes on some architectures, so a constat page size assumption cannot work. It's useful because a getpagesize() can't be used for numerous things, such as setting the size of an array. Use dynamically allocated memory for the array then. This isn't programming 101. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] remove PAGE_SIZE from headers_install
On 7/14/07, David Miller [EMAIL PROTECTED] wrote: From: Albert Cahalan [EMAIL PROTECTED] Date: Sat, 14 Jul 2007 22:48:57 -0400 A real constant-value PAGE_SIZE is useful and doable. It's bogus to use it. The kernel can get recompiled to arbitrary page sizes on some architectures, so a constat page size assumption cannot work. Sure it can work. The ABI specifies limits on such things. Probably the most appropriate size is the one specified for alignment of ELF sections. If I remember right, it's 64 K for the PowerPC ABI. This allows for 64 K pages, even though many chips offer 4 K pages. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/