From: Izik Eidus <ieidus@redhat.com>
To: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Andrea Arcangeli <aarcange@redhat.com>,
Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
linux-mm@kvack.org
Subject: Re: improving checksum cpu consumption in ksm
Date: Thu, 03 Sep 2009 15:36:15 +0300 [thread overview]
Message-ID: <4A9FB83F.2000605@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0908312233340.23516@sister.anvils>
Hugh Dickins wrote:
>
> But the first thing to try (measure) would be Jozsef's patch, updating
> jhash.h from the 1996 Jenkins lookup2 to the 2006 Jenkins lookup3,
> which is supposed to be a considerable improvement from all angles.
>
> See http://lkml.org/lkml/2009/2/12/65
>
>
Hi,
I just did small test of the new hash compare to the old
using the program below, i ran ksm (with nice -20)
at time_to_sleep_in_millisecs = 1
run = 1
pages_to_scan = 9999
(The program is designing just to pressure the hash calcs and tree
walking (and not to share any page really)
then i checked how many full_scans have ksm reached (i just checked
/sys/kernel/mm/ksm/full_scans)
And i got the following results:
with the old jhash version ksm did 395 loops
with the new jhash version ksm did 455 loops
we got here 15% improvment for this case where we have pages that are
static but are not shareable...
(And it will help in any case we got page we are not merging in the
stable tree)
I think it is nice...
(I used AMD Phenom(tm) II X3 720 Processor, but probably i didnt run
the test enougth, i should rerun it again and see if the results are
consistent)
(Another thing is that I had conflit with something of
JHASH_GOLDEN_NUNBER? i just added back that define and the kernel was
compiling)
Thanks.
#include <malloc.h>
#include <stdio.h>
#include <sys/mman.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
int main()
{
int x;
unsigned char *p, *tmp;
unsigned char *p_end;
p = (unsigned char *) malloc(1024 * 1024 * 100 + 4096);
if (!p) {
printf("error\n");
}
p_end = p + 1024 * 1024 * 100;
p = (unsigned char *)((unsigned long)p & ~4095);
tmp = p;
for(; tmp != p_end; ++tmp) {
*tmp = (unsigned char)random();
}
if (madvise(p, 1024 * 1024 * 100, 12) == -1) {
perror("madvise");
}
sleep(60);
return 0;
}
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2009-09-03 12:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-28 20:21 improving checksum cpu consumption in ksm Izik Eidus
2009-08-31 22:49 ` Hugh Dickins
2009-09-01 12:12 ` Izik Eidus
2009-09-03 12:36 ` Izik Eidus [this message]
2009-09-03 15:20 ` Hugh Dickins
2009-09-03 15:42 ` Izik Eidus
2009-09-04 22:29 ` Moussa Ba
2009-09-05 11:33 ` Hugh Dickins
2009-09-12 16:33 ` Izik Eidus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A9FB83F.2000605@redhat.com \
--to=ieidus@redhat.com \
--cc=aarcange@redhat.com \
--cc=hugh.dickins@tiscali.co.uk \
--cc=kadlec@blackhole.kfki.hu \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).