[systemd-commits] 3 commits - fixme src/readahead-collect.c src/readahead-common.h src/readahead-replay.c
Lennart Poettering
lennart at kemper.freedesktop.org
Fri Sep 24 02:12:53 PDT 2010
fixme | 2 ++
src/readahead-collect.c | 11 ++++++-----
src/readahead-common.h | 1 +
src/readahead-replay.c | 7 +++----
4 files changed, 12 insertions(+), 9 deletions(-)
New commits:
commit 4030d7a923427a50745fc5786f4905aa703f0bcb
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Sep 24 11:12:10 2010 +0200
readahead: take file system root on command line
diff --git a/src/readahead-collect.c b/src/readahead-collect.c
index e93f4fe..937231c 100644
--- a/src/readahead-collect.c
+++ b/src/readahead-collect.c
@@ -437,11 +437,12 @@ finish:
}
int main(int argc, char *argv[]) {
+
log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
log_parse_environment();
log_open();
- if (collect("/") < 0)
+ if (collect(argc >= 2 ? argv[1] : "/") < 0)
return 1;
return 0;
diff --git a/src/readahead-replay.c b/src/readahead-replay.c
index 5f7a484..1f1ec52 100644
--- a/src/readahead-replay.c
+++ b/src/readahead-replay.c
@@ -201,11 +201,12 @@ finish:
}
int main(int argc, char*argv[]) {
+
log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
log_parse_environment();
log_open();
- if (replay("/") < 0)
+ if (replay(argc >= 2 ? argv[1] : "/") < 0)
return 1;
return 0;
commit c1480dae170e5b597b937dc3591974dc76728680
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu Sep 23 17:44:33 2010 +0200
readahead: normalize logging
diff --git a/fixme b/fixme
index 18b81e3..16aabda 100644
--- a/fixme
+++ b/fixme
@@ -94,6 +94,8 @@
* properly handle bind mounts in /etc/fstab
+* readahead() vs. fadvise() vs. ioprio
+
External:
* place /etc/inittab with explaining blurb.
diff --git a/src/readahead-collect.c b/src/readahead-collect.c
index 3699c3d..e93f4fe 100644
--- a/src/readahead-collect.c
+++ b/src/readahead-collect.c
@@ -319,7 +319,6 @@ static int collect(const char *root) {
m = FAN_EVENT_NEXT(m, n);
}
-
}
if (fanotify_fd >= 0) {
@@ -438,12 +437,10 @@ finish:
}
int main(int argc, char *argv[]) {
- /* log_set_target(LOG_TARGET_SYSLOG_OR_KMSG); */
+ log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
log_parse_environment();
log_open();
- log_set_max_level(LOG_DEBUG);
-
if (collect("/") < 0)
return 1;
diff --git a/src/readahead-replay.c b/src/readahead-replay.c
index b886857..5f7a484 100644
--- a/src/readahead-replay.c
+++ b/src/readahead-replay.c
@@ -201,12 +201,10 @@ finish:
}
int main(int argc, char*argv[]) {
- /* log_set_target(LOG_TARGET_SYSLOG_OR_KMSG); */
+ log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
log_parse_environment();
log_open();
- log_set_max_level(LOG_DEBUG);
-
if (replay("/") < 0)
return 1;
commit 6e3eb5ba18172ed965e6b91fd7fc05de6c86f739
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu Sep 23 17:35:16 2010 +0200
readahead: put limit on files we read ahead
diff --git a/src/readahead-collect.c b/src/readahead-collect.c
index 5ff3711..3699c3d 100644
--- a/src/readahead-collect.c
+++ b/src/readahead-collect.c
@@ -255,6 +255,9 @@ static int collect(const char *root) {
ssize_t n;
struct fanotify_event_metadata *m;
+ if (hashmap_size(files) > READAHEAD_FILES_MAX)
+ break;
+
if (poll(pollfd, _FD_MAX, -1) < 0) {
if (errno == EINTR)
diff --git a/src/readahead-common.h b/src/readahead-common.h
index da6a74e..5d8f1a3 100644
--- a/src/readahead-common.h
+++ b/src/readahead-common.h
@@ -25,6 +25,7 @@
#include <sys/stat.h>
#define READAHEAD_FILE_SIZE_MAX (128*1024*1024)
+#define READAHEAD_FILES_MAX (16*1024)
int file_verify(int fd, const char *fn, struct stat *st);
More information about the systemd-commits
mailing list