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: <4933CC78.2030707@gmail.com>
Date:	Mon, 01 Dec 2008 13:37:28 +0200
From:	Török Edwin <edwintorok@...il.com>
To:	Nick Piggin <npiggin@...e.de>
CC:	Mike Waychison <mikew@...gle.com>, Ying Han <yinghan@...gle.com>,
	Ingo Molnar <mingo@...e.hu>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org, akpm <akpm@...ux-foundation.org>,
	David Rientjes <rientjes@...gle.com>,
	Rohit Seth <rohitseth@...gle.com>,
	Hugh Dickins <hugh@...itas.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [RFC v1][PATCH]page_fault retry with NOPAGE_RETRY

On 2008-12-01 13:13, Nick Piggin wrote:
> BTW. I think your source code (I see you updated it since last posting)
> should be very easy to give good hints to the kernel about the IO. I
> will try a few simple tricks and we can see if they help. (this pattern
> of touching memory corresponds well to how your app works?)

It corresponds well to the latencies involved, but only part of the
behaviour:

- in some cases mmap is used to sequentially read a file (PROT_READ,
MAP_PRIVATE), and does operations like
memchr, memcpy on it, my testcase models this
- in some cases it is used to mmap archives, and containers, that have
the index at the end (like zip), so it jumps back and forth between the
end of the file, and the offset indicated there (using pread here may be
better, but using mmap simplified the code a lot)
- there are multiple threads, each processing a different file, the only
data shared between threads is the signature database, so once a thread
started working on a file,
no other thread touches it
- the goal is to process as many files as possible, which works on some
files very well (PE files mostly), but not on others (where I can't load
all cores to 400%)

In either case it pagefaults a lot, and calls mmap() often, which is
what my testcase attempted to model.

You can completely disable mmap usage in clamav, but last I tried that
slowed things down (it falls back to using fread, and reading the entire
file in memory in case of zip).
Perhaps I should try turning off mmap for just portions.

If you find something that improves my testcase, I can try on the real
application and let you know if it improved or not (and perhaps create a
new testcase).

If you want, you can test on the original application (its open source
after all!) too.
I found that scanning my local copy of my Gmail inbox is  a good
testcase. I can walk you through how to configure/setup clamav to test.

Best regards,
--Edwin
--
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