Re: [PATCH 01/14] resource limits: foundation for resource highwater tracking

From: Nicolas Dichtel
Date: Fri Jul 15 2016 - 13:57:18 EST


Le 15/07/2016 18:27, Topi Miettinen a Ãcrit :
[snip]
>> Why playing with version number? It complexifies the (userland) code and
>> existing applications break when the kernel is updated.
>> Goal of netlink is to be easily extensible. By adding a new attribute, existing
>> userspace tools won't break.
>
> I just followed this text in taskstats.h. Does that give wrong advice?
>
> * The struct is versioned. Newer versions should only add fields to
> * the bottom of the struct to maintain backward compatibility.
> *
> *
> * To add new fields
> * a) bump up TASKSTATS_VERSION
> * b) add comment indicating new version number at end of struct
> * c) add new fields after version comment; maintain 64-bit alignment
I don't know taskstats well, but that is not how netlink works. There is no need
to manage a version with netlink, just add new attributes.


Regards,
Nicolas