lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20061213005954.e2d32446.akpm@osdl.org>
Date:	Wed, 13 Dec 2006 00:59:54 -0800
From:	Andrew Morton <akpm@...l.org>
To:	Suleiman Souhlal <ssouhlal@...eBSD.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc:	linux-kernel@...r.kernel.org, balbir@...ibm.com, csturtiv@....com,
	daw@....com, guillaume.thouvenin@...l.net, jlan@....com,
	nagar@...son.ibm.com, tee@....com
Subject: Re: [patch 03/13] io-accounting: write accounting

On Wed, 13 Dec 2006 00:45:50 -0800
Suleiman Souhlal <ssouhlal@...eBSD.org> wrote:

> akpm@...l.org wrote:
> > From: Andrew Morton <akpm@...l.org>
> > 
> > Accounting writes is fairly simple: whenever a process flips a page from clean
> > to dirty, we accuse it of having caused a write to underlying storage of
> > PAGE_CACHE_SIZE bytes.
> 
> On architectures where dirtying a page doesn't cause a page fault (like i386), couldn't you end up billing the wrong process (in fact, I think that even on other archituctures set_page_dirty() doesn't get called immediately in the page fault handler)? 

Yes, that would be a problem in 2.6.18 and earlier.

In 2.6.19 and later, we do take a fault when transitioning a page from
pte-clean to pte-dirty.  That was done to get the dirty-page accounting
right - to avoid the all-of-memory-is-dirty-but-the-kernel-doesn't-know-it
problem.


> AFAICS, set_page_dirty() is mostly called when trying to unmap a page when trying to shrink LRU lists, and there is no guarantee that this happens under the process that dirtied it (in fact, the set_page_dirty() is often done by kswapd).

hm, that code is still there in zap_pte_range().  If all is well, that
set_page_dirty() call should never return true.  Peter did, you ever test
for that?

(Well, it might return true in rare races, because zap_pte_range() doesn't
lock the pages)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ