From: Zlatko Calusic <zlatko.calusic@iskon.hr>
To: Hillf Danton <dhillf@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Mel Gorman <mgorman@suse.de>, Hugh Dickins <hughd@google.com>,
linux-mm <linux-mm@kvack.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: do not sleep in balance_pgdat if there's no i/o congestion
Date: Sat, 29 Dec 2012 13:11:28 +0100 [thread overview]
Message-ID: <50DEDDF0.8090405@iskon.hr> (raw)
In-Reply-To: <CAJd=RBB0bwyjoMc5yt5SfgxCt3JcLUo8Fiz1r3oQ0RRhE1i59w@mail.gmail.com>
On 29.12.2012 08:25, Hillf Danton wrote:
> On Thu, Dec 27, 2012 at 11:42 PM, Zlatko Calusic
> <zlatko.calusic@iskon.hr> wrote:
>> On 21.12.2012 12:51, Hillf Danton wrote:
>>>
>>> On Thu, Dec 20, 2012 at 7:25 AM, Zlatko Calusic <zlatko.calusic@iskon.hr>
>>> wrote:
>>>>
>>>> static unsigned long balance_pgdat(pg_data_t *pgdat, int order,
>>>> int
>>>> *classzone_idx)
>>>> {
>>>> - int all_zones_ok;
>>>> + struct zone *unbalanced_zone;
>>>
>>>
>>> nit: less hunks if not erase that mark
>>>
>>> Hillf
>>
>>
>> This one left unanswered and forgotten because I didn't understand what you
>> meant. Could you elaborate?
>>
> Sure, the patch looks simpler(and nicer) if we dont
> erase all_zones_ok.
>
Ah, yes. I gave it a good thought. But, when I introduced
unbalanced_zone it just didn't make much sense to me to have two
variables with very similar meaning. If I decided to keep all_zones_ok,
it would be either:
all_zones_ok = true
unbalanced_zone = NULL
(meaning: if no zone in unbalanced, then all zones must be ok)
or
all_zones_ok = false
unbalanced_zone = struct zone *
(meaning: if there's an unbalanced zone, then certainly not all zones
are ok)
So I decided to use only unbalanced_zone (because I had to!), and remove
all_zones_ok to avoid redundancy. I hope it makes sense.
If you check my latest (and still queued) optimization (mm: avoid
calling pgdat_balanced() needlessly), there again popped up a need for a
boolean, but I called it pgdat_is_balanced this time, just to match the
name of two other functions. It could've also been called all_zones_ok
if you prefer the name? Of course, I have no strong feelings about the
name, both are OK, so if you want me to redo the patch, just say.
Generally speaking, while I always attempt to make a smaller patch (less
hunks and less changes = easier to review), before that I'll always try
to make the code that results from the commit cleaner, simpler, more
readable.
For example, I'll always check that I don't mess with whitespace
needlessly, unless I think it's actually desirable, here's just one example:
"mm: avoid calling pgdat_balanced() needlessly" changes
---
} while (--sc.priority >= 0);
out:
if (!pgdat_balanced(pgdat, order, *classzone_idx)) {
---
to
---
} while (--sc.priority >= 0);
out:
if (!pgdat_is_balanced) {
---
because I find the latter more correct place for the label "out".
Thanks for the comment.
--
Zlatko
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Zlatko Calusic <zlatko.calusic@iskon.hr>
To: Hillf Danton <dhillf@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Mel Gorman <mgorman@suse.de>, Hugh Dickins <hughd@google.com>,
linux-mm <linux-mm@kvack.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: do not sleep in balance_pgdat if there's no i/o congestion
Date: Sat, 29 Dec 2012 13:11:28 +0100 [thread overview]
Message-ID: <50DEDDF0.8090405@iskon.hr> (raw)
In-Reply-To: <CAJd=RBB0bwyjoMc5yt5SfgxCt3JcLUo8Fiz1r3oQ0RRhE1i59w@mail.gmail.com>
On 29.12.2012 08:25, Hillf Danton wrote:
> On Thu, Dec 27, 2012 at 11:42 PM, Zlatko Calusic
> <zlatko.calusic@iskon.hr> wrote:
>> On 21.12.2012 12:51, Hillf Danton wrote:
>>>
>>> On Thu, Dec 20, 2012 at 7:25 AM, Zlatko Calusic <zlatko.calusic@iskon.hr>
>>> wrote:
>>>>
>>>> static unsigned long balance_pgdat(pg_data_t *pgdat, int order,
>>>> int
>>>> *classzone_idx)
>>>> {
>>>> - int all_zones_ok;
>>>> + struct zone *unbalanced_zone;
>>>
>>>
>>> nit: less hunks if not erase that mark
>>>
>>> Hillf
>>
>>
>> This one left unanswered and forgotten because I didn't understand what you
>> meant. Could you elaborate?
>>
> Sure, the patch looks simpler(and nicer) if we dont
> erase all_zones_ok.
>
Ah, yes. I gave it a good thought. But, when I introduced
unbalanced_zone it just didn't make much sense to me to have two
variables with very similar meaning. If I decided to keep all_zones_ok,
it would be either:
all_zones_ok = true
unbalanced_zone = NULL
(meaning: if no zone in unbalanced, then all zones must be ok)
or
all_zones_ok = false
unbalanced_zone = struct zone *
(meaning: if there's an unbalanced zone, then certainly not all zones
are ok)
So I decided to use only unbalanced_zone (because I had to!), and remove
all_zones_ok to avoid redundancy. I hope it makes sense.
If you check my latest (and still queued) optimization (mm: avoid
calling pgdat_balanced() needlessly), there again popped up a need for a
boolean, but I called it pgdat_is_balanced this time, just to match the
name of two other functions. It could've also been called all_zones_ok
if you prefer the name? Of course, I have no strong feelings about the
name, both are OK, so if you want me to redo the patch, just say.
Generally speaking, while I always attempt to make a smaller patch (less
hunks and less changes = easier to review), before that I'll always try
to make the code that results from the commit cleaner, simpler, more
readable.
For example, I'll always check that I don't mess with whitespace
needlessly, unless I think it's actually desirable, here's just one example:
"mm: avoid calling pgdat_balanced() needlessly" changes
---
} while (--sc.priority >= 0);
out:
if (!pgdat_balanced(pgdat, order, *classzone_idx)) {
---
to
---
} while (--sc.priority >= 0);
out:
if (!pgdat_is_balanced) {
---
because I find the latter more correct place for the label "out".
Thanks for the comment.
--
Zlatko
next prev parent reply other threads:[~2012-12-29 12:11 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-19 23:17 [PATCH] mm: do not sleep in balance_pgdat if there's no i/o congestion Zlatko Calusic
2012-12-19 23:17 ` Zlatko Calusic
2012-12-19 23:25 ` Zlatko Calusic
2012-12-19 23:25 ` Zlatko Calusic
2012-12-21 11:51 ` Hillf Danton
2012-12-21 11:51 ` Hillf Danton
2012-12-27 15:42 ` Zlatko Calusic
2012-12-27 15:42 ` Zlatko Calusic
2012-12-29 7:25 ` Hillf Danton
2012-12-29 7:25 ` Hillf Danton
2012-12-29 12:11 ` Zlatko Calusic [this message]
2012-12-29 12:11 ` Zlatko Calusic
2012-12-20 11:12 ` Mel Gorman
2012-12-20 11:12 ` Mel Gorman
2012-12-20 20:58 ` Andrew Morton
2012-12-20 20:58 ` Andrew Morton
2012-12-22 18:54 ` [PATCH] mm: modify pgdat_balanced() so that it also handles order=0 Zlatko Calusic
2012-12-22 18:54 ` Zlatko Calusic
2012-12-23 14:12 ` [PATCH v2] " Zlatko Calusic
2012-12-23 14:12 ` Zlatko Calusic
2012-12-26 15:07 ` [PATCH] mm: avoid calling pgdat_balanced() needlessly Zlatko Calusic
2012-12-26 15:07 ` Zlatko Calusic
2012-12-28 2:16 ` [PATCH] mm: fix null pointer dereference in wait_iff_congested() Zlatko Calusic
2012-12-28 2:16 ` Zlatko Calusic
2012-12-28 2:49 ` Minchan Kim
2012-12-28 2:49 ` Minchan Kim
2012-12-28 13:29 ` Zlatko Calusic
2012-12-28 13:29 ` Zlatko Calusic
2012-12-31 0:50 ` Minchan Kim
2012-12-31 0:50 ` Minchan Kim
2012-12-29 8:45 ` Sedat Dilek
2012-12-29 8:45 ` Sedat Dilek
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=50DEDDF0.8090405@iskon.hr \
--to=zlatko.calusic@iskon.hr \
--cc=akpm@linux-foundation.org \
--cc=dhillf@gmail.com \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=torvalds@linux-foundation.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.