Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758903AbZD3CnU (ORCPT ); Wed, 29 Apr 2009 22:43:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751524AbZD3CnI (ORCPT ); Wed, 29 Apr 2009 22:43:08 -0400 Received: from tomts36-srv.bellnexxia.net ([209.226.175.93]:42173 "EHLO tomts36-srv.bellnexxia.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750869AbZD3CnH (ORCPT ); Wed, 29 Apr 2009 22:43:07 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYFAAaq+ElMQW1W/2dsb2JhbACBUL0DCJBdgiUWCIEyBQ Date: Wed, 29 Apr 2009 22:43:03 -0400 From: Mathieu Desnoyers To: Linus Torvalds Cc: Andrew Morton , Nick Piggin , Ingo Molnar , KOSAKI Motohiro , Peter Zijlstra , thomas.pi@arcor.dea, Yuriy Lalym , Linux Kernel Mailing List , ltt-dev@lists.casi.polymtl.ca, Christoph Lameter Subject: Re: [PATCH] Fix dirty page accounting in redirty_page_for_writepage() Message-ID: <20090430024303.GB19875@Krystal> References: <20090429232546.GB15782@Krystal> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline In-Reply-To: X-Editor: vi X-Info: http://krystal.dyndns.org:8080 X-Operating-System: Linux/2.6.21.3-grsec (i686) X-Uptime: 22:34:10 up 60 days, 23:00, 1 user, load average: 0.28, 0.50, 0.41 User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2261 Lines: 61 * Linus Torvalds (torvalds@linux-foundation.org) wrote: > > > On Wed, 29 Apr 2009, Mathieu Desnoyers wrote: > > > > This patch adds missing dirty page accounting in redirty_page_for_writepage(). > > This should fix a _lot_ of issues involving machines becoming slow under heavy > > write I/O. No surprise : eventually the system starts swapping. > > That patch (and description) is odd. > > The patch actually adds the dirty page accounting not to > redirty_page_for_writepage(), but to __set_page_dirty_nobuffers(). > > And __set_page_dirty_nobuffers() will later (just a few lines down) call > down to account_page_dirtied(), which in turn does all that > same accounting (assuming the "mapping" is marked to account for dirty. > > So the description seems to be wrong, but so does the patch. > > Did you attach the wrong patch (explaining both problems)? > Nope, just tried to go back into the OOM problem I experienced when testing the "heavy I/O latency" bug. But it looks like I can't reproduce it anyway. > Or if the patch is what you really meant to do, then you need to fix your > explanation, and also explain why the double-dirty accounting is a good > idea. Nope, I just "messed this one up" completely. :-) > > Or is the real problem perhaps that your /tmp is ramdisk, and not marked > to do dirty accounting? Nope, I don't think so. /tmp is on a ext3 partition, on raid 1, sata disks. And thanks for the review! This excercise only convinced me that the kernel memory accounting works as expected. All this gave me the chance to have a good look at the memory accounting code. We could probably benefit of Christoph Lameter's cpu ops (using segment registers to address per-cpu variables with atomic inc/dec) in there. Or at least removing interrupt disabling by using preempt disable and local_t variables for the per-cpu counters could bring some benefit. Mathieu > > Linus -- Mathieu Desnoyers OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/