From: Mel Gorman <mgorman@techsingularity.net>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Wonhyuk Yang <vvghjk1234@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org
Subject: Re: [PATCH v2] mm/compactoin: Fix misbehaviors of fast_find_migrateblock()
Date: Thu, 28 Jan 2021 14:22:57 +0000 [thread overview]
Message-ID: <20210128142257.GG3592@techsingularity.net> (raw)
In-Reply-To: <095faeec-ecb1-77c8-6118-267d28710508@suse.cz>
On Thu, Jan 28, 2021 at 03:01:27PM +0100, Vlastimil Babka wrote:
> On 1/28/21 2:50 PM, Wonhyuk Yang wrote:
> > On Thu, Jan 28, 2021 at 10:25 PM Mel Gorman <mgorman@techsingularity.net> wrote:
> >>
> >> As nr_scanned is post-incremented, this will still consider if the page
> >> should be used when the limit is reached. ++nr_scanned?
> >
> > Hi,
> >
> > Let's consider that limit is 4, nr_scanned is 0 and loop until reach the limit.
> > 1) pre-increment: it will search three times.(0,1,2)
> > 2) post-increment: it will search four times. (0,1,2,3)
> >
> > So you mean that searching three times is correct?
>
> 1) will match the outer loop's "nr_scanned < limit;" condition. It doesn't
> matter that much in practice, but for consistency sake, it should be 1)
Ok, while I find it a little strange to enter the loop and then break
immediately due to the limit, it's a marginal difference and in general,
the patch makes sense.
--
Mel Gorman
SUSE Labs
next prev parent reply other threads:[~2021-01-28 14:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-28 13:04 Wonhyuk Yang
2021-01-28 13:25 ` Mel Gorman
2021-01-28 13:50 ` Wonhyuk Yang
2021-01-28 14:01 ` Vlastimil Babka
2021-01-28 14:22 ` Mel Gorman [this message]
2021-01-28 14:31 ` Wonhyuk Yang
2021-01-28 14:40 ` Vlastimil Babka
2021-01-28 14:49 ` Wonhyuk Yang
2021-01-28 14:34 ` Vlastimil Babka
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=20210128142257.GG3592@techsingularity.net \
--to=mgorman@techsingularity.net \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=vbabka@suse.cz \
--cc=vvghjk1234@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox