linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Frans Pop <elendil@planet.nl>
To: Mel Gorman <mel@csn.ul.ie>
Cc: David Rientjes <rientjes@google.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Kernel Testers List <kernel-testers@vger.kernel.org>,
	Pekka Enberg <penberg@cs.helsinki.fi>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	Karol Lewandowski <karol.k.lewandowski@gmail.com>,
	Mohamed Abbas <mohamed.abbas@intel.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	linux-mm@kvack.org
Subject: Re: [Bug #14141] order 2 page allocation failures in iwlagn
Date: Mon, 19 Oct 2009 01:33:29 +0200	[thread overview]
Message-ID: <200910190133.33183.elendil@planet.nl> (raw)
In-Reply-To: <200910141510.11059.elendil@planet.nl>

Another long mail, sorry.

On Wednesday 14 October 2009, Frans Pop wrote:
> > There still has not been a mm-change identified that makes
> > fragmentation significantly worse.
>
> My bisection shows a very clear point, even if not an individual commit,
> in the 'akpm' merge where SKB errors suddenly become *much* more
> frequent and easy to trigger.
> I'm sorry to say this, but the fact that nothing has been identified yet
> is IMO the result of a lack of effort, not because there is no such
> change.

I was wrong. It turns out that I was creating the variations in the test 
results around the akpm merge myself by tiny changes in the way I ran the 
tests. It took another round of about 30 compilations and tests purely in 
this range to show that, but those same tests also made me aware of other 
patterns I should look at.

Until a few days ago I was concentrating on "do I see SKB allocation errors 
or not". Since then I've also been looking more consciously at when they 
happen, at disk access patterns and at desktop freeze patterns.

I think I did mention before that this whole issue is rather subtle :-/
So, my apologies for finguering the wrong area for so long, but it looked 
solid given the info available at the time.

On Thursday 15 October 2009, Mel Gorman wrote:
> Outside the range of commits suspected of causing problems was the
> following. It's extremely low probability
>
> Commit 8aa7e84 Fix congestion_wait() sync/async vs read/write confusion
>         This patch alters the call to congestion_wait() in the page
>         allocator. Frankly, I don't get the change but it might worth
>         checking if replacing BLK_RW_ASYNC with WRITE on top of 2.6.31
>         makes any difference

This is the real culprit. Mel: thanks very much for looking beyond the 
area I identified. Your overview of mm changes was exactly what I needed 
and really helped a lot during my later tests.

This commit definitely causes most of the problems; confirmed by reverting 
it on top of 2.6.31 (also requires reverting 373c0a7e, which is a later 
build fix).

The rest of this mail gives details on my tests and how I reached the above 
conclusion.

TEST BASELINE (2.6.30)
======================
I mentioned in an earlier mail that I run three instances of gitk for my 
tests. Loading gitk seems to consist of 3 phases:
1) general initial scan of the repository (branches?)
2) reading commits: commit counter increases
3) reading references (including bisection good/bad points) and
   uncommitted changes

Below times and comments per stage when the test is run with 2.6.30. As my 
test starts after a clean boot, buffers are mostly empty.

1st instance: 'gitk v2.6.29..master' (preparation)
1) ~20 seconds; user interface is mostly blank
2) ~5 seconds to read 35.000 commits; user interface is updated and counter
   increases steadily as they are read
3) ~10 seconds; "branch"/"follows"/"precedes" info and tags are filled
   in; fairly heavy disk activity

2st instance: 'gitk master' (preparation)
1) 0 seconds (because data is already buffered)
2) ~25 seconds to read 167500 commits; counter increases steadily
3) 1-2 seconds (because data is already buffered)

3st instance: 'gitk master' (the actual test)
1) 0 seconds because data is already buffered
2) ~55 seconds due to swapping overhead; minor music skip around commit
   110.000; counter slower after 90.000, some short halts, but generally
   increases steadily; moderate disk activity
3) ~55-60 seconds; because buffers have been emptied data must by read
   again, with swapping; very heavy disk activity; fairly long music
   skip (15-20 seconds), but no SKB allocation errors

So, the loading of the 3rd instance takes 1.5 minutes longer than the 
second because of the swapping. And phase 3) is most affected by it.

AFTER WIRELESS CHANGE
=====================
After commit 4752c93c30 ("iwlcore: Allow skb allocation from tasklet") I 
start getting the SKB errors. They can be triggered reliably if the whole 
test is repeated 1 or 2 times, but generally not the first time the test 
is run.

Or so I thought for a long time.
It turns out that I will get SKB errors during the first run if I'm
"sloppy" in the test execution. For example if I wait too long before 
switching from the last gitk instance to konsole where I have 
a 'tail -f /var/log/kern.log' running.
Another factor is the state of the repository: do I have master checked 
out, or an older branch, or am I in the middle of a bisection. This 
influences how data is read from the disk and thus the test results.
A last factor may be the size of the kernel I'm using: my test/bisect 
kernel is significantly smaller than my regular kernel.

If the test is run completely cleanly, I will not get SKB errors during the 
first run. Also, this change does not affect the timings of the test at 
all: the total load time of the 3rd instance is still ~1:55 and music 
skips happen in roughly the same places. The pattern of disk activity also 
remains unchanged.

If I do *not* run the test cleanly, any SKB errors during the first test 
run will always be during phase 3), never during phase 2). This is what I 
saw during tests in the 'akpm' range, and explains the inconsistent 
results there.

After discovering this I've made a copy of the git repo so that I always 
test using the exact same state and tightened my test procedure.

AFTER congestion_wait CHANGE
============================
If I test commit 9f2d8be, which is just before the congestion_wait() 
change, I still get the same pattern as described above. But when I test 
with 8aa7e84 ("Fix congestion_wait() sync/async vs read/write confusion"), 
things change dramatically when the 3rd gitk instance is started.

During the 2nd phase I see the first SKB allocation errors with a music 
skip between reading commits 95.000 and 110.000.
About commit 115.000 there is a very long pause during which the counter 
does not increase, music stops and the desktop freezes completely. The 
first 30 seconds of that freeze there is only very low disk activity (which 
seems strange); the next 25 seconds there suddenly is very high disk  
activity during which things gradually unfreeze and more SKB errors are 
displayed. After that the commit counter runs up fairly steadily again.

Phase 2) ends at ~1:45. Phase 3) (with more SKB errors) ends at ~2:05.

So this change almost doubles the time needed for phase 2) and causes SKB 
allocation errors to occur during that phase. Also, before this commit the 
desktop freezes are much shorter and less severe. With this change the 
desktop is completely unusable for almost a minute during phase 2), with 
even the mouse pointer frozen solid.
Note that phase 3) becomes shorter, but that the total time needed to load 
the 3rd instance increases by about 10-15 seconds.

Note: -rc2 and -rc3 had broken NFS, so I had to cherry-pick 3 NFS commits 
from -rc4 on top of the commits I wanted to test.

WITH congestion_wait CHANGE REVERTED
====================================
I've done quite a few tests of 2.6.31 with 373c0a7e and 8aa7e847 reverted 
to confirm that's really the culprit. I've done this for .31-rc3, .31-rc4,
.31-rc5, .31 and .31.1.

In all cases the huge freeze in phase 2) is gone and the general behavior 
and timings are again as it was after the wireless change. During most 
tests I did not get any SKB allocation errors during phase 2) or phase 3).

However with .31-rc5, .31 and .31.1 I have had some tests where I would see 
a few SKB allocation errors during phase 3) (which is somewhat likely), 
but also during phase 2). At this point I'm unsure whether this is just 
noise, or maybe a minor influence from some change merged after .31-rc4.
Looking through the commits there are several mm/page allocation changes.

For now I suggest ignoring this though as the impact (if any) is very minor 
and it is not reproducible reliably enough.


Next I'll retest Mel's patches and also test Reinette's patches.

Cheers,
FJP

--
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>

  parent reply	other threads:[~2009-10-18 23:33 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3onW63eFtRF.A.xXH.oMTxKB@chimera>
     [not found] ` <COE24pZSBH.A.k2B.ZNTxKB@chimera>
     [not found]   ` <200910021111.55749.elendil@planet.nl>
2009-10-05  5:13     ` Frans Pop
2009-10-05  6:50       ` Frans Pop
2009-10-05  8:54         ` Frans Pop
2009-10-05  8:57         ` Mel Gorman
2009-10-05 21:34           ` Frans Pop
2009-10-06  0:04             ` David Rientjes
2009-10-06  1:25               ` KOSAKI Motohiro
2009-10-06  8:53               ` Mel Gorman
2009-10-06  9:14                 ` David Rientjes
2009-10-06  9:22                   ` Mel Gorman
2009-10-06 10:23               ` Frans Pop
2009-10-11 23:10         ` Frans Pop
2009-10-11 23:36           ` Frans Pop
2009-10-12 13:43           ` Mel Gorman
2009-10-12 17:32             ` Frans Pop
2009-10-12 18:43               ` Mel Gorman
2009-10-13 20:38               ` Frans Pop
2009-10-14 10:30                 ` Mel Gorman
2009-10-14 13:10                   ` Frans Pop
2009-10-14 15:40                     ` Mel Gorman
2009-10-14 16:13                       ` Frans Pop
2009-10-14 18:34                       ` Frans Pop
2009-10-14 23:56                         ` Mel Gorman
2009-10-15 20:15                           ` Frans Pop
2009-10-16  9:39                             ` Mel Gorman
2009-10-14 16:30                     ` reinette chatre
2009-10-18 23:33                     ` Frans Pop [this message]
2009-10-19  0:36                       ` Pekka Enberg
2009-10-19  2:44                         ` Frans Pop
2009-10-19  9:49                           ` [Bug #14141] order 2 page allocation failures (generic) Tobi Oetiker
2009-10-19  9:54                             ` Pekka Enberg
2009-10-19 14:01                               ` Karol Lewandowski
2009-10-19 14:06                                 ` Mel Gorman
2009-10-19 17:09                                   ` Karol Lewandowski
2009-10-20  1:47                                     ` Karol Lewandowski
2009-10-19 13:31                             ` Mel Gorman
2009-10-19 13:40                               ` Tobias Oetiker
2009-10-19 14:09                                 ` Mel Gorman
2009-10-19 14:16                                   ` Tobias Oetiker
2009-10-19 14:59                                     ` Mel Gorman
2009-10-19 20:12                                       ` Tobias Oetiker
2009-10-19 20:17                                         ` Tobias Oetiker
2009-10-20 10:57                                           ` Mel Gorman
2009-10-20 11:44                                             ` Tobias Oetiker
2009-10-20 12:51                                               ` Mel Gorman
2009-10-20 12:58                                                 ` Tobias Oetiker
2009-10-20 13:39                                                   ` Mel Gorman
2009-10-20 13:50                                                     ` Tobias Oetiker
2009-10-20 14:14                                                       ` Mel Gorman
2009-10-20 14:20                                                         ` Tobias Oetiker
2009-10-22 10:27                                                     ` Tobias Oetiker
2009-10-19  2:52                         ` [Bug #14141] order 2 page allocation failures in iwlagn Jens Axboe
2009-10-19 14:01                       ` Mel Gorman
2009-10-19 16:18                         ` Chris Mason
2009-10-19 17:01                           ` Christoph Hellwig
2009-10-19 21:57                             ` Chris Mason
2009-10-19 17:01                           ` Christoph Hellwig
2009-10-20 10:48                           ` Mel Gorman
2009-10-20 10:48                           ` Mel Gorman
2009-10-26 21:06                             ` Frans Pop
2009-10-27 14:54                               ` Mel Gorman
2009-10-27 15:16                                 ` KOSAKI Motohiro
2009-10-27 15:21                                   ` Mel Gorman
2009-10-27 15:52                                 ` Mel Gorman
2009-10-27 16:03                                   ` Chris Mason
2009-10-27 17:21                                     ` Frans Pop
2009-10-27 17:21                                     ` Frans Pop
2009-11-05 20:14                               ` Frans Pop
2009-11-06  9:51                                 ` Frans Pop
2009-11-09 19:00                                   ` Mel Gorman
2009-10-25 18:54                           ` Frans Pop
2009-10-14 16:28                   ` reinette chatre
2009-10-14 16:50                     ` Mel Gorman
2009-10-14 20:41                       ` reinette chatre
2009-10-14 21:33                         ` Frans Pop
2009-10-14 21:55                           ` reinette chatre
2009-10-15  2:02                         ` Frans Pop
2009-10-15 15:29                           ` reinette chatre
2009-10-15 19:41                             ` Frans Pop
2009-10-16 17:21                               ` reinette chatre
2009-10-17  5:42                               ` reinette chatre
2009-10-27 11:10                                 ` Frans Pop
2009-10-27 16:15                                   ` reinette chatre
     [not found] ` <COE24pZSBH.A.rP.2MTxKB@chimera>
2009-10-21 20:04   ` [PATCH] SLUB: Don't drop __GFP_NOFAIL completely from allocate_slab() (was: Re: [Bug #14265] ifconfig: page allocation failure. order:5,ode:0x8020 w/ e100) Karol Lewandowski
2009-10-21 21:06     ` David Rientjes
2009-10-21 21:20       ` Karol Lewandowski
2009-10-22 10:20         ` Mel Gorman
2009-10-22 21:33           ` Karol Lewandowski

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=200910190133.33183.elendil@planet.nl \
    --to=elendil@planet.nl \
    --cc=bzolnier@gmail.com \
    --cc=karol.k.lewandowski@gmail.com \
    --cc=kernel-testers@vger.kernel.org \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linville@tuxdriver.com \
    --cc=mel@csn.ul.ie \
    --cc=mohamed.abbas@intel.com \
    --cc=penberg@cs.helsinki.fi \
    --cc=reinette.chatre@intel.com \
    --cc=rientjes@google.com \
    --cc=rjw@sisk.pl \
    /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