Messages in this thread | | | From | Jeff Moyer <> | Subject | Re: [PATCH]cfq-iosched: fix an oops caused by slab leak | Date | Wed, 26 May 2010 15:42:57 -0400 |
| |
Shaohua Li <shaohua.li@intel.com> writes:
> I got below oops when unloading cfq-iosched. Considering scenario: > queue A merge to B, C merge to D and B will be merged to D. Before B is merged > to D, we do split B. We should put B's reference for D. [...] > Signed-off-by: Shaohua Li <shaohua.li@intel.com> > > diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c > index ed897b5..855fd5f 100644 > --- a/block/cfq-iosched.c > +++ b/block/cfq-iosched.c > @@ -2537,15 +2537,10 @@ static void cfq_free_io_context(struct io_context *ioc) > __call_for_each_cic(ioc, cic_free_func); > } > > -static void cfq_exit_cfqq(struct cfq_data *cfqd, struct cfq_queue *cfqq) > +static void cfq_put_cooperator(struct cfq_queue *cfqq) > { > struct cfq_queue *__cfqq, *next; > > - if (unlikely(cfqq == cfqd->active_queue)) { > - __cfq_slice_expired(cfqd, cfqq, 0); > - cfq_schedule_dispatch(cfqd); > - } > - > /* > * If this queue was scheduled to merge with another queue, be > * sure to drop the reference taken on that queue (and others in > @@ -2561,6 +2556,16 @@ static void cfq_exit_cfqq(struct cfq_data *cfqd, struct cfq_queue *cfqq) > cfq_put_queue(__cfqq); > __cfqq = next; > } > +} > + > +static void cfq_exit_cfqq(struct cfq_data *cfqd, struct cfq_queue *cfqq) > +{ > + if (unlikely(cfqq == cfqd->active_queue)) { > + __cfq_slice_expired(cfqd, cfqq, 0); > + cfq_schedule_dispatch(cfqd); > + } > + > + cfq_put_cooperator(cfqq); > > cfq_put_queue(cfqq); > } > @@ -3516,6 +3521,9 @@ split_cfqq(struct cfq_io_context *cic, struct cfq_queue *cfqq) > } > > cic_set_cfqq(cic, NULL, 1); > + > + cfq_put_cooperator(cfqq); > + > cfq_put_queue(cfqq); > return NULL; > }
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
| |