Re: [PATCH 08/20] sysfs: Optimize just changing the sysfs file mode.

From: Tejun Heo
Date: Thu May 21 2009 - 04:42:44 EST


Hello,

Eric W. Biederman wrote:
>> One visible difference is lack of timestamp update. Is there any use
>> case where sysfs file mode changing needs to be fast?\
>
> Not really. If the time changes we set something besides ATTR_MODE
> like ATTR_MTIME or ATTR_CTIME. If we come in through any of the
> user space entry points ATTR_CTIME appears to be set so this optimization
> will not trigger.
>
> I think there are cases where we only opportunistically track time
> changes, when the structure is allocated that this changes but it
> is a very small percentage of the time.
>
> The practical effect of my changes should be that we only track timestamps
> when user space actually performs an explicit change to the file.
>
> If someone was depending on some weird indirect side effect like that
> on one of the 5-6 files that calls sysfs_chmod let's make it explicit.
>
> For me this isn't about making this go faster. This is about keeping
> the sysfs data structures small when we can.
>
> It doesn't really complicate the code and we wind up doing the obvious thing.

Well, it doesn't add a lot of complexity but also seems pointless when
there basically is no use case which would benefit from this change.
I suppose it's upto the maintainer. Greg?

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/