Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1238498
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 3/5] writeback: bdi_writeback iteration must not skip dying ones |
| Date | 2015-10-02 20:20 +0200 |
| Message-ID | <qfd61-2L2-9@gated-at.bofh.it> (permalink) |
| References | <qe6gh-3Gy-5@gated-at.bofh.it> <qe6gj-3Gy-39@gated-at.bofh.it> <qf9lM-5Mt-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Oct 02, 2015 at 04:12:12PM +0200, Jan Kara wrote:
> > + if (last_wb) {
> > + wb_put(last_wb);
> > + last_wb = NULL;
> > + }
>
> But you seem to forget to drop last_wb reference in case this was the last
> wb in the list, don't you?
You're right. Will update the patch.
> > @@ -686,6 +691,9 @@ static void cgwb_bdi_destroy(struct backing_dev_info *bdi)
> > radix_tree_for_each_slot(slot, &bdi->cgwb_tree, &iter, 0)
> > cgwb_kill(*slot);
> >
> > + /* wb may get released after @bdi is freed, sever list head */
> > + list_del(&bdi->wb_list);
> > +
>
> But we wait for bdi->usage_cnt to drop to 0 which means there's no wb,
> don't we? What am I missing?
And I forgot that we were doing that. This isn't necessary.
> > @@ -764,15 +772,22 @@ static void cgwb_bdi_destroy(struct backing_dev_info *bdi) { }
> >
> > int bdi_init(struct backing_dev_info *bdi)
> > {
> > + int ret;
> > +
> > bdi->dev = NULL;
> >
> > bdi->min_ratio = 0;
> > bdi->max_ratio = 100;
> > bdi->max_prop_frac = FPROP_FRAC_BASE;
> > INIT_LIST_HEAD(&bdi->bdi_list);
> > + INIT_LIST_HEAD(&bdi->wb_list);
> > init_waitqueue_head(&bdi->wb_waitq);
> >
> > - return cgwb_bdi_init(bdi);
> > + ret = cgwb_bdi_init(bdi);
> > +
> > + list_add_tail_rcu(&bdi->wb.bdi_node, &bdi->wb_list);
>
> Won't this be more logical in cgwb_bdi_init()?
bdi->wb_list exists whether cgwb is enabled or not, so if we move this
to cgwb_bdi_init(), we'll be duplicating it in both paths.
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCHSET block/for-linus] writeback: cgroup writeback fixes Tejun Heo <tj@kernel.org> - 2015-09-29 18:50 +0200
[PATCH 3/5] writeback: bdi_writeback iteration must not skip dying ones Tejun Heo <tj@kernel.org> - 2015-09-29 18:50 +0200
Re: [PATCH 3/5] writeback: bdi_writeback iteration must not skip dying ones Jan Kara <jack@suse.cz> - 2015-10-02 16:20 +0200
Re: [PATCH 3/5] writeback: bdi_writeback iteration must not skip dying ones Tejun Heo <tj@kernel.org> - 2015-10-02 20:20 +0200
[PATCH v2 3/5] writeback: bdi_writeback iteration must not skip dying ones Tejun Heo <tj@kernel.org> - 2015-10-02 20:50 +0200
Re: [PATCHSET block/for-linus] writeback: cgroup writeback fixes Tejun Heo <tj@kernel.org> - 2015-09-29 19:00 +0200
csiph-web