linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Zi Yan <ziy@nvidia.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Doug Berger <opendmb@gmail.com>,
	linux-mm@kvack.org, David Hildenbrand <david@redhat.com>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] mm/page_isolation: fix isolate_single_pageblock() isolation behavior
Date: Wed, 14 Sep 2022 18:47:26 -0400	[thread overview]
Message-ID: <04AD3C98-5BD5-47CB-8B26-945D03BAD9E5@nvidia.com> (raw)
In-Reply-To: <20220914154225.e3f8ad4b076236c75705b0f9@linux-foundation.org>

[-- Attachment #1: Type: text/plain, Size: 1436 bytes --]

On 14 Sep 2022, at 18:42, Andrew Morton wrote:

> On Tue, 13 Sep 2022 22:39:13 -0400 Zi Yan <zi.yan@sent.com> wrote:
>
>> set_migratetype_isolate() does not allow isolating MIGRATE_CMA pageblocks
>> unless it is used for CMA allocation. isolate_single_pageblock() did not
>> have the same behavior when it is used together with
>> set_migratetype_isolate() in start_isolate_page_range(). This allows
>> alloc_contig_range() with migratetype other than MIGRATE_CMA, like
>> MIGRATE_MOVABLE (used by alloc_contig_pages()), to isolate first and last
>> pageblock but fail the rest. The failure leads to changing migratetype
>> of the first and last pageblock to MIGRATE_MOVABLE from MIGRATE_CMA,
>> corrupting the CMA region. This can happen during gigantic page
>> allocations.
>
> How does this bug manifest itself as far as the user is concerned?

Like Doug said here: https://lore.kernel.org/linux-mm/a3363a52-883b-dcd1-b77f-f2bb378d6f2d@gmail.com/T/#u,
for gigantic page allocations, the user would notice no difference, since
the allocation on CMA region will fail as well as it did before. But
it might hurt the performance of device drivers that use CMA, since
CMA region size decreases.


>
>> Fix it by passing migratetype into isolate_single_pageblock(), so that
>> set_migratetype_isolate() used by isolate_single_pageblock() will prevent
>> the isolation happening.


--
Best Regards,
Yan, Zi

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 854 bytes --]

      reply	other threads:[~2022-09-14 22:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14  2:39 Zi Yan
2022-09-14 22:42 ` Andrew Morton
2022-09-14 22:47   ` Zi Yan [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=04AD3C98-5BD5-47CB-8B26-945D03BAD9E5@nvidia.com \
    --to=ziy@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=opendmb@gmail.com \
    --cc=stable@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox