xfs
[Top] [All Lists]

Re: Hang on mount with 2.6

To: Klaus Strebel <klaus.strebel@xxxxxxxxx>
Subject: Re: Hang on mount with 2.6
From: Eric Sandeen <sandeen@xxxxxxx>
Date: 02 Oct 2003 13:07:45 -0500
Cc: Steve Lord <lord@xxxxxxx>, linux-xfs@xxxxxxxxxxx
In-reply-to: <3F7C6718.4070208@xxxxxxxxx>
Organization:
References: <3F7C16EA.9060701@xxxxxxxxx> <1065100031.1510.110.camel@xxxxxxxxxxxxxxxxxxxxxxx> <1065109451.23210.3.camel@xxxxxxxxxxxxxxxxxxxxxx> <3F7C6718.4070208@xxxxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
This patch should fix it up to work with preempt, as well.  Earlier code
was braindead on my part...

This doesn't protect the stats vars from preemption; I don't think we
care much, in any case it shouldn't harm anything but the accuracy of
the stats.

-Eric

===========================================================================
linux/fs/xfs/linux/xfs_stats.h
===========================================================================
 
--- /usr/tmp/TmpDir.27349-0/linux/fs/xfs/linux/xfs_stats.h_1.9  2003-10-02 
13:06:14.000000000 -0500
+++ linux/fs/xfs/linux/xfs_stats.h      2003-10-02 12:37:24.000000000 -0500
@@ -130,9 +130,11 @@
  
 DECLARE_PER_CPU(struct xfsstats, xfsstats);
  
-# define XFS_STATS_INC(count)          ( get_cpu_var(xfsstats).count++ )
-# define XFS_STATS_DEC(count)          ( get_cpu_var(xfsstats).count-- )
-# define XFS_STATS_ADD(count, inc)     ( get_cpu_var(xfsstats).count += (inc) )
+/* We don't disable preempt, not too worried about poking the
+ * wrong cpu's stat */
+#define XFS_STATS_INC(count)     (__get_cpu_var(xfsstats).count++)
+#define XFS_STATS_DEC(count)     (__get_cpu_var(xfsstats).count--)
+#define XFS_STATS_ADD(count, inc) (__get_cpu_var(xfsstats).count += (inc))
  
 extern void xfs_init_procfs(void);
 extern void xfs_cleanup_procfs(void);
 
===========================================================================
linux/fs/xfs/pagebuf/page_buf_internal.h
===========================================================================
 
--- /usr/tmp/TmpDir.27349-0/linux/fs/xfs/pagebuf/page_buf_internal.h_1.27       
2003-10-02 13:06:14.000000000 -0500
+++ linux/fs/xfs/pagebuf/page_buf_internal.h    2003-10-02 12:37:43.000000000 
-0500
@@ -123,7 +123,12 @@
  
 DECLARE_PER_CPU(struct pbstats, pbstats);
  
-#define PB_STATS_INC(count)    ( get_cpu_var(pbstats).count++ )
+/* We don't disable preempt, not too worried about poking the
+ * wrong cpu's stat */
+#define PB_STATS_INC(count) do {       \
+       get_cpu_var(pbstats).count++;   \
+       put_cpu_var(pbstats);           \
+} while (0)
  
 #ifndef STATIC
 # define STATIC        static



<Prev in Thread] Current Thread [Next in Thread>