[pve-devel] [PATCH cluster v4 1/2] status: introduce new pve-{type}- rrd and metric format
Thomas Lamprecht
t.lamprecht at proxmox.com
Thu Jul 31 05:23:07 CEST 2025
Am 29.07.25 um 11:44 schrieb Lukas Wagner:
>> +// A 4k buffer should be plenty to temporarily store RRD data. 64 bit integers are 20 chars long,
>> +// plus the separator char: (4096-1)/21~195 columns This buffer is only used in the
>> +// `update_rrd_data` function. It is safe to use as the calling sites get the global mutex:
>> +// rrd_update_data -> rrdentry_hash_set -> cfs_status_set / and cfs_kvstore_node_set
>> +static char rrd_format_update_buffer[4096];
> Maybe I'm missing something, but since this is only used in the
> update_rrd_data function, is there any reason why this statically
> allocated and not just malloc'd as needed?
For the record: I nudged Aaron in that direction in a previous review, IMO a
small static buffer can sometimes be easier to handle compared to malloc, and
definitively could be more performant that frequent malloc+free sequences, but
performance probably is not really impacted here in any case.
More information about the pve-devel
mailing list