Re: Kernel crash in icq_free_icq_rcu

From: Jens Axboe
Date: Wed Jan 18 2012 - 11:25:19 EST


On 2012-01-18 17:09, Tejun Heo wrote:
> On Wed, Jan 18, 2012 at 09:20:05AM -0500, Vivek Goyal wrote:
>>> Not allocating icq if request is never going to go to elevator as elevator
>>> switch was happening makes sense to me.
>>>
>>> I tried this patch. It went little further and crashed at a different
>>> place. I think this seems to be separate merging issue Tejun is trying
>>> to track down.
>>
>> Applied Tejun's debug patch to return early and not call into elevator
>> for checking whether merge is allowed or not. Things seems to be stable
>> now for me.
>
> Yeah, plug merge is calling into elevator code without any
> synchronization, so it's bound to be broken. Given plugging is
> per-task, I don't think we really need to query elevator about merging
> bio's. The request is not on elevator and plugging is part of issuing
> mechanism, not scheduling, after all. Jens, what do you think?

Hmmm. We can bypass asking the elevator, as long as we query the
restrictions. Does the below, by itself, resolve the crash? If yes, let
me cook up a patch splitting the elv and blk rq merging logic.

diff --git a/block/elevator.c b/block/elevator.c
index 91e18f8..c2f319a 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -105,8 +105,10 @@ int elv_rq_merge_ok(struct request *rq, struct bio *bio)
if (bio_integrity(bio) != blk_integrity_rq(rq))
return 0;

+#if 0
if (!elv_iosched_allow_merge(rq, bio))
return 0;
+#endif

return 1;
}

--
Jens Axboe

--
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/