Article View: news.software.nntp
Article #11616Re: Incoming feed acknowledgment speed & Backlog
From: Alan Brown
Date: Sun, 13 Oct 1996 00:00
Date: Sun, 13 Oct 1996 00:00
149 lines
7271 bytes
7271 bytes
In article <325ac78d.2480336@193.162.159.210>,
Jesper Skriver <jsr@teledk.net> wrote:
>jpc@drum.msfc.nasa.gov (J. Porter Clark) wrote:
>
>>Did anybody find a way to do this with Solaris 2.x?
>Or AIX 4.1.4 ?
Here's the original Linux patch to do it. It hasn't been rolled into
production kernels (yet), so Linuxers wanting to take advantage of it
will have to patch -l -p0.
Anyone else is going to have to try hacking their kernel to do the job.
I've been running this since mid June with no ill effects so far.
Date: Sun, 2 Jun 1996 09:00:59 -0500
From: coneill@PREMIER.NET
Reply-To: Linux Servers mailing list <SERVER-LINUX@NETSPACE.ORG>
To: Multiple recipients of list SERVER-LINUX <SERVER-LINUX@NETSPACE.ORG>
Subject: Ext2 speedup (No atime update)
This is an implementation of an idea that I believe was originally
mentioned on the FreeBSD hackers mailing list.
The basic idea behind this is that for some applications, there is litle
or no point in updating the access time on the file. My primary use for
this is on our news server's spool and history disks. These drives are
primarily read-intensive, with most of the files being 2-3k. As you can
understand, updating a 1k inode every time you read a 2k file isn't
really very nice if you don't have to. My tests and examination of the
news programs I'm using indicate that it isn't used for anything.
This patch adds two mount-time options, "no_atime" and "update_atime".
update_atime is the default and will update atime's normally. no_atime
will never update atime's on files, directories, and symlinks.
update_atime primarily exists for remounting the filesystem.
This patch has been in production here for almost a week now with no
problems. It's very straightforward, and should have little or no
side-effects. However, I am wondering, would this be more
useful/appropriate as an inheritable ext2 attribute?
Anyway, please send any feedback you have to me, I'd like to hear from
anyone that tries it, whether or works or doesn't :)
diff -u -r linux.orig/fs/ext2/dir.c linux/fs/ext2/dir.c
--- linux.orig/fs/ext2/dir.c Fri Dec 22 05:00:19 1995
+++ linux/fs/ext2/dir.c Thu May 30 03:04:18 1996
@@ -206,7 +206,7 @@
offset = 0;
brelse (bh);
}
- if (!IS_RDONLY(inode)) {
+ if (!IS_RDONLY(inode) && !test_opt(sb,NO_ATIME)) {
inode->i_atime = CURRENT_TIME;
inode->i_dirt = 1;
}
diff -u -r linux.orig/fs/ext2/file.c linux/fs/ext2/file.c
diff -u -r linux.orig/fs/ext2/super.c linux/fs/ext2/super.c
--- linux.orig/fs/ext2/super.c Sat May 4 02:07:07 1996
+++ linux/fs/ext2/super.c Thu May 30 15:39:58 1996
@@ -252,6 +252,11 @@
value);
return 0;
}
+ } else if (!strcmp (this_char, "no_atime")) {
+ set_opt (*mount_options, NO_ATIME);
+ }
+ else if (!strcmp (this_char, "update_atime")) {
+ clear_opt (*mount_options, NO_ATIME);
}
/* Silently ignore the quota options */
else if (!strcmp (this_char, "grpquota")
diff -u -r linux.orig/fs/ext2/symlink.c linux/fs/ext2/symlink.c
--- linux.orig/fs/ext2/symlink.c Fri Apr 12 02:33:26 1996
+++ linux/fs/ext2/symlink.c Thu May 30 15:42:14 1996
@@ -86,7 +86,7 @@
link = bh->b_data;
} else
link = (char *) inode->u.ext2_i.i_data;
- if (!IS_RDONLY(inode)) {
+ if (!IS_RDONLY(inode) && !test_opt(inode->i_sb,NO_ATIME)) {
inode->i_atime = CURRENT_TIME;
inode->i_dirt = 1;
}
@@ -127,7 +127,7 @@
i++;
put_user (c, buffer++);
}
- if (!IS_RDONLY(inode)) {
+ if (!IS_RDONLY(inode) && !test_opt(inode->i_sb,NO_ATIME)) {
inode->i_atime = CURRENT_TIME;
inode->i_dirt = 1;
}
diff -u -r linux.orig/include/linux/ext2_fs.h linux/include/linux/ext2_fs.h
--- linux.orig/include/linux/ext2_fs.h Mon May 20 12:33:56 1996
+++ linux/include/linux/ext2_fs.h Thu May 30 03:01:55 1996
@@ -296,6 +296,7 @@
#define EXT2_MOUNT_ERRORS_RO 0x0020 /* Remount fs ro on errors */
#define EXT2_MOUNT_ERRORS_PANIC 0x0040 /* Panic on errors */
#define EXT2_MOUNT_MINIX_DF 0x0080 /* Mimics the Minix statfs */
+#define EXT2_MOUNT_NO_ATIME 0x0100 /* Don't update the atime */
#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt
#define set_opt(o, opt) o |= EXT2_MOUNT_##opt
diff -u -r linux.orig/mm/filemap.c linux/mm/filemap.c
--- linux.orig/mm/filemap.c Sun May 19 15:37:07 1996
+++ linux/mm/filemap.c Thu May 30 21:35:58 1996
@@ -719,7 +719,12 @@
filp->f_reada = 1;
if (page_cache)
free_page(page_cache);
- if (!IS_RDONLY(inode)) {
+ if (inode->i_sb->s_magic==EXT2_SUPER_MAGIC) {
+ if (!IS_RDONLY(inode) && !test_opt(inode->i_sb, NO_ATIME)) {
+ inode->i_atime = CURRENT_TIME;
+ inode->i_dirt = 1;
+ }
+ } else if (!IS_RDONLY(inode)) {
inode->i_atime = CURRENT_TIME;
inode->i_dirt = 1;
}
@@ -1097,7 +1102,12 @@
return -EACCES;
if (!inode->i_op || !inode->i_op->readpage)
return -ENOEXEC;
- if (!IS_RDONLY(inode)) {
+ if (inode->i_sb->s_magic==EXT2_SUPER_MAGIC) {
+ if (!IS_RDONLY(inode) && !test_opt(inode->i_sb, NO_ATIME)) {
+ inode->i_atime = CURRENT_TIME;
+ inode->i_dirt = 1;
+ }
+ } else if (!IS_RDONLY(inode)) {
inode->i_atime = CURRENT_TIME;
inode->i_dirt = 1;
}
-------------------------------------------------------------------------
Clayton O'Neill Business--> Premier One Inc
whatever@oneill.net clayton@premier.net
http://www.oneill.net <--Personal http://www.premier.net
--
One net to rule them all, one net to find them, one net to bring them all,
using Unix to bind them.
Technical Details
Message-ID:
<53ps3c$5s8@papaioea.manawatu.gen.nz>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<lyle-ya023180000210961146000001@news.azlink.com> <53culo$2bv@papaioea.manawatu.gen.nz> <53dvm5$qh@anvil.msfc.nasa.gov> <325ac78d.2480336@193.162.159.210>Show Full Headers
Complete Article Headers
Message-ID: <53ps3c$5s8@papaioea.manawatu.gen.nz> Subject: Re: Incoming feed acknowledgment speed & Backlog Date: Sun, 13 Oct 1996 00:00:00 +0000 From: alan@papaioea.manawatu.gen.nz (Alan Brown) References: <lyle-ya023180000210961146000001@news.azlink.com> <53culo$2bv@papaioea.manawatu.gen.nz> <53dvm5$qh@anvil.msfc.nasa.gov> <325ac78d.2480336@193.162.159.210> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 189093677 Content-type: text/plain; charset=iso-8859-1 Organization: PlaNet (NZ) Manawatu, Palmerston North +64 6 357-9245, Levin +64 6 367 9944 Mime-version: 1.0 Newsgroups: news.software.nntp