Lines Matching defs:hdtc

171 static void hmdfs_init_dirty_limit(struct hmdfs_dirty_throttle_control *hdtc)
173 struct hmdfs_writeback *hwb = hdtc->hwb;
175 hdtc->fs_thresh = hdtc->hwb->dirty_fs_thresh;
176 hdtc->file_thresh = hdtc->hwb->dirty_file_thresh;
177 hdtc->fs_bg_thresh = hdtc->hwb->dirty_fs_bg_thresh;
178 hdtc->file_bg_thresh = hdtc->hwb->dirty_file_bg_thresh;
187 if (hwb->bw_fs_thresh < hdtc->fs_thresh) {
188 hdtc->fs_thresh = hwb->bw_fs_thresh;
189 hdtc->fs_bg_thresh = hmdfs_ratio_thresh(hwb->fs_bg_ratio,
190 hdtc->fs_thresh);
192 if (hwb->bw_file_thresh < hdtc->file_thresh) {
193 hdtc->file_thresh = hwb->bw_file_thresh;
194 hdtc->file_bg_thresh = hmdfs_ratio_thresh(hwb->file_bg_ratio,
195 hdtc->file_thresh);
201 hdtc->thresh_time_stamp = jiffies - HMDFS_BANDWIDTH_INTERVAL - 1;
204 static void hmdfs_update_dirty_limit(struct hmdfs_dirty_throttle_control *hdtc)
206 struct hmdfs_writeback *hwb = hdtc->hwb;
231 hdtc->fs_thresh = hwb->dirty_fs_thresh;
232 hdtc->file_thresh = hwb->dirty_file_thresh;
233 hdtc->fs_bg_thresh = hwb->dirty_fs_bg_thresh;
234 hdtc->file_bg_thresh = hwb->dirty_file_bg_thresh;
237 hdtc->fs_thresh = thresh;
238 hdtc->fs_bg_thresh = hmdfs_ratio_thresh(hwb->fs_bg_ratio,
239 hdtc->fs_thresh);
240 hdtc->file_thresh = hmdfs_ratio_thresh(hwb->fs_file_ratio,
241 hdtc->fs_thresh);
242 hdtc->file_bg_thresh = hmdfs_ratio_thresh(hwb->file_bg_ratio,
243 hdtc->file_thresh);
246 hwb->bw_fs_thresh = hdtc->fs_thresh;
247 hwb->bw_file_thresh = hdtc->file_thresh;
249 hdtc->thresh_time_stamp = jiffies;
254 struct hmdfs_dirty_throttle_control hdtc = {.hwb = hwb};
256 hmdfs_init_dirty_limit(&hdtc);
258 /* hdtc.file_bg_thresh should be the lowest thresh */
259 hwb->ratelimit_pages = hdtc.file_bg_thresh /
286 hmdfs_dirty_freerun_ceiling(struct hmdfs_dirty_throttle_control *hdtc,
290 return (hdtc->fs_thresh + hdtc->fs_bg_thresh) / 2;
292 return (hdtc->file_thresh + hdtc->file_bg_thresh) / 2;
311 struct hmdfs_dirty_throttle_control hdtc = {.hwb = hwb};
321 hmdfs_init_dirty_limit(&hdtc);
328 hdtc.fs_nr_dirty = wb_stat_sum(wb, WB_RECLAIMABLE);
329 hdtc.fs_nr_reclaimable =
330 hdtc.fs_nr_dirty + wb_stat_sum(wb, WB_WRITEBACK);
331 if (hdtc.fs_nr_reclaimable < hdtc.file_bg_thresh) {
332 diff = hmdfs_dirty_intv(hdtc.fs_nr_reclaimable,
333 hdtc.file_thresh);
338 hdtc.file_nr_dirty =
340 hdtc.file_nr_reclaimable =
342 hdtc.file_nr_dirty;
343 if ((hdtc.fs_nr_reclaimable <
344 hmdfs_dirty_freerun_ceiling(&hdtc, HMDFS_DIRTY_FS)) &&
345 (hdtc.file_nr_reclaimable <
346 hmdfs_dirty_freerun_ceiling(&hdtc, HMDFS_DIRTY_FILE))) {
349 fs_intv = hmdfs_dirty_intv(hdtc.fs_nr_reclaimable,
350 hdtc.fs_thresh);
351 file_intv = hmdfs_dirty_intv(hdtc.file_nr_reclaimable,
352 hdtc.file_thresh);
360 if (hdtc.fs_nr_reclaimable >=
361 hmdfs_dirty_freerun_ceiling(&hdtc, HMDFS_DIRTY_FS)) {
377 time_is_before_jiffies(hdtc.thresh_time_stamp +
379 hmdfs_update_dirty_limit(&hdtc);
381 if (unlikely(hdtc.fs_nr_reclaimable >= hdtc.fs_thresh))
383 if (unlikely(hdtc.file_nr_reclaimable >= hdtc.file_thresh))
387 trace_hmdfs_balance_dirty_pages(sbi, wb, &hdtc,
401 pause = hmdfs_wb_pause(wb, hdtc.fs_nr_reclaimable);
403 trace_hmdfs_balance_dirty_pages(sbi, wb, &hdtc, pause,
416 if (hdtc.fs_nr_reclaimable >= hdtc.fs_bg_thresh) {
419 } else if (hdtc.file_nr_reclaimable >= hdtc.file_bg_thresh) {