[PATCH 2.6.12-rc5-mm1 1/4] perfctr: seqlocks for mmap:ed state: common

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

 



Andrew,

This set of patches changes perfctr's low-level drivers to indicate
changes to the mmap:ed counter state via a unified seqlock mechanism.
This cleans up user-space, enables user-space fast sampling in some
previously impossible cases (x86 w/o TSC), and eliminates a highly
unlikely but not impossible failure case on x86 SMP.

This is a rewrite of a patch originally from David Gibson.

perfctr seqlocks 1/4: common changes
- define write_perfseq_begin/end in <linux/perfctr.h>
- bump version and sync it with current user-space package

Signed-off-by: Mikael Pettersson <[email protected]>

 drivers/perfctr/version.h |    2 +-
 include/linux/perfctr.h   |   17 +++++++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff -rupN linux-2.6.12-rc5-mm1/drivers/perfctr/version.h linux-2.6.12-rc5-mm1.perfctr-seqlock-common/drivers/perfctr/version.h
--- linux-2.6.12-rc5-mm1/drivers/perfctr/version.h	2005-05-26 00:24:22.000000000 +0200
+++ linux-2.6.12-rc5-mm1.perfctr-seqlock-common/drivers/perfctr/version.h	2005-05-26 02:54:26.000000000 +0200
@@ -1 +1 @@
-#define VERSION "2.7.15"
+#define VERSION "2.7.17"
diff -rupN linux-2.6.12-rc5-mm1/include/linux/perfctr.h linux-2.6.12-rc5-mm1.perfctr-seqlock-common/include/linux/perfctr.h
--- linux-2.6.12-rc5-mm1/include/linux/perfctr.h	2005-05-26 00:24:32.000000000 +0200
+++ linux-2.6.12-rc5-mm1.perfctr-seqlock-common/include/linux/perfctr.h	2005-05-26 02:54:26.000000000 +0200
@@ -154,6 +154,23 @@ static inline void perfctr_set_cpus_allo
 
 #endif	/* CONFIG_PERFCTR_VIRTUAL */
 
+/* These routines are identical to write_seqcount_begin() and
+ * write_seqcount_end(), except they take an explicit __u32 rather
+ * than a seqcount_t.  That's because this sequence lock is user from
+ * userspace, so we have to pin down the counter's type explicitly to
+ * have a clear ABI.  They also omit the SMP write barriers since we
+ * only support mmap() based sampling for self-monitoring tasks.
+ */
+static inline void write_perfseq_begin(__u32 *seq)
+{
+	++*seq;
+}
+
+static inline void write_perfseq_end(__u32 *seq)
+{
+	++*seq; 
+}
+
 #endif	/* __KERNEL__ */
 
 #endif	/* _LINUX_PERFCTR_H */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux