linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
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:01:27 +0100	[thread overview]
Message-ID: <095faeec-ecb1-77c8-6118-267d28710508@suse.cz> (raw)
In-Reply-To: <CAEcHRTodemE6JazJGctUskkB4JxutKc-8PQXQx9DV7XNh1wxBQ@mail.gmail.com>

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)


  reply	other threads:[~2021-01-28 14:01 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 [this message]
2021-01-28 14:22       ` Mel Gorman
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=095faeec-ecb1-77c8-6118-267d28710508@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