On Mon, Jul 01, 2024 at 12:52:59PM +0000, Xiu Jianfeng wrote: > + if (new_usage > READ_ONCE(res->watermark)) > + WRITE_ONCE(res->watermark, new_usage); It'd be better to do cmpxchg loop on update. That doesn't make it noticeably more expensive and the peak tracking would actually be accurate. Thanks. -- tejun