* Re: [patch 8/9] Pageflags: Eliminate PG_xxx aliases
[not found] ` <20080318182036.212376083@sgi.com>
@ 2008-03-18 19:32 ` Pekka Enberg
2008-03-18 19:35 ` Christoph Lameter
0 siblings, 1 reply; 13+ messages in thread
From: Pekka Enberg @ 2008-03-18 19:32 UTC (permalink / raw)
To: Christoph Lameter
Cc: Andrew Morton, apw, KAMEZAWA Hiroyuki, KOSAKI Motohiro,
Rik van Riel, Jeremy Fitzhardinge, linux-mm
On Tue, Mar 18, 2008 at 8:20 PM, Christoph Lameter <clameter@sgi.com> wrote:
> #ifdef CONFIG_HIGHMEM
> /*
> * Must use a macro here due to header dependency issues. page_zone() is not
> * available at this point.
> */
> -#define PageHighMem(__p) is_highmem(page_zone(page))
> +#define PageHighMem(__p) is_highmem(page_zone(__p))
Looks like this hunk should be in some other patch.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [patch 8/9] Pageflags: Eliminate PG_xxx aliases
2008-03-18 19:32 ` [patch 8/9] Pageflags: Eliminate PG_xxx aliases Pekka Enberg
@ 2008-03-18 19:35 ` Christoph Lameter
0 siblings, 0 replies; 13+ messages in thread
From: Christoph Lameter @ 2008-03-18 19:35 UTC (permalink / raw)
To: Pekka Enberg
Cc: Andrew Morton, apw, KAMEZAWA Hiroyuki, KOSAKI Motohiro,
Rik van Riel, Jeremy Fitzhardinge, linux-mm
On Tue, 18 Mar 2008, Pekka Enberg wrote:
> On Tue, Mar 18, 2008 at 8:20 PM, Christoph Lameter <clameter@sgi.com> wrote:
> > #ifdef CONFIG_HIGHMEM
> > /*
> > * Must use a macro here due to header dependency issues. page_zone() is not
> > * available at this point.
> > */
> > -#define PageHighMem(__p) is_highmem(page_zone(page))
> > +#define PageHighMem(__p) is_highmem(page_zone(__p))
>
> Looks like this hunk should be in some other patch.
True....
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <20080318182035.197900850@sgi.com>]
* Re: [patch 4/9] Pageflags: Get rid of FLAGS_RESERVED
[not found] ` <20080318182035.197900850@sgi.com>
@ 2008-03-28 8:12 ` Andrew Morton
2008-03-28 18:51 ` Christoph Lameter
0 siblings, 1 reply; 13+ messages in thread
From: Andrew Morton @ 2008-03-28 8:12 UTC (permalink / raw)
To: Christoph Lameter
Cc: apw, David Miller, KAMEZAWA Hiroyuki, KOSAKI Motohiro,
Rik van Riel, Jeremy Fitzhardinge, linux-mm
On Tue, 18 Mar 2008 11:20:01 -0700 Christoph Lameter <clameter@sgi.com> wrote:
> NR_PAGEFLAGS specifies the number of page flags we are using.
> >From that we can calculate the number of bits leftover that can
> be used for zone, node (and maybe the sections id). There is
> no need anymore for FLAGS_RESERVED if we use NR_PAGEFLAGS.
>
> Use the new methods to make NR_PAGEFLAGS available via
> the preprocessor. NR_PAGEFLAGS is used to calculate field
> boundaries in the page flags fields. These field widths have
For some reason this isn't working on mips - include/linux/bounds.h has no
#define for NR_PAGEFLAGS.
http://userweb.kernel.org/~akpm/cross-compilers/ has the i386->mips
toolchain which I'm using.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [patch 4/9] Pageflags: Get rid of FLAGS_RESERVED
2008-03-28 8:12 ` [patch 4/9] Pageflags: Get rid of FLAGS_RESERVED Andrew Morton
@ 2008-03-28 18:51 ` Christoph Lameter
2008-03-28 18:59 ` Andrew Morton
0 siblings, 1 reply; 13+ messages in thread
From: Christoph Lameter @ 2008-03-28 18:51 UTC (permalink / raw)
To: Andrew Morton
Cc: apw, David Miller, KAMEZAWA Hiroyuki, KOSAKI Motohiro,
Rik van Riel, Jeremy Fitzhardinge, linux-mm
On Fri, 28 Mar 2008, Andrew Morton wrote:
> For some reason this isn't working on mips - include/linux/bounds.h has no
> #define for NR_PAGEFLAGS.
Likely an asm issue? Are there no definitions at all in
include/linux/bounds.h?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [patch 4/9] Pageflags: Get rid of FLAGS_RESERVED
2008-03-28 18:51 ` Christoph Lameter
@ 2008-03-28 18:59 ` Andrew Morton
2008-03-28 19:04 ` Christoph Lameter
0 siblings, 1 reply; 13+ messages in thread
From: Andrew Morton @ 2008-03-28 18:59 UTC (permalink / raw)
To: Christoph Lameter
Cc: apw, davem, kamezawa.hiroyu, kosaki.motohiro, riel, jeremy,
linux-mm
On Fri, 28 Mar 2008 11:51:09 -0700 (PDT)
Christoph Lameter <clameter@sgi.com> wrote:
> On Fri, 28 Mar 2008, Andrew Morton wrote:
>
> > For some reason this isn't working on mips - include/linux/bounds.h has no
> > #define for NR_PAGEFLAGS.
>
> Likely an asm issue? Are there no definitions at all in
> include/linux/bounds.h?
None - just the skeleton comments and ifdefs.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [patch 4/9] Pageflags: Get rid of FLAGS_RESERVED
2008-03-28 18:59 ` Andrew Morton
@ 2008-03-28 19:04 ` Christoph Lameter
2008-03-28 19:23 ` Andrew Morton
0 siblings, 1 reply; 13+ messages in thread
From: Christoph Lameter @ 2008-03-28 19:04 UTC (permalink / raw)
To: Andrew Morton
Cc: apw, davem, kamezawa.hiroyu, kosaki.motohiro, riel, jeremy,
linux-mm
On Fri, 28 Mar 2008, Andrew Morton wrote:
> On Fri, 28 Mar 2008 11:51:09 -0700 (PDT)
> Christoph Lameter <clameter@sgi.com> wrote:
>
> > On Fri, 28 Mar 2008, Andrew Morton wrote:
> >
> > > For some reason this isn't working on mips - include/linux/bounds.h has no
> > > #define for NR_PAGEFLAGS.
> >
> > Likely an asm issue? Are there no definitions at all in
> > include/linux/bounds.h?
>
> None - just the skeleton comments and ifdefs.
Guess the asm is different for mips:
kernel/bounds.c does:
#define DEFINE(sym, val) \
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
mips wants something different.
#define offset(string, val) \
__asm__("\n@@@" string "%0" : : "i" (val))
Argh. Do an #ifdef MIPS or add a definition in an arch specific .h file
somewhere?
The asm could be different. gas is pretty uniform but some
arches may not be using gas?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [patch 4/9] Pageflags: Get rid of FLAGS_RESERVED
2008-03-28 19:04 ` Christoph Lameter
@ 2008-03-28 19:23 ` Andrew Morton
2008-03-29 20:22 ` Christoph Lameter
0 siblings, 1 reply; 13+ messages in thread
From: Andrew Morton @ 2008-03-28 19:23 UTC (permalink / raw)
To: Christoph Lameter
Cc: apw, davem, kamezawa.hiroyu, kosaki.motohiro, riel, jeremy,
linux-mm
On Fri, 28 Mar 2008 12:04:00 -0700 (PDT)
Christoph Lameter <clameter@sgi.com> wrote:
> On Fri, 28 Mar 2008, Andrew Morton wrote:
>
> > On Fri, 28 Mar 2008 11:51:09 -0700 (PDT)
> > Christoph Lameter <clameter@sgi.com> wrote:
> >
> > > On Fri, 28 Mar 2008, Andrew Morton wrote:
> > >
> > > > For some reason this isn't working on mips - include/linux/bounds.h has no
> > > > #define for NR_PAGEFLAGS.
> > >
> > > Likely an asm issue? Are there no definitions at all in
> > > include/linux/bounds.h?
> >
> > None - just the skeleton comments and ifdefs.
>
> Guess the asm is different for mips:
>
> kernel/bounds.c does:
>
> #define DEFINE(sym, val) \
> asm volatile("\n->" #sym " %0 " #val : : "i" (val))
>
> mips wants something different.
>
> #define offset(string, val) \
> __asm__("\n@@@" string "%0" : : "i" (val))
>
> Argh. Do an #ifdef MIPS or add a definition in an arch specific .h file
> somewhere?
The usual way is to add asm-generic/foo.h which has the usual
implementation and then have each arch's asm/foo.h include
asm-generic/foo.h. Architectires which have special needs would provide a
custom implementation and do not include the asm-generic file.
> The asm could be different. gas is pretty uniform but some
> arches may not be using gas?
I'm unaware of any other assemblers being used. If they are, they'd need
to be fairly gassy to be able to build the kernel. Maybe Intel's ICC uses
its own assembler, dunno - hopefully it uses gas.
Why do we use gas at all here? All we're doing is converting
->NR_PAGEFLAGS 18 __NR_PAGEFLAGS #
into
#define NR_PAGEFLAGS 18
which can be done with sed or whatever?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [patch 4/9] Pageflags: Get rid of FLAGS_RESERVED
2008-03-28 19:23 ` Andrew Morton
@ 2008-03-29 20:22 ` Christoph Lameter
2008-03-29 22:06 ` Andrew Morton
0 siblings, 1 reply; 13+ messages in thread
From: Christoph Lameter @ 2008-03-29 20:22 UTC (permalink / raw)
To: Andrew Morton
Cc: apw, davem, kamezawa.hiroyu, kosaki.motohiro, riel, jeremy,
linux-mm
On Fri, 28 Mar 2008, Andrew Morton wrote:
> Why do we use gas at all here? All we're doing is converting
>
> ->NR_PAGEFLAGS 18 __NR_PAGEFLAGS #
>
> into
>
> #define NR_PAGEFLAGS 18
>
> which can be done with sed or whatever?
Only the compiler knows the value of __NR_PAGEFLAGS since it was defined
via enum. We are generating an object file and then extract the symbols.
This is the same process as used in arch/*/asm-offsets.*
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [patch 4/9] Pageflags: Get rid of FLAGS_RESERVED
2008-03-29 20:22 ` Christoph Lameter
@ 2008-03-29 22:06 ` Andrew Morton
2008-03-31 20:19 ` Christoph Lameter
0 siblings, 1 reply; 13+ messages in thread
From: Andrew Morton @ 2008-03-29 22:06 UTC (permalink / raw)
To: Christoph Lameter
Cc: apw, davem, kamezawa.hiroyu, kosaki.motohiro, riel, jeremy,
linux-mm
On Sat, 29 Mar 2008 13:22:30 -0700 (PDT) Christoph Lameter <clameter@sgi.com> wrote:
> On Fri, 28 Mar 2008, Andrew Morton wrote:
>
> > Why do we use gas at all here? All we're doing is converting
> >
> > ->NR_PAGEFLAGS 18 __NR_PAGEFLAGS #
> >
> > into
> >
> > #define NR_PAGEFLAGS 18
> >
> > which can be done with sed or whatever?
>
> Only the compiler knows the value of __NR_PAGEFLAGS since it was defined
> via enum. We are generating an object file and then extract the symbols.
I know. I suggested that we process the .s file with sed, generating the
#defines for the .h file. There is no need to assemble the .s file!
> This is the same process as used in arch/*/asm-offsets.*
Maybe that wasn't the best way of doing it.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [patch 4/9] Pageflags: Get rid of FLAGS_RESERVED
2008-03-29 22:06 ` Andrew Morton
@ 2008-03-31 20:19 ` Christoph Lameter
0 siblings, 0 replies; 13+ messages in thread
From: Christoph Lameter @ 2008-03-31 20:19 UTC (permalink / raw)
To: Andrew Morton
Cc: apw, davem, kamezawa.hiroyu, kosaki.motohiro, riel, jeremy,
linux-mm
On Sat, 29 Mar 2008, Andrew Morton wrote:
> > This is the same process as used in arch/*/asm-offsets.*
>
> Maybe that wasn't the best way of doing it.
Is there any alternative? It would be best if we could get the c compiler
to define a linker symbol with the values that we need without asm. I
guess we could somehow stick this into ldlinux.lds.S but that is going to
be ugly as well.
I checked and all arches use the same asm to define a symbol except for
mips. If we allow an arch to override the way to define a symbol then it
also works on mips.
From: Christoph Lameter <clameter@sgi.com>
Subject: Allow override of definition for asm constant
MIPS has a different way of defining asm constants which causes troubles
for bounds.h generation.
Add a new per arch CONFIG variable
CONFIG_ASM_SYMBOL_PREFIX
which can be set to define an alternate header for asm constant definitions.
Use this for MIPS to make bounds determination work right.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
arch/mips/Kconfig | 7 +++++++
kernel/bounds.c | 11 ++++++++++-
2 files changed, 17 insertions(+), 1 deletion(-)
Index: linux-2.6.25-rc5-mm1/arch/mips/Kconfig
===================================================================
--- linux-2.6.25-rc5-mm1.orig/arch/mips/Kconfig 2008-03-31 13:14:26.888383587 -0700
+++ linux-2.6.25-rc5-mm1/arch/mips/Kconfig 2008-03-31 13:14:28.028403612 -0700
@@ -2019,6 +2019,13 @@ config I8253
config ZONE_DMA32
bool
+#
+# Used to override gas symbol setup in kernel/bounds.c.
+#
+config ASM_SYMBOL_PREFIX
+ string
+ default "@@@#define "
+
source "drivers/pcmcia/Kconfig"
source "drivers/pci/hotplug/Kconfig"
Index: linux-2.6.25-rc5-mm1/kernel/bounds.c
===================================================================
--- linux-2.6.25-rc5-mm1.orig/kernel/bounds.c 2008-03-31 13:14:26.904383870 -0700
+++ linux-2.6.25-rc5-mm1/kernel/bounds.c 2008-03-31 13:14:28.028403612 -0700
@@ -9,8 +9,17 @@
#include <linux/page-flags.h>
#include <linux/mmzone.h>
+#ifdef CONFIG_ASM_SYMBOL_PREFIX
+#define PREFIX CONFIG_ASM_SYMBOL_PREFIX
+#else
+/*
+ * Standard gas way of defining an asm symbol
+ */
+#define PREFIX "->"
+#endif
+
#define DEFINE(sym, val) \
- asm volatile("\n->" #sym " %0 " #val : : "i" (val))
+ asm volatile("\n" PREFIX #sym " %0 " : : "i" (val))
#define BLANK() asm volatile("\n->" : :)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [patch 0/9] Page flags V3: Cleanup and reorg
[not found] <20080318181957.138598511@sgi.com>
[not found] ` <20080318182036.212376083@sgi.com>
[not found] ` <20080318182035.197900850@sgi.com>
@ 2008-03-28 9:08 ` Andrew Morton
2 siblings, 0 replies; 13+ messages in thread
From: Andrew Morton @ 2008-03-28 9:08 UTC (permalink / raw)
To: Christoph Lameter
Cc: apw, KAMEZAWA Hiroyuki, KOSAKI Motohiro, Rik van Riel,
Jeremy Fitzhardinge, linux-mm
On Tue, 18 Mar 2008 11:19:57 -0700 Christoph Lameter <clameter@sgi.com> wrote:
> A set of patches that attempts to improve page flag handling.
sh allmodconfig blows up with various unsatisfied link-time references to
swapper_space.
this:
--- a/include/linux/mm.h~a
+++ a/include/linux/mm.h
@@ -605,9 +605,12 @@ static inline struct address_space *page
struct address_space *mapping = page->mapping;
VM_BUG_ON(PageSlab(page));
+#ifdef CONFIG_SWAP
if (unlikely(PageSwapCache(page)))
mapping = &swapper_space;
- else if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON))
+ else
+#endif
+ if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON))
mapping = NULL;
return mapping;
}
_
fixes it, but it shouldn't, unless it's a cimpiler bug. Could you
investigate please, check that we're not adding unintended code bloat for
some reason?
http://userweb.kernel.org/~akpm/cross-compilers/ has the toolchain.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 13+ messages in thread[parent not found: <20080401200019.47892504.akpm@linux-foundation.org>]
[parent not found: <20080308001850.306617873@sgi.com>]
* Re: [patch 0/9] Page flags V3: Cleanup and reorg
[not found] <20080308001850.306617873@sgi.com>
@ 2008-03-11 4:50 ` Andrew Morton
0 siblings, 0 replies; 13+ messages in thread
From: Andrew Morton @ 2008-03-11 4:50 UTC (permalink / raw)
To: Christoph Lameter
Cc: apw, KAMEZAWA Hiroyuki, KOSAKI Motohiro, Rik van Riel, linux-mm
On Fri, 07 Mar 2008 16:18:50 -0800 Christoph Lameter <clameter@sgi.com> wrote:
> A set of patches that attempts to improve page flag handling.
First darn thing I tried was i386 allnoconfig and it goes splat.
In file included from include/linux/mm.h:192,
from kernel/bounds.c:8:
include/linux/page-flags.h: In function 'PageHighMem':
include/linux/page-flags.h:180: error: implicit declaration of function 'page_zone'
There's also a parenthesis mismatch so it looks like it was neither
compile-time nor runtime tested on i386. Sorry, but I don't have the time
to be the first one to try this out.
To fix this page-flags.h needs to include mm.h, but mm.h includes
page-flags.h. Making PageHighMem a macro would be the expedient fix.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2008-04-10 17:33 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20080318181957.138598511@sgi.com>
[not found] ` <20080318182036.212376083@sgi.com>
2008-03-18 19:32 ` [patch 8/9] Pageflags: Eliminate PG_xxx aliases Pekka Enberg
2008-03-18 19:35 ` Christoph Lameter
[not found] ` <20080318182035.197900850@sgi.com>
2008-03-28 8:12 ` [patch 4/9] Pageflags: Get rid of FLAGS_RESERVED Andrew Morton
2008-03-28 18:51 ` Christoph Lameter
2008-03-28 18:59 ` Andrew Morton
2008-03-28 19:04 ` Christoph Lameter
2008-03-28 19:23 ` Andrew Morton
2008-03-29 20:22 ` Christoph Lameter
2008-03-29 22:06 ` Andrew Morton
2008-03-31 20:19 ` Christoph Lameter
2008-03-28 9:08 ` [patch 0/9] Page flags V3: Cleanup and reorg Andrew Morton
[not found] <20080401200019.47892504.akpm@linux-foundation.org>
[not found] ` <Pine.LNX.4.64.0804021026400.26938@schroedinger.engr.sgi.com>
[not found] ` <Pine.LNX.4.64.0804022125001.1684@schroedinger.engr.sgi.com>
[not found] ` <20080402.222542.106676535.davem@davemloft.net>
[not found] ` <Pine.LNX.4.64.0804031149060.7108@schroedinger.engr.sgi.com>
2008-04-10 17:33 ` Christoph Lameter
[not found] <20080308001850.306617873@sgi.com>
2008-03-11 4:50 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).