All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mel Gorman <mgorman@techsingularity.net>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-mm@kvack.org
Subject: Re: [bug report] mm, compaction: round-robin the order while searching the free lists for a target
Date: Wed, 9 Jan 2019 10:35:43 +0000	[thread overview]
Message-ID: <20190109103543.GT31517@techsingularity.net> (raw)
In-Reply-To: <20190109102546.GS31517@techsingularity.net>

On Wed, Jan 09, 2019 at 10:25:46AM +0000, Mel Gorman wrote:
> On Wed, Jan 09, 2019 at 11:27:33AM +0300, Dan Carpenter wrote:
> > Hello Mel Gorman,
> > 
> > The patch 1688e2896de4: "mm, compaction: round-robin the order while
> > searching the free lists for a target" from Jan 8, 2019, leads to the
> > following static checker warning:
> > 
> > 	mm/compaction.c:1252 next_search_order()
> > 	warn: impossible condition '(cc->search_order < 0) => (0-u16max < 0)'
> > 
> 
> Thanks Dan!
> 
> Does the following combination of two patches address it? The two
> patches address separate problems with two patches in the series.
> 

Sending a version that was actually committed might help.

diff --git a/mm/compaction.c b/mm/compaction.c
index 6720234dc701..399dea80d09b 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -1269,6 +1269,10 @@ fast_isolate_freepages(struct compact_control *cc)
 	bool scan_start = false;
 	int order;
 
+	/* Full compaction passes in a negative order */
+	if (cc->order <= 0)
+		return cc->free_pfn;
+
 	/*
 	 * If starting the scan, use a deeper search and use the highest
 	 * PFN found if a suitable one is not found.
diff --git a/mm/internal.h b/mm/internal.h
index 6b1e5e313855..bebfb4b655dd 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -192,7 +192,7 @@ struct compact_control {
 	unsigned long total_migrate_scanned;
 	unsigned long total_free_scanned;
 	unsigned short fast_search_fail;/* failures to use free list searches */
-	unsigned short search_order;	/* order to start a fast search at */
+	short search_order;		/* order to start a fast search at */
 	const gfp_t gfp_mask;		/* gfp mask of a direct compactor */
 	int order;			/* order a direct compactor needs */
 	int migratetype;		/* migratetype of direct compactor */

-- 
Mel Gorman
SUSE Labs

      parent reply	other threads:[~2019-01-09 10:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-09  8:27 [bug report] mm, compaction: round-robin the order while searching the free lists for a target Dan Carpenter
2019-01-09 10:25 ` Mel Gorman
2019-01-09 10:28   ` Dan Carpenter
2019-01-09 10:35   ` Mel Gorman [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=20190109103543.GT31517@techsingularity.net \
    --to=mgorman@techsingularity.net \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-mm@kvack.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 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.