Re: [PATCHSET] mempool, percpu, blkcg: fix percpu stat allocationand remove stats_lock

From: Tejun Heo
Date: Mon Mar 05 2012 - 12:45:22 EST


Hello,

On Mon, Feb 27, 2012 at 09:40:45AM -0500, Vivek Goyal wrote:
> So we call following.
>
> elevator_switch()
> blkg_destroy_all()
> update_root_blkg();
>
> Here update_root_blkg() will free up the blkg->pd for cfq.
>
> And later we call.
>
> elevator_exit()
> cfq_exit_queue()
> cfq_put_async_queues()
> cfq_put_queue()
> blkg_put(cfqg_to_blkg(cfqg)); <------ trying to reach blkg through
> already freed policy data.
>
> So we should not free up root group policy data till old elevator has
> exited.

Yeah, this analysis seems correct. For some reason, I still can't
reproduce it even with slab debugging turned on. I modified the free
path to fill *pd with pattern w/o actually freeing it and now can see
similar crashes. Will post fix soon.

Thanks a lot.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/