All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wonhyuk Yang <vvghjk1234@gmail.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Mel Gorman <mgorman@techsingularity.net>,
	 linux-mm@kvack.org
Subject: Re: [PATCH] mm/compactoin: Fix edge case of fast_find_migrateblock()
Date: Tue, 26 Jan 2021 23:37:45 +0900	[thread overview]
Message-ID: <CAEcHRToLN3WfsJzVwKJeq9DmiRo7EJu6Kvcdq_3NVAMdo2CAVg@mail.gmail.com> (raw)
In-Reply-To: <0ed60e73-9c4f-5a62-754d-b3c864239941@suse.cz>

On Tue, Jan 26, 2021 at 1:49 AM Vlastimil Babka <vbabka@suse.cz> wrote:
>
> Maybe instead of replacing one magic value of 'pfn' with another
> (cc->migrate_pfn with high_pfn) I would just add a "bool found" and use it
> appropriately. Would make the function less subtle perhaps.

I agree. Using that bool variable will look good.

>
> While reviewing I found more potentially questionable parts, if you're interested:
>
> - if we go through "if (get_pageblock_skip(freepage))... continue;" we are
> increasing nr_scanned++; but not checking the limit.

Yes, you've got a point. I think nr_scanned checking should be first.

>
> - the "if (list_is_last(freelist, &freepage->lru)) break;" part seems
> unneccesary? if we are on the last page and just "continue;" the
> list_for_each_entry() iteration should stop anyway.
>

Yes It seems unnecessary. only if the skipped block was reordered, it
would be required.

Then I will reflect your opinion and send a new version.


      reply	other threads:[~2021-01-26 14:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-23 15:43 [PATCH] mm/compactoin: Fix edge case of fast_find_migrateblock() Wonhyuk Yang
2021-01-25 16:49 ` Vlastimil Babka
2021-01-26 14:37   ` Wonhyuk Yang [this message]

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=CAEcHRToLN3WfsJzVwKJeq9DmiRo7EJu6Kvcdq_3NVAMdo2CAVg@mail.gmail.com \
    --to=vvghjk1234@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=vbabka@suse.cz \
    /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.