Lines Matching full:thresh
347 * domain_dirty_limits - calculate thresh and bg_thresh for a wb_domain
350 * Calculate @dtc->thresh and ->bg_thresh considering
364 unsigned long thresh; in domain_dirty_limits() local
389 thresh = DIV_ROUND_UP(bytes, PAGE_SIZE); in domain_dirty_limits()
391 thresh = (ratio * available_memory) / PAGE_SIZE; in domain_dirty_limits()
401 thresh += thresh / 4 + global_wb_domain.dirty_limit / 32; in domain_dirty_limits()
407 if (thresh > UINT_MAX) in domain_dirty_limits()
408 thresh = UINT_MAX; in domain_dirty_limits()
410 if (bg_thresh >= thresh) in domain_dirty_limits()
411 bg_thresh = thresh / 2; in domain_dirty_limits()
412 dtc->thresh = thresh; in domain_dirty_limits()
417 trace_global_dirty_state(bg_thresh, thresh); in domain_dirty_limits()
423 * @pdirty: out parameter for thresh
425 * Calculate bg_thresh and thresh for global_wb_domain. See
436 *pdirty = gdtc.thresh; in global_dirty_limits()
821 static unsigned long dirty_freerun_ceiling(unsigned long thresh, in dirty_freerun_ceiling() argument
824 return (thresh + bg_thresh) / 2; in dirty_freerun_ceiling()
828 unsigned long thresh) in hard_dirty_limit() argument
830 return max(thresh, dom->dirty_limit); in hard_dirty_limit()
879 * @thresh: dirty throttling or dirty background threshold of wb_domain in @dtc
901 unsigned long thresh) in __wb_calc_thresh() argument
911 * Calculate this wb's share of the thresh ratio. in __wb_calc_thresh()
916 wb_thresh = (thresh * (100 * BDI_RATIO_SCALE - bdi_min_ratio)) / (100 * BDI_RATIO_SCALE); in __wb_calc_thresh()
922 wb_thresh += (thresh * wb_min_ratio) / (100 * BDI_RATIO_SCALE); in __wb_calc_thresh()
931 if (thresh > dtc->dirty) { in __wb_calc_thresh()
933 wb_thresh = max(wb_thresh, (thresh - dtc->dirty) / 100); in __wb_calc_thresh()
935 wb_thresh = max(wb_thresh, (thresh - dtc->dirty) / 8); in __wb_calc_thresh()
938 wb_max_thresh = thresh * wb_max_ratio / (100 * BDI_RATIO_SCALE); in __wb_calc_thresh()
945 unsigned long wb_calc_thresh(struct bdi_writeback *wb, unsigned long thresh) in wb_calc_thresh() argument
950 return __wb_calc_thresh(&gdtc, thresh); in wb_calc_thresh()
962 return __wb_calc_thresh(&mdtc, mdtc.thresh); in cgwb_calc_thresh()
1069 * - the wb dirty thresh drops quickly due to change of JBOD workload
1075 unsigned long freerun = dirty_freerun_ceiling(dtc->thresh, dtc->bg_thresh); in wb_position_ratio()
1076 unsigned long limit = dtc->limit = hard_dirty_limit(dtc_dom(dtc), dtc->thresh); in wb_position_ratio()
1192 if (unlikely(wb_thresh > dtc->thresh)) in wb_position_ratio()
1193 wb_thresh = dtc->thresh; in wb_position_ratio()
1196 * wb_setpoint = setpoint * wb_thresh / thresh in wb_position_ratio()
1198 x = div_u64((u64)wb_thresh << 16, dtc->thresh | 1); in wb_position_ratio()
1202 * (thresh - wb_thresh ~= 0) and transit to wb_thresh in JBOD case. in wb_position_ratio()
1204 * wb_thresh thresh - wb_thresh in wb_position_ratio()
1206 * thresh thresh in wb_position_ratio()
1208 span = (dtc->thresh - wb_thresh + 8 * write_bw) * (u64)x >> 16; in wb_position_ratio()
1287 unsigned long thresh = dtc->thresh; in update_dirty_limit() local
1293 if (limit < thresh) { in update_dirty_limit()
1294 limit = thresh; in update_dirty_limit()
1299 * Follow down slowly. Use the higher one as the target, because thresh in update_dirty_limit()
1303 thresh = max(thresh, dtc->dirty); in update_dirty_limit()
1304 if (limit > thresh) { in update_dirty_limit()
1305 limit -= (limit - thresh) >> 5; in update_dirty_limit()
1344 unsigned long freerun = dirty_freerun_ceiling(dtc->thresh, dtc->bg_thresh); in wb_update_dirty_ratelimit()
1345 unsigned long limit = hard_dirty_limit(dtc_dom(dtc), dtc->thresh); in wb_update_dirty_ratelimit()
1566 unsigned long thresh) in dirty_poll_interval() argument
1568 if (thresh > dirty) in dirty_poll_interval()
1569 return 1UL << (ilog2(thresh - dirty) >> 1); in dirty_poll_interval()
1686 dtc->wb_thresh = __wb_calc_thresh(dtc, dtc->thresh); in wb_dirty_limits()
1687 dtc->wb_bg_thresh = dtc->thresh ? in wb_dirty_limits()
1688 div_u64((u64)dtc->wb_thresh * dtc->bg_thresh, dtc->thresh) : 0; in wb_dirty_limits()
1695 * Otherwise it would be possible to get thresh+n pages in wb_dirty_limits()
1696 * reported dirty, even though there are thresh-m pages in wb_dirty_limits()
1712 unsigned long dirty, thresh; in domain_poll_intv() local
1716 thresh = dtc->wb_thresh; in domain_poll_intv()
1719 thresh = dtc->thresh; in domain_poll_intv()
1722 return dirty_poll_interval(dirty, thresh); in domain_poll_intv()
1737 unsigned long dirty, thresh, bg_thresh; in domain_dirty_freerun() local
1742 thresh = dtc->wb_thresh; in domain_dirty_freerun()
1746 thresh = dtc->thresh; in domain_dirty_freerun()
1749 dtc->freerun = dirty <= dirty_freerun_ceiling(thresh, bg_thresh); in domain_dirty_freerun()
1785 ((dtc->dirty > dtc->thresh) || strictlimit); in wb_dirty_exceeded()
1986 * This is typically equal to (dirty < thresh) and can also in balance_dirty_pages()
2124 * and thresh, but it's for background writeback.