[RFC 00/21] Generic show_mem() - Kernel

This is a discussion on [RFC 00/21] Generic show_mem() - Kernel ; Hi. Every arch implements its own show_mem() function. Most of them share quite some code, some of them are completely identical. This proposal implements a generic version of this functions and migrates almost all architectures to use it. I have ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 35

Thread: [RFC 00/21] Generic show_mem()

  1. [RFC 00/21] Generic show_mem()

    Hi.

    Every arch implements its own show_mem() function. Most of them share
    quite some code, some of them are completely identical.

    This proposal implements a generic version of this functions and
    migrates almost all architectures to use it.

    I have only tested the x86_32 related part in lack of other archs.

    As far as I understood the code, the generic version should work for
    the architectures that used to iterate mem_map pfns, but I can not
    tell for sure. Please give feedback.

    Also, this series leaves ia64, arm, and sparc as is.

    Tony, as far as I understand, ia64 jumps holes in the memory map with
    vmemmap_find_next_valid_pfn(). Any idea if and how this could be
    built into the generic show_mem() version?

    Russell, I don't know if arm can be transformed. For now, it keeps
    its arch-specific show_mem().

    Dave, can sparc's version be simply migrated as well?

    Hannes

    arch/alpha/mm/init.c | 30 ------------------
    arch/alpha/mm/numa.c | 35 ----------------------
    arch/arm/mm/Kconfig | 3 ++
    arch/avr32/mm/init.c | 39 ------------------------
    arch/blackfin/mm/init.c | 27 -----------------
    arch/cris/mm/init.c | 31 -------------------
    arch/frv/mm/init.c | 31 -------------------
    arch/h8300/mm/init.c | 28 -----------------
    arch/ia64/Kconfig | 3 ++
    arch/m32r/mm/init.c | 37 -----------------------
    arch/m68k/mm/init.c | 31 -------------------
    arch/m68knommu/mm/init.c | 28 -----------------
    arch/mips/mm/Makefile | 3 +-
    arch/mips/mm/pgtable.c | 37 -----------------------
    arch/mn10300/mm/pgtable.c | 27 -----------------
    arch/parisc/mm/init.c | 72 ---------------------------------------------
    arch/powerpc/mm/mem.c | 40 -------------------------
    arch/ppc/mm/init.c | 31 -------------------
    arch/s390/mm/init.c | 36 ----------------------
    arch/sh/mm/init.c | 41 -------------------------
    arch/sparc/Kconfig | 3 ++
    arch/sparc64/mm/init.c | 45 ----------------------------
    arch/um/kernel/mem.c | 31 -------------------
    arch/v850/kernel/setup.c | 30 ------------------
    arch/x86/mm/init_64.c | 40 -------------------------
    arch/x86/mm/pgtable_32.c | 48 ------------------------------
    arch/xtensa/mm/init.c | 27 -----------------
    mm/page_alloc.c | 53 +++++++++++++++++++++++++++++++++
    28 files changed, 63 insertions(+), 824 deletions(-)
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. [RFC 13/22] mn10300: Use generic show_mem()


    Signed-off-by: Johannes Weiner

    diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig
    index a20b8f6..6a6409a 100644
    --- a/arch/mn10300/Kconfig
    +++ b/arch/mn10300/Kconfig
    @@ -353,9 +353,6 @@ config MN10300_TTYSM2_CTS

    endmenu

    -config HAVE_ARCH_SHOW_MEM
    - def_bool y
    -
    source "mm/Kconfig"

    menu "Power management options"
    diff --git a/arch/mn10300/mm/pgtable.c b/arch/mn10300/mm/pgtable.c
    index a477038..baffc58 100644
    --- a/arch/mn10300/mm/pgtable.c
    +++ b/arch/mn10300/mm/pgtable.c
    @@ -27,33 +27,6 @@
    #include
    #include

    -void show_mem(void)
    -{
    - unsigned long i;
    - int free = 0, total = 0, reserved = 0, shared = 0;
    -
    - int cached = 0;
    - printk(KERN_INFO "Mem-info:\n");
    - show_free_areas();
    - i = max_mapnr;
    - while (i-- > 0) {
    - total++;
    - if (PageReserved(mem_map + i))
    - reserved++;
    - else if (PageSwapCache(mem_map + i))
    - cached++;
    - else if (!page_count(mem_map + i))
    - free++;
    - else
    - shared += page_count(mem_map + i) - 1;
    - }
    - printk(KERN_INFO "%d pages of RAM\n", total);
    - printk(KERN_INFO "%d free pages\n", free);
    - printk(KERN_INFO "%d reserved pages\n", reserved);
    - printk(KERN_INFO "%d pages shared\n", shared);
    - printk(KERN_INFO "%d pages swap cached\n", cached);
    -}
    -
    /*
    * Associate a large virtual page frame with a given physical page frame
    * and protection flags for that frame. pfn is for the base of the page,
    --
    1.5.2.2

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

  3. [RFC 16/22] ppc: Use generic show_mem()


    Signed-off-by: Johannes Weiner

    diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
    index db5e6a1..abc877f 100644
    --- a/arch/ppc/Kconfig
    +++ b/arch/ppc/Kconfig
    @@ -924,9 +924,6 @@ config HIGHMEM
    config ARCH_POPULATES_NODE_MAP
    def_bool y

    -config HAVE_ARCH_SHOW_MEM
    - def_bool y
    -
    source kernel/Kconfig.hz
    source kernel/Kconfig.preempt
    source "mm/Kconfig"
    diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c
    index 7444df3..132031a 100644
    --- a/arch/ppc/mm/init.c
    +++ b/arch/ppc/mm/init.c
    @@ -101,37 +101,6 @@ unsigned long __max_memory;
    /* max amount of low RAM to map in */
    unsigned long __max_low_memory = MAX_LOW_MEM;

    -void show_mem(void)
    -{
    - int i,free = 0,total = 0,reserved = 0;
    - int shared = 0, cached = 0;
    - int highmem = 0;
    -
    - printk("Mem-info:\n");
    - show_free_areas();
    - printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
    - i = max_mapnr;
    - while (i-- > 0) {
    - total++;
    - if (PageHighMem(mem_map+i))
    - highmem++;
    - if (PageReserved(mem_map+i))
    - reserved++;
    - else if (PageSwapCache(mem_map+i))
    - cached++;
    - else if (!page_count(mem_map+i))
    - free++;
    - else
    - shared += page_count(mem_map+i) - 1;
    - }
    - printk("%d pages of RAM\n",total);
    - printk("%d pages of HIGHMEM\n", highmem);
    - printk("%d free pages\n",free);
    - printk("%d reserved pages\n",reserved);
    - printk("%d pages shared\n",shared);
    - printk("%d pages swap cached\n",cached);
    -}
    -
    /* Free up now-unused memory */
    static void free_sec(unsigned long start, unsigned long end, const char *name)
    {
    --
    1.5.2.2

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

  4. [RFC 21/22] xtensa: Use generic show_mem()


    Signed-off-by: Johannes Weiner

    diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
    index 0e3b68c..9fc8551 100644
    --- a/arch/xtensa/Kconfig
    +++ b/arch/xtensa/Kconfig
    @@ -163,9 +163,6 @@ config XTENSA_ISS_NETWORK
    depends on XTENSA_PLATFORM_ISS
    default y

    -config HAVE_ARCH_SHOW_MEM
    - def_bool y
    -
    source "mm/Kconfig"

    endmenu
    diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c
    index 81d0560..303fa3e 100644
    --- a/arch/xtensa/mm/init.c
    +++ b/arch/xtensa/mm/init.c
    @@ -280,33 +280,6 @@ void free_initmem(void)
    (&__init_end - &__init_begin) >> 10);
    }

    -void show_mem(void)
    -{
    - int i, free = 0, total = 0, reserved = 0;
    - int shared = 0, cached = 0;
    -
    - printk("Mem-info:\n");
    - show_free_areas();
    - printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
    - i = max_mapnr;
    - while (i-- > 0) {
    - total++;
    - if (PageReserved(mem_map+i))
    - reserved++;
    - else if (PageSwapCache(mem_map+i))
    - cached++;
    - else if (!page_count(mem_map + i))
    - free++;
    - else
    - shared += page_count(mem_map + i) - 1;
    - }
    - printk("%d pages of RAM\n", total);
    - printk("%d reserved pages\n", reserved);
    - printk("%d pages shared\n", shared);
    - printk("%d pages swap cached\n",cached);
    - printk("%d free pages\n", free);
    -}
    -
    struct kmem_cache *pgtable_cache __read_mostly;

    static void pgd_ctor(struct kmem_cache *cache, void* addr)
    --
    1.5.2.2

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

  5. [RFC 20/22] v850: Use generic show_mem()


    Signed-off-by: Johannes Weiner

    diff --git a/arch/v850/Kconfig b/arch/v850/Kconfig
    index a4d8e72..4379f43 100644
    --- a/arch/v850/Kconfig
    +++ b/arch/v850/Kconfig
    @@ -56,9 +56,6 @@ config ARCH_HAS_ILOG2_U64
    config ARCH_SUPPORTS_AOUT
    def_bool y

    -config HAVE_ARCH_SHOW_MEM
    - def_bool y
    -
    # Turn off some random 386 crap that can affect device config
    config ISA
    bool
    diff --git a/arch/v850/kernel/setup.c b/arch/v850/kernel/setup.c
    index a0a8456..5751709 100644
    --- a/arch/v850/kernel/setup.c
    +++ b/arch/v850/kernel/setup.c
    @@ -298,33 +298,3 @@ init_mem_alloc (unsigned long ram_start, unsigned long ram_len)
    free_area_init_node (0, NODE_DATA(0), zones_size,
    ADDR_TO_PAGE (PAGE_OFFSET), 0);
    }
    -
    -
    -
    -/* Taken from m68knommu */
    -void show_mem(void)
    -{
    - unsigned long i;
    - int free = 0, total = 0, reserved = 0, shared = 0;
    - int cached = 0;
    -
    - printk(KERN_INFO "\nMem-info:\n");
    - show_free_areas();
    - i = max_mapnr;
    - while (i-- > 0) {
    - total++;
    - if (PageReserved(mem_map+i))
    - reserved++;
    - else if (PageSwapCache(mem_map+i))
    - cached++;
    - else if (!page_count(mem_map+i))
    - free++;
    - else
    - shared += page_count(mem_map+i) - 1;
    - }
    - printk(KERN_INFO "%d pages of RAM\n",total);
    - printk(KERN_INFO "%d free pages\n",free);
    - printk(KERN_INFO "%d reserved pages\n",reserved);
    - printk(KERN_INFO "%d pages shared\n",shared);
    - printk(KERN_INFO "%d pages swap cached\n",cached);
    -}
    --
    1.5.2.2

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

  6. [RFC 22/22] alpha: Use generic show_mem()


    Signed-off-by: Johannes Weiner

    diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
    index efffa92..c91629f 100644
    --- a/arch/alpha/Kconfig
    +++ b/arch/alpha/Kconfig
    @@ -598,9 +598,6 @@ config ALPHA_LARGE_VMALLOC

    Say N unless you know you need gobs and gobs of vmalloc space.

    -config HAVE_ARCH_SHOW_MEM
    - def_bool y
    -
    config VERBOSE_MCHECK
    bool "Verbose Machine Checks"

    @@ -679,4 +676,3 @@ source "security/Kconfig"
    source "crypto/Kconfig"

    source "lib/Kconfig"
    -
    diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c
    index 40c15e7..234e42b 100644
    --- a/arch/alpha/mm/init.c
    +++ b/arch/alpha/mm/init.c
    @@ -94,36 +94,6 @@ __bad_page(void)
    return pte_mkdirty(mk_pte(virt_to_page(EMPTY_PGE), PAGE_SHARED));
    }

    -#ifndef CONFIG_DISCONTIGMEM
    -void
    -show_mem(void)
    -{
    - long i,free = 0,total = 0,reserved = 0;
    - long shared = 0, cached = 0;
    -
    - printk("\nMem-info:\n");
    - show_free_areas();
    - printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
    - i = max_mapnr;
    - while (i-- > 0) {
    - total++;
    - if (PageReserved(mem_map+i))
    - reserved++;
    - else if (PageSwapCache(mem_map+i))
    - cached++;
    - else if (!page_count(mem_map+i))
    - free++;
    - else
    - shared += page_count(mem_map + i) - 1;
    - }
    - printk("%ld pages of RAM\n",total);
    - printk("%ld free pages\n",free);
    - printk("%ld reserved pages\n",reserved);
    - printk("%ld pages shared\n",shared);
    - printk("%ld pages swap cached\n",cached);
    -}
    -#endif
    -
    static inline unsigned long
    load_PCB(struct pcb_struct *pcb)
    {
    diff --git a/arch/alpha/mm/numa.c b/arch/alpha/mm/numa.c
    index 10ab783..a460645 100644
    --- a/arch/alpha/mm/numa.c
    +++ b/arch/alpha/mm/numa.c
    @@ -359,38 +359,3 @@ void __init mem_init(void)
    mem_stress();
    #endif
    }
    -
    -void
    -show_mem(void)
    -{
    - long i,free = 0,total = 0,reserved = 0;
    - long shared = 0, cached = 0;
    - int nid;
    -
    - printk("\nMem-info:\n");
    - show_free_areas();
    - printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
    - for_each_online_node(nid) {
    - unsigned long flags;
    - pgdat_resize_lock(NODE_DATA(nid), &flags);
    - i = node_spanned_pages(nid);
    - while (i-- > 0) {
    - struct page *page = nid_page_nr(nid, i);
    - total++;
    - if (PageReserved(page))
    - reserved++;
    - else if (PageSwapCache(page))
    - cached++;
    - else if (!page_count(page))
    - free++;
    - else
    - shared += page_count(page) - 1;
    - }
    - pgdat_resize_unlock(NODE_DATA(nid), &flags);
    - }
    - printk("%ld pages of RAM\n",total);
    - printk("%ld free pages\n",free);
    - printk("%ld reserved pages\n",reserved);
    - printk("%ld pages shared\n",shared);
    - printk("%ld pages swap cached\n",cached);
    -}
    --
    1.5.2.2

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

  7. Re: [RFC 10/22] m68k: Use generic show_mem()


    The new version no longer prints

    > - printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));


    and

    > - printk("%d free pages\n",free);


    on m68k.

    Gr{oetje,eeting}s,

    Geert

    --
    Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

    In personal conversations with technical people, I call myself a hacker. But
    when I'm talking to journalists I just say "programmer" or something like that.
    -- Linus Torvalds
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  8. Re: [RFC 01/22] Generic show_mem() implementation

    > diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
    > index 729cdbd..efffa92 100644
    > --- a/arch/alpha/Kconfig
    > +++ b/arch/alpha/Kconfig
    > @@ -598,6 +598,9 @@ config ALPHA_LARGE_VMALLOC
    >
    > Say N unless you know you need gobs and gobs of vmalloc space.
    >
    > +config HAVE_ARCH_SHOW_MEM
    > + def_bool y
    > +
    > config VERBOSE_MCHECK
    > bool "Verbose Machine Checks"
    >
    > diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
    > index 76348f0..acad217 100644
    > --- a/arch/arm/mm/Kconfig
    > +++ b/arch/arm/mm/Kconfig
    > @@ -673,3 +673,6 @@ config OUTER_CACHE
    > config CACHE_L2X0
    > bool
    > select OUTER_CACHE
    > +
    > +config HAVE_ARCH_SHOW_MEM
    > + def_bool y


    These are all not necessary. Better add some global Kconfig option that
    gets selected by an arch if it wants the generic implementation.

    e.g. we currently have this in arch/s390/Kconfig:

    config S390
    def_bool y
    select HAVE_OPROFILE
    select HAVE_KPROBES
    select HAVE_KRETPROBES

    just add a select HAVE_GENERIC_SHOWMEM or something like that in the arch
    specific patches.
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  9. Re: [RFC 17/22] s390: Use generic show_mem()

    > diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
    > index 8053245..27b94cb 100644
    > --- a/arch/s390/mm/init.c
    > +++ b/arch/s390/mm/init.c
    > @@ -42,42 +42,6 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
    > pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE)));
    > char empty_zero_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE)));
    >
    > - printk("Free swap: %6ldkB\n", nr_swap_pages << (PAGE_SHIFT - 10));
    > - printk("%lu pages dirty\n", global_page_state(NR_FILE_DIRTY));
    > - printk("%lu pages writeback\n", global_page_state(NR_WRITEBACK));
    > - printk("%lu pages mapped\n", global_page_state(NR_FILE_MAPPED));
    > - printk("%lu pages slab\n",
    > - global_page_state(NR_SLAB_RECLAIMABLE) +
    > - global_page_state(NR_SLAB_UNRECLAIMABLE));
    > - printk("%lu pages pagetables\n", global_page_state(NR_PAGETABLE));


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

  10. Re: [RFC 18/22] sh: Use generic show_mem()

    On Wed, Apr 02, 2008 at 10:40:24PM +0200, Johannes Weiner wrote:
    > - printk(KERN_INFO "Total of %ld pages in page table cache\n",
    > - quicklist_total_size());
    > -}
    > -


    NACK. The quicklists are also absent from the generic implementation.
    Doing things generically is nice and all, but please do not go around
    removing all of the different implementations and consolidating on the
    simplest point of commonality you could come up with. Either combine
    everything in to a generic show_mem() that doesn't sacrifice
    functionality, or only convert the platforms that are identical.
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  11. Re: [RFC 01/22] Generic show_mem() implementation

    On Thu, Apr 03, 2008 at 09:55:45AM +0200, Heiko Carstens wrote:
    > > diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
    > > index 729cdbd..efffa92 100644
    > > --- a/arch/alpha/Kconfig
    > > +++ b/arch/alpha/Kconfig
    > > @@ -598,6 +598,9 @@ config ALPHA_LARGE_VMALLOC
    > >
    > > Say N unless you know you need gobs and gobs of vmalloc space.
    > >
    > > +config HAVE_ARCH_SHOW_MEM
    > > + def_bool y
    > > +
    > > config VERBOSE_MCHECK
    > > bool "Verbose Machine Checks"
    > >
    > > diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
    > > index 76348f0..acad217 100644
    > > --- a/arch/arm/mm/Kconfig
    > > +++ b/arch/arm/mm/Kconfig
    > > @@ -673,3 +673,6 @@ config OUTER_CACHE
    > > config CACHE_L2X0
    > > bool
    > > select OUTER_CACHE
    > > +
    > > +config HAVE_ARCH_SHOW_MEM
    > > + def_bool y

    >
    > These are all not necessary. Better add some global Kconfig option that
    > gets selected by an arch if it wants the generic implementation.
    >
    > e.g. we currently have this in arch/s390/Kconfig:
    >
    > config S390
    > def_bool y
    > select HAVE_OPROFILE
    > select HAVE_KPROBES
    > select HAVE_KRETPROBES
    >
    > just add a select HAVE_GENERIC_SHOWMEM or something like that in the arch
    > specific patches.

    Seconded.
    See Documentation/kbuild/kconfig-language.txt for a few more hints
    how to do it.

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

  12. Re: [RFC 10/22] m68k: Use generic show_mem()

    Hi Geert,

    Geert Uytterhoeven writes:

    > The new version no longer prints
    >
    >> - printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));

    >


    show_mem()
    show_free_areas()
    show_swap_cache_info()
    printk("Free swap = %lukB\n", nr_swap_pages << (PAGE_SHIFT - 10));

    > and
    >
    >> - printk("%d free pages\n",free);

    >
    > on m68k.


    show_free_areas() prints global_page_state(NR_FREE_PAGES). Isn't this
    the same?

    Thanks,

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

  13. Re: [RFC 18/22] sh: Use generic show_mem()

    Hi Paul,

    Paul Mundt writes:

    > On Wed, Apr 02, 2008 at 10:40:24PM +0200, Johannes Weiner wrote:
    >> - printk(KERN_INFO "Total of %ld pages in page table cache\n",
    >> - quicklist_total_size());
    >> -}
    >> -

    >
    > NACK. The quicklists are also absent from the generic implementation.
    > Doing things generically is nice and all, but please do not go around
    > removing all of the different implementations and consolidating on the
    > simplest point of commonality you could come up with. Either combine
    > everything in to a generic show_mem() that doesn't sacrifice
    > functionality, or only convert the platforms that are identical.


    Sorry, I made it an RFC because I was not quite sure if the generic pfn
    walker is valid on all affected architectures. If it is okay, I will
    send a patch-set meant for application that does not miss any output.

    Thanks,

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

  14. Re: [RFC 17/22] s390: Use generic show_mem()

    Hi,

    Heiko Carstens writes:

    >> diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
    >> index 8053245..27b94cb 100644
    >> --- a/arch/s390/mm/init.c
    >> +++ b/arch/s390/mm/init.c
    >> @@ -42,42 +42,6 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
    >> pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE)));
    >> char empty_zero_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE)));
    >>
    >> - printk("Free swap: %6ldkB\n", nr_swap_pages << (PAGE_SHIFT - 10));
    >> - printk("%lu pages dirty\n", global_page_state(NR_FILE_DIRTY));
    >> - printk("%lu pages writeback\n", global_page_state(NR_WRITEBACK));
    >> - printk("%lu pages mapped\n", global_page_state(NR_FILE_MAPPED));
    >> - printk("%lu pages slab\n",
    >> - global_page_state(NR_SLAB_RECLAIMABLE) +
    >> - global_page_state(NR_SLAB_UNRECLAIMABLE));
    >> - printk("%lu pages pagetables\n", global_page_state(NR_PAGETABLE));

    >
    > These are all missing in the generic implementation.


    These are all duplicates from show_free_areas().

    Thanks,

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

  15. Re: [RFC 10/22] m68k: Use generic show_mem()

    On Thu, 3 Apr 2008, Johannes Weiner wrote:
    > Geert Uytterhoeven writes:
    > > The new version no longer prints
    > >
    > >> - printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));

    > >

    >
    > show_mem()
    > show_free_areas()
    > show_swap_cache_info()
    > printk("Free swap = %lukB\n", nr_swap_pages << (PAGE_SHIFT - 10));
    >
    > > and
    > >
    > >> - printk("%d free pages\n",free);

    > >
    > > on m68k.

    >
    > show_free_areas() prints global_page_state(NR_FREE_PAGES). Isn't this
    > the same?


    Thanks, good to know...

    So I suggest to add an additional (first) step to the consolidation: remove all
    duplicates.

    Gr{oetje,eeting}s,

    Geert

    --
    Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

    In personal conversations with technical people, I call myself a hacker. But
    when I'm talking to journalists I just say "programmer" or something like that.
    -- Linus Torvalds
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  16. Re: [RFC 01/22] Generic show_mem() implementation

    Hi,

    Sam Ravnborg writes:

    >> > +
    >> > +config HAVE_ARCH_SHOW_MEM
    >> > + def_bool y

    >>
    >> These are all not necessary. Better add some global Kconfig option that
    >> gets selected by an arch if it wants the generic implementation.
    >>
    >> e.g. we currently have this in arch/s390/Kconfig:
    >>
    >> config S390
    >> def_bool y
    >> select HAVE_OPROFILE
    >> select HAVE_KPROBES
    >> select HAVE_KRETPROBES
    >>
    >> just add a select HAVE_GENERIC_SHOWMEM or something like that in the arch
    >> specific patches.

    > Seconded.
    > See Documentation/kbuild/kconfig-language.txt for a few more hints
    > how to do it.


    Yes, I will rework the patches. Thanks.

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

  17. Re: [RFC 01/22] Generic show_mem() implementation

    Hi,

    Sam Ravnborg writes:

    >> e.g. we currently have this in arch/s390/Kconfig:
    >>
    >> config S390
    >> def_bool y
    >> select HAVE_OPROFILE
    >> select HAVE_KPROBES
    >> select HAVE_KRETPROBES
    >>
    >> just add a select HAVE_GENERIC_SHOWMEM or something like that in the arch
    >> specific patches.

    > Seconded.
    > See Documentation/kbuild/kconfig-language.txt for a few more hints
    > how to do it.


    After more thinking about it, wouldn't it be better to have
    HAVE_ARCH_SHOW_MEM in mm/Kconfig and let archs with their own show_mem()
    select it? Because there are far more archs that use the generic
    version than those having their own.

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

  18. Re: [RFC 10/22] m68k: Use generic show_mem()

    Hi,

    Geert Uytterhoeven writes:

    > So I suggest to add an additional (first) step to the consolidation: remove all
    > duplicates.


    I shall do that. Problem is, I had a patch-series removing only parts
    of the duplication (shame on me) and not all of these patches are yet in
    the subsystem trees and still partially in -mm. None of them have hit
    mainline yet. Suggestions?

    The earlier patch-series was called `remove redundant output from
    show_mem()'.

    Sorry for the wasted time. These cleanups already took more energy than
    they are worth it, I guess... :/

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

  19. Re: [RFC 10/22] m68k: Use generic show_mem()

    On Thu, 3 Apr 2008, Johannes Weiner wrote:
    >
    > Sorry for the wasted time. These cleanups already took more energy than
    > they are worth it, I guess... :/


    Please do persist, I for one appreciate your efforts on this:
    something I wanted to do years ago but never yet got around to.

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

  20. Re: [RFC 10/22] m68k: Use generic show_mem()

    Hi,

    Hugh Dickins writes:

    > On Thu, 3 Apr 2008, Johannes Weiner wrote:
    >>
    >> Sorry for the wasted time. These cleanups already took more energy than
    >> they are worth it, I guess... :/

    >
    > Please do persist, I for one appreciate your efforts on this:
    > something I wanted to do years ago but never yet got around to.
    >
    > Thank you!
    > Hugh


    Thanks a lot!

    I will do a removal of redundant output for every show_mem() based on my
    prior patches first and then give the generic version another shot.

    Thanks for all your comments so far.

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

+ Reply to Thread
Page 1 of 2 1 2 LastLast