lkml.org 
[lkml]   [2007]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 08/12] mm: count writeback pages per BDI
    Count per BDI writeback pages.

    Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    ---
    include/linux/backing-dev.h | 1 +
    mm/page-writeback.c | 12 ++++++++++--
    2 files changed, 11 insertions(+), 2 deletions(-)

    Index: linux-2.6/mm/page-writeback.c
    ===================================================================
    --- linux-2.6.orig/mm/page-writeback.c 2007-04-12 17:32:17.000000000 +0200
    +++ linux-2.6/mm/page-writeback.c 2007-04-12 17:34:24.000000000 +0200
    @@ -977,14 +977,18 @@ int test_clear_page_writeback(struct pag
    int ret;

    if (mapping) {
    + struct backing_dev_info *bdi = mapping->backing_dev_info;
    unsigned long flags;

    write_lock_irqsave(&mapping->tree_lock, flags);
    ret = TestClearPageWriteback(page);
    - if (ret)
    + if (ret) {
    radix_tree_tag_clear(&mapping->page_tree,
    page_index(page),
    PAGECACHE_TAG_WRITEBACK);
    + if (bdi_cap_writeback_dirty(bdi))
    + __dec_bdi_stat(bdi, BDI_WRITEBACK);
    + }
    write_unlock_irqrestore(&mapping->tree_lock, flags);
    } else {
    ret = TestClearPageWriteback(page);
    @@ -1000,14 +1004,18 @@ int test_set_page_writeback(struct page
    int ret;

    if (mapping) {
    + struct backing_dev_info *bdi = mapping->backing_dev_info;
    unsigned long flags;

    write_lock_irqsave(&mapping->tree_lock, flags);
    ret = TestSetPageWriteback(page);
    - if (!ret)
    + if (!ret) {
    radix_tree_tag_set(&mapping->page_tree,
    page_index(page),
    PAGECACHE_TAG_WRITEBACK);
    + if (bdi_cap_writeback_dirty(bdi))
    + __inc_bdi_stat(bdi, BDI_WRITEBACK);
    + }
    if (!PageDirty(page))
    radix_tree_tag_clear(&mapping->page_tree,
    page_index(page),
    Index: linux-2.6/include/linux/backing-dev.h
    ===================================================================
    --- linux-2.6.orig/include/linux/backing-dev.h 2007-04-12 17:32:17.000000000 +0200
    +++ linux-2.6/include/linux/backing-dev.h 2007-04-12 17:32:40.000000000 +0200
    @@ -27,6 +27,7 @@ typedef int (congested_fn)(void *, int);

    enum bdi_stat_item {
    BDI_DIRTY,
    + BDI_WRITEBACK,
    NR_BDI_STAT_ITEMS
    };

    --

    -
    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: 2007-04-17 09:31    [W:0.021 / U:31.844 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site