Messages in this thread | | | From | 禹舟键 <> | Date | Fri, 22 Jun 2018 17:33:12 +0800 | Subject | Re: [PATCH v9] Refactor part of the oom report in dump_header |
| |
Hi Michal > diff --git a/include/linux/oom.h b/include/linux/oom.h > index 6adac113e96d..5bed78d4bfb8 100644 > --- a/include/linux/oom.h > +++ b/include/linux/oom.h > @@ -15,6 +15,20 @@ struct notifier_block; > struct mem_cgroup; > struct task_struct; > > +enum oom_constraint { > + CONSTRAINT_NONE, > + CONSTRAINT_CPUSET, > + CONSTRAINT_MEMORY_POLICY, > + CONSTRAINT_MEMCG, > +}; > + > +static const char * const oom_constraint_text[] = { > + [CONSTRAINT_NONE] = "CONSTRAINT_NONE", > + [CONSTRAINT_CPUSET] = "CONSTRAINT_CPUSET", > + [CONSTRAINT_MEMORY_POLICY] = "CONSTRAINT_MEMORY_POLICY", > + [CONSTRAINT_MEMCG] = "CONSTRAINT_MEMCG", > +};
> I've suggested that this should be a separate patch. I've separate this part in patch v7.
[PATCH v7 1/2] Add an array of const char and enum oom_constraint in memcontrol.h On Sat 02-06-18 19:58:51, ufo19890607@gmail.com wrote: >> From: yuzhoujian <yuzhoujian@didichuxing.com> >> >> This patch will make some preparation for the follow-up patch: Refactor >> part of the oom report in dump_header. It puts enum oom_constraint in >> memcontrol.h and adds an array of const char for each constraint.
> I do not get why you separate this specific part out. > oom_constraint_text is not used in the patch. It is almost always > preferable to have a user of newly added functionality.
So do I need to separate this part ?
Thanks
| |