All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rik van Riel <riel@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	Mel Gorman <mel@csn.ul.ie>, Minchan Kim <minchan@kernel.org>,
	Andrea Arcangeli <aarcange@redhat.com>,
	linux-mm@kvack.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] mm: compaction: make compact_control order signed
Date: Wed, 01 Feb 2012 21:28:43 +0000	[thread overview]
Message-ID: <4F29AE8B.2020600@redhat.com> (raw)
In-Reply-To: <20120201132415.b09d8710.akpm@linux-foundation.org>

On 02/01/2012 04:24 PM, Andrew Morton wrote:
> On Wed, 01 Feb 2012 16:17:10 -0500
> Rik van Riel<riel@redhat.com>  wrote:
>
>>>> @@ -35,7 +35,7 @@ struct compact_control {
>>>>    	unsigned long migrate_pfn;	/* isolate_migratepages search base */
>>>>    	bool sync;			/* Synchronous migration */
>>>>
>>>> -	unsigned int order;		/* order a direct compactor needs */
>>>> +	int order;			/* order a direct compactor needs */
>>>>    	int migratetype;		/* MOVABLE, RECLAIMABLE etc */
>>>>    	struct zone *zone;
>>>>    };
>>>
>>> One would expect this to significantly change the behaviour of
>>> /proc/sys/vm/compact_memory.  Enfeebled minds want to know: is
>>> the new behaviour better or worse than the old behaviour?
>>
>> The old behaviour and the behaviour post Dan's fix are the
>> same.
>>
>> My patch temporarily broke things, by testing for order<  0,
>> instead of the explicit cc->order = -1 used elsewhere in
>> the code.
>>
>> I did not notice it in my own testing because I tested on
>> 3.2.0 and sent you patches against 3.3-current. It looks
>> like this line of code is the one difference between both
>> trees I was working on :(
>>
>> In my test tree, I had (cc->sync || !compaction_deferred(zone, cc->order)).
>>
>> Arguably, testing for cc->order = -1 (or cc->order<  0) is
>> better anyway.
>
> I suppose it would be nicer to make the code in __compact_pgdat() match
> all the other places whcih do this:
>
> --- a/mm/compaction.c~mm-compaction-make-compact_control-order-signed-fix
> +++ a/mm/compaction.c
> @@ -686,7 +686,7 @@ static int __compact_pgdat(pg_data_t *pg
>   		INIT_LIST_HEAD(&cc->freepages);
>   		INIT_LIST_HEAD(&cc->migratepages);
>
> -		if (cc->order<  0 || !compaction_deferred(zone, cc->order))
> +		if (cc->order = -1 || !compaction_deferred(zone, cc->order))
>   			compact_zone(zone, cc);
>
>   		if (cc->order>  0) {

Agreed, with that and Dan's patch, things should all be
as expected.

-- 
All rights reversed

WARNING: multiple messages have this Message-ID (diff)
From: Rik van Riel <riel@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	Mel Gorman <mel@csn.ul.ie>, Minchan Kim <minchan@kernel.org>,
	Andrea Arcangeli <aarcange@redhat.com>,
	linux-mm@kvack.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] mm: compaction: make compact_control order signed
Date: Wed, 01 Feb 2012 16:28:43 -0500	[thread overview]
Message-ID: <4F29AE8B.2020600@redhat.com> (raw)
In-Reply-To: <20120201132415.b09d8710.akpm@linux-foundation.org>

On 02/01/2012 04:24 PM, Andrew Morton wrote:
> On Wed, 01 Feb 2012 16:17:10 -0500
> Rik van Riel<riel@redhat.com>  wrote:
>
>>>> @@ -35,7 +35,7 @@ struct compact_control {
>>>>    	unsigned long migrate_pfn;	/* isolate_migratepages search base */
>>>>    	bool sync;			/* Synchronous migration */
>>>>
>>>> -	unsigned int order;		/* order a direct compactor needs */
>>>> +	int order;			/* order a direct compactor needs */
>>>>    	int migratetype;		/* MOVABLE, RECLAIMABLE etc */
>>>>    	struct zone *zone;
>>>>    };
>>>
>>> One would expect this to significantly change the behaviour of
>>> /proc/sys/vm/compact_memory.  Enfeebled minds want to know: is
>>> the new behaviour better or worse than the old behaviour?
>>
>> The old behaviour and the behaviour post Dan's fix are the
>> same.
>>
>> My patch temporarily broke things, by testing for order<  0,
>> instead of the explicit cc->order == -1 used elsewhere in
>> the code.
>>
>> I did not notice it in my own testing because I tested on
>> 3.2.0 and sent you patches against 3.3-current. It looks
>> like this line of code is the one difference between both
>> trees I was working on :(
>>
>> In my test tree, I had (cc->sync || !compaction_deferred(zone, cc->order)).
>>
>> Arguably, testing for cc->order == -1 (or cc->order<  0) is
>> better anyway.
>
> I suppose it would be nicer to make the code in __compact_pgdat() match
> all the other places whcih do this:
>
> --- a/mm/compaction.c~mm-compaction-make-compact_control-order-signed-fix
> +++ a/mm/compaction.c
> @@ -686,7 +686,7 @@ static int __compact_pgdat(pg_data_t *pg
>   		INIT_LIST_HEAD(&cc->freepages);
>   		INIT_LIST_HEAD(&cc->migratepages);
>
> -		if (cc->order<  0 || !compaction_deferred(zone, cc->order))
> +		if (cc->order == -1 || !compaction_deferred(zone, cc->order))
>   			compact_zone(zone, cc);
>
>   		if (cc->order>  0) {

Agreed, with that and Dan's patch, things should all be
as expected.

-- 
All rights reversed

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2012-02-01 21:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-01 14:41 [patch] mm: compaction: make compact_control order signed Dan Carpenter
2012-02-01 14:41 ` Dan Carpenter
2012-02-01 14:59 ` Rik van Riel
2012-02-01 14:59   ` Rik van Riel
2012-02-01 20:46 ` Andrew Morton
2012-02-01 20:46   ` Andrew Morton
2012-02-01 21:17   ` Rik van Riel
2012-02-01 21:17     ` Rik van Riel
2012-02-01 21:24     ` Andrew Morton
2012-02-01 21:24       ` Andrew Morton
2012-02-01 21:28       ` Rik van Riel [this message]
2012-02-01 21:28         ` Rik van Riel

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=4F29AE8B.2020600@redhat.com \
    --to=riel@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=minchan@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 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.