On Wed, 19 Sep 2007, Andy Whitcroft wrote:[edited out some bogus lines from stale stack] I've been seeing something like that on 4-way PPC64: in my case I've shells hanging in D state trying to append to kernel build log on ext3 (the builds themselves going on elsewhere, in tmpfs): one of the shells holding i_mutex and stuck doing congestion_waits from balance_dirty_pages. My *guess* is that this is peculiar to 2.6.23-rc6-mm1, and from Peter's mm-per-device-dirty-threshold.patch. printks showed bdi_nr_reclaimable 0, bdi_nr_writeback 24, bdi_thresh 1 in balance_dirty_pages (though I've not done enough to check if those really correlate with the hangs), and I'm wondering if the bdi_stat_sum business is needed on the !nr_reclaimable path. So I'm running now with the patch below, good so far, but can't judge until tomorrow whether it has actually addressed the problem seen. Not-yet-Signed-off-by: Hugh Dickins <hugh@veritas.com> --- mm/page-writeback.c | 53 +++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 29 deletions(-) --- 2.6.23-rc6-mm1/mm/page-writeback.c 2007-09-18 12:28:25.000000000 +0100 +++ linux/mm/page-writeback.c 2007-09-19 20:00:46.000000000 +0100 @@ -379,7 +379,7 @@ static void balance_dirty_pages(struct a bdi_nr_reclaimable = bdi_stat(bdi, BDI_RECLAIMABLE); bdi_nr_writeback = bdi_stat(bdi, BDI_WRITEBACK); if (bdi_nr_reclaimable + bdi_nr_writeback <= bdi_thresh) - break; + break; if (!bdi->dirty_exceeded) bdi->dirty_exceeded = 1; @@ -392,39 +392,34 @@ static void balance_dirty_pages(struct a */ if (bdi_nr_reclaimable) { writeback_inodes(&wbc); - + pages_written += write_chunk - wbc.nr_to_write; get_dirty_limits(&background_thresh, &dirty_thresh, &bdi_thresh, bdi); + } - /* - * In order to avoid the stacked BDI deadlock we need - * to ensure we accurately count the 'dirty' pages when - * the threshold is low. - * - * Otherwise it would be possible to get thresh+n pages - * reported dirty, even though there are thresh-m pages - * actually dirty; with m+n sitting in the percpu - * deltas. - */ - if (bdi_thresh < 2*bdi_stat_error(bdi)) { - bdi_nr_reclaimable = - bdi_stat_sum(bdi, BDI_RECLAIMABLE); - bdi_nr_writeback = - bdi_stat_sum(bdi, BDI_WRITEBACK); - } else { - bdi_nr_reclaimable = - bdi_stat(bdi, BDI_RECLAIMABLE); - bdi_nr_writeback = - bdi_stat(bdi, BDI_WRITEBACK); - } + /* + * In order to avoid the stacked BDI deadlock we need + * to ensure we accurately count the 'dirty' pages when + * the threshold is low. + * + * Otherwise it would be possible to get thresh+n pages + * reported dirty, even though there are thresh-m pages + * actually dirty; with m+n sitting in the percpu + * deltas. + */ + if (bdi_thresh < 2*bdi_stat_error(bdi)) { + bdi_nr_reclaimable = bdi_stat_sum(bdi, BDI_RECLAIMABLE); + bdi_nr_writeback = bdi_stat_sum(bdi, BDI_WRITEBACK); + } else if (bdi_nr_reclaimable) { + bdi_nr_reclaimable = bdi_stat(bdi, BDI_RECLAIMABLE); + bdi_nr_writeback = bdi_stat(bdi, BDI_WRITEBACK); + } - if (bdi_nr_reclaimable + bdi_nr_writeback <= bdi_thresh) - break; + if (bdi_nr_reclaimable + bdi_nr_writeback <= bdi_thresh) + break; + if (pages_written >= write_chunk) + break; /* We've done our duty */ - pages_written += write_chunk - wbc.nr_to_write; - if (pages_written >= write_chunk) - break; /* We've done our duty */ - } congestion_wait(WRITE, HZ/10); } -
| Linus Torvalds | Linux 2.6.27-rc8 |
| Rafael J. Wysocki | 2.6.26-rc9-git12: Reported regressions from 2.6.25 |
| Alan Cox | [PATCH 00/76] Queued TTY Patches |
| James Bottomley | Re: Integration of SCST in the mainstream Linux kernel |
git: | |
| Shawn O. Pearce | Re: cleaner/better zlib sources? |
| sbejar | Re: Using GIT to store /etc (Or: How to make GIT store all file permission bits) |
| Mark Levedahl | mingw, windows, crlf/lf, and git |
| bain | [Announce] teamGit v0.0.3 |
| Richard Stallman | Real men don't attack straw men |
| Leon Dippenaar | New tcp stack attack |
| Jonathan Thornburg | svnd questions (encrypting all of a partition or disk) |
| Chris Bullock | OpenBSD isakmpd and pf vs Cisco PIX or ASA |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| Dushan Tcholich | Re: ksoftirqd high cpu load on kernels 2.6.24 to 2.6.27-rc1-mm1 |
| Jarek Poplawski | Re: [PATCH] Fix routing tables with id > 255 for legacy software |
| Evgeniy Polyakov | Re: [Bugme-new] [Bug 10556] New: IPVS sync_backup oops |
