Lines Matching full:thresh
134 unsigned long thresh; /* dirty threshold */ member
379 * domain_dirty_limits - calculate thresh and bg_thresh for a wb_domain
382 * Calculate @dtc->thresh and ->bg_thresh considering
396 unsigned long thresh; in domain_dirty_limits() local
421 thresh = DIV_ROUND_UP(bytes, PAGE_SIZE); in domain_dirty_limits()
423 thresh = (ratio * available_memory) / PAGE_SIZE; in domain_dirty_limits()
433 thresh += thresh / 4 + global_wb_domain.dirty_limit / 32; in domain_dirty_limits()
439 if (thresh > UINT_MAX) in domain_dirty_limits()
440 thresh = UINT_MAX; in domain_dirty_limits()
442 if (bg_thresh >= thresh) in domain_dirty_limits()
443 bg_thresh = thresh / 2; in domain_dirty_limits()
444 dtc->thresh = thresh; in domain_dirty_limits()
449 trace_global_dirty_state(bg_thresh, thresh); in domain_dirty_limits()
455 * @pdirty: out parameter for thresh
457 * Calculate bg_thresh and thresh for global_wb_domain. See
468 *pdirty = gdtc.thresh; in global_dirty_limits()
727 static unsigned long dirty_freerun_ceiling(unsigned long thresh, in dirty_freerun_ceiling() argument
730 return (thresh + bg_thresh) / 2; in dirty_freerun_ceiling()
734 unsigned long thresh) in hard_dirty_limit() argument
736 return max(thresh, dom->dirty_limit); in hard_dirty_limit()
778 unsigned long thresh = dtc->thresh; in __wb_calc_thresh() local
784 * Calculate this BDI's share of the thresh ratio. in __wb_calc_thresh()
789 wb_thresh = (thresh * (100 - bdi_min_ratio)) / 100; in __wb_calc_thresh()
795 wb_thresh += (thresh * wb_min_ratio) / 100; in __wb_calc_thresh()
796 if (wb_thresh > (thresh * wb_max_ratio) / 100) in __wb_calc_thresh()
797 wb_thresh = thresh * wb_max_ratio / 100; in __wb_calc_thresh()
802 unsigned long wb_calc_thresh(struct bdi_writeback *wb, unsigned long thresh) in wb_calc_thresh() argument
805 .thresh = thresh }; in wb_calc_thresh()
913 * - the wb dirty thresh drops quickly due to change of JBOD workload
919 unsigned long freerun = dirty_freerun_ceiling(dtc->thresh, dtc->bg_thresh); in wb_position_ratio()
920 unsigned long limit = hard_dirty_limit(dtc_dom(dtc), dtc->thresh); in wb_position_ratio()
1044 if (unlikely(wb_thresh > dtc->thresh)) in wb_position_ratio()
1045 wb_thresh = dtc->thresh; in wb_position_ratio()
1056 * wb_setpoint = setpoint * wb_thresh / thresh in wb_position_ratio()
1058 x = div_u64((u64)wb_thresh << 16, dtc->thresh | 1); in wb_position_ratio()
1062 * (thresh - wb_thresh ~= 0) and transit to wb_thresh in JBOD case. in wb_position_ratio()
1064 * wb_thresh thresh - wb_thresh in wb_position_ratio()
1066 * thresh thresh in wb_position_ratio()
1068 span = (dtc->thresh - wb_thresh + 8 * write_bw) * (u64)x >> 16; in wb_position_ratio()
1147 unsigned long thresh = dtc->thresh; in update_dirty_limit() local
1153 if (limit < thresh) { in update_dirty_limit()
1154 limit = thresh; in update_dirty_limit()
1159 * Follow down slowly. Use the higher one as the target, because thresh in update_dirty_limit()
1163 thresh = max(thresh, dtc->dirty); in update_dirty_limit()
1164 if (limit > thresh) { in update_dirty_limit()
1165 limit -= (limit - thresh) >> 5; in update_dirty_limit()
1204 unsigned long freerun = dirty_freerun_ceiling(dtc->thresh, dtc->bg_thresh); in wb_update_dirty_ratelimit()
1205 unsigned long limit = hard_dirty_limit(dtc_dom(dtc), dtc->thresh); in wb_update_dirty_ratelimit()
1422 unsigned long thresh) in dirty_poll_interval() argument
1424 if (thresh > dirty) in dirty_poll_interval()
1425 return 1UL << (ilog2(thresh - dirty) >> 1); in dirty_poll_interval()
1543 dtc->wb_bg_thresh = dtc->thresh ? in wb_dirty_limits()
1544 div64_u64(dtc->wb_thresh * dtc->bg_thresh, dtc->thresh) : 0; in wb_dirty_limits()
1551 * Otherwise it would be possible to get thresh+n pages in wb_dirty_limits()
1552 * reported dirty, even though there are thresh-m pages in wb_dirty_limits()
1596 unsigned long dirty, thresh, bg_thresh; in balance_dirty_pages() local
1611 thresh = gdtc->wb_thresh; in balance_dirty_pages()
1615 thresh = gdtc->thresh; in balance_dirty_pages()
1640 m_thresh = mdtc->thresh; in balance_dirty_pages()
1657 if (dirty <= dirty_freerun_ceiling(thresh, bg_thresh) && in balance_dirty_pages()
1664 intv = dirty_poll_interval(dirty, thresh); in balance_dirty_pages()
1699 ((gdtc->dirty > gdtc->thresh) || strictlimit); in balance_dirty_pages()
1726 ((mdtc->dirty > mdtc->thresh) || strictlimit); in balance_dirty_pages()
1770 sdtc->thresh, in balance_dirty_pages()
1799 sdtc->thresh, in balance_dirty_pages()
1819 * This is typically equal to (dirty < thresh) and can also in balance_dirty_pages()