Re: [PATCH 02/10] block: fix genhd refcounting inblkio_policy_parse_and_set()

From: Tejun Heo
Date: Wed Oct 19 2011 - 19:51:56 EST


Hello, again.

(cc'ing containers list and Kay)

The original thread is at

http://thread.gmane.org/gmane.linux.kernel/1205150/focus=1205160

and it's about retaining blkiocg rules across device destruction.

On Wed, Oct 19, 2011 at 03:07:17PM -0700, Tejun Heo wrote:
> On Wed, Oct 19, 2011 at 03:05:53PM -0700, Tejun Heo wrote:
> > Hmmm.... I don't know. If we're gonna bind rule existence to that of
>
> Heh, I meant to say, "if those two are unbound,"
>
> > device, wouldn't it be better to simply not check whether the device
> > exists? The current behavior seems pretty confusing to me.

I've been thinking about it and the more I think about it, the current
behavior seems just wrong. Device node # doesn't mean anything before
a device actually appears there. There is no way userland can know
deterministically how the device node allocation would end up.

For example, sd allocates minors according to internal ida allocation
which is freed on scsi_disk_release() - ie. when all *kernel*
references go away which the userland has no way to find out until
after new device comes up with a different devt.

For EXT_DEVT devices, this becomes even less meaingful. There is
absolutely no guarantee what devno would mean what. devno which is
currently assigned to the whole disk now can be reassigned to a
partition. There absolutely is no rule regarding who gets what
numbers. ie. This can end up with rules pointing to partitions.

Moreover, it doesn't even make the implementation simpler. blkiocg
currently keeps a separate list of policies so that they don't
disappear along with blkg's.

The only way applying rules to dynamic devices can work is doing the
proper dynamic configuration off udev and friends.

Can we *please* get rid of this misfeature?

Thank you.

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