[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YFIOTTC7wgXHQRpy@dhcp22.suse.cz>
Date: Wed, 17 Mar 2021 15:12:29 +0100
From: Michal Hocko <mhocko@...e.com>
To: Oscar Salvador <osalvador@...e.de>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Vlastimil Babka <vbabka@...e.cz>,
David Hildenbrand <david@...hat.com>,
Muchun Song <songmuchun@...edance.com>,
Mike Kravetz <mike.kravetz@...cle.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 2/5] mm,compaction: Let
isolate_migratepages_{range,block} return error codes
On Wed 17-03-21 12:12:48, Oscar Salvador wrote:
> Currently, isolate_migratepages_{range,block} and their callers use
> a pfn == 0 vs pfn != 0 scheme to let the caller know whether there was
> any error during isolation.
> This does not work as soon as we need to start reporting different error
> codes and make sure we pass them down the chain, so they are properly
> interpreted by functions like e.g: alloc_contig_range.
>
> Let us rework isolate_migratepages_{range,block} so we can report error
> codes.
Yes this is an improvement.
> Since isolate_migratepages_block will stop returning the next pfn to be
> scanned, we reuse the cc->migrate_pfn field to keep track of that.
This looks hakish and I cannot really tell that users of cc->migrate_pfn
work as intended.
> @@ -810,6 +811,8 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
> unsigned long next_skip_pfn = 0;
> bool skip_updated = false;
>
> + cc->migrate_pfn = low_pfn;
> +
> /*
> * Ensure that there are not too many pages isolated from the LRU
> * list by either parallel reclaimers or compaction. If there are,
> @@ -818,16 +821,16 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
> while (unlikely(too_many_isolated(pgdat))) {
> /* stop isolation if there are still pages not migrated */
> if (cc->nr_migratepages)
> - return 0;
> + return -EINTR;
>
> /* async migration should just abort */
> if (cc->mode == MIGRATE_ASYNC)
> - return 0;
> + return -EINTR;
EINTR for anything other than signal based bail out is really confusing.
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists