Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309283
b: refs/heads/master
c: ff26eaa
h: refs/heads/master
i:
  309281: c74f7eb
  309279: a2f79ef
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed May 23, 2012
1 parent b5f82a6 commit 000b7e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0b7877d4eea3f93e3dd941999522bbd8c538cb53
refs/heads/master: ff26eaadf4d914e397872b99885d45756104e9ae
10 changes: 6 additions & 4 deletions trunk/block/blk-throttle.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ static void tg_stats_alloc_fn(struct work_struct *work)
static void throtl_pd_init(struct blkcg_gq *blkg)
{
struct throtl_grp *tg = blkg_to_tg(blkg);
unsigned long flags;

RB_CLEAR_NODE(&tg->rb_node);
bio_list_init(&tg->bio_lists[0]);
Expand All @@ -235,19 +236,20 @@ static void throtl_pd_init(struct blkcg_gq *blkg)
* but percpu allocator can't be called from IO path. Queue tg on
* tg_stats_alloc_list and allocate from work item.
*/
spin_lock(&tg_stats_alloc_lock);
spin_lock_irqsave(&tg_stats_alloc_lock, flags);
list_add(&tg->stats_alloc_node, &tg_stats_alloc_list);
queue_delayed_work(system_nrt_wq, &tg_stats_alloc_work, 0);
spin_unlock(&tg_stats_alloc_lock);
spin_unlock_irqrestore(&tg_stats_alloc_lock, flags);
}

static void throtl_pd_exit(struct blkcg_gq *blkg)
{
struct throtl_grp *tg = blkg_to_tg(blkg);
unsigned long flags;

spin_lock(&tg_stats_alloc_lock);
spin_lock_irqsave(&tg_stats_alloc_lock, flags);
list_del_init(&tg->stats_alloc_node);
spin_unlock(&tg_stats_alloc_lock);
spin_unlock_irqrestore(&tg_stats_alloc_lock, flags);

free_percpu(tg->stats_cpu);
}
Expand Down

0 comments on commit 000b7e8

Please sign in to comment.