From: Vlastimil Babka <vbabka@suse.cz>
To: Wonhyuk Yang <vvghjk1234@gmail.com>,
Mel Gorman <mgorman@techsingularity.net>
Cc: 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 15:40:34 +0100 [thread overview]
Message-ID: <a26dea47-aa20-156a-409f-f7a7926ea14d@suse.cz> (raw)
In-Reply-To: <CAEcHRTqb1FRVdpqTU6-MWBVPgO=1u1RexO2Z9zEb-HzS_c=QoQ@mail.gmail.com>
On 1/28/21 3:31 PM, Wonhyuk Yang wrote:
> On Thu, Jan 28, 2021 at 11:23 PM Mel Gorman <mgorman@techsingularity.net> wrote:
>>
>> 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)
Got confused there, it's 2) that matches the outer loop condition, so your patch
is fine.
>> 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.
>>
>
> Then, should I change post-increment to pre-increment?
IMHO, nope.
> If so, should I send a new version? It seems like it's too tiny change...
next prev parent reply other threads:[~2021-01-28 14:40 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
2021-01-28 14:31 ` Wonhyuk Yang
2021-01-28 14:40 ` Vlastimil Babka [this message]
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=a26dea47-aa20-156a-409f-f7a7926ea14d@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--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