lkml.org 
[lkml]   [2002]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: 2.4.18(19) swapcache oops
    Andrew Morton wrote:
    >
    > ...
    > --- 2.4.19/mm/swap.c~lru-race Thu Aug 15 13:03:48 2002
    > +++ 2.4.19-akpm/mm/swap.c Thu Aug 15 13:04:19 2002
    > @@ -57,9 +57,10 @@ void activate_page(struct page * page)
    > */
    > void lru_cache_add(struct page * page)
    > {
    > - if (!TestSetPageLRU(page)) {
    > + if (!PageLRU(page)) {
    > spin_lock(&pagemap_lru_lock);
    > - add_page_to_inactive_list(page);
    > + if (!TestSetPageLRU(page))
    > + add_page_to_inactive_list(page);
    > spin_unlock(&pagemap_lru_lock);
    > }
    > }

    Seems that I fixed this in 2.5.32. That set_bit outside
    the lock gave me the willes, and I couldn't put my finger on why.
    Never occurred to me that the page could be found via pagecache
    lookup in this manner.

    In 2.5, it is effectively:

    void lru_cache_add(struct page * page)
    {
    spin_lock(&pagemap_lru_lock);
    if (TestSetPageLRU(page))
    BUG();
    add_page_to_inactive_list(page);
    spin_unlock(&pagemap_lru_lock);
    }

    which is what should be tested in 2.4. It's stricter, and significantly
    faster.
    -
    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 13:28    [W:0.026 / U:31.624 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site