Message ID | 20241206013512.2883617-2-chenridong@huaweicloud.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Some cleanup for memcg | expand |
On Fri, Dec 06, 2024 at 01:35:08AM GMT, Chen Ridong <chenridong@huaweicloud.com> wrote: > From: Chen Ridong <chenridong@huawei.com> > > The 'OFP_PEAK_UNSET' has been defined, use it instead of '-1'. > > Signed-off-by: Chen Ridong <chenridong@huawei.com> > --- > mm/memcontrol.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Michal Koutný <mkoutny@suse.com>
On Tue, Dec 17, 2024 at 7:27 AM Michal Koutný <mkoutny@suse.com> wrote: > > On Fri, Dec 06, 2024 at 01:35:08AM GMT, Chen Ridong <chenridong@huaweicloud.com> wrote: > > From: Chen Ridong <chenridong@huawei.com> > > > > The 'OFP_PEAK_UNSET' has been defined, use it instead of '-1'. > > > > Signed-off-by: Chen Ridong <chenridong@huawei.com> > > --- > > mm/memcontrol.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > Reviewed-by: Michal Koutný <mkoutny@suse.com> Thanks for cleaning this up! Acked-By: David Finkel <davidf@vimeo.com>
On Fri, Dec 06, 2024 at 01:35:08AM +0000, Chen Ridong wrote: > From: Chen Ridong <chenridong@huawei.com> > > The 'OFP_PEAK_UNSET' has been defined, use it instead of '-1'. > > Signed-off-by: Chen Ridong <chenridong@huawei.com> Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 7b3503d12aaf..fc18633aba5d 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -4014,7 +4014,7 @@ static ssize_t peak_write(struct kernfs_open_file *of, char *buf, size_t nbytes, WRITE_ONCE(peer_ctx->value, usage); /* initial write, register watcher */ - if (ofp->value == -1) + if (ofp->value == OFP_PEAK_UNSET) list_add(&ofp->list, watchers); WRITE_ONCE(ofp->value, usage);