X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fosc%2Fosc_page.c;h=0f009b3a86c7e2c2fe62d5734db4186be2f09735;hp=ae7d01b526829d1dccc338c298f5ac025f6d4f5a;hb=3e5faa441266cd8dc2ee54ae140ad0129b4affa0;hpb=e2e30106bc0c70da0111f9d677e5e671701ee932 diff --git a/lustre/osc/osc_page.c b/lustre/osc/osc_page.c index ae7d01b..0f009b3 100644 --- a/lustre/osc/osc_page.c +++ b/lustre/osc/osc_page.c @@ -875,6 +875,13 @@ void osc_lru_unreserve(struct client_obd *cli, unsigned long npages) * In practice this can work pretty good because the pages in the same RPC * are likely from the same page zone. */ +#ifdef HAVE_NR_UNSTABLE_NFS +/* Old kernels use a separate counter for unstable pages, + * newer kernels treat them like any other writeback. + */ +#define NR_WRITEBACK NR_UNSTABLE_NFS +#endif + static inline void unstable_page_accounting(struct ptlrpc_bulk_desc *desc, struct osc_brw_async_args *aa, int factor) @@ -903,7 +910,7 @@ static inline void unstable_page_accounting(struct ptlrpc_bulk_desc *desc, } if (count > 0) { - mod_zone_page_state(zone, NR_UNSTABLE_NFS, + mod_zone_page_state(zone, NR_WRITEBACK, factor * count); count = 0; } @@ -911,7 +918,7 @@ static inline void unstable_page_accounting(struct ptlrpc_bulk_desc *desc, ++count; } if (count > 0) - mod_zone_page_state(zone, NR_UNSTABLE_NFS, factor * count); + mod_zone_page_state(zone, NR_WRITEBACK, factor * count); } static inline void add_unstable_page_accounting(struct ptlrpc_bulk_desc *desc,