lkml.org 
[lkml]   [2019]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] blkcg: prevent priority inversion problem during sync()
On Sat, Feb 09, 2019 at 01:06:33PM +0100, Andrea Righi wrote:
...
> +/**
> + * blkcg_wb_waiters_on_bdi - check for writeback waiters on a block device
> + * @bdi: block device to check
> + *
> + * Return true if any other blkcg is waiting for writeback on the target block
> + * device, false otherwise.
> + */
> +bool blkcg_wb_waiters_on_bdi(struct backing_dev_info *bdi)
> +{
> + struct blkcg *blkcg, *curr_blkcg;
> + bool ret = false;
> +
> + if (unlikely(!bdi))
> + return false;
> +
> + rcu_read_lock();
> + curr_blkcg = css_to_blkcg(task_css(current, io_cgrp_id));

Sorry, the logic is messed up here. We shouldn't get curr_blkcg from the
current task, because during writeback throttling the context is
obviously not the current task.

I'll post a new patch soon.

> + list_for_each_entry_rcu(blkcg, &bdi->cgwb_waiters, cgwb_wait_node)
> + if (blkcg != curr_blkcg) {
> + ret = true;
> + break;
> + }
> + rcu_read_unlock();
> +
> + return ret;
> +}

-Andrea

\
 
 \ /
  Last update: 2019-02-09 14:53    [W:0.059 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site