All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Geliang Tang <geliangtang@163.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
	cgroups@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/memcontrol.c: use list_{first,next}_entry
Date: Mon, 7 Dec 2015 17:21:03 +0100	[thread overview]
Message-ID: <20151207162102.GC20774@dhcp22.suse.cz> (raw)
In-Reply-To: <20151205025542.GB9812@bogon>

On Sat 05-12-15 10:55:42, Geliang Tang wrote:
> On Thu, Dec 03, 2015 at 05:27:18PM +0100, Michal Hocko wrote:
> > On Thu 03-12-15 22:16:55, Geliang Tang wrote:
> > > To make the intention clearer, use list_{first,next}_entry instead
> > > of list_entry.
> > 
> > Does this really help readability? This function simply uncharges the
> > given list of pages. Why cannot we simply use list_for_each_entry
> > instead...
> 
> I have tested it, list_for_each_entry can't work. Dose it mean that my
> patch is OK? Or please give me some other advices.

I dunno. Your change is technically correct of course. I find the exit
condition easier to read without your patch though.

-- 
Michal Hocko
SUSE Labs

WARNING: multiple messages have this Message-ID (diff)
From: Michal Hocko <mhocko@kernel.org>
To: Geliang Tang <geliangtang@163.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
	cgroups@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/memcontrol.c: use list_{first,next}_entry
Date: Mon, 7 Dec 2015 17:21:03 +0100	[thread overview]
Message-ID: <20151207162102.GC20774@dhcp22.suse.cz> (raw)
In-Reply-To: <20151205025542.GB9812@bogon>

On Sat 05-12-15 10:55:42, Geliang Tang wrote:
> On Thu, Dec 03, 2015 at 05:27:18PM +0100, Michal Hocko wrote:
> > On Thu 03-12-15 22:16:55, Geliang Tang wrote:
> > > To make the intention clearer, use list_{first,next}_entry instead
> > > of list_entry.
> > 
> > Does this really help readability? This function simply uncharges the
> > given list of pages. Why cannot we simply use list_for_each_entry
> > instead...
> 
> I have tested it, list_for_each_entry can't work. Dose it mean that my
> patch is OK? Or please give me some other advices.

I dunno. Your change is technically correct of course. I find the exit
condition easier to read without your patch though.

-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2015-12-07 16:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-03 14:16 [PATCH] mm/memcontrol.c: use list_{first,next}_entry Geliang Tang
2015-12-03 14:16 ` Geliang Tang
2015-12-03 14:16 ` Geliang Tang
2015-12-03 16:27 ` Michal Hocko
2015-12-03 16:27   ` Michal Hocko
2015-12-03 16:27   ` Michal Hocko
2015-12-03 19:27   ` Johannes Weiner
2015-12-03 19:27     ` Johannes Weiner
2015-12-03 19:27     ` Johannes Weiner
2015-12-04  8:46     ` Michal Hocko
2015-12-04  8:46       ` Michal Hocko
2015-12-04  8:46       ` Michal Hocko
2015-12-05  2:55   ` Geliang Tang
2015-12-05  2:55     ` Geliang Tang
2015-12-05 16:22     ` Johannes Weiner
2015-12-05 16:22       ` Johannes Weiner
2015-12-07 16:21     ` Michal Hocko [this message]
2015-12-07 16:21       ` 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=20151207162102.GC20774@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=geliangtang@163.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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.