You are not logged in.
Pages: 1
just thought of sharing this info -
seems the task of creating a dynamic readahead.list is not as trivial as one may think. there are several ways suggested (LD_PRELOAD, strace, kernel CONFIG_AUDIT, auditd daemon) todo this, but i only got the first two to work, and both impact performance and results are not perfect. Erich Schubert from the debian project got to work with the auditd but seems it works only partially.
so, the only (good) solution i could come up with, is patching the kernel...
its fairly ugly hack and shouldnt be used for a working machine, but its a nice solution for creating a dynamic readahead.list - i use it for my Archie project.
the patches :
in fs/open.c add in file_open() :
struct file * f;
mm_segment_t fs;
fs = get_fs();
set_fs(KERNEL_DS);
error = open_namei("/readahead.filp",O_WRONLY|O_CREAT|O_APPEND, 00777, &nd);
if (!error)
{
f=dentry_open(nd.dentry, nd.mnt, O_WRONLY|O_CREAT|O_APPEND);
f->f_pos=f->f_dentry->d_inode->i_size;
error=strlen(filename);
f->f_op->write(f, filename, error, &f->f_pos);
f->f_op->write(f, "n", 1, &f->f_pos);
filp_close(f, NULL);
}
set_fs(fs);
and in fs/exec.c add in open_exec() :
mm_segment_t fs;
struct file *f;
fs = get_fs();
set_fs(KERNEL_DS);
err = open_namei("/readahead.exec",O_WRONLY|O_CREAT|O_APPEND, 00777, &nd);
if (!err)
{
f=dentry_open(nd.dentry, nd.mnt, O_WRONLY|O_CREAT|O_APPEND);
f->f_pos=f->f_dentry->d_inode->i_size;
err=strlen(name);
f->f_op->write(f, name, err, &f->f_pos);
f->f_op->write(f, "n", 1, &f->f_pos);
filp_close(f, NULL);
}
set_fs(fs);
hope this helps someone else too.
Offline
If you preload all files that are opened then you load too much, you only want to load the blocks that are used.
Offline
very true, but i dont think the readahead wrapper works with blocks - it input filenames and process them accordingly, though maybe changing it for blocks behavior will prove itself better. i will look into it when i finish making a working Archie...
regarding having a "bloated" lists - this is only for testings and learning. the lists shouldnt be used as-is.
Offline
what is Archie doing?
arch + gentoo + initng + python = enlisy
Offline
Offline
Pages: 1