[prev in list] [next in list] [prev in thread] [next in thread] 

List:       oprofile-commits
Subject:    [oprof-cvs] CVS: oprofile/daemon opd_anon.c,1.4,1.5
From:       John Levon <movement () users ! sourceforge ! net>
Date:       2006-03-19 19:13:50
Message-ID: E1FL3La-0006AN-7f () sc8-pr-cvs1 ! sourceforge ! net
[Download RAW message or body]

Update of /cvsroot/oprofile/oprofile/daemon
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23595/daemon

Modified Files:
	opd_anon.c 
Log Message:
LRU improvement


Index: opd_anon.c
===================================================================
RCS file: /cvsroot/oprofile/oprofile/daemon/opd_anon.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -d -r1.4 -r1.5
--- opd_anon.c	19 Mar 2006 18:58:22 -0000	1.4
+++ opd_anon.c	19 Mar 2006 19:13:47 -0000	1.5
@@ -29,8 +29,14 @@
 #define HASH_SIZE 1024
 #define HASH_BITS (HASH_SIZE - 1)
 
-#define LRU_SIZE 1000
-#define LRU_AMOUNT (LRU_SIZE/5)
+/*
+ * Note that this value is tempered by the fact that when we miss in the
+ * anon cache, we'll tear down all the mappings for that tgid. Thus, LRU
+ * of a mapping can potentially clear out a much larger number of
+ * mappings.
+ */
+#define LRU_SIZE 8192
+#define LRU_AMOUNT (LRU_SIZE/8)
 
 static struct list_head hashes[HASH_SIZE];
 static struct list_head lru;
@@ -43,6 +49,7 @@ static void do_lru(struct transient * tr
 	struct list_head * pos2;
 	struct anon_mapping * entry;
 
+	fprintf(stderr, "Doing lru.\n");
 	list_for_each_safe(pos, pos2, &lru) {
 		entry = list_entry(pos, struct anon_mapping, lru_list);
 		if (trans->anon == entry)
@@ -52,7 +59,6 @@ static void do_lru(struct transient * tr
 		list_del(&entry->list);
 		list_del(&entry->lru_list);
 		sfile_clear_anon(entry);
-		--nr_lru;
 		free(entry);
 		if (nr_to_kill-- == 0)
 			break;
@@ -182,6 +188,8 @@ retry:
 	}
 
 	if (!tried) {
+		fprintf(stderr, "clr tgid %d app_cookie %s pc %llx\n",
+trans->tgid, verbose_cookie(trans->app_cookie), trans->pc);
 		clear_anon_maps(trans);
 		get_anon_maps(trans);
 		tried = 1;



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Oprofile-commits mailing list
Oprofile-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oprofile-commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic