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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20061213140058.be5f7445.akpm@osdl.org>
Date:	Wed, 13 Dec 2006 14:00:58 -0800
From:	Andrew Morton <akpm@...l.org>
To:	Suleiman Souhlal <ssouhlal@...eBSD.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	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 11:07:01 -0800
Andrew Morton <akpm@...l.org> wrote:

> On Wed, 13 Dec 2006 03:02:38 -0800
> Suleiman Souhlal <ssouhlal@...eBSD.org> wrote:
> 
> > The only I/O non-shared VMAs might cause is from swapping, and I'm not
> > sure if the io accounting patches actually care about that.
> 
> Yes, the patches do attempt to correctly account for swap IO.  swapin is
> accounted in submit_bio() and swapout is, err, not accounted at all.  Drat,
> I forgot to retest that.
> 

hey, this is hard.

The obvious "fix" is to do:

--- a/mm/page-writeback.c~a
+++ a/mm/page-writeback.c
@@ -816,8 +816,10 @@ int fastcall set_page_dirty(struct page 
 		return (*spd)(page);
 	}
 	if (!PageDirty(page)) {
-		if (!TestSetPageDirty(page))
+		if (!TestSetPageDirty(page)) {
+			task_io_account_write(PAGE_SIZE);
 			return 1;
+		}
 	}
 	return 0;
 }
_


but that means that memset(malloc(1000000)) will accuse the task of having
done 1MB of writing, which is daft.

What would be appropriate here is to account the task with the write when
someone moves a dirty anon page into swapcache.  That means that some
random task needs to locate the task which "owns" this anon page.  So in
shrink_page_list()->add_to_swap() we need to hunt down the appropriate
locks, do the rmap walk, find the vma, find the mm, then wonder how the
heck we find the right task_struct based on the mm_struct.

I think I'll back slowly away from this problem and mark it as "known
shortcoming".

Which perhaps means that we should not account for swapin either.
-
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