lkml.org 
[lkml]   [2004]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH] 2.6.4-rc2-mm1: vm-split-active-lists
    Nick Piggin writes:
    >

    [...]

    >
    > By the way, I would be interested to know the rationale behind
    > mark_page_accessed as it is without this patch, also what is it doing in
    > rmap.c (I know hardly anything actually uses page_test_and_clear_young, but
    > still). It seems to me like it only serves to make VM behaviour harder to
    > understand, but I'm probably missing something. Andrew?

    With your patch, once a page got into inactive list, its PG_referenced
    bit will only be checked by VM scanner when page wanders to the tail of
    list. In particular, if is impossible to tell pages that were accessed
    only once while on inactive list from ones that were accessed multiple
    times. Original mark_page_accessed() moves page to the active list on
    the second access, thus making it less eligible for the reclaim.

    I actually tried quite an opposite modification:
    (ftp://ftp.namesys.com/pub/misc-patches/unsupported/extra/2004.03.10-2.6.4-rc3/a_1[5678]*)

    /* roughly, modulo locking, etc. */
    void fastcall mark_page_accessed(struct page *page)
    {
    if (!PageReferenced(page))
    SetPageReferenced(page);
    else if (!PageLRU(page))
    continue;
    else if (!PageActive(page)) {
    /* page is on inactive list */
    del_page_from_inactive_list(zone, page);
    SetPageActive(page);
    add_page_to_active_list(zone, page);
    inc_page_state(pgactivate);
    ClearPageReferenced(page);
    } else {
    /* page is on active list, move it to head */
    list_move(&page->lru, &zone->active_list);
    ClearPageReferenced(page);
    }
    }

    That is, referenced and active page is moved to head of the active
    list. While somewhat improving file system performance it badly affects
    anonymous memory, because (it seems) file system pages tend to push
    mapped ones out of active list. Probably it should have better effect
    with your split active lists.

    >

    Nikita.
    -
    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-03-22 14:01    [W:0.025 / U:1.196 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site