lkml.org 
[lkml]   [2005]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[patch 1/12] mm: free_pages_and_swap_cache opt
    Date
    Minor optimization (though it doesn't help in the PREEMPT case, severely
    constrained by small ZAP_BLOCK_SIZE). free_pages_and_swap_cache works in
    chunks of 16, calling release_pages which works in chunks of PAGEVEC_SIZE.
    But PAGEVEC_SIZE was dropped from 16 to 14 in 2.6.10, so we're now doing
    more spin_lock_irq'ing than necessary: use PAGEVEC_SIZE throughout.

    Signed-off-by: Hugh Dickins <hugh@veritas.com>

    Index: linux-2.6/mm/swap_state.c
    ===================================================================
    --- linux-2.6.orig/mm/swap_state.c
    +++ linux-2.6/mm/swap_state.c
    @@ -14,6 +14,7 @@
    #include <linux/pagemap.h>
    #include <linux/buffer_head.h>
    #include <linux/backing-dev.h>
    +#include <linux/pagevec.h>

    #include <asm/pgtable.h>

    @@ -272,12 +273,11 @@ void free_page_and_swap_cache(struct pag
    */
    void free_pages_and_swap_cache(struct page **pages, int nr)
    {
    - int chunk = 16;
    struct page **pagep = pages;

    lru_add_drain();
    while (nr) {
    - int todo = min(chunk, nr);
    + int todo = min(nr, PAGEVEC_SIZE);
    int i;

    for (i = 0; i < todo; i++)
    Send instant messages to your online friends http://au.messenger.yahoo.com
    -
    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/

    \
     
     \ /
      Last update: 2005-11-21 14:26    [W:0.020 / U:65.304 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site