Re: [PATCH 1/2] md: make devices disappear when they are no longerneeded.

From: Tejun Heo
Date: Mon Nov 24 2008 - 09:05:30 EST


Al Viro wrote:
> On Mon, Nov 24, 2008 at 03:56:12PM +0900, Tejun Heo wrote:
>
>> mddev holds module reference and till the gendisk is gone mddev won't
>> be gone, so as long as gendisk is around the respective mddev and
>> md.ko are around.
>
> It doesn't and it *could* *not* - you can't drop the final reference to
> module from within that module, period.

Yeap, right, I was confused. Referencing self doesn't make any sense.
Got confused with holding sub modules and the days when there was no
preemption inside kernel. I think there still might be some remnants
of those in SCSI but I need to look again.

>> I don't think it's necessary to allow modules to unload while devices
>> are hot.
>
> gendisk may stay referenced past the point when everything got closed
> and unregistered.

Can we then make gendisk hold owner module till it gets released? It
would be much nicer to write code to if we can keep the regular object
reference counting across module boundaries and being able to taking
down a module while devices are active isn't a too important
requirement. For vast majoerity (ide, scsi, md) one way or the other
doesn't even matter at all.

Thanks.

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