Re: [PATCH] 2/2 Prezeroing large blocks of pages during allocation

From: Mel Gorman (mel_at_csn.ul.ie)
Date: 02/28/05

  • Next message: Christian Schmid: "Re: Slowdown on high-load machines with 3000 sockets"
    Date:	Mon, 28 Feb 2005 19:01:53 +0000 (GMT)
    To: Dave Hansen <haveblue@us.ibm.com>
    
    

    On Mon, 28 Feb 2005, Dave Hansen wrote:

    > On Sun, 2005-02-27 at 13:43 +0000, Mel Gorman wrote:
    > > + /*
    > > + * If this is a request for a zero page and the page was
    > > + * not taken from the USERZERO pool, zero it all
    > > + */
    > > + if ((flags & __GFP_ZERO) && alloctype != ALLOC_USERZERO) {
    > > + int zero_order=order;
    > > +
    > > + /*
    > > + * This is important. We are about to zero a block
    > > + * which may be larger than we need so we have to
    > > + * determine do we zero just what we need or do
    > > + * we zero the whole block and put the pages in
    > > + * the zero page.
    > > + *
    > > + * We zero the whole block in the event we are taking
    > > + * from the KERNNORCLM pools and otherwise zero just
    > > + * what we need. The reason we do not always zero
    > > + * everything is because we do not want unreclaimable
    > > + * pages to leak into the USERRCLM and KERNRCLM
    > > + * pools
    > > + *
    > > + */
    > > + if (alloctype != ALLOC_USERRCLM &&
    > > + alloctype != ALLOC_KERNRCLM) {
    > > + area = zone->free_area_lists[ALLOC_USERZERO] +
    > > + current_order;
    > > + zero_order = current_order;
    > > + }
    > > +
    > > +
    > > + spin_unlock_irqrestore(&zone->lock, *irq_flags);
    > > + prep_zero_page(page, zero_order, flags);
    > > + inc_zeroblock_count(zone, zero_order, flags);
    > > + spin_lock_irqsave(&zone->lock, *irq_flags);
    > > +
    > > + }
    > > +
    > > return expand(zone, page, order, current_order, area);
    > > }
    > >
    >
    > I think it would make sense to put that in its own helper function.
    > When comments get that big, they often reduce readability. The only
    > outside variable that gets modified is "area", I think.
    >
    > So, a static inline:
    >
    > area = my_new_function_with_the_huge_comment(zone, ..., area);
    >

    Will make that change in the next version. It makes perfect sense.

    > BTW, what kernel does this apply against? Is linux-2.6.11-rc4-v18 the
    > same as bk18?
    >

    It applies on top of 2.6.11-rc4 with the latest version of the placement
    policy. Admittedly, the naming of the tree is not very obvious.

    -- 
    Mel Gorman
    -
    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/
    

  • Next message: Christian Schmid: "Re: Slowdown on high-load machines with 3000 sockets"

    Relevant Pages

    • Re: [PATCH] 2/2 Prezeroing large blocks of pages during allocation
      ... On Sun, 2005-02-27 at 13:43 +0000, Mel Gorman wrote: ... I think it would make sense to put that in its own helper function. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: kgdb for mainline kernel: core-lite [patch 1/3]
      ... This feature lets gdb hook onto a kernel function to detect loading and ... unloading of modules and preserves module section information for later use ... The one in my tree also apparently works to some ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [RFC] removal of legacy cdrom drivers (Re: [PATCH] mcdx.c insanity removal)
      ... bar and baz and fairly long expressions. ... if we want to keep the FPOS in the tree. ... Driver is obviously ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [BK] upgrade will be needed
      ... > tree. ... automatic real-time gateway with no license problems. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • RE: arch/xen is a bad idea
      ... > The Xen team still believe that it's best to keep arch/xen, ... I'd hope that we could get xen into the main-line tree. ... This is going to require some significant i386 code refactoring, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)