All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: 禹舟键 <ufo19890607@gmail.com>
Cc: akpm@linux-foundation.org, rientjes@google.com,
	kirill.shutemov@linux.intel.com, aarcange@redhat.com,
	penguin-kernel@i-love.sakura.ne.jp, guro@fb.com,
	yang.s@alibaba-inc.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,
	Wind Yu <yuzhoujian@didichuxing.com>
Subject: Re: [PATCH v9] Refactor part of the oom report in dump_header
Date: Fri, 22 Jun 2018 12:42:17 +0200	[thread overview]
Message-ID: <20180622104217.GV10465@dhcp22.suse.cz> (raw)
In-Reply-To: <CAHCio2jkE2FGc2g48jm+ddvEbN3hEOoohBM+-871v32N2i2gew@mail.gmail.com>

On Fri 22-06-18 17:33:12, 禹舟键 wrote:
> 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 ?

You misunderstood my suggestion. Let me be more specific. Please
separate the whole new oom_constraint including its _usage_.
-- 
Michal Hocko
SUSE Labs

WARNING: multiple messages have this Message-ID (diff)
From: Michal Hocko <mhocko@kernel.org>
To: 禹舟键 <ufo19890607@gmail.com>
Cc: akpm@linux-foundation.org, rientjes@google.com,
	kirill.shutemov@linux.intel.com, aarcange@redhat.com,
	penguin-kernel@i-love.sakura.ne.jp, guro@fb.com,
	yang.s@alibaba-inc.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,
	Wind Yu <yuzhoujian@didichuxing.com>
Subject: Re: [PATCH v9] Refactor part of the oom report in dump_header
Date: Fri, 22 Jun 2018 12:42:17 +0200	[thread overview]
Message-ID: <20180622104217.GV10465@dhcp22.suse.cz> (raw)
In-Reply-To: <CAHCio2jkE2FGc2g48jm+ddvEbN3hEOoohBM+-871v32N2i2gew@mail.gmail.com>

On Fri 22-06-18 17:33:12, c|1e??e?(R) wrote:
> 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 ?

You misunderstood my suggestion. Let me be more specific. Please
separate the whole new oom_constraint including its _usage_.
-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2018-06-22 10:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-15  9:52 [PATCH v9] Refactor part of the oom report in dump_header ufo19890607
2018-06-22  6:33 ` 禹舟键
2018-06-22  8:39 ` Michal Hocko
2018-06-22  9:33   ` 禹舟键
2018-06-22 10:42     ` Michal Hocko [this message]
2018-06-22 10:42       ` Michal Hocko
2018-06-22 11:40       ` 禹舟键
2018-06-22 12:19         ` Michal Hocko
2018-06-22 12:19           ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180622104217.GV10465@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=guro@fb.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=rientjes@google.com \
    --cc=ufo19890607@gmail.com \
    --cc=yang.s@alibaba-inc.com \
    --cc=yuzhoujian@didichuxing.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.