[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [patch] tux3-2.6.8.1-A3



Hi Ingo,

> the latest Tux patch merged to 2.6.8.1 is available at:
> 
>    redhat.com/~mingo/TUX-patches/tux3-2.6.8.1-A3
> 
> this fixes the symbol export problem reported by Fredrik Danerklint, and
> cleans up cpumask handling. The log_cpu_mask tunable moved from
> /proc/sys/net/tux/ to /proc/net/tux/.

Here is Andrew Mortons patch from a while ago to do more intelligent
writeout/invalidation of the logfile. It made writeout much more smooth.

Also I couldnt compile tux when it wasnt a module. Moving tux_module
outside CONFIG_MODULE fixed that.

(FYI open_private_file disappeared in current BK.)

Anton
diff -puN include/linux/fs.h~tux-better-logwrite include/linux/fs.h
--- foobar2/include/linux/fs.h~tux-better-logwrite	2004-09-11 02:07:16.982705700 +1000
+++ foobar2-anton/include/linux/fs.h	2004-09-11 02:07:17.015703164 +1000
@@ -588,6 +588,9 @@ struct file {
 	struct list_head	f_ep_links;
 	spinlock_t		f_ep_lock;
 #endif /* #ifdef CONFIG_EPOLL */
+#ifdef CONFIG_TUX
+	loff_t			f_last_index;
+#endif
 	struct address_space	*f_mapping;
 };
 extern spinlock_t files_lock;
diff -puN net/tux/logger.c~tux-better-logwrite net/tux/logger.c
--- foobar2/net/tux/logger.c~tux-better-logwrite	2004-09-11 02:07:16.989705162 +1000
+++ foobar2-anton/net/tux/logger.c	2004-09-11 02:07:17.018702933 +1000
@@ -681,6 +681,8 @@ static unsigned int writeout_log (void)
 	struct file *log_filp;
 	char * str;
 	unsigned int ret;
+	struct inode *inode;
+	struct address_space *mapping;
 
 	if (tux_logging)
 		Dprintk("TUX logger: opening log file {%s}.\n", tux_logfile);
@@ -725,18 +727,22 @@ static unsigned int writeout_log (void)
 	/*
 	 * Sync log data to disk:
 	 */
-	if (log_filp->f_op && log_filp->f_op->fsync) {
-		down(&log_filp->f_dentry->d_inode->i_sem);
-		log_filp->f_op->fsync(log_filp, log_filp->f_dentry, 1);
-		up(&log_filp->f_dentry->d_inode->i_sem);
+	inode = log_filp->f_dentry->d_inode;
+	mapping = inode->i_mapping;
+	if (mapping->nrpages > 256) {   /* batch stuff up */
+		down(&inode->i_sem);
+		filemap_fdatawrite(inode->i_mapping);
+
+		/*
+		 * Now nuke old pagecache up to the place where we just
+		 * started the I/O.   There's no point in trying to invalidate
+		 * pages after that, because they're currently in-flight.
+		 */
+		invalidate_mapping_pages(mapping, 0, log_filp->f_last_index);
+		log_filp->f_last_index = log_filp->f_pos >> PAGE_CACHE_SHIFT;
+		up(&inode->i_sem);
 	}
 
-	/*
-	 * Reduce the cache footprint of the logger file - it's
-	 * typically write-once.
-	 */
-	invalidate_inode_pages(log_filp->f_dentry->d_inode->i_mapping);
-
 out_lock:
 	spin_lock(&log_lock);
 out:
_
diff -puN net/socket.c~fix_tuxmodule net/socket.c
--- foobar2/net/socket.c~fix_tuxmodule	2004-09-11 02:01:56.135071423 +1000
+++ foobar2-anton/net/socket.c	2004-09-11 02:02:04.815730266 +1000
@@ -2086,11 +2086,12 @@ void __init sock_init(void)
 int tux_Dprintk;
 int tux_TDprintk;
 
+struct module *tux_module = NULL;
+
 #ifdef CONFIG_TUX_MODULE
 
 asmlinkage long (*sys_tux_ptr) (unsigned int action, user_req_t *u_info) = NULL;
 
-struct module *tux_module = NULL;
 spinlock_t tux_module_lock = SPIN_LOCK_UNLOCKED;
 
 asmlinkage long sys_tux (unsigned int action, user_req_t *u_info)
_

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]