Lines Matching full:thresh
134 unsigned long thresh; /* dirty threshold */ member
369 * domain_dirty_limits - calculate thresh and bg_thresh for a wb_domain
372 * Calculate @dtc->thresh and ->bg_thresh considering
386 unsigned long thresh; in domain_dirty_limits() local
411 thresh = DIV_ROUND_UP(bytes, PAGE_SIZE); in domain_dirty_limits()
413 thresh = (ratio * available_memory) / PAGE_SIZE; in domain_dirty_limits()
423 thresh += thresh / 4 + global_wb_domain.dirty_limit / 32; in domain_dirty_limits()
429 if (thresh > UINT_MAX) in domain_dirty_limits()
430 thresh = UINT_MAX; in domain_dirty_limits()
432 if (bg_thresh >= thresh) in domain_dirty_limits()
433 bg_thresh = thresh / 2; in domain_dirty_limits()
434 dtc->thresh = thresh; in domain_dirty_limits()
439 trace_global_dirty_state(bg_thresh, thresh); in domain_dirty_limits()
445 * @pdirty: out parameter for thresh
447 * Calculate bg_thresh and thresh for global_wb_domain. See
458 *pdirty = gdtc.thresh; in global_dirty_limits()
837 static unsigned long dirty_freerun_ceiling(unsigned long thresh, in dirty_freerun_ceiling() argument
840 return (thresh + bg_thresh) / 2; in dirty_freerun_ceiling()
844 unsigned long thresh) in hard_dirty_limit() argument
846 return max(thresh, dom->dirty_limit); in hard_dirty_limit()
895 * @thresh: dirty throttling or dirty background threshold of wb_domain in @dtc
917 unsigned long thresh) in __wb_calc_thresh() argument
925 * Calculate this wb's share of the thresh ratio. in __wb_calc_thresh()
930 wb_thresh = (thresh * (100 * BDI_RATIO_SCALE - bdi_min_ratio)) / (100 * BDI_RATIO_SCALE); in __wb_calc_thresh()
936 wb_thresh += (thresh * wb_min_ratio) / (100 * BDI_RATIO_SCALE); in __wb_calc_thresh()
937 if (wb_thresh > (thresh * wb_max_ratio) / (100 * BDI_RATIO_SCALE)) in __wb_calc_thresh()
938 wb_thresh = thresh * wb_max_ratio / (100 * BDI_RATIO_SCALE); in __wb_calc_thresh()
943 unsigned long wb_calc_thresh(struct bdi_writeback *wb, unsigned long thresh) in wb_calc_thresh() argument
947 return __wb_calc_thresh(&gdtc, thresh); in wb_calc_thresh()
959 return __wb_calc_thresh(&mdtc, mdtc.thresh); in cgwb_calc_thresh()
1066 * - the wb dirty thresh drops quickly due to change of JBOD workload
1072 unsigned long freerun = dirty_freerun_ceiling(dtc->thresh, dtc->bg_thresh); in wb_position_ratio()
1073 unsigned long limit = hard_dirty_limit(dtc_dom(dtc), dtc->thresh); in wb_position_ratio()
1197 if (unlikely(wb_thresh > dtc->thresh)) in wb_position_ratio()
1198 wb_thresh = dtc->thresh; in wb_position_ratio()
1209 * wb_setpoint = setpoint * wb_thresh / thresh in wb_position_ratio()
1211 x = div_u64((u64)wb_thresh << 16, dtc->thresh | 1); in wb_position_ratio()
1215 * (thresh - wb_thresh ~= 0) and transit to wb_thresh in JBOD case. in wb_position_ratio()
1217 * wb_thresh thresh - wb_thresh in wb_position_ratio()
1219 * thresh thresh in wb_position_ratio()
1221 span = (dtc->thresh - wb_thresh + 8 * write_bw) * (u64)x >> 16; in wb_position_ratio()
1300 unsigned long thresh = dtc->thresh; in update_dirty_limit() local
1306 if (limit < thresh) { in update_dirty_limit()
1307 limit = thresh; in update_dirty_limit()
1312 * Follow down slowly. Use the higher one as the target, because thresh in update_dirty_limit()
1316 thresh = max(thresh, dtc->dirty); in update_dirty_limit()
1317 if (limit > thresh) { in update_dirty_limit()
1318 limit -= (limit - thresh) >> 5; in update_dirty_limit()
1357 unsigned long freerun = dirty_freerun_ceiling(dtc->thresh, dtc->bg_thresh); in wb_update_dirty_ratelimit()
1358 unsigned long limit = hard_dirty_limit(dtc_dom(dtc), dtc->thresh); in wb_update_dirty_ratelimit()
1586 unsigned long thresh) in dirty_poll_interval() argument
1588 if (thresh > dirty) in dirty_poll_interval()
1589 return 1UL << (ilog2(thresh - dirty) >> 1); in dirty_poll_interval()
1706 dtc->wb_thresh = __wb_calc_thresh(dtc, dtc->thresh); in wb_dirty_limits()
1707 dtc->wb_bg_thresh = dtc->thresh ? in wb_dirty_limits()
1708 div_u64((u64)dtc->wb_thresh * dtc->bg_thresh, dtc->thresh) : 0; in wb_dirty_limits()
1715 * Otherwise it would be possible to get thresh+n pages in wb_dirty_limits()
1716 * reported dirty, even though there are thresh-m pages in wb_dirty_limits()
1732 unsigned long dirty, thresh; in domain_poll_intv() local
1736 thresh = dtc->wb_thresh; in domain_poll_intv()
1739 thresh = dtc->thresh; in domain_poll_intv()
1742 return dirty_poll_interval(dirty, thresh); in domain_poll_intv()
1757 unsigned long dirty, thresh, bg_thresh; in domain_dirty_freerun() local
1762 thresh = dtc->wb_thresh; in domain_dirty_freerun()
1766 thresh = dtc->thresh; in domain_dirty_freerun()
1769 dtc->freerun = dirty <= dirty_freerun_ceiling(thresh, bg_thresh); in domain_dirty_freerun()
1805 ((dtc->dirty > dtc->thresh) || strictlimit); in wb_dirty_exceeded()
1961 sdtc->thresh, in balance_dirty_pages()
1990 sdtc->thresh, in balance_dirty_pages()
2014 * This is typically equal to (dirty < thresh) and can also in balance_dirty_pages()
2152 * and thresh, but it's for background writeback.