Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe:
"Mainly sending this off now for the writeback fixes, since they fix a
real regression introduced with the cgroup writeback changes. The
NVMe fix could wait for next pull for this series, but it's simple
enough that we might as well include it.
This contains:
- two cgroup writeback fixes from Tejun, fixing a user reported issue
with luks crypt devices hanging when being closed.
- NVMe error cleanup fix from Jon Derrick, fixing a case where we'd
attempt to free an unregistered IRQ"
* 'for-linus' of git://git.kernel.dk/linux-block:
NVMe: Fix irq freeing when queue_request_irq fails
writeback: don't drain bdi_writeback_congested on bdi destruction
writeback: don't embed root bdi_writeback_congested in bdi_writeback
This commit is contained in:
commit
1e512b08da
4 changed files with 77 additions and 52 deletions
|
|
@ -50,10 +50,10 @@ enum wb_stat_item {
|
|||
*/
|
||||
struct bdi_writeback_congested {
|
||||
unsigned long state; /* WB_[a]sync_congested flags */
|
||||
atomic_t refcnt; /* nr of attached wb's and blkg */
|
||||
|
||||
#ifdef CONFIG_CGROUP_WRITEBACK
|
||||
struct backing_dev_info *bdi; /* the associated bdi */
|
||||
atomic_t refcnt; /* nr of attached wb's and blkg */
|
||||
int blkcg_id; /* ID of the associated blkcg */
|
||||
struct rb_node rb_node; /* on bdi->cgwb_congestion_tree */
|
||||
#endif
|
||||
|
|
@ -150,11 +150,12 @@ struct backing_dev_info {
|
|||
atomic_long_t tot_write_bandwidth;
|
||||
|
||||
struct bdi_writeback wb; /* the root writeback info for this bdi */
|
||||
struct bdi_writeback_congested wb_congested; /* its congested state */
|
||||
#ifdef CONFIG_CGROUP_WRITEBACK
|
||||
struct radix_tree_root cgwb_tree; /* radix tree of active cgroup wbs */
|
||||
struct rb_root cgwb_congested_tree; /* their congested states */
|
||||
atomic_t usage_cnt; /* counts both cgwbs and cgwb_contested's */
|
||||
#else
|
||||
struct bdi_writeback_congested *wb_congested;
|
||||
#endif
|
||||
wait_queue_head_t wb_waitq;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
#include <linux/writeback.h>
|
||||
#include <linux/blk-cgroup.h>
|
||||
#include <linux/backing-dev-defs.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
int __must_check bdi_init(struct backing_dev_info *bdi);
|
||||
void bdi_destroy(struct backing_dev_info *bdi);
|
||||
|
|
@ -465,11 +466,14 @@ static inline bool inode_cgwb_enabled(struct inode *inode)
|
|||
static inline struct bdi_writeback_congested *
|
||||
wb_congested_get_create(struct backing_dev_info *bdi, int blkcg_id, gfp_t gfp)
|
||||
{
|
||||
return bdi->wb.congested;
|
||||
atomic_inc(&bdi->wb_congested->refcnt);
|
||||
return bdi->wb_congested;
|
||||
}
|
||||
|
||||
static inline void wb_congested_put(struct bdi_writeback_congested *congested)
|
||||
{
|
||||
if (atomic_dec_and_test(&congested->refcnt))
|
||||
kfree(congested);
|
||||
}
|
||||
|
||||
static inline struct bdi_writeback *wb_find_current(struct backing_dev_info *bdi)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue