From: Mel Gorman <mel@csn.ul.ie>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Frans Pop <elendil@planet.nl>,
Chris Mason <chris.mason@oracle.com>,
David Rientjes <rientjes@google.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>,
Jens Axboe <jens.axboe@oracle.com>,
"John W. Linville" <linville@tuxdriver.com>,
linux-mm@kvack.org
Subject: Re: [Bug #14141] order 2 page allocation failures in iwlagn
Date: Tue, 27 Oct 2009 15:21:19 +0000 [thread overview]
Message-ID: <20091027152118.GI8900@csn.ul.ie> (raw)
In-Reply-To: <2f11576a0910270816s3e1b268ah91b5f2d0cc0d562e@mail.gmail.com>
On Wed, Oct 28, 2009 at 12:16:30AM +0900, KOSAKI Motohiro wrote:
> 2009/10/27 Mel Gorman <mel@csn.ul.ie>:
> > On Mon, Oct 26, 2009 at 10:06:09PM +0100, Frans Pop wrote:
> >> On Tuesday 20 October 2009, Mel Gorman wrote:
> >> > I've attached a patch below that should allow us to cheat. When it's
> >> > applied, it outputs who called congestion_wait(), how long the timeout
> >> > was and how long it waited for. By comparing before and after sleep
> >> > times, we should be able to see which of the callers has significantly
> >> > changed and if it's something easily addressable.
> >>
> >> The results from this look fairly interesting (although I may be a bad
> >> judge as I don't really know what I'm looking at ;-).
> >>
> >> I've tested with two kernels:
> >> 1) 2.6.31.1: 1 test run
> >> 2) 2.6.31.1 + congestion_wait() reverts: 2 test runs
> >>
> >> The 1st kernel had the expected "freeze" while reading commits in gitk;
> >> reading commits with the 2nd kernel was more fluent.
> >> I did 2 runs with the 2nd kernel as the first run had a fairly long music
> >> skip and more SKB errors than expected. The second run was fairly normal
> >> with no music skips at all even though it had a few SKB errors.
> >>
> >> Data for the tests:
> >> 1st kernel 2nd kernel 1 2nd kernel 2
> >> end reading commits 1:15 1:00 0:55
> >> "freeze" yes no no
> >> branch data shown 1:55 1:15 1:10
> >> system quiet 2:25 1:50 1:45
> >> # SKB allocation errors 10 53 5
> >>
> >> Note that the test is substantially faster with the 2nd kernel and that the
> >> SKB errors don't really affect the duration of the test.
> >>
> >
> > Ok. I think that despite expectations, the writeback changes have
> > changed the timing significantly enough to be worth examining closer.
> >
> >>
> >> - without the revert 'background_writeout' is called a lot less frequently,
> >> but when it's called it gets long delays
> >> - without the revert you have 'wb_kupdate', which is relatively expensive
> >> - with the revert 'shrink_list' is relatively expensive, although not
> >> really in absolute terms
> >>
> >
> > Lets look at the callers that waited in congestion_wait() for at least
> > 25 jiffies.
> >
> > 2.6.31.1-async-sync-congestion-wait i.e. vanilla kernel
> > generated with: cat kern.log_1_test | awk -F ] '{print $2}' | sort -k 5 -n | uniq -c
> > 24 background_writeout congestion_wait sync=0 delay 25 timeout 25
> > 203 kswapd congestion_wait sync=0 delay 25 timeout 25
> > 5 shrink_list congestion_wait sync=0 delay 25 timeout 25
> > 155 try_to_free_pages congestion_wait sync=0 delay 25 timeout 25
> > 145 wb_kupdate congestion_wait sync=0 delay 25 timeout 25
> > 2 kswapd congestion_wait sync=0 delay 26 timeout 25
> > 8 wb_kupdate congestion_wait sync=0 delay 26 timeout 25
> > 1 try_to_free_pages congestion_wait sync=0 delay 54 timeout 25
> >
> > 2.6.31.1-write-congestion-wait i.e. kernel with patch reverted
> > generated with: cat kern.log_2.1_test | awk -F ] '{print $2}' | sort -k 5 -n | uniq -c
> > 2 background_writeout congestion_wait rw=1 delay 25 timeout 25
> > 188 kswapd congestion_wait rw=1 delay 25 timeout 25
> > 14 shrink_list congestion_wait rw=1 delay 25 timeout 25
> > 181 try_to_free_pages congestion_wait rw=1 delay 25 timeout 25
> > 5 kswapd congestion_wait rw=1 delay 26 timeout 25
> > 10 try_to_free_pages congestion_wait rw=1 delay 26 timeout 25
> > 3 try_to_free_pages congestion_wait rw=1 delay 27 timeout 25
> > 1 kswapd congestion_wait rw=1 delay 29 timeout 25
> > 1 __alloc_pages_nodemask congestion_wait rw=1 delay 30 timeout 5
> > 1 try_to_free_pages congestion_wait rw=1 delay 31 timeout 25
> > 1 try_to_free_pages congestion_wait rw=1 delay 35 timeout 25
> > 1 kswapd congestion_wait rw=1 delay 51 timeout 25
> > 1 try_to_free_pages congestion_wait rw=1 delay 56 timeout 25
> >
> > So, wb_kupdate and background_writeout are the big movers in terms of waiting,
> > not the direct reclaimers which is what we were expecting. Of those big
> > movers, wb_kupdate is the most interested because compare the following
> >
> > $ cat kern.log_2.1_test | awk -F ] '{print $2}' | sort -k 5 -n | uniq -c | grep wb_kup
> > [ no output ]
> > $ $ cat kern.log_1_test | awk -F ] '{print $2}' | sort -k 5 -n | uniq -c | grep wb_kup
> > 1 wb_kupdate congestion_wait sync=0 delay 15 timeout 25
> > 1 wb_kupdate congestion_wait sync=0 delay 23 timeout 25
> > 145 wb_kupdate congestion_wait sync=0 delay 25 timeout 25
> > 8 wb_kupdate congestion_wait sync=0 delay 26 timeout 25
> >
> > The vanilla kernel is not waiting in wb_kupdate at all.
> >
> > Jens, before the congestion_wait() changes, wb_kupdate was waiting on
> > congestion and afterwards it's not. Furthermore, look at the number of pages
> > that are queued for writeback in the two page allocation failure reports.
> >
> > without-revert: writeback:65653
> > with-revert: writeback:21713
> >
> > So, after the move to async/sync, a lot more pages are getting queued
> > for writeback - more than three times the number of pages are queued for
> > writeback with the vanilla kernel. This amount of congestion might be why
> > direct reclaimers and kswapd's timings have changed so much.
> >
> > Chris Mason hinted at this but I didn't quite "get it" at the time but is it
> > possible that writeback_inodes() is converting what is expected to be async
> > IO into sync IO? One way of checking this is if Frans could test the patch
> > below that makes wb_kupdate wait on sync instead of async.
> >
> > If this makes a difference, I think the three main areas of trouble we
> > are now seeing are
> >
> > 1. page allocator regressions - mostly fixed hopefully
> > 2. page writeback change in timing - theory yet to be confirmed
> > 3. drivers using more atomics - iwlagn specific, being dealt with
> >
> > Of course, the big problem is if the changes are due to major timing
> > differences in page writeback, then mainline is a totally different
> > shape of problem as pdflush has been replaced there.
> >
> > ====
> > Have wb_kupdate wait on sync IO congestion instead of async
> >
> > wb_kupdate is expected to only have queued up pages for async IO.
> > However, something screwy is happening because it never appears to go to
> > sleep. Frans, can you test with this patch instead of the revert please?
> > Preferably, keep the verbose-congestion_wait patch applied so we can
> > still get an idea who is going to sleep and for how long when calling
> > congestion_wait. thanks
> >
> > Not-signed-off-hacket-job: Mel Gorman <mel@csn.ul.ie>
> > ---
> >
> > diff --git a/mm/page-writeback.c b/mm/page-writeback.c
> > index 81627eb..cb646dd 100644
> > --- a/mm/page-writeback.c
> > +++ b/mm/page-writeback.c
> > @@ -787,7 +787,7 @@ static void wb_kupdate(unsigned long arg)
> > writeback_inodes(&wbc);
> > if (wbc.nr_to_write > 0) {
> > if (wbc.encountered_congestion || wbc.more_io)
> > - congestion_wait(BLK_RW_ASYNC, HZ/10);
> > + congestion_wait(BLK_RW_SYNC, HZ/10);
> > else
> > break; /* All the old data is written */
> > }
>
> Hmm, This doesn't looks correct to me.
>
> BLK_RW_ASYNC mean async write.
> BLK_RW_SYNC mean read and sync-write.
>
> wb_kupdate use WB_SYNC_NONE. it's async write.
>
I don't think it's correct either which is why I described it as
"something screwy is happening because it never appears to go to sleep".
This is despite there being a whole lot of pages queued for writeback
according to the page allocation failure reports.
--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
--
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>
next prev parent reply other threads:[~2009-10-27 15:21 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
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 [this message]
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=20091027152118.GI8900@csn.ul.ie \
--to=mel@csn.ul.ie \
--cc=bzolnier@gmail.com \
--cc=chris.mason@oracle.com \
--cc=elendil@planet.nl \
--cc=jens.axboe@oracle.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=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