Lines Matching defs:hdtc

147 static void hmdfs_init_dirty_limit(struct hmdfs_dirty_throttle_control *hdtc)
149 struct hmdfs_writeback *hwb = hdtc->hwb;
151 hdtc->fs_thresh = hdtc->hwb->dirty_fs_thresh;
152 hdtc->file_thresh = hdtc->hwb->dirty_file_thresh;
153 hdtc->fs_bg_thresh = hdtc->hwb->dirty_fs_bg_thresh;
154 hdtc->file_bg_thresh = hdtc->hwb->dirty_file_bg_thresh;
163 if (hwb->bw_fs_thresh < hdtc->fs_thresh) {
164 hdtc->fs_thresh = hwb->bw_fs_thresh;
165 hdtc->fs_bg_thresh = hmdfs_ratio_thresh(hwb->fs_bg_ratio,
166 hdtc->fs_thresh);
168 if (hwb->bw_file_thresh < hdtc->file_thresh) {
169 hdtc->file_thresh = hwb->bw_file_thresh;
170 hdtc->file_bg_thresh = hmdfs_ratio_thresh(hwb->file_bg_ratio,
171 hdtc->file_thresh);
177 hdtc->thresh_time_stamp = jiffies - HMDFS_BANDWIDTH_INTERVAL - 1;
180 static void hmdfs_update_dirty_limit(struct hmdfs_dirty_throttle_control *hdtc)
182 struct hmdfs_writeback *hwb = hdtc->hwb;
207 hdtc->fs_thresh = hwb->dirty_fs_thresh;
208 hdtc->file_thresh = hwb->dirty_file_thresh;
209 hdtc->fs_bg_thresh = hwb->dirty_fs_bg_thresh;
210 hdtc->file_bg_thresh = hwb->dirty_file_bg_thresh;
213 hdtc->fs_thresh = thresh;
214 hdtc->fs_bg_thresh = hmdfs_ratio_thresh(hwb->fs_bg_ratio,
215 hdtc->fs_thresh);
216 hdtc->file_thresh = hmdfs_ratio_thresh(hwb->fs_file_ratio,
217 hdtc->fs_thresh);
218 hdtc->file_bg_thresh = hmdfs_ratio_thresh(hwb->file_bg_ratio,
219 hdtc->file_thresh);
222 hwb->bw_fs_thresh = hdtc->fs_thresh;
223 hwb->bw_file_thresh = hdtc->file_thresh;
225 hdtc->thresh_time_stamp = jiffies;
230 struct hmdfs_dirty_throttle_control hdtc = {.hwb = hwb};
232 hmdfs_init_dirty_limit(&hdtc);
234 /* hdtc.file_bg_thresh should be the lowest thresh */
235 hwb->ratelimit_pages = hdtc.file_bg_thresh /
262 hmdfs_dirty_freerun_ceiling(struct hmdfs_dirty_throttle_control *hdtc,
266 return (hdtc->fs_thresh + hdtc->fs_bg_thresh) / 2;
268 return (hdtc->file_thresh + hdtc->file_bg_thresh) / 2;
287 struct hmdfs_dirty_throttle_control hdtc = {.hwb = hwb};
297 hmdfs_init_dirty_limit(&hdtc);
304 hdtc.fs_nr_dirty = wb_stat_sum(wb, WB_RECLAIMABLE);
305 hdtc.fs_nr_reclaimable =
306 hdtc.fs_nr_dirty + wb_stat_sum(wb, WB_WRITEBACK);
307 if (hdtc.fs_nr_reclaimable < hdtc.file_bg_thresh) {
308 diff = hmdfs_dirty_intv(hdtc.fs_nr_reclaimable,
309 hdtc.file_thresh);
314 hdtc.file_nr_dirty =
316 hdtc.file_nr_reclaimable =
318 hdtc.file_nr_dirty;
319 if ((hdtc.fs_nr_reclaimable <
320 hmdfs_dirty_freerun_ceiling(&hdtc, HMDFS_DIRTY_FS)) &&
321 (hdtc.file_nr_reclaimable <
322 hmdfs_dirty_freerun_ceiling(&hdtc, HMDFS_DIRTY_FILE))) {
325 fs_intv = hmdfs_dirty_intv(hdtc.fs_nr_reclaimable,
326 hdtc.fs_thresh);
327 file_intv = hmdfs_dirty_intv(hdtc.file_nr_reclaimable,
328 hdtc.file_thresh);
336 if (hdtc.fs_nr_reclaimable >=
337 hmdfs_dirty_freerun_ceiling(&hdtc, HMDFS_DIRTY_FS)) {
353 time_is_before_jiffies(hdtc.thresh_time_stamp +
355 hmdfs_update_dirty_limit(&hdtc);
357 if (unlikely(hdtc.fs_nr_reclaimable >= hdtc.fs_thresh))
359 if (unlikely(hdtc.file_nr_reclaimable >= hdtc.file_thresh))
363 trace_hmdfs_balance_dirty_pages(sbi, wb, &hdtc,
377 pause = hmdfs_wb_pause(wb, hdtc.fs_nr_reclaimable);
379 trace_hmdfs_balance_dirty_pages(sbi, wb, &hdtc, pause,
392 if (hdtc.fs_nr_reclaimable >= hdtc.fs_bg_thresh) {
395 } else if (hdtc.file_nr_reclaimable >= hdtc.file_bg_thresh) {