2008-02-13 21:54:45

by Adrian Bunk

[permalink] [raw]
Subject: [2.6 patch] x86: make dump_pagetable() static

dump_pagetable() can now become static.

Signed-off-by: Adrian Bunk <[email protected]>

---

arch/x86/mm/fault.c | 2 +-
include/asm-x86/kdebug.h | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)

fe111b005768f97b9f83af7ad4014a77e7adc249 diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 621afb6..fdc6674 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -186,7 +186,7 @@ static int bad_address(void *p)
}
#endif

-void dump_pagetable(unsigned long address)
+static void dump_pagetable(unsigned long address)
{
#ifdef CONFIG_X86_32
__typeof__(pte_val(__pte(0))) page;
diff --git a/include/asm-x86/kdebug.h b/include/asm-x86/kdebug.h
index dd442a1..99dcbaf 100644
--- a/include/asm-x86/kdebug.h
+++ b/include/asm-x86/kdebug.h
@@ -31,7 +31,6 @@ extern void show_trace(struct task_struct *t, struct pt_regs *regs,
unsigned long *sp, unsigned long bp);
extern void __show_regs(struct pt_regs *regs);
extern void show_regs(struct pt_regs *regs);
-extern void dump_pagetable(unsigned long);
extern unsigned long oops_begin(void);
extern void oops_end(unsigned long, struct pt_regs *, int signr);


2008-02-13 22:28:05

by Harvey Harrison

[permalink] [raw]
Subject: Re: [2.6 patch] x86: make dump_pagetable() static

On Wed, 2008-02-13 at 23:31 +0200, Adrian Bunk wrote:
> dump_pagetable() can now become static.
>
> Signed-off-by: Adrian Bunk <[email protected]>
>

I believe Andi Kleen wanted this kept global to make it easy to use when
adding debugging code elsewhere.

Cheers,

Harvey

2008-02-13 22:31:38

by Arjan van de Ven

[permalink] [raw]
Subject: Re: [2.6 patch] x86: make dump_pagetable() static

On Wed, 13 Feb 2008 23:31:31 +0200
Adrian Bunk <[email protected]> wrote:

> dump_pagetable() can now become static.
>
> Signed-off-by: Adrian Bunk <[email protected]>


Acked-by: Arjan van de Ven <[email protected]>



--
If you want to reach me at my work email, use [email protected]
For development, discussion and tips for power savings,
visit http://www.lesswatts.org

2008-02-13 22:36:48

by Adrian Bunk

[permalink] [raw]
Subject: Re: [2.6 patch] x86: make dump_pagetable() static

On Wed, Feb 13, 2008 at 02:27:47PM -0800, Harvey Harrison wrote:
> On Wed, 2008-02-13 at 23:31 +0200, Adrian Bunk wrote:
> > dump_pagetable() can now become static.
> >
> > Signed-off-by: Adrian Bunk <[email protected]>
> >
>
> I believe Andi Kleen wanted this kept global to make it easy to use when
> adding debugging code elsewhere.

That's not a reason as long as his code isn't in the tree (and he anyway
has to patch the kernel for using it).

> Cheers,
>
> Harvey

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2008-02-14 05:51:31

by Ingo Molnar

[permalink] [raw]
Subject: Re: [2.6 patch] x86: make dump_pagetable() static


* Adrian Bunk <[email protected]> wrote:

> On Wed, Feb 13, 2008 at 02:27:47PM -0800, Harvey Harrison wrote:
> > On Wed, 2008-02-13 at 23:31 +0200, Adrian Bunk wrote:
> > > dump_pagetable() can now become static.
> > >
> > > Signed-off-by: Adrian Bunk <[email protected]>

thanks, applied.

> > I believe Andi Kleen wanted this kept global to make it easy to use
> > when adding debugging code elsewhere.
>
> That's not a reason as long as his code isn't in the tree (and he
> anyway has to patch the kernel for using it).

correct. There's also a new CONFIG_X86_PTDUMP=y pagetable dumping debug
feature now in x86.git#mm that produces much nicer output.

Arjan: i it might be nice to make the new pagetable dumper triggerable
from a SysRq - could you try the kernel/time/timer_list.c's SEQ_printf()
trick to make the dumping dual-purpose? [so that it printk()'s if it
should dump to the console and seq_printf()'s if it should dump via
/proc]

Ingo

2008-02-14 07:56:37

by Andi Kleen

[permalink] [raw]
Subject: Re: [2.6 patch] x86: make dump_pagetable() static

Adrian Bunk wrote:
> On Wed, Feb 13, 2008 at 02:27:47PM -0800, Harvey Harrison wrote:
>> On Wed, 2008-02-13 at 23:31 +0200, Adrian Bunk wrote:
>>> dump_pagetable() can now become static.
>>>
>>> Signed-off-by: Adrian Bunk <[email protected]>
>>>
>> I believe Andi Kleen wanted this kept global to make it easy to use when
>> adding debugging code elsewhere.
>
> That's not a reason as long as his code isn't in the tree (and he anyway
> has to patch the kernel for using it).

It was originally needed for the old cpa patchkit which dumped
the page tables when it detected an internal inconsistency
with the reference counts.

I think something like this would still make sense in a few
cases, although there are no reference counts to check anymore
currently.

-Andi