linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 0/4] Lockless update of reference count protected by spinlock
@ 2013-08-06  3:12 Waiman Long
  2013-08-06  3:12 ` [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount Waiman Long
                   ` (4 more replies)
  0 siblings, 5 replies; 151+ messages in thread
From: Waiman Long @ 2013-08-06  3:12 UTC (permalink / raw)
  To: Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner
  Cc: Waiman Long, linux-fsdevel, linux-kernel, Peter Zijlstra,
	Steven Rostedt, Linus Torvalds, Benjamin Herrenschmidt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

v6->v7:
 - Substantially reduce the number of patches from 14 to 4 because a
   lot of the minor filesystem related changes had been merged to
   v3.11-rc1.
 - Remove architecture specific customization (LOCKREF_WAIT_SHIFT &
   LOCKREF_RETRY_COUNT).
 - Tune single-thread performance of lockref_put/get to within 10%
   of old lock->update->unlock code.

v5->v6:
 - Add a new GENERIC_SPINLOCK_REFCOUNT config parameter for using the
   generic implementation.
 - Add two parameters LOCKREF_WAIT_SHIFT and LOCKREF_RETRY_COUNT which
   can be specified differently for each architecture.
 - Update various spinlock_refcount.* files to incorporate review
   comments.
 - Replace reference of d_refcount() macro in Lustre filesystem code in
   the staging tree to use the new d_count() helper function.

v4->v5:
 - Add a d_count() helper for readonly access of reference count and
   change all references to d_count outside of dcache.c, dcache.h
   and namei.c to use d_count().

v3->v4:
 - Replace helper function access to d_lock and d_count by using
   macros to redefine the old d_lock name to the spinlock and new
   d_refcount name to the reference count. This greatly reduces the
   size of this patchset from 25 to 12 and make it easier to review.

v2->v3:
 - Completely revamp the packaging by adding a new lockref data
   structure that combines the spinlock with the reference
   count. Helper functions are also added to manipulate the new data
   structure. That results in modifying over 50 files, but the changes
   were trivial in most of them.
 - Change initial spinlock wait to use a timeout.
 - Force 64-bit alignment of the spinlock & reference count structure.
 - Add a new way to use the combo by using a new union and helper
   functions.

v1->v2:
 - Add one more layer of indirection to LOCK_WITH_REFCOUNT macro.
 - Add __LINUX_SPINLOCK_REFCOUNT_H protection to spinlock_refcount.h.
 - Add some generic get/put macros into spinlock_refcount.h.

This patchset supports a generic mechanism to atomically update
a reference count that is protected by a spinlock without actually
acquiring the lock itself. If the update doesn't succeeed, the caller
will have to acquire the lock and update the reference count in the
the old way.  This will help in situation where there is a lot of
spinlock contention because of frequent reference count update.

The d_lock and d_count fields of the struct dentry in dcache.h was
modified to use the new lockref data structure and the d_lock name
is now a macro to the actual spinlock.

This patch set causes significant performance improvement in the
short workload of the AIM7 benchmark on a 8-socket x86-64 machine
with 80 cores.

Thank to Thomas Gleixner, Andi Kleen and Linus for their valuable
input in shaping this patchset.

Signed-off-by: Waiman Long <Waiman.Long@hp.com>

Waiman Long (4):
  spinlock: A new lockref structure for lockless update of refcount
  spinlock: Enable x86 architecture to do lockless refcount update
  dcache: replace d_lock/d_count by d_lockcnt
  dcache: Enable lockless update of dentry's refcount

 arch/x86/Kconfig                        |    3 +
 fs/dcache.c                             |   78 +++++++------
 fs/namei.c                              |    6 +-
 include/asm-generic/spinlock_refcount.h |   46 +++++++
 include/linux/dcache.h                  |   22 ++--
 include/linux/spinlock_refcount.h       |  126 ++++++++++++++++++++
 kernel/Kconfig.locks                    |   15 +++
 lib/Makefile                            |    2 +
 lib/spinlock_refcount.c                 |  198 +++++++++++++++++++++++++++++++
 9 files changed, 449 insertions(+), 47 deletions(-)
 create mode 100644 include/asm-generic/spinlock_refcount.h
 create mode 100644 include/linux/spinlock_refcount.h
 create mode 100644 lib/spinlock_refcount.c


^ permalink raw reply	[flat|nested] 151+ messages in thread

* [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-06  3:12 [PATCH v7 0/4] Lockless update of reference count protected by spinlock Waiman Long
@ 2013-08-06  3:12 ` Waiman Long
  2013-08-29  1:40   ` Linus Torvalds
  2013-08-06  3:12 ` [PATCH v7 2/4] spinlock: Enable x86 architecture to do lockless refcount update Waiman Long
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 151+ messages in thread
From: Waiman Long @ 2013-08-06  3:12 UTC (permalink / raw)
  To: Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner
  Cc: Waiman Long, linux-fsdevel, linux-kernel, Peter Zijlstra,
	Steven Rostedt, Linus Torvalds, Benjamin Herrenschmidt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

This patch introduces a new set of spinlock_refcount.h header files to
be included by kernel codes that want to do a faster lockless update
of reference count protected by a spinlock.

The new lockref structure consists of just the spinlock and the
reference count data. Helper functions are defined in the new
<linux/spinlock_refcount.h> header file to access the content of
the new structure. There is a generic structure defined for all
architecture, but each architecture can also optionally define its
own structure and use its own helper functions.

Three new config parameters are introduced:
1. SPINLOCK_REFCOUNT
2. GENERIC_SPINLOCK_REFCOUNT
2. ARCH_SPINLOCK_REFCOUNT

The first one is defined in the kernel/Kconfig.locks which is used
to enable or disable the faster lockless reference count update
optimization. The second and third one have to be defined in each of
the architecture's Kconfig file to enable the optimization for that
architecture. Therefore, each architecture has to opt-in for this
optimization or it won't get it. This allows each architecture plenty
of time to test it out before deciding to use it or replace it with
a better architecture specific solution. The architecture should set
only GENERIC_SPINLOCK_REFCOUNT to use the generic implementation
without customization. By setting only ARCH_SPINLOCK_REFCOUNT,
the architecture will have to provide its own implementation.

This optimization won't work for non-SMP system or when spinlock
debugging is turned on. As a result, it is turned off each any of
them is true. It also won't work for full preempt-RT and so should
be turned off in this case.

To maximize the chance of doing lockless atomic update, the new code
will wait until the lock is free before trying to do the update.
The code will also attempt to do lockless atomic update a few times
before falling back to the old code path of acquiring a lock before
doing the update.

The table below shows the average JPM (jobs/minute) number (out of
3 runs) of the AIM7's short workload at 1500 users for different
configurations on an 8-socket 80-core DL980 with HT off with kernel
based on 3.11-rc3.

Configuration					  JPM
-------------					  ---
Wait till lock free, 1 update attempt		5899907
Wait till lock free, 2 update attempts		6534958
Wait till lock free, 3 update attempts		6868170
Wait till lock free, 4 update attempts		6905332
No wait,  2 update attempts			1091273
No wait,  4 update attempts			1281867
No wait,  8 update attempts			5095203
No wait, 16 update attempts			6392709
No wait, 32 update attempts			6438080

The "no wait, 8 update attempts" test showed high variability in the
results.  One run can have 6M JPM whereas the other one is only 2M
JPM, for example. The "wait till lock free" tests, on the other hand,
are much more stable in their throughput numbers.

For this initial version, the code will wait until the lock is free
with 4 update attempts.

To evaluate the performance difference between doing a reference count
update using the old way (lock->update->unlock) and the new lockref
functions in the uncontended case, a 256K loop was run on a 2.4Ghz
Westmere x86-64 CPU.  The following table shows the average time
(in ns) for a single update operation (including the looping and
timing overhead):

Update Type		Time (ns)
-----------		---------
lock->update->unlock	  14.7
lockref_get/lockref_put	  16.0

The new lockref* functions are about 10% slower than when there is
no contention. Since reference count update is usually a very small
part of a typical workload, the actual performance impact of this
change is negligible when there is no contention.

Signed-off-by: Waiman Long <Waiman.Long@hp.com>
---
 include/asm-generic/spinlock_refcount.h |   46 +++++++
 include/linux/spinlock_refcount.h       |  126 ++++++++++++++++++++
 kernel/Kconfig.locks                    |   15 +++
 lib/Makefile                            |    2 +
 lib/spinlock_refcount.c                 |  198 +++++++++++++++++++++++++++++++
 5 files changed, 387 insertions(+), 0 deletions(-)
 create mode 100644 include/asm-generic/spinlock_refcount.h
 create mode 100644 include/linux/spinlock_refcount.h
 create mode 100644 lib/spinlock_refcount.c

diff --git a/include/asm-generic/spinlock_refcount.h b/include/asm-generic/spinlock_refcount.h
new file mode 100644
index 0000000..d3a4119
--- /dev/null
+++ b/include/asm-generic/spinlock_refcount.h
@@ -0,0 +1,46 @@
+/*
+ * Spinlock with reference count combo
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
+ *
+ * Authors: Waiman Long <waiman.long@hp.com>
+ */
+#ifndef __ASM_GENERIC_SPINLOCK_REFCOUNT_H
+#define __ASM_GENERIC_SPINLOCK_REFCOUNT_H
+
+/*
+ * The lockref structure defines a combined spinlock with reference count
+ * data structure to be embedded in a larger structure. The combined data
+ * structure is always 8-byte aligned. So proper placement of this structure
+ * in the larger embedding data structure is needed to ensure that there is
+ * no hole in it.
+ */
+struct __aligned(sizeof(u64)) lockref {
+	union {
+		u64		lock_count;
+		struct {
+			unsigned int	refcnt;	/* Reference count */
+			spinlock_t	lock;
+		};
+	};
+};
+
+/*
+ * Struct lockref helper functions
+ */
+extern void lockref_get(struct lockref *lockcnt);
+extern int  lockref_put(struct lockref *lockcnt);
+extern int  lockref_get_not_zero(struct lockref *lockcnt);
+extern int  lockref_put_or_lock(struct lockref *lockcnt);
+
+#endif /* __ASM_GENERIC_SPINLOCK_REFCOUNT_H */
diff --git a/include/linux/spinlock_refcount.h b/include/linux/spinlock_refcount.h
new file mode 100644
index 0000000..abadd87
--- /dev/null
+++ b/include/linux/spinlock_refcount.h
@@ -0,0 +1,126 @@
+/*
+ * Spinlock with reference count combo data structure
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
+ *
+ * Authors: Waiman Long <waiman.long@hp.com>
+ */
+#ifndef __LINUX_SPINLOCK_REFCOUNT_H
+#define __LINUX_SPINLOCK_REFCOUNT_H
+
+#include <linux/spinlock.h>
+
+/*
+ * To enable lockless update of reference count, an architecture has to define
+ * either one of the following two config parameters in its Kconfig file:
+ * 1. GENERIC_SPINLOCK_REFCOUNT
+ * 2. ARCH_SPINLOCK_REFCOUNT
+ *
+ * By defining just the GENERIC_SPINLOCK_REFCOUNT parameter, the architecture
+ * will use the generic implementation. There is nothing else an architecture
+ * need to do.
+ *
+ * On the other hand, defining the ARCH_SPINLOCK_REFCOUNT parameter indicates
+ * that the architecture is provding its own implementation. It has to provide
+ * an <asm/spinlock_refcount.h> header file.
+ */
+#ifdef CONFIG_SPINLOCK_REFCOUNT
+
+# ifdef CONFIG_ARCH_SPINLOCK_REFCOUNT
+# include <asm/spinlock_refcount.h>
+# else
+# include <asm-generic/spinlock_refcount.h>
+# endif
+
+#else
+/*
+ * If the spinlock & reference count optimization feature is disabled,
+ * they will be accessed separately on its own.
+ */
+struct lockref {
+	unsigned int refcnt;	/* Reference count */
+	spinlock_t   lock;
+};
+
+/*
+ * Struct lockref helper functions
+ */
+/**
+ * lockref_get - Increments reference count unconditionally
+ * @lockcnt: pointer to lockref structure
+ */
+static __always_inline void lockref_get(struct lockref *lockcnt)
+{
+	spin_lock(&lockcnt->lock);
+	lockcnt->refcnt++;
+	spin_unlock(&lockcnt->lock);
+}
+
+/**
+ * lockref_get_not_zero - Increments count unless the count is 0
+ * @lockcnt: pointer to lockref structure
+ * Return: 1 if count updated successfully or 0 if count is 0
+ */
+static __always_inline int lockref_get_not_zero(struct lockref *lockcnt)
+{
+	int retval = 0;
+
+	spin_lock(&lockcnt->lock);
+	if (likely(lockcnt->refcnt)) {
+		lockcnt->refcnt++;
+		retval = 1;
+	}
+	spin_unlock(&lockcnt->lock);
+	return retval;
+}
+
+/**
+ * lockref_put - Decrements count unless count <= 1 before decrement
+ * @lockcnt: pointer to lockref structure
+ * Return: 1 if count updated successfully or 0 if count <= 1
+ */
+static __always_inline int lockref_put(struct lockref *lockcnt)
+{
+	int retval = 0;
+
+	spin_lock(&lockcnt->lock);
+	if (likely(lockcnt->refcnt > 1)) {
+		lockcnt->refcnt--;
+		retval = 1;
+	}
+	spin_unlock(&lockcnt->lock);
+	return retval;
+}
+
+/**
+ * lockref_put_or_lock - decrements count unless count <= 1 before decrement
+ * @lockcnt: pointer to lockref structure
+ * Return: 1 if count updated successfully or 0 if count <= 1 and lock taken
+ *
+ * The only difference between lockref_put_or_lock and lockref_put is that
+ * the former function will hold the lock on return while the latter one
+ * will free it on return.
+ */
+static __always_inline int lockref_put_or_lock(struct lockref *lockcnt)
+{
+	spin_lock(&lockcnt->lock);
+	if (likely(lockcnt->refcnt > 1)) {
+		lockcnt->refcnt--;
+		spin_unlock(&lockcnt->lock);
+		return 1;
+	}
+	return 0;
+}
+
+#endif /* !CONFIG_SPINLOCK_REFCOUNT */
+#endif /* __LINUX_SPINLOCK_REFCOUNT_H */
diff --git a/kernel/Kconfig.locks b/kernel/Kconfig.locks
index d2b32ac..67ff90b 100644
--- a/kernel/Kconfig.locks
+++ b/kernel/Kconfig.locks
@@ -223,3 +223,18 @@ endif
 config MUTEX_SPIN_ON_OWNER
 	def_bool y
 	depends on SMP && !DEBUG_MUTEXES
+
+#
+# Spinlock with reference count optimization
+#
+config GENERIC_SPINLOCK_REFCOUNT
+	bool
+
+config ARCH_SPINLOCK_REFCOUNT
+	bool
+
+config SPINLOCK_REFCOUNT
+	def_bool y
+	depends on ARCH_SPINLOCK_REFCOUNT || GENERIC_SPINLOCK_REFCOUNT
+	depends on SMP
+	depends on !GENERIC_LOCKBREAK && !DEBUG_SPINLOCK && !DEBUG_LOCK_ALLOC
diff --git a/lib/Makefile b/lib/Makefile
index 7baccfd..91de559 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -187,3 +187,5 @@ quiet_cmd_build_OID_registry = GEN     $@
 clean-files	+= oid_registry_data.c
 
 obj-$(CONFIG_UCS2_STRING) += ucs2_string.o
+
+obj-$(CONFIG_GENERIC_SPINLOCK_REFCOUNT) += spinlock_refcount.o
diff --git a/lib/spinlock_refcount.c b/lib/spinlock_refcount.c
new file mode 100644
index 0000000..963ff07
--- /dev/null
+++ b/lib/spinlock_refcount.c
@@ -0,0 +1,198 @@
+/*
+ * Generic spinlock with reference count combo
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * (C) Copyright 2013 Hewlett-Packard Development Company, L.P.
+ *
+ * Authors: Waiman Long <waiman.long@hp.com>
+ */
+
+#ifdef CONFIG_SPINLOCK_REFCOUNT
+#include <linux/spinlock.h>
+#include <linux/spinlock_refcount.h>
+
+/*
+ * The number of attempts to update the reference count locklessly before
+ * quitting (default = 4).
+ */
+#ifndef	LOCKREF_RETRY_COUNT
+#define LOCKREF_RETRY_COUNT	4
+#endif
+
+/**
+ *
+ * add_unless - atomically add to count unless locked or reach threshold
+ *
+ * @lockcnt  : pointer to the lockref structure
+ * @value    : value to be added
+ * @threshold: threshold value for acquiring the lock
+ * Return    : 1 if operation succeeds, -1 if threshold reached, 0 otherwise
+ *
+ * If the lock was not acquired, add_unless() atomically adds the given value
+ * to the reference count unless the given threshold is reached. If the lock
+ * was acquired or the threshold was reached, 0 is returned and the caller
+ * will have to acquire the lock and update the count accordingly (can be
+ * done in a non-atomic way).
+ */
+static __always_inline int
+add_unless(struct lockref *lockcnt, int value, int threshold)
+{
+	struct lockref old;
+	register struct lockref new;
+
+	old.lock_count = ACCESS_ONCE(lockcnt->lock_count);
+	if ((threshold >= 0) && (old.refcnt <= threshold))
+		return -1;
+	if (likely(!spin_is_locked(&old.lock))) {
+		new.lock_count = old.lock_count;
+		new.refcnt += value;
+		if (likely(cmpxchg64(&lockcnt->lock_count, old.lock_count,
+				     new.lock_count) == old.lock_count))
+			return 1;
+	}
+	return 0;
+}
+
+/**
+ *
+ * add_unless_loop - call add_unless in a loop
+ *
+ * @lockcnt  : pointer to the lockref structure
+ * @value    : value to be added
+ * @threshold: threshold value for acquiring the lock
+ * @loopcnt  : loop count
+ * Return    : 1 if operation succeeds, 0 otherwise
+ */
+static noinline int
+add_unless_loop(struct lockref *lockcnt, int value, int threshold, int loopcnt)
+{
+	int ret;
+
+	if (threshold >= 0) {
+		for (; loopcnt > 0; loopcnt--) {
+			ret = add_unless(lockcnt, value, threshold);
+			if (ret > 0)
+				return 1;
+			else if (ret < 0)
+				return 0;
+			cpu_relax();
+		}
+	} else {
+		for (; loopcnt > 0; loopcnt--) {
+			if (add_unless(lockcnt, value, -1) > 0)
+				return 1;
+			cpu_relax();
+		}
+	}
+	return 0;
+}
+
+/**
+ *
+ * lockref_add_unless - atomically add to count unless locked or reach threshold
+ *
+ * @lockcnt  : pointer to the lockref structure
+ * @value    : value to be added
+ * @threshold: threshold value for acquiring the lock
+ * Return    : 1 if operation succeeds, 0 otherwise
+ *
+ * The reason for separating out the first lockless update attempt from the
+ * rest is due to the fact that gcc compiler seems to be less able to optimize
+ * complex operations in a loop. So we try it once, if it doesn't work, we
+ * try out the remaining attempts in a separate slowpath function.
+ */
+static __always_inline int
+lockref_add_unless(struct lockref *lockcnt, int value, int threshold)
+{
+	int ret;
+
+	/*
+	 * Code doesn't work if raw spinlock is larger than 4 bytes
+	 * or is empty.
+	 */
+	BUILD_BUG_ON((sizeof(arch_spinlock_t) == 0) ||
+		     (sizeof(arch_spinlock_t) >  4));
+
+	/*
+	 * Wait until the lock is free before attempting to do a lockless
+	 * reference count update.
+	 */
+	while (spin_is_locked(&lockcnt->lock))
+		cpu_relax();
+
+	ret = add_unless(lockcnt, value, threshold);
+	if (likely(ret > 0))
+		return 1;
+	if (unlikely((ret == 0) && (LOCKREF_RETRY_COUNT > 1))) {
+		cpu_relax();
+		if (add_unless_loop(lockcnt, value, threshold,
+				    LOCKREF_RETRY_COUNT - 1))
+			return 1;
+	}
+	return 0;
+}
+
+/*
+ * Struct lockref helper functions
+ */
+/**
+ * lockref_get - Increments reference count unconditionally
+ * @lockcnt: pointer to struct lockref structure
+ */
+void lockref_get(struct lockref *lockcnt)
+{
+	if (likely(lockref_add_unless(lockcnt, 1, -1)))
+		return;
+	spin_lock(&lockcnt->lock);
+	lockcnt->refcnt++;
+	spin_unlock(&lockcnt->lock);
+}
+EXPORT_SYMBOL(lockref_get);
+
+/**
+ * lockref_get_not_zero - Increments count unless the count is 0
+ * @lockcnt: pointer to struct lockref structure
+ * Return: 1 if count updated successfully or 0 if count is 0 and lock taken
+ */
+int lockref_get_not_zero(struct lockref *lockcnt)
+{
+	return lockref_add_unless(lockcnt, 1, 0);
+}
+EXPORT_SYMBOL(lockref_get_not_zero);
+
+/**
+ * lockref_put - Decrements count unless the count <= 1
+ * @lockcnt: pointer to struct lockref structure
+ * Return: 1 if count updated successfully or 0 if count <= 1
+ */
+int lockref_put(struct lockref *lockcnt)
+{
+	return lockref_add_unless(lockcnt, -1, 1);
+}
+EXPORT_SYMBOL(lockref_put);
+
+/**
+ * lockref_put_or_lock - Decrements count unless the count is <= 1
+ *			 otherwise, the lock will be taken
+ * @lockcnt: pointer to struct lockref structure
+ * Return: 1 if count updated successfully or 0 if count <= 1 and lock taken
+ */
+int
+lockref_put_or_lock(struct lockref *lockcnt)
+{
+	if (likely(lockref_add_unless(lockcnt, -1, 1)))
+		return 1;
+	spin_lock(&lockcnt->lock);
+	return 0;
+}
+EXPORT_SYMBOL(lockref_put_or_lock);
+#endif /* CONFIG_SPINLOCK_REFCOUNT */
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 151+ messages in thread

* [PATCH v7 2/4] spinlock: Enable x86 architecture to do lockless refcount update
  2013-08-06  3:12 [PATCH v7 0/4] Lockless update of reference count protected by spinlock Waiman Long
  2013-08-06  3:12 ` [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount Waiman Long
@ 2013-08-06  3:12 ` Waiman Long
  2013-08-06  3:12 ` [PATCH v7 3/4] dcache: replace d_lock/d_count by d_lockcnt Waiman Long
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 151+ messages in thread
From: Waiman Long @ 2013-08-06  3:12 UTC (permalink / raw)
  To: Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner
  Cc: Waiman Long, linux-fsdevel, linux-kernel, Peter Zijlstra,
	Steven Rostedt, Linus Torvalds, Benjamin Herrenschmidt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

This patch enables the x86 architecture to do lockless reference
count update using the generic lockref implementation with default
parameters. Only the x86/Kconfig file needs to be changed.

Signed-off-by: Waiman Long <Waiman.Long@hp.com>
---
 arch/x86/Kconfig |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index b32ebf9..79a9309 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -262,6 +262,9 @@ config ARCH_CPU_PROBE_RELEASE
 config ARCH_SUPPORTS_UPROBES
 	def_bool y
 
+config GENERIC_SPINLOCK_REFCOUNT
+	def_bool y
+
 source "init/Kconfig"
 source "kernel/Kconfig.freezer"
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 151+ messages in thread

* [PATCH v7 3/4] dcache: replace d_lock/d_count by d_lockcnt
  2013-08-06  3:12 [PATCH v7 0/4] Lockless update of reference count protected by spinlock Waiman Long
  2013-08-06  3:12 ` [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount Waiman Long
  2013-08-06  3:12 ` [PATCH v7 2/4] spinlock: Enable x86 architecture to do lockless refcount update Waiman Long
@ 2013-08-06  3:12 ` Waiman Long
  2013-08-06  3:12 ` [PATCH v7 4/4] dcache: Enable lockless update of dentry's refcount Waiman Long
  2013-08-13 18:03 ` [PATCH v7 0/4] Lockless update of reference count protected by spinlock Waiman Long
  4 siblings, 0 replies; 151+ messages in thread
From: Waiman Long @ 2013-08-06  3:12 UTC (permalink / raw)
  To: Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner
  Cc: Waiman Long, linux-fsdevel, linux-kernel, Peter Zijlstra,
	Steven Rostedt, Linus Torvalds, Benjamin Herrenschmidt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

This patch replaces the d_lock and d_count fields of the dentry
data structure by the combined d_lockcnt structure. A d_lock macro
is defined to remap the old d_lock name to the new d_lockcnt.lock
name. This is needed as a lot of files use the d_lock spinlock.

Read accesses to d_count are replaced by the d_count() helper
function. Write accesses to d_count are replaced by the new
d_lockcnt.refcnt name. Other than that, there is no other functional
change in this patch.

The offsets of the new d_lockcnt field are at byte 72 and 88 for
32-bit and 64-bit SMP systems respectively. In both cases, they are
8-byte aligned and their combination into a single 8-byte word will
not introduce a hole that increase the size of the dentry structure.

Signed-off-by: Waiman Long <Waiman.Long@hp.com>
---
 fs/dcache.c            |   54 ++++++++++++++++++++++++------------------------
 fs/namei.c             |    6 ++--
 include/linux/dcache.h |   15 ++++++++----
 3 files changed, 40 insertions(+), 35 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index 87bdb53..3adb6aa 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -54,7 +54,7 @@
  *   - d_flags
  *   - d_name
  *   - d_lru
- *   - d_count
+ *   - d_lockcnt.refcnt
  *   - d_unhashed()
  *   - d_parent and d_subdirs
  *   - childrens' d_child and d_parent
@@ -229,7 +229,7 @@ static void __d_free(struct rcu_head *head)
  */
 static void d_free(struct dentry *dentry)
 {
-	BUG_ON(dentry->d_count);
+	BUG_ON(d_count(dentry));
 	this_cpu_dec(nr_dentry);
 	if (dentry->d_op && dentry->d_op->d_release)
 		dentry->d_op->d_release(dentry);
@@ -467,7 +467,7 @@ relock:
 	}
 
 	if (ref)
-		dentry->d_count--;
+		dentry->d_lockcnt.refcnt--;
 	/*
 	 * inform the fs via d_prune that this dentry is about to be
 	 * unhashed and destroyed.
@@ -513,12 +513,12 @@ void dput(struct dentry *dentry)
 		return;
 
 repeat:
-	if (dentry->d_count == 1)
+	if (d_count(dentry) == 1)
 		might_sleep();
 	spin_lock(&dentry->d_lock);
-	BUG_ON(!dentry->d_count);
-	if (dentry->d_count > 1) {
-		dentry->d_count--;
+	BUG_ON(!d_count(dentry));
+	if (d_count(dentry) > 1) {
+		dentry->d_lockcnt.refcnt--;
 		spin_unlock(&dentry->d_lock);
 		return;
 	}
@@ -535,7 +535,7 @@ repeat:
 	dentry->d_flags |= DCACHE_REFERENCED;
 	dentry_lru_add(dentry);
 
-	dentry->d_count--;
+	dentry->d_lockcnt.refcnt--;
 	spin_unlock(&dentry->d_lock);
 	return;
 
@@ -590,7 +590,7 @@ int d_invalidate(struct dentry * dentry)
 	 * We also need to leave mountpoints alone,
 	 * directory or not.
 	 */
-	if (dentry->d_count > 1 && dentry->d_inode) {
+	if (d_count(dentry) > 1 && dentry->d_inode) {
 		if (S_ISDIR(dentry->d_inode->i_mode) || d_mountpoint(dentry)) {
 			spin_unlock(&dentry->d_lock);
 			return -EBUSY;
@@ -606,7 +606,7 @@ EXPORT_SYMBOL(d_invalidate);
 /* This must be called with d_lock held */
 static inline void __dget_dlock(struct dentry *dentry)
 {
-	dentry->d_count++;
+	dentry->d_lockcnt.refcnt++;
 }
 
 static inline void __dget(struct dentry *dentry)
@@ -634,8 +634,8 @@ repeat:
 		goto repeat;
 	}
 	rcu_read_unlock();
-	BUG_ON(!ret->d_count);
-	ret->d_count++;
+	BUG_ON(!d_count(ret));
+	ret->d_lockcnt.refcnt++;
 	spin_unlock(&ret->d_lock);
 	return ret;
 }
@@ -718,7 +718,7 @@ restart:
 	spin_lock(&inode->i_lock);
 	hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
 		spin_lock(&dentry->d_lock);
-		if (!dentry->d_count) {
+		if (!d_count(dentry)) {
 			__dget_dlock(dentry);
 			__d_drop(dentry);
 			spin_unlock(&dentry->d_lock);
@@ -734,7 +734,7 @@ EXPORT_SYMBOL(d_prune_aliases);
 
 /*
  * Try to throw away a dentry - free the inode, dput the parent.
- * Requires dentry->d_lock is held, and dentry->d_count == 0.
+ * Requires dentry->d_lock is held, and dentry->d_lockcnt.refcnt == 0.
  * Releases dentry->d_lock.
  *
  * This may fail if locks cannot be acquired no problem, just try again.
@@ -764,8 +764,8 @@ static void try_prune_one_dentry(struct dentry *dentry)
 	dentry = parent;
 	while (dentry) {
 		spin_lock(&dentry->d_lock);
-		if (dentry->d_count > 1) {
-			dentry->d_count--;
+		if (d_count(dentry) > 1) {
+			dentry->d_lockcnt.refcnt--;
 			spin_unlock(&dentry->d_lock);
 			return;
 		}
@@ -793,7 +793,7 @@ static void shrink_dentry_list(struct list_head *list)
 		 * the LRU because of laziness during lookup.  Do not free
 		 * it - just keep it off the LRU list.
 		 */
-		if (dentry->d_count) {
+		if (d_count(dentry)) {
 			dentry_lru_del(dentry);
 			spin_unlock(&dentry->d_lock);
 			continue;
@@ -913,7 +913,7 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry)
 			dentry_lru_del(dentry);
 			__d_shrink(dentry);
 
-			if (dentry->d_count != 0) {
+			if (d_count(dentry) != 0) {
 				printk(KERN_ERR
 				       "BUG: Dentry %p{i=%lx,n=%s}"
 				       " still in use (%d)"
@@ -922,7 +922,7 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry)
 				       dentry->d_inode ?
 				       dentry->d_inode->i_ino : 0UL,
 				       dentry->d_name.name,
-				       dentry->d_count,
+				       d_count(dentry),
 				       dentry->d_sb->s_type->name,
 				       dentry->d_sb->s_id);
 				BUG();
@@ -933,7 +933,7 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry)
 				list_del(&dentry->d_u.d_child);
 			} else {
 				parent = dentry->d_parent;
-				parent->d_count--;
+				parent->d_lockcnt.refcnt--;
 				list_del(&dentry->d_u.d_child);
 			}
 
@@ -981,7 +981,7 @@ void shrink_dcache_for_umount(struct super_block *sb)
 
 	dentry = sb->s_root;
 	sb->s_root = NULL;
-	dentry->d_count--;
+	dentry->d_lockcnt.refcnt--;
 	shrink_dcache_for_umount_subtree(dentry);
 
 	while (!hlist_bl_empty(&sb->s_anon)) {
@@ -1147,7 +1147,7 @@ resume:
 		 * loop in shrink_dcache_parent() might not make any progress
 		 * and loop forever.
 		 */
-		if (dentry->d_count) {
+		if (d_count(dentry)) {
 			dentry_lru_del(dentry);
 		} else if (!(dentry->d_flags & DCACHE_SHRINK_LIST)) {
 			dentry_lru_move_list(dentry, dispose);
@@ -1269,7 +1269,7 @@ struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)
 	smp_wmb();
 	dentry->d_name.name = dname;
 
-	dentry->d_count = 1;
+	dentry->d_lockcnt.refcnt = 1;
 	dentry->d_flags = 0;
 	spin_lock_init(&dentry->d_lock);
 	seqcount_init(&dentry->d_seq);
@@ -1970,7 +1970,7 @@ struct dentry *__d_lookup(const struct dentry *parent, const struct qstr *name)
 				goto next;
 		}
 
-		dentry->d_count++;
+		dentry->d_lockcnt.refcnt++;
 		found = dentry;
 		spin_unlock(&dentry->d_lock);
 		break;
@@ -2069,7 +2069,7 @@ again:
 	spin_lock(&dentry->d_lock);
 	inode = dentry->d_inode;
 	isdir = S_ISDIR(inode->i_mode);
-	if (dentry->d_count == 1) {
+	if (d_count(dentry) == 1) {
 		if (!spin_trylock(&inode->i_lock)) {
 			spin_unlock(&dentry->d_lock);
 			cpu_relax();
@@ -2937,7 +2937,7 @@ resume:
 		}
 		if (!(dentry->d_flags & DCACHE_GENOCIDE)) {
 			dentry->d_flags |= DCACHE_GENOCIDE;
-			dentry->d_count--;
+			dentry->d_lockcnt.refcnt--;
 		}
 		spin_unlock(&dentry->d_lock);
 	}
@@ -2945,7 +2945,7 @@ resume:
 		struct dentry *child = this_parent;
 		if (!(this_parent->d_flags & DCACHE_GENOCIDE)) {
 			this_parent->d_flags |= DCACHE_GENOCIDE;
-			this_parent->d_count--;
+			this_parent->d_lockcnt.refcnt--;
 		}
 		this_parent = try_to_ascend(this_parent, locked, seq);
 		if (!this_parent)
diff --git a/fs/namei.c b/fs/namei.c
index 8b61d10..28e5152 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -536,8 +536,8 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry)
 		 * a reference at this point.
 		 */
 		BUG_ON(!IS_ROOT(dentry) && dentry->d_parent != parent);
-		BUG_ON(!parent->d_count);
-		parent->d_count++;
+		BUG_ON(!d_count(parent));
+		parent->d_lockcnt.refcnt++;
 		spin_unlock(&dentry->d_lock);
 	}
 	spin_unlock(&parent->d_lock);
@@ -3327,7 +3327,7 @@ void dentry_unhash(struct dentry *dentry)
 {
 	shrink_dcache_parent(dentry);
 	spin_lock(&dentry->d_lock);
-	if (dentry->d_count == 1)
+	if (d_count(dentry) == 1)
 		__d_drop(dentry);
 	spin_unlock(&dentry->d_lock);
 }
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index b90337c..20e6f2e 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -9,6 +9,7 @@
 #include <linux/seqlock.h>
 #include <linux/cache.h>
 #include <linux/rcupdate.h>
+#include <linux/spinlock_refcount.h>
 
 struct nameidata;
 struct path;
@@ -112,8 +113,7 @@ struct dentry {
 	unsigned char d_iname[DNAME_INLINE_LEN];	/* small names */
 
 	/* Ref lookup also touches following */
-	unsigned int d_count;		/* protected by d_lock */
-	spinlock_t d_lock;		/* per dentry lock */
+	struct lockref d_lockcnt;	/* per dentry lock & count */
 	const struct dentry_operations *d_op;
 	struct super_block *d_sb;	/* The root of the dentry tree */
 	unsigned long d_time;		/* used by d_revalidate */
@@ -132,6 +132,11 @@ struct dentry {
 };
 
 /*
+ * Define macros to access the name-changed spinlock
+ */
+#define d_lock	d_lockcnt.lock
+
+/*
  * dentry->d_lock spinlock nesting subclasses:
  *
  * 0: normal
@@ -318,7 +323,7 @@ static inline int __d_rcu_to_refcount(struct dentry *dentry, unsigned seq)
 	assert_spin_locked(&dentry->d_lock);
 	if (!read_seqcount_retry(&dentry->d_seq, seq)) {
 		ret = 1;
-		dentry->d_count++;
+		dentry->d_lockcnt.refcnt++;
 	}
 
 	return ret;
@@ -326,7 +331,7 @@ static inline int __d_rcu_to_refcount(struct dentry *dentry, unsigned seq)
 
 static inline unsigned d_count(const struct dentry *dentry)
 {
-	return dentry->d_count;
+	return dentry->d_lockcnt.refcnt;
 }
 
 /* validate "insecure" dentry pointer */
@@ -356,7 +361,7 @@ extern char *dentry_path(struct dentry *, char *, int);
 static inline struct dentry *dget_dlock(struct dentry *dentry)
 {
 	if (dentry)
-		dentry->d_count++;
+		dentry->d_lockcnt.refcnt++;
 	return dentry;
 }
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 151+ messages in thread

* [PATCH v7 4/4] dcache: Enable lockless update of dentry's refcount
  2013-08-06  3:12 [PATCH v7 0/4] Lockless update of reference count protected by spinlock Waiman Long
                   ` (2 preceding siblings ...)
  2013-08-06  3:12 ` [PATCH v7 3/4] dcache: replace d_lock/d_count by d_lockcnt Waiman Long
@ 2013-08-06  3:12 ` Waiman Long
  2013-08-13 18:03 ` [PATCH v7 0/4] Lockless update of reference count protected by spinlock Waiman Long
  4 siblings, 0 replies; 151+ messages in thread
From: Waiman Long @ 2013-08-06  3:12 UTC (permalink / raw)
  To: Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner
  Cc: Waiman Long, linux-fsdevel, linux-kernel, Peter Zijlstra,
	Steven Rostedt, Linus Torvalds, Benjamin Herrenschmidt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

The current code takes the dentry's d_lock lock whenever the refcnt
is being updated. In reality, nothing big really happens until refcnt
goes to 0 in dput(). So it is not necessary to take the lock if the
reference count won't go to 0. On the other hand, there are cases
where refcnt should not be updated or was not expected to be updated
while d_lock was acquired by another thread.

This patch changes the code in dput(), dget(), __dget() and
dget_parent() to use lockless reference count update function calls.

This patch has a particular big impact on the short workload of the
AIM7 benchmark with ramdisk filesystem. The table below show the
performance improvement to the JPM (jobs per minutes) throughput due
to this patch on an 8-socket 80-core x86-64 system with a 3.11-rc3
kernel in a 1/2/4/8 node configuration by using numactl to restrict
the execution of the workload on certain nodes.

+-----------------+----------------+-----------------+----------+
|  Configuration  |    Mean JPM    |    Mean JPM     | % Change |
|                 | Rate w/o patch | Rate with patch |          |
+-----------------+---------------------------------------------+
|                 |              User Range 10 - 100            |
+-----------------+---------------------------------------------+
| 8 nodes, HT off |    1760523     |     4225737     | +140.0%  |
| 4 nodes, HT off |    2020076     |     3206202     |  +58.7%  |
| 2 nodes, HT off |    2391359     |     2654701     |  +11.0%  |
| 1 node , HT off |    2302912     |     2302433     |    0.0%  |
+-----------------+---------------------------------------------+
|                 |              User Range 200 - 1000          |
+-----------------+---------------------------------------------+
| 8 nodes, HT off |    1078421     |     7380760     | +584.4%  |
| 4 nodes, HT off |    1371040     |     4212007     | +207.2%  |
| 2 nodes, HT off |    2844720     |     2783442     |   -2.2%  |
| 1 node , HT off |    2433443     |     2415590     |   -0.7%  |
+-----------------+---------------------------------------------+
|                 |              User Range 1100 - 2000         |
+-----------------+---------------------------------------------+
| 8 nodes, HT off |    1055626     |     7118985     | +574.4%  |
| 4 nodes, HT off |    1352329     |     4512914     | +233.7%  |
| 2 nodes, HT off |    2793037     |     2758652     |   -1.2%  |
| 1 node , HT off |    2458125     |     2445069     |   -0.5%  |
+-----------------+----------------+-----------------+----------+

With 4 nodes and above, there are significant performance improvement
with this patch. With only 1 or 2 nodes, the performance is very close.
Because of variability of the AIM7 benchmark, a few percent difference
may not indicate a real performance gain or loss.

A perf call-graph report of the short workload at 1500 users
without the patch on the same 8-node machine indicates that about
79% of the workload's total time were spent in the _raw_spin_lock()
function. Almost all of which can be attributed to the following 2
kernel functions:
 1. dget_parent (49.92%)
 2. dput (49.84%)

The relevant perf report lines are:
+  78.76%      reaim  [kernel.kallsyms]   [k] _raw_spin_lock
+   0.05%      reaim  [kernel.kallsyms]   [k] dput
+   0.01%      reaim  [kernel.kallsyms]   [k] dget_parent

With this patch installed, the new perf report lines are:
+  19.66%      reaim  [kernel.kallsyms]   [k] _raw_spin_lock_irqsave
+   2.46%      reaim  [kernel.kallsyms]   [k] _raw_spin_lock
+   2.23%      reaim  [kernel.kallsyms]   [k] lockref_get_not_zero
+   0.50%      reaim  [kernel.kallsyms]   [k] dput
+   0.32%      reaim  [kernel.kallsyms]   [k] lockref_put_or_lock
+   0.30%      reaim  [kernel.kallsyms]   [k] lockref_get
+   0.01%      reaim  [kernel.kallsyms]   [k] dget_parent

-   2.46%      reaim  [kernel.kallsyms]   [k] _raw_spin_lock
   - _raw_spin_lock
      + 23.89% sys_getcwd
      + 23.60% d_path
      + 8.01% prepend_path
      + 5.18% complete_walk
      + 4.21% __rcu_process_callbacks
      + 3.08% inet_twsk_schedule
      + 2.36% do_anonymous_page
      + 2.24% unlazy_walk
      + 2.02% sem_lock
      + 1.82% process_backlog
      + 1.62% selinux_inode_free_security
      + 1.54% task_rq_lock
      + 1.45% unix_dgram_sendmsg
      + 1.18% enqueue_to_backlog
      + 1.06% unix_stream_sendmsg
      + 0.94% tcp_v4_rcv
      + 0.87% unix_create1
      + 0.71% scheduler_tick
      + 0.60% unix_release_sock
      + 0.59% do_wp_page
      + 0.59% unix_stream_recvmsg
      + 0.58% handle_pte_fault
      + 0.57% __do_fault
      + 0.53% unix_peer_get

The dput() and dget_parent() functions didn't show up in the
_raw_spin_lock callers at all.

This impact of this patch on other AIM7 workloads were much more
modest. Besides short, the other AIM7 workload that showed consistent
improvement is the high_systime workload. For the other workloads,
the changes were so minor that they are no significant difference
with and without the patch.

+--------------+---------------+----------------+-----------------+
|   Workload   | mean % change | mean % change  | mean % change   |
|              | 10-100 users  | 200-1000 users | 1100-2000 users |
+--------------+---------------+----------------+-----------------+
| high_systime |     +0.1%     |     +1.1%      |     +3.4%       |
+--------------+---------------+----------------+-----------------+

Signed-off-by: Waiman Long <Waiman.Long@hp.com>
---
 fs/dcache.c            |   26 ++++++++++++++++++--------
 include/linux/dcache.h |    7 ++-----
 2 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index 3adb6aa..9a4cf30 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -513,9 +513,15 @@ void dput(struct dentry *dentry)
 		return;
 
 repeat:
-	if (d_count(dentry) == 1)
-		might_sleep();
-	spin_lock(&dentry->d_lock);
+	if (d_count(dentry) > 1) {
+		if (lockref_put_or_lock(&dentry->d_lockcnt))
+			return;
+		/* dentry's lock taken */
+	} else {
+		if (d_count(dentry) == 1)
+			might_sleep();
+		spin_lock(&dentry->d_lock);
+	}
 	BUG_ON(!d_count(dentry));
 	if (d_count(dentry) > 1) {
 		dentry->d_lockcnt.refcnt--;
@@ -611,26 +617,30 @@ static inline void __dget_dlock(struct dentry *dentry)
 
 static inline void __dget(struct dentry *dentry)
 {
-	spin_lock(&dentry->d_lock);
-	__dget_dlock(dentry);
-	spin_unlock(&dentry->d_lock);
+	lockref_get(&dentry->d_lockcnt);
 }
 
 struct dentry *dget_parent(struct dentry *dentry)
 {
 	struct dentry *ret;
 
+	rcu_read_lock();
+	ret = rcu_dereference(dentry->d_parent);
+	if (lockref_get_not_zero(&ret->d_lockcnt)) {
+		rcu_read_unlock();
+		return ret;
+	}
 repeat:
 	/*
 	 * Don't need rcu_dereference because we re-check it was correct under
 	 * the lock.
 	 */
-	rcu_read_lock();
-	ret = dentry->d_parent;
+	ret = ACCESS_ONCE(dentry->d_parent);
 	spin_lock(&ret->d_lock);
 	if (unlikely(ret != dentry->d_parent)) {
 		spin_unlock(&ret->d_lock);
 		rcu_read_unlock();
+		rcu_read_lock();
 		goto repeat;
 	}
 	rcu_read_unlock();
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 20e6f2e..ec9206e 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -367,11 +367,8 @@ static inline struct dentry *dget_dlock(struct dentry *dentry)
 
 static inline struct dentry *dget(struct dentry *dentry)
 {
-	if (dentry) {
-		spin_lock(&dentry->d_lock);
-		dget_dlock(dentry);
-		spin_unlock(&dentry->d_lock);
-	}
+	if (dentry)
+		lockref_get(&dentry->d_lockcnt);
 	return dentry;
 }
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 0/4] Lockless update of reference count protected by spinlock
  2013-08-06  3:12 [PATCH v7 0/4] Lockless update of reference count protected by spinlock Waiman Long
                   ` (3 preceding siblings ...)
  2013-08-06  3:12 ` [PATCH v7 4/4] dcache: Enable lockless update of dentry's refcount Waiman Long
@ 2013-08-13 18:03 ` Waiman Long
  4 siblings, 0 replies; 151+ messages in thread
From: Waiman Long @ 2013-08-13 18:03 UTC (permalink / raw)
  To: Waiman Long
  Cc: Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, linux-kernel, Peter Zijlstra,
	Steven Rostedt, Linus Torvalds, Benjamin Herrenschmidt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On 08/05/2013 11:12 PM, Waiman Long wrote:
> v6->v7:
>   - Substantially reduce the number of patches from 14 to 4 because a
>     lot of the minor filesystem related changes had been merged to
>     v3.11-rc1.
>   - Remove architecture specific customization (LOCKREF_WAIT_SHIFT&
>     LOCKREF_RETRY_COUNT).
>   - Tune single-thread performance of lockref_put/get to within 10%
>     of old lock->update->unlock code.
>
> v5->v6:
>   - Add a new GENERIC_SPINLOCK_REFCOUNT config parameter for using the
>     generic implementation.
>   - Add two parameters LOCKREF_WAIT_SHIFT and LOCKREF_RETRY_COUNT which
>     can be specified differently for each architecture.
>   - Update various spinlock_refcount.* files to incorporate review
>     comments.
>   - Replace reference of d_refcount() macro in Lustre filesystem code in
>     the staging tree to use the new d_count() helper function.
>
> v4->v5:
>   - Add a d_count() helper for readonly access of reference count and
>     change all references to d_count outside of dcache.c, dcache.h
>     and namei.c to use d_count().
>
> v3->v4:
>   - Replace helper function access to d_lock and d_count by using
>     macros to redefine the old d_lock name to the spinlock and new
>     d_refcount name to the reference count. This greatly reduces the
>     size of this patchset from 25 to 12 and make it easier to review.
>
> v2->v3:
>   - Completely revamp the packaging by adding a new lockref data
>     structure that combines the spinlock with the reference
>     count. Helper functions are also added to manipulate the new data
>     structure. That results in modifying over 50 files, but the changes
>     were trivial in most of them.
>   - Change initial spinlock wait to use a timeout.
>   - Force 64-bit alignment of the spinlock&  reference count structure.
>   - Add a new way to use the combo by using a new union and helper
>     functions.
>
> v1->v2:
>   - Add one more layer of indirection to LOCK_WITH_REFCOUNT macro.
>   - Add __LINUX_SPINLOCK_REFCOUNT_H protection to spinlock_refcount.h.
>   - Add some generic get/put macros into spinlock_refcount.h.
>
> This patchset supports a generic mechanism to atomically update
> a reference count that is protected by a spinlock without actually
> acquiring the lock itself. If the update doesn't succeeed, the caller
> will have to acquire the lock and update the reference count in the
> the old way.  This will help in situation where there is a lot of
> spinlock contention because of frequent reference count update.
>
> The d_lock and d_count fields of the struct dentry in dcache.h was
> modified to use the new lockref data structure and the d_lock name
> is now a macro to the actual spinlock.
>
> This patch set causes significant performance improvement in the
> short workload of the AIM7 benchmark on a 8-socket x86-64 machine
> with 80 cores.
>
> Thank to Thomas Gleixner, Andi Kleen and Linus for their valuable
> input in shaping this patchset.
>
> Signed-off-by: Waiman Long<Waiman.Long@hp.com>
>
> Waiman Long (4):
>    spinlock: A new lockref structure for lockless update of refcount
>    spinlock: Enable x86 architecture to do lockless refcount update
>    dcache: replace d_lock/d_count by d_lockcnt
>    dcache: Enable lockless update of dentry's refcount
>
>   arch/x86/Kconfig                        |    3 +
>   fs/dcache.c                             |   78 +++++++------
>   fs/namei.c                              |    6 +-
>   include/asm-generic/spinlock_refcount.h |   46 +++++++
>   include/linux/dcache.h                  |   22 ++--
>   include/linux/spinlock_refcount.h       |  126 ++++++++++++++++++++
>   kernel/Kconfig.locks                    |   15 +++
>   lib/Makefile                            |    2 +
>   lib/spinlock_refcount.c                 |  198 +++++++++++++++++++++++++++++++
>   9 files changed, 449 insertions(+), 47 deletions(-)
>   create mode 100644 include/asm-generic/spinlock_refcount.h
>   create mode 100644 include/linux/spinlock_refcount.h
>   create mode 100644 lib/spinlock_refcount.c

So far, I haven't heard back anything about if further change and 
improvement is needed for this patch set. Any comment or feedback will 
be appreciated.

Thank in advance for your time.

Regards,
Longman

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-06  3:12 ` [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount Waiman Long
@ 2013-08-29  1:40   ` Linus Torvalds
  2013-08-29  4:44     ` Benjamin Herrenschmidt
  2013-08-29 15:20     ` Waiman Long
  0 siblings, 2 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-08-29  1:40 UTC (permalink / raw)
  To: Waiman Long
  Cc: Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Peter Zijlstra, Steven Rostedt, Benjamin Herrenschmidt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

Just FYI: I've merged two preparatory patches in my tree for the whole
lockref thing. Instead of applying your four patches as-is during the
merge window, I ended up writing two patches that introduce the
concept and use it in the dentry code *without* introducing any of the
new semantics yet.

Waiman, I attributed the patches to you, even if they don't actually
look much like any of the patches you sent out. And because I was
trying very hard to make sure that no actual semantics changed, my
version doesn't have the dget_parent() lockless update code, for
example. I literally just did a search-and-replace of "->d_count" with
"->d_lockref.count" and then I fixed up a few things by hand (undid
one replacement in a comment, and used the helper functions where they
were semantically identical).

 You don't have to rewrite your patches if you don't want to, I'm
planning on cherry-picking the actual code changes during the merge
window.

                  Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-29  1:40   ` Linus Torvalds
@ 2013-08-29  4:44     ` Benjamin Herrenschmidt
  2013-08-29  7:00       ` Ingo Molnar
  2013-08-29 15:20     ` Waiman Long
  1 sibling, 1 reply; 151+ messages in thread
From: Benjamin Herrenschmidt @ 2013-08-29  4:44 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Waiman Long, Alexander Viro, Jeff Layton, Miklos Szeredi,
	Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Wed, 2013-08-28 at 18:40 -0700, Linus Torvalds wrote:
> Just FYI: I've merged two preparatory patches in my tree for the whole
> lockref thing. Instead of applying your four patches as-is during the
> merge window, I ended up writing two patches that introduce the
> concept and use it in the dentry code *without* introducing any of the
> new semantics yet.
> 
> Waiman, I attributed the patches to you, even if they don't actually
> look much like any of the patches you sent out. And because I was
> trying very hard to make sure that no actual semantics changed, my
> version doesn't have the dget_parent() lockless update code, for
> example. I literally just did a search-and-replace of "->d_count" with
> "->d_lockref.count" and then I fixed up a few things by hand (undid
> one replacement in a comment, and used the helper functions where they
> were semantically identical).
> 
>  You don't have to rewrite your patches if you don't want to, I'm
> planning on cherry-picking the actual code changes during the merge
> window.

I've somewhat lost track of this, will I need some arch support for
powerpc ?

Cheers,
Ben.

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-29  4:44     ` Benjamin Herrenschmidt
@ 2013-08-29  7:00       ` Ingo Molnar
  2013-08-29 16:43         ` Linus Torvalds
  0 siblings, 1 reply; 151+ messages in thread
From: Ingo Molnar @ 2013-08-29  7:00 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Linus Torvalds, Waiman Long, Alexander Viro, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J


* Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> On Wed, 2013-08-28 at 18:40 -0700, Linus Torvalds wrote:
> > Just FYI: I've merged two preparatory patches in my tree for the whole
> > lockref thing. Instead of applying your four patches as-is during the
> > merge window, I ended up writing two patches that introduce the
> > concept and use it in the dentry code *without* introducing any of the
> > new semantics yet.
> > 
> > Waiman, I attributed the patches to you, even if they don't actually
> > look much like any of the patches you sent out. And because I was
> > trying very hard to make sure that no actual semantics changed, my
> > version doesn't have the dget_parent() lockless update code, for
> > example. I literally just did a search-and-replace of "->d_count" with
> > "->d_lockref.count" and then I fixed up a few things by hand (undid
> > one replacement in a comment, and used the helper functions where they
> > were semantically identical).
> > 
> >  You don't have to rewrite your patches if you don't want to, I'm
> > planning on cherry-picking the actual code changes during the merge
> > window.
> 
> I've somewhat lost track of this, will I need some arch support for 
> powerpc ?

Lockrefs are combiend spinlock+count objects that fit into a 
MESI-cacheline and can be accessed via the cmpxchg8b() primitives and 
allow smart combined operations on the count field without necessarily 
taking the lock.

So if an architecture meets the assumptions of the generic lockref code 
(spinlock + an u32 fits in an aligned cacheline, has the cmpxchgb8b() 
primitive, lockdep is off, etc.) then it needs no changes.

You won't see these arch requirements from Linus's current patches yet, 
but the followup changes that actually add the optimization should make 
this clear.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-29  1:40   ` Linus Torvalds
  2013-08-29  4:44     ` Benjamin Herrenschmidt
@ 2013-08-29 15:20     ` Waiman Long
  1 sibling, 0 replies; 151+ messages in thread
From: Waiman Long @ 2013-08-29 15:20 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Peter Zijlstra, Steven Rostedt, Benjamin Herrenschmidt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On 08/28/2013 09:40 PM, Linus Torvalds wrote:
> Just FYI: I've merged two preparatory patches in my tree for the whole
> lockref thing. Instead of applying your four patches as-is during the
> merge window, I ended up writing two patches that introduce the
> concept and use it in the dentry code *without* introducing any of the
> new semantics yet.
>
> Waiman, I attributed the patches to you, even if they don't actually
> look much like any of the patches you sent out. And because I was
> trying very hard to make sure that no actual semantics changed, my
> version doesn't have the dget_parent() lockless update code, for
> example. I literally just did a search-and-replace of "->d_count" with
> "->d_lockref.count" and then I fixed up a few things by hand (undid
> one replacement in a comment, and used the helper functions where they
> were semantically identical).
>
>   You don't have to rewrite your patches if you don't want to, I'm
> planning on cherry-picking the actual code changes during the merge
> window.
>
>                    Linus

Thanks for merging the 2 preparatory patches for me. I will rebase my 
patches with the latest linux git tree. A new v8 patch set will be sent 
out sometime next week. I am looking forward to the v3.12 merge window 
which I think is coming soon.

Cheer,
Longman

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-29  7:00       ` Ingo Molnar
@ 2013-08-29 16:43         ` Linus Torvalds
  2013-08-29 19:25           ` Linus Torvalds
  2013-08-30 17:17           ` Peter Zijlstra
  0 siblings, 2 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-08-29 16:43 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Benjamin Herrenschmidt, Waiman Long, Alexander Viro, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Thu, Aug 29, 2013 at 12:00 AM, Ingo Molnar <mingo@kernel.org> wrote:
>
> Lockrefs are combiend spinlock+count objects that fit into a
> MESI-cacheline and can be accessed via the cmpxchg8b() primitives and
> allow smart combined operations on the count field without necessarily
> taking the lock.

Side note: I'm going to finally build a new desktop, and made sure
that I got a CPU that supports TSX. I'm not convinced transactional
memory ends up being usable in general without hardware support for
predicting transaction success, but using transactions to do small
specialized things like this may well be worth it. Especially since
the cmpxchg approach has some issues.

We'll see. The real problem is that I'm not sure if I can even see the
scalability issue on any machine I actually personally want to use
(read: silent). On my current  system I can only get up to 15%
_raw_spin_lock by just stat'ing the same file over and over and over
again from lots of threads.

             Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-29 16:43         ` Linus Torvalds
@ 2013-08-29 19:25           ` Linus Torvalds
  2013-08-29 23:42             ` Linus Torvalds
  2013-08-30 17:17           ` Peter Zijlstra
  1 sibling, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-08-29 19:25 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Benjamin Herrenschmidt, Waiman Long, Alexander Viro, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Thu, Aug 29, 2013 at 9:43 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> We'll see. The real problem is that I'm not sure if I can even see the
> scalability issue on any machine I actually personally want to use
> (read: silent). On my current  system I can only get up to 15%
> _raw_spin_lock by just stat'ing the same file over and over and over
> again from lots of threads.

Hmm. I can see it, but it turns out that for normal pathname walking,
one of the main stumbling blocks is the RCU case of complete_walk(),
which cannot be done with the lockless lockref model.

Why? It needs to check the sequence count too and cannot touch the
refcount unless it matches under the spinlock. We could use
lockref_get_non_zero(), but for the final path component (which this
is) the zero refcount is actually a common case.

Waiman worked around this by having some rather complex code to retry
and wait for the dentry lock to be released in his lockref code. But
that has a lot of tuning implications, and I wanted to see what it is
*without* that kind of tuning. And that's when you hit the "lockless
case fails all the time because the lock is actually held" case.

I'm going to play around with changing the semantics of
"lockref_get_non_zero()" to match the "lockless_put_or_lock()":
instead of failing when the count it zero, it gets the lock. That
won't generally get any contention, because if the count is zero,
there generally isn't anybody else playing with that dentry.

            Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-29 19:25           ` Linus Torvalds
@ 2013-08-29 23:42             ` Linus Torvalds
  2013-08-30  0:26               ` Benjamin Herrenschmidt
                                 ` (2 more replies)
  0 siblings, 3 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-08-29 23:42 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Benjamin Herrenschmidt, Waiman Long, Alexander Viro, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

[-- Attachment #1: Type: text/plain, Size: 4749 bytes --]

On Thu, Aug 29, 2013 at 12:25 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> Hmm. I can see it, but it turns out that for normal pathname walking,
> one of the main stumbling blocks is the RCU case of complete_walk(),
> which cannot be done with the lockless lockref model.
> [... snip ...]

Ok, here's a patch for people to try out if they want to. It's tested,
and works for me, but it is - like the two preparatory patches I
already applied - not really based on Waiman's patches except from a
conceptual standpoint.

For architecture people (ie Ben, if you want to try this on ppc64),
the thing that it needs from an architecture:

 - the raw_spinlock_t and the "unsigned long" needs to fit in a u64.

   This is normally true anyway, but if your architecture code has a
big spinlock, you can't use it.

 - the architecture needs to support "cmpxchg()" on that "u64" type
(so x86-32 does *not* use this, although we could teach it to do so by
teaching x86-32 to use "cmpxchg8b" for the 8-byte case)

   A 64-bit architecture needs to support cmpxchg() on an u64 anyway,
so this is always true on 64-bit. It _can_ be true on 32-bit
architectures too.

 - the architecture needs to implement a simple
"arch_spin_value_unlocked()" macro, which takes a raw_spinlock_t value
and says whether it is unlocked or not.

   This is a new macro/function. It's generally a one-liner. For the
x86 ticket locks, for example, the test is simply "lock.tickets.head
== lock.tickets.tail".

 - the architecture code needs to let the generic code know that it
supports all this by doing a "select ARCH_USE_CMPXCHG_LOCKREF"

   Add it to your Kconfig file in the appropriate place. You do *not*
need to worry about LOCKDEP etc, you only need to worry about your own
architecture details above.

That's it. If it does that, the lockref code will use the cmpxchg
optimization when appropriate (ie spinlock debugging is not turned on
etc etc).

For Waiman: your patch had that adaptive waiting thing, and "wait for
unlocked" code, and I threw all that away. I didn't like it, and the
only reason for it existing was that the spinlock could be taken in a
hot path, which I felt was against the whole point of this "lockref"
thing.

So I fixed the VFS layer instead. With dput() and friends using
lockrefs, the only thing remaining in the hot RCU dentry lookup path
was the nasty __d_rcu_to_refcount() thing in complete_walk(). I
rewrote that to locklessly increment the refcount when it was nonzero,
and get the lock if it was zero, and that all seems to work fine.

And once the only case that is relevant for the fast-path is "d_lock
is unlocked", all your games with waiting for the spinlock to be
released are unnecessary. Making everything much simpler. If the
spinlock isn't unlocked, we always kick out to the fallback case (with
real locking).

NOTE! My test-case was very small and simple, so it may not trigger
other cases that might trigger d_lock in a hotpath. Anything that
kicks us out of rcu mode (like a symlink, for example) will trigger
"unlazy_walk()", and I didn't do the same thing there. So there's
still details like that to sort out, but I very much think this whole
"only an unlocked spinlock is a fastpath" is the right approach.

My simple testing shows that this has about the same best-case
performance, and the 15% _raw_spin_lock load I was able to trigger is
totally gone. That doesn't make things *faster* for me (because the
cost of the cmpxchg is pretty much comparable to the cost of the
spinlocks), but the big difference is the contended behavior where we
don't actually have to wait for the spinlock, we can just locklessly
increment the counter.

I can't trigger the CPU-eating contention case on my single-socket
system, which is why I'm sending out this patch for testing (despite
it not having that unlazy_walk() thing etc).

Also note that this is one single patch, not split up. Again, that's
because what I'm really hoping to get is just "does this fix the
contention-case on the 80-core monster machine that I don't have
access to?"

Side note: the whole cmpxchg() loop is written to basically generate
the perfect cmpxchg sequence on x86. The assembly results actually
look pretty good. I can't take advantage of the eflag setting of the
instruction, because gcc inline asms don't support that (even with
"asm goto" - I'd need to have output values for that, and "asm goto"
does now allow that). So there's one extra "cmpq" instruction, and gcc
makes a mess of "add 1 to structure member in high bytes of a 64-bit
stricture", but it's actually fairly readable and short assembly code,
which was *not* true of the original patches.

Waiman? Mind looking at this and testing?

                          Linus

[-- Attachment #2: patch.diff --]
[-- Type: application/octet-stream, Size: 8574 bytes --]

 arch/x86/Kconfig                |   1 +
 arch/x86/include/asm/spinlock.h |   5 ++
 fs/dcache.c                     |  15 +++++
 fs/namei.c                      |  18 ++++--
 include/linux/lockref.h         |  59 ++++---------------
 lib/Kconfig                     |  10 ++++
 lib/Makefile                    |   1 +
 lib/lockref.c                   | 127 ++++++++++++++++++++++++++++++++++++++++
 8 files changed, 183 insertions(+), 53 deletions(-)
 create mode 100644 lib/lockref.c

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index b32ebf92b0ce..67e00740531c 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -16,6 +16,7 @@ config X86_64
 	def_bool y
 	depends on 64BIT
 	select X86_DEV_DMA_OPS
+	select ARCH_USE_CMPXCHG_LOCKREF
 
 ### Arch settings
 config X86
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h
index e3ddd7db723f..e0e668422c75 100644
--- a/arch/x86/include/asm/spinlock.h
+++ b/arch/x86/include/asm/spinlock.h
@@ -34,6 +34,11 @@
 # define UNLOCK_LOCK_PREFIX
 #endif
 
+static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock)
+{
+	return lock.tickets.head == lock.tickets.tail;
+}
+
 /*
  * Ticket locks are conceptually two parts, one indicating the current head of
  * the queue, and the other indicating the current tail. The lock is acquired
diff --git a/fs/dcache.c b/fs/dcache.c
index b949af850cd6..2d244227999d 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -611,8 +611,23 @@ static inline void __dget(struct dentry *dentry)
 
 struct dentry *dget_parent(struct dentry *dentry)
 {
+	int gotref;
 	struct dentry *ret;
 
+	/*
+	 * Do optimistic parent lookup without any
+	 * locking.
+	 */
+	rcu_read_lock();
+	ret = ACCESS_ONCE(dentry->d_parent);
+	gotref = lockref_get_not_zero(&ret->d_lockref);
+	rcu_read_unlock();
+	if (likely(gotref)) {
+		if (likely(ret == ACCESS_ONCE(dentry->d_parent)))
+			return ret;
+		dput(ret);
+	}
+
 repeat:
 	/*
 	 * Don't need rcu_dereference because we re-check it was correct under
diff --git a/fs/namei.c b/fs/namei.c
index 7720fbd5277b..2dfa2e3136c0 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -582,17 +582,25 @@ static int complete_walk(struct nameidata *nd)
 	int status;
 
 	if (nd->flags & LOOKUP_RCU) {
+		int gotref;
+
 		nd->flags &= ~LOOKUP_RCU;
 		if (!(nd->flags & LOOKUP_ROOT))
 			nd->root.mnt = NULL;
-		spin_lock(&dentry->d_lock);
-		if (unlikely(!__d_rcu_to_refcount(dentry, nd->seq))) {
-			spin_unlock(&dentry->d_lock);
+
+		gotref = lockref_get_or_lock(&dentry->d_lockref);
+		if (read_seqcount_retry(&dentry->d_seq, nd->seq)) {
+			if (gotref)
+				dput(dentry);
+			else
+				spin_unlock(&dentry->d_lock);
 			unlock_rcu_walk();
 			return -ECHILD;
 		}
-		BUG_ON(nd->inode != dentry->d_inode);
-		spin_unlock(&dentry->d_lock);
+		if (!gotref) {
+			dentry->d_lockref.count++;
+			spin_unlock(&dentry->d_lock);
+		}
 		mntget(nd->path.mnt);
 		unlock_rcu_walk();
 	}
diff --git a/include/linux/lockref.h b/include/linux/lockref.h
index 01233e01627a..5bb6c6700dd5 100644
--- a/include/linux/lockref.h
+++ b/include/linux/lockref.h
@@ -17,55 +17,18 @@
 #include <linux/spinlock.h>
 
 struct lockref {
-	spinlock_t lock;
-	unsigned int count;
+	union {
+		aligned_u64 lock_count;
+		struct {
+			spinlock_t lock;
+			unsigned int count;
+		};
+	};
 };
 
-/**
- * lockref_get - Increments reference count unconditionally
- * @lockcnt: pointer to lockref structure
- *
- * This operation is only valid if you already hold a reference
- * to the object, so you know the count cannot be zero.
- */
-static inline void lockref_get(struct lockref *lockref)
-{
-	spin_lock(&lockref->lock);
-	lockref->count++;
-	spin_unlock(&lockref->lock);
-}
-
-/**
- * lockref_get_not_zero - Increments count unless the count is 0
- * @lockcnt: pointer to lockref structure
- * Return: 1 if count updated successfully or 0 if count is 0
- */
-static inline int lockref_get_not_zero(struct lockref *lockref)
-{
-	int retval = 0;
-
-	spin_lock(&lockref->lock);
-	if (lockref->count) {
-		lockref->count++;
-		retval = 1;
-	}
-	spin_unlock(&lockref->lock);
-	return retval;
-}
-
-/**
- * lockref_put_or_lock - decrements count unless count <= 1 before decrement
- * @lockcnt: pointer to lockref structure
- * Return: 1 if count updated successfully or 0 if count <= 1 and lock taken
- */
-static inline int lockref_put_or_lock(struct lockref *lockref)
-{
-	spin_lock(&lockref->lock);
-	if (lockref->count <= 1)
-		return 0;
-	lockref->count--;
-	spin_unlock(&lockref->lock);
-	return 1;
-}
+extern void lockref_get(struct lockref *);
+extern int lockref_get_not_zero(struct lockref *);
+extern int lockref_get_or_lock(struct lockref *);
+extern int lockref_put_or_lock(struct lockref *);
 
 #endif /* __LINUX_LOCKREF_H */
diff --git a/lib/Kconfig b/lib/Kconfig
index 71d9f81f6eed..65561716c16c 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -48,6 +48,16 @@ config STMP_DEVICE
 config PERCPU_RWSEM
 	boolean
 
+config ARCH_USE_CMPXCHG_LOCKREF
+	bool
+
+config CMPXCHG_LOCKREF
+	def_bool y if ARCH_USE_CMPXCHG_LOCKREF
+	depends on SMP
+	depends on !GENERIC_LOCKBREAK
+	depends on !DEBUG_SPINLOCK
+	depends on !DEBUG_LOCK_ALLOC
+
 config CRC_CCITT
 	tristate "CRC-CCITT functions"
 	help
diff --git a/lib/Makefile b/lib/Makefile
index 7baccfd8a4e9..f2cb3082697c 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -20,6 +20,7 @@ lib-$(CONFIG_MMU) += ioremap.o
 lib-$(CONFIG_SMP) += cpumask.o
 
 lib-y	+= kobject.o klist.o
+obj-y	+= lockref.o
 
 obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \
 	 bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \
diff --git a/lib/lockref.c b/lib/lockref.c
new file mode 100644
index 000000000000..7819c2d1d315
--- /dev/null
+++ b/lib/lockref.c
@@ -0,0 +1,127 @@
+#include <linux/export.h>
+#include <linux/lockref.h>
+
+#ifdef CONFIG_CMPXCHG_LOCKREF
+
+/*
+ * Note that the "cmpxchg()" reloads the "old" value for the
+ * failure case.
+ */
+#define CMPXCHG_LOOP(CODE, SUCCESS) do {					\
+	struct lockref old;							\
+	BUILD_BUG_ON(sizeof(old) != 8);						\
+	old.lock_count = ACCESS_ONCE(lockref->lock_count);			\
+	while (likely(arch_spin_value_unlocked(old.lock.rlock.raw_lock))) {  	\
+		struct lockref new = old, prev = old;				\
+		CODE								\
+		old.lock_count = cmpxchg(&lockref->lock_count,			\
+					 old.lock_count, new.lock_count);	\
+		if (likely(old.lock_count == prev.lock_count)) {		\
+			SUCCESS;						\
+		}								\
+	}									\
+} while (0)
+
+#else
+
+#define CMPXCHG_LOOP(CODE, SUCCESS) do { } while (0)
+
+#endif
+
+/**
+ * lockref_get - Increments reference count unconditionally
+ * @lockcnt: pointer to lockref structure
+ *
+ * This operation is only valid if you already hold a reference
+ * to the object, so you know the count cannot be zero.
+ */
+void lockref_get(struct lockref *lockref)
+{
+	CMPXCHG_LOOP(
+		new.count++;
+	,
+		return;
+	);
+
+	spin_lock(&lockref->lock);
+	lockref->count++;
+	spin_unlock(&lockref->lock);
+}
+EXPORT_SYMBOL(lockref_get);
+
+/**
+ * lockref_get_not_zero - Increments count unless the count is 0
+ * @lockcnt: pointer to lockref structure
+ * Return: 1 if count updated successfully or 0 if count was zero
+ */
+int lockref_get_not_zero(struct lockref *lockref)
+{
+	int retval;
+
+	CMPXCHG_LOOP(
+		new.count++;
+		if (!old.count)
+			return 0;
+	,
+		return 1;
+	);
+
+	spin_lock(&lockref->lock);
+	retval = 0;
+	if (lockref->count) {
+		lockref->count++;
+		retval = 1;
+	}
+	spin_unlock(&lockref->lock);
+	return retval;
+}
+EXPORT_SYMBOL(lockref_get_not_zero);
+
+/**
+ * lockref_get_or_lock - Increments count unless the count is 0
+ * @lockcnt: pointer to lockref structure
+ * Return: 1 if count updated successfully or 0 if count was zero
+ * and we got the lock instead.
+ */
+int lockref_get_or_lock(struct lockref *lockref)
+{
+	CMPXCHG_LOOP(
+		new.count++;
+		if (!old.count)
+			break;
+	,
+		return 1;
+	);
+
+	spin_lock(&lockref->lock);
+	if (!lockref->count)
+		return 0;
+	lockref->count++;
+	spin_unlock(&lockref->lock);
+	return 1;
+}
+EXPORT_SYMBOL(lockref_get_or_lock);
+
+/**
+ * lockref_put_or_lock - decrements count unless count <= 1 before decrement
+ * @lockcnt: pointer to lockref structure
+ * Return: 1 if count updated successfully or 0 if count <= 1 and lock taken
+ */
+int lockref_put_or_lock(struct lockref *lockref)
+{
+	CMPXCHG_LOOP(
+		new.count--;
+		if (old.count <= 1)
+			break;
+	,
+		return 1;
+	);
+
+	spin_lock(&lockref->lock);
+	if (lockref->count <= 1)
+		return 0;
+	lockref->count--;
+	spin_unlock(&lockref->lock);
+	return 1;
+}
+EXPORT_SYMBOL(lockref_put_or_lock);

^ permalink raw reply related	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-29 23:42             ` Linus Torvalds
@ 2013-08-30  0:26               ` Benjamin Herrenschmidt
  2013-08-30  0:49                 ` Linus Torvalds
  2013-08-30  3:12               ` Waiman Long
  2013-09-08 21:45               ` Linus Torvalds
  2 siblings, 1 reply; 151+ messages in thread
From: Benjamin Herrenschmidt @ 2013-08-30  0:26 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ingo Molnar, Waiman Long, Alexander Viro, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J,
	Michael Neuling

On Thu, 2013-08-29 at 16:42 -0700, Linus Torvalds wrote:

> For architecture people (ie Ben, if you want to try this on ppc64),
> the thing that it needs from an architecture:
> 
>  - the raw_spinlock_t and the "unsigned long" needs to fit in a u64.

I assume you mean unsigned int ? :-)

 .../...

>  - the architecture needs to implement a simple
> "arch_spin_value_unlocked()" macro, which takes a raw_spinlock_t value
> and says whether it is unlocked or not.

What's wrong with the existing arch_spin_is_locked() ?

BTW. Do you have your test case at hand ?

Cheers,
Ben.

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30  0:26               ` Benjamin Herrenschmidt
@ 2013-08-30  0:49                 ` Linus Torvalds
  2013-08-30  2:06                   ` Michael Neuling
  2013-08-30  7:16                   ` Ingo Molnar
  0 siblings, 2 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-08-30  0:49 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Ingo Molnar, Waiman Long, Alexander Viro, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J,
	Michael Neuling

[-- Attachment #1: Type: text/plain, Size: 2853 bytes --]

On Thu, Aug 29, 2013 at 5:26 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
>
> I assume you mean unsigned int ? :-)

Oops, yes.

> What's wrong with the existing arch_spin_is_locked() ?

It takes a memory location. And we very much want to test the value we
loaded into a register.

And yes, gcc can do the right thing. But at least on x86,
arch_spin_is_locked() actually uses ACCESS_ONCE() to load the value
from the memory location, and I actually think that is the right thing
to do (or at least not incorrect). So the end result is that
arch_spin_value_unlocked() is actually fairly fundamentally different
from arch_spin_is_locked().

So I could have re-used arch_spin_is_locked() after having changed the
semantics of it, but I really didn't want to possibly change totally
unrelated users for this particular feature.

> BTW. Do you have your test case at hand ?

My test-case is a joke. It's explicitly *trying* to get as much
contention as possible on a dentry, by just starting up a lot of
threads that look up one single pathname (the same one for everybody).
It defaults to using /tmp for this, but you can specify the filename.

Note that directories, regular files and symlinks have fundamentally
different dentry lookup behavior:

 - directories tend to have an elevated reference count (because they
have children). This was my primary test-case, because while I suspect
that there are crazy loads (and AIM7 may be one of them) that open the
same _regular_ file all concurrently, I don't think it's a "normal"
load). But opening the same directory concurrently as part of pathname
lookup is certainly normal.

 - regular files tend to have a dentry count of zero unless they are
actively open, and the patch I sent out will take the dentry spinlock
for them when doing the final RCU finishing touches if that's the
case. So this one *will* still use the per-dentry spinlock rather than
the lockless refcount increments, but as outlined above I don't think
that should be a scalability issue unless you're crazy.

 - symlink traveral causes us to drop out of RCU lookup mode, and thus
cause various slow-paths to happen. Some of that we can improve on,
but I suspect it will cause the lockless refcount paths to take a hit
too.

Anyway, I'm attaching my completely mindless test program. It has
hacky things like "unsigned long count[MAXTHREADS][32]" which are
purely to just spread out the counts so that they aren't in the same
cacheline etc.

Also note that the performance numbers it spits out depend a lot on
tings like how long the dcache hash chains etc are, so they are not
really reliable. Running the test-program right after reboot when the
dentries haven't been populated can result in much higher numbers -
without that having anything to do with contention or locking at all.

                          Linus

[-- Attachment #2: t.c --]
[-- Type: text/x-csrc, Size: 1007 bytes --]

#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

#define MAXTHREADS 16

static volatile int start = 0;
static char *file = "/tmp";
static unsigned long count[MAXTHREADS][32];

void *start_routine(void *arg)
{
	const char *filename;
	struct stat st;
	unsigned long *counter = arg;

	pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
	while (!start)
		/* nothing */;
	filename = file;
	for (;;) {
		stat(filename, &st);
		++*counter;
	}
}

int main(int argc, char **argv)
{
	pthread_t threads[MAXTHREADS];
	unsigned long n;
	int i;

	if (argv[1])
		file = argv[1];
	for (i = 0; i < MAXTHREADS; i++)
		pthread_create(threads+i, NULL, start_routine, count[i]);
	start = 1;
	sleep(10);
	for (i = 0; i < MAXTHREADS; i++)
		pthread_cancel(threads[i]);
	for (i = 0; i < MAXTHREADS; i++)
		pthread_join(threads[i], NULL);
	n = 0;
	for (i = 0; i < MAXTHREADS; i++)
		n += count[i][0];
	printf("Total loops: %lu\n", n);
	return 0;
}

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30  0:49                 ` Linus Torvalds
@ 2013-08-30  2:06                   ` Michael Neuling
  2013-08-30  2:30                     ` Benjamin Herrenschmidt
  2013-08-30  2:31                     ` Linus Torvalds
  2013-08-30  7:16                   ` Ingo Molnar
  1 sibling, 2 replies; 151+ messages in thread
From: Michael Neuling @ 2013-08-30  2:06 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Benjamin Herrenschmidt, Ingo Molnar, Waiman Long, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

> Anyway, I'm attaching my completely mindless test program. It has
> hacky things like "unsigned long count[MAXTHREADS][32]" which are
> purely to just spread out the counts so that they aren't in the same
> cacheline etc.
> 
> Also note that the performance numbers it spits out depend a lot on
> tings like how long the dcache hash chains etc are, so they are not
> really reliable. Running the test-program right after reboot when the
> dentries haven't been populated can result in much higher numbers -
> without that having anything to do with contention or locking at all.

Running on a POWER7 here with 32 threads (8 cores x 4 threads) I'm
getting some good improvements:

  Without patch:
    # ./t
    Total loops: 3730618

  With patch:
    # ./t
    Total loops: 16826271

The numbers move around about 10% from run to run.  I didn't change your
program at all, so it's still running with MAXTHREADS 16.

powerpc patch below. I'm using arch_spin_is_locked() to implement
arch_spin_value_unlocked().

Mikey

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 9cf59816d..4a3f86b 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -139,6 +139,7 @@ config PPC
 	select OLD_SIGSUSPEND
 	select OLD_SIGACTION if PPC32
 	select HAVE_DEBUG_STACKOVERFLOW
+	select ARCH_USE_CMPXCHG_LOCKREF
 
 config EARLY_PRINTK
 	bool
diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h
index 5b23f91..65c25272 100644
--- a/arch/powerpc/include/asm/spinlock.h
+++ b/arch/powerpc/include/asm/spinlock.h
@@ -156,6 +156,11 @@ extern void arch_spin_unlock_wait(arch_spinlock_t *lock);
 	do { while (arch_spin_is_locked(lock)) cpu_relax(); } while (0)
 #endif
 
+static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock)
+{
+	return !arch_spin_is_locked(&lock);
+}
+
 /*
  * Read-write spinlocks, allowing multiple readers
  * but only one writer.

^ permalink raw reply related	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30  2:06                   ` Michael Neuling
@ 2013-08-30  2:30                     ` Benjamin Herrenschmidt
  2013-08-30  2:35                       ` Linus Torvalds
  2013-08-30  2:31                     ` Linus Torvalds
  1 sibling, 1 reply; 151+ messages in thread
From: Benjamin Herrenschmidt @ 2013-08-30  2:30 UTC (permalink / raw)
  To: Michael Neuling
  Cc: Linus Torvalds, Ingo Molnar, Waiman Long, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Fri, 2013-08-30 at 12:06 +1000, Michael Neuling wrote:

> powerpc patch below. I'm using arch_spin_is_locked() to implement
> arch_spin_value_unlocked().

>  
> +static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock)
> +{
> +	return !arch_spin_is_locked(&lock);
> +}
> +

Arguably, it should be done the other way around :-) 

arch_spin_value_unlocked semantics is to basically operate on an already
read copy of the value, while arch_spin_is_locked() has ACCESS_ONE
semantics on *top* of that.

Or we can keep both completely separate like Linus does on x86.

Cheers,
Ben.

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30  2:06                   ` Michael Neuling
  2013-08-30  2:30                     ` Benjamin Herrenschmidt
@ 2013-08-30  2:31                     ` Linus Torvalds
  2013-08-30  2:43                       ` Benjamin Herrenschmidt
  1 sibling, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-08-30  2:31 UTC (permalink / raw)
  To: Michael Neuling
  Cc: Benjamin Herrenschmidt, Ingo Molnar, Waiman Long, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Thu, Aug 29, 2013 at 7:06 PM, Michael Neuling <mikey@neuling.org> wrote:
>
> Running on a POWER7 here with 32 threads (8 cores x 4 threads) I'm
> getting some good improvements:

That's *much* better than I get. But I literally just have a single
socket with two cores (and HT, so four threads) in my test machine, so
I really have a hard time getting any real contention. And the main
advantage of the patch should be when you actually have CPU's spinning
on that dentry d_lock.

Also, on x86, there are no advantages to cmpxchg over a spinlock -
they are both exactly one equally serializing instruction. If
anything, cmpxchg is worse due to having a cache read before the
write, and a few cycles slower anyway. So I actually expect the x86
code to slow down a tiny bit for the single-threaded case, although
that should be hopefully unmeasurable.

On POWER, you may have much less serialization for the cmpxchg. That
may sadly be something we'll need to fix - the serialization between
getting a lockref and checking sequence counts etc may need some extra
work.

So it may be that you are seeing unrealistically good numbers, and
that we will need to add a memory barrier or two. On x86, due to the
locked instruction semantics, that just isn't an issue.

> The numbers move around about 10% from run to run.

Please note that the whole "dentry hash chains may be better" for one
run vs another, and that's something that will _persist_ between
subsequent runs, so you may see "only 10% variability", but there may
be a bigger picture variability that you're not noticing because you
had to reboot in between.

To be really comparable, you should really run the stupid benchmark
after fairly equal boot up sequences. If the machine had been up for
several days for one set of numbers, and freshly rebooted for the
other, it can be a very unfair comparison.

(I long ago had a nice "L1 dentry cache" patch that helped with the
fact that the dentry chains *can* get long especially if you have tons
of memory, and that helped with this kind of variability a lot - and
improved performance too. It was slightly racy, though, which is why
it never got merged).

> powerpc patch below. I'm using arch_spin_is_locked() to implement
> arch_spin_value_unlocked().

Your "slock" is of type "volatile unsigned int slock", so it may well
cause those temporaries to be written to memory.

It probably doesn't matter, but you may want to check that the result
of "make lib/lockref.s" looks ok.

                 Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30  2:30                     ` Benjamin Herrenschmidt
@ 2013-08-30  2:35                       ` Linus Torvalds
  2013-08-30  2:45                         ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-08-30  2:35 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Michael Neuling, Ingo Molnar, Waiman Long, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Thu, Aug 29, 2013 at 7:30 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
>
> Or we can keep both completely separate like Linus does on x86.

I did it that way mainly to minimize the patch.

I agree with you that it probably makes sense to layer them the other
way around from what Michael's patch did, iow implement
arch_spin_is_locked() in terms of arch_spin_value_unlocked().

That said, on power, you have that "ACCESS_ONCE()" implicit in the
*type*, not in the code, so an "arch_spinlock_t" is fundamentally
volatile in itself. It's one of the reasons I despise "volatile":
things like volatility are _not_ attributes of a variable or a type,
but of the code in question. Something can be volatile in one context,
but not in another (one context might be locked, for example).

              Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30  2:31                     ` Linus Torvalds
@ 2013-08-30  2:43                       ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 151+ messages in thread
From: Benjamin Herrenschmidt @ 2013-08-30  2:43 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Michael Neuling, Ingo Molnar, Waiman Long, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Thu, 2013-08-29 at 19:31 -0700, Linus Torvalds wrote:

> Also, on x86, there are no advantages to cmpxchg over a spinlock -
> they are both exactly one equally serializing instruction. If
> anything, cmpxchg is worse due to having a cache read before the
> write, and a few cycles slower anyway. So I actually expect the x86
> code to slow down a tiny bit for the single-threaded case, although
> that should be hopefully unmeasurable.
> 
> On POWER, you may have much less serialization for the cmpxchg. That
> may sadly be something we'll need to fix - the serialization between
> getting a lockref and checking sequence counts etc may need some extra
> work.

> So it may be that you are seeing unrealistically good numbers, and
> that we will need to add a memory barrier or two. On x86, due to the
> locked instruction semantics, that just isn't an issue.

Dunno, our cmpxhg has both acquire and release barriers. It basically
does release, xchg, then acquire. So it is equivalent to an unlock
followed by a lock.

> > The numbers move around about 10% from run to run.
> 
> Please note that the whole "dentry hash chains may be better" for one
> run vs another, and that's something that will _persist_ between
> subsequent runs, so you may see "only 10% variability", but there may
> be a bigger picture variability that you're not noticing because you
> had to reboot in between.
> 
> To be really comparable, you should really run the stupid benchmark
> after fairly equal boot up sequences. If the machine had been up for
> several days for one set of numbers, and freshly rebooted for the
> other, it can be a very unfair comparison.
> 
> (I long ago had a nice "L1 dentry cache" patch that helped with the
> fact that the dentry chains *can* get long especially if you have tons
> of memory, and that helped with this kind of variability a lot - and
> improved performance too. It was slightly racy, though, which is why
> it never got merged).
> 
> > powerpc patch below. I'm using arch_spin_is_locked() to implement
> > arch_spin_value_unlocked().
> 
> Your "slock" is of type "volatile unsigned int slock", so it may well
> cause those temporaries to be written to memory.
> 
> It probably doesn't matter, but you may want to check that the result
> of "make lib/lockref.s" looks ok.
> 
>                  Linus



^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30  2:35                       ` Linus Torvalds
@ 2013-08-30  2:45                         ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 151+ messages in thread
From: Benjamin Herrenschmidt @ 2013-08-30  2:45 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Michael Neuling, Ingo Molnar, Waiman Long, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Thu, 2013-08-29 at 19:35 -0700, Linus Torvalds wrote:
> That said, on power, you have that "ACCESS_ONCE()" implicit in the
> *type*, not in the code, so an "arch_spinlock_t" is fundamentally
> volatile in itself. It's one of the reasons I despise "volatile":
> things like volatility are _not_ attributes of a variable or a type,
> but of the code in question. Something can be volatile in one context,
> but not in another (one context might be locked, for example).

Right, we can probably change that to use ACCESS_ONCE... volatile tend
to never quite do what you expect anyway.

Cheers,
Ben.

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-29 23:42             ` Linus Torvalds
  2013-08-30  0:26               ` Benjamin Herrenschmidt
@ 2013-08-30  3:12               ` Waiman Long
  2013-08-30  3:54                 ` Linus Torvalds
  2013-09-08 21:45               ` Linus Torvalds
  2 siblings, 1 reply; 151+ messages in thread
From: Waiman Long @ 2013-08-30  3:12 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On 08/29/2013 07:42 PM, Linus Torvalds wrote:
> Waiman? Mind looking at this and testing? Linus 

Sure, I will try out the patch tomorrow morning and see how it works out 
for my test case.

Regards,
Longman

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30  3:12               ` Waiman Long
@ 2013-08-30  3:54                 ` Linus Torvalds
  2013-08-30  7:55                   ` Sedat Dilek
  2013-08-30 18:33                   ` Waiman Long
  0 siblings, 2 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-08-30  3:54 UTC (permalink / raw)
  To: Waiman Long
  Cc: Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

[-- Attachment #1: Type: text/plain, Size: 1898 bytes --]

On Thu, Aug 29, 2013 at 8:12 PM, Waiman Long <waiman.long@hp.com> wrote:
> On 08/29/2013 07:42 PM, Linus Torvalds wrote:
>>
>> Waiman? Mind looking at this and testing? Linus
>
> Sure, I will try out the patch tomorrow morning and see how it works out for
> my test case.

Ok, thanks, please use this slightly updated patch attached here.

It improves on the previous version in actually handling the
"unlazy_walk()" case with native lockref handling, which means that
one other not entirely odd case (symlink traversal) avoids the d_lock
contention.

It also refactored the __d_rcu_to_refcount() to be more readable, and
adds a big comment about what the heck is going on. The old code was
clever, but I suspect not very many people could possibly understand
what it actually did. Plus it used nested spinlocks because it wanted
to avoid checking the sequence count twice. Which is stupid, since
nesting locks is how you get really bad contention, and the sequence
count check is really cheap anyway. Plus the nesting *really* didn't
work with the whole lockref model.

With this, my stupid thread-lookup thing doesn't show any spinlock
contention even for the "look up symlink" case.

It also avoids the unnecessary aligned u64 for when we don't actually
use cmpxchg at all.

It's still one single patch, since I was working on lots of small
cleanups. I think it's pretty close to done now (assuming your testing
shows it performs fine - the powerpc numbers are promising, though),
so I'll split it up into proper chunks rather than random commit
points. But I'm done for today at least.

NOTE NOTE NOTE! My test coverage really has been pretty pitiful. You
may hit cases I didn't test. I think it should be *stable*, but maybe
there's some other d_lock case that your tuned waiting hid, and that
my "fastpath only for unlocked case" version ends up having problems
with.

                 Linus

[-- Attachment #2: patch.diff --]
[-- Type: application/octet-stream, Size: 13590 bytes --]

 arch/x86/Kconfig                |   1 +
 arch/x86/include/asm/spinlock.h |   5 ++
 fs/dcache.c                     |  17 +++++-
 fs/namei.c                      |  90 ++++++++++++++++++++--------
 include/linux/dcache.h          |  22 -------
 include/linux/lockref.h         |  61 ++++---------------
 lib/Kconfig                     |  10 ++++
 lib/Makefile                    |   1 +
 lib/lockref.c                   | 127 ++++++++++++++++++++++++++++++++++++++++
 9 files changed, 237 insertions(+), 97 deletions(-)
 create mode 100644 lib/lockref.c

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index b32ebf92b0ce..67e00740531c 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -16,6 +16,7 @@ config X86_64
 	def_bool y
 	depends on 64BIT
 	select X86_DEV_DMA_OPS
+	select ARCH_USE_CMPXCHG_LOCKREF
 
 ### Arch settings
 config X86
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h
index e3ddd7db723f..e0e668422c75 100644
--- a/arch/x86/include/asm/spinlock.h
+++ b/arch/x86/include/asm/spinlock.h
@@ -34,6 +34,11 @@
 # define UNLOCK_LOCK_PREFIX
 #endif
 
+static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock)
+{
+	return lock.tickets.head == lock.tickets.tail;
+}
+
 /*
  * Ticket locks are conceptually two parts, one indicating the current head of
  * the queue, and the other indicating the current tail. The lock is acquired
diff --git a/fs/dcache.c b/fs/dcache.c
index b949af850cd6..96655f4f4574 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -611,8 +611,23 @@ static inline void __dget(struct dentry *dentry)
 
 struct dentry *dget_parent(struct dentry *dentry)
 {
+	int gotref;
 	struct dentry *ret;
 
+	/*
+	 * Do optimistic parent lookup without any
+	 * locking.
+	 */
+	rcu_read_lock();
+	ret = ACCESS_ONCE(dentry->d_parent);
+	gotref = lockref_get_not_zero(&ret->d_lockref);
+	rcu_read_unlock();
+	if (likely(gotref)) {
+		if (likely(ret == ACCESS_ONCE(dentry->d_parent)))
+			return ret;
+		dput(ret);
+	}
+
 repeat:
 	/*
 	 * Don't need rcu_dereference because we re-check it was correct under
@@ -1771,7 +1786,7 @@ static noinline enum slow_d_compare slow_dentry_cmp(
  * without taking d_lock and checking d_seq sequence count against @seq
  * returned here.
  *
- * A refcount may be taken on the found dentry with the __d_rcu_to_refcount
+ * A refcount may be taken on the found dentry with the d_rcu_to_refcount
  * function.
  *
  * Alternatively, __d_lookup_rcu may be called again to look up the child of
diff --git a/fs/namei.c b/fs/namei.c
index 7720fbd5277b..851a55e79dd8 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -494,6 +494,50 @@ static inline void unlock_rcu_walk(void)
 	br_read_unlock(&vfsmount_lock);
 }
 
+/*
+ * When we move over from the RCU domain to properly refcounted
+ * long-lived dentries, we need to check the sequence numbers
+ * we got before lookup very carefully.
+ *
+ * We cannot blindly increment a dentry refcount - even if it
+ * is not locked - if it is zero, because it may have gone
+ * through the final d_kill() logic already.
+ *
+ * So for a zero refcount, we need to get the spinlock (which is
+ * safe even for a dead dentry because the de-allocation is
+ * RCU-delayed), and check the sequence count under the lock.
+ *
+ * Once we have checked the sequence count, we know it is live,
+ * and since we hold the spinlock it cannot die from under us.
+ *
+ * In contrast, if the reference count wasn't zero, we can just
+ * increment the lockref without having to take the spinlock.
+ * Even if the sequence number ends up being stale, we haven't
+ * gone through the final dput() and killed the dentry yet.
+ */
+static int d_rcu_to_refcount(struct dentry *dentry, seqcount_t *validate, unsigned seq)
+{
+	int gotref;
+
+	gotref = lockref_get_or_lock(&dentry->d_lockref);
+
+	/* Does the sequence number still match? */
+	if (read_seqcount_retry(validate, seq)) {
+		if (gotref)
+			dput(dentry);
+		else
+			spin_unlock(&dentry->d_lock);
+		return -ECHILD;
+	}
+
+	/* Get the ref now, if we couldn't get it originally */
+	if (!gotref) {
+		dentry->d_lockref.count++;
+		spin_unlock(&dentry->d_lock);
+	}
+	return 0;
+}
+
 /**
  * unlazy_walk - try to switch to ref-walk mode.
  * @nd: nameidata pathwalk data
@@ -518,29 +562,28 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry)
 				nd->root.dentry != fs->root.dentry)
 			goto err_root;
 	}
-	spin_lock(&parent->d_lock);
+
+	/*
+	 * For a negative lookup, the lookup sequence point is the parents
+	 * sequence point, and it only needs to revalidate the parent dentry.
+	 *
+	 * For a positive lookup, we need to move both the parent and the
+	 * dentry from the RCU domain to be properly refcounted. And the
+	 * sequence number in the dentry validates *both* dentry counters,
+	 * since we checked the sequence number of the parent after we got
+	 * the child sequence number. So we know the parent must still
+	 * be valid if the child sequence number is still valid.
+	 */
 	if (!dentry) {
-		if (!__d_rcu_to_refcount(parent, nd->seq))
-			goto err_parent;
+		if (d_rcu_to_refcount(parent, &parent->d_seq, nd->seq) < 0)
+			goto err_root;
 		BUG_ON(nd->inode != parent->d_inode);
 	} else {
-		if (dentry->d_parent != parent)
+		if (d_rcu_to_refcount(dentry, &dentry->d_seq, nd->seq) < 0)
+			goto err_root;
+		if (d_rcu_to_refcount(parent, &dentry->d_seq, nd->seq) < 0)
 			goto err_parent;
-		spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
-		if (!__d_rcu_to_refcount(dentry, nd->seq))
-			goto err_child;
-		/*
-		 * If the sequence check on the child dentry passed, then
-		 * the child has not been removed from its parent. This
-		 * means the parent dentry must be valid and able to take
-		 * a reference at this point.
-		 */
-		BUG_ON(!IS_ROOT(dentry) && dentry->d_parent != parent);
-		BUG_ON(!parent->d_lockref.count);
-		parent->d_lockref.count++;
-		spin_unlock(&dentry->d_lock);
 	}
-	spin_unlock(&parent->d_lock);
 	if (want_root) {
 		path_get(&nd->root);
 		spin_unlock(&fs->lock);
@@ -551,10 +594,8 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry)
 	nd->flags &= ~LOOKUP_RCU;
 	return 0;
 
-err_child:
-	spin_unlock(&dentry->d_lock);
 err_parent:
-	spin_unlock(&parent->d_lock);
+	dput(dentry);
 err_root:
 	if (want_root)
 		spin_unlock(&fs->lock);
@@ -585,14 +626,11 @@ static int complete_walk(struct nameidata *nd)
 		nd->flags &= ~LOOKUP_RCU;
 		if (!(nd->flags & LOOKUP_ROOT))
 			nd->root.mnt = NULL;
-		spin_lock(&dentry->d_lock);
-		if (unlikely(!__d_rcu_to_refcount(dentry, nd->seq))) {
-			spin_unlock(&dentry->d_lock);
+
+		if (d_rcu_to_refcount(dentry, &dentry->d_seq, nd->seq) < 0) {
 			unlock_rcu_walk();
 			return -ECHILD;
 		}
-		BUG_ON(nd->inode != dentry->d_inode);
-		spin_unlock(&dentry->d_lock);
 		mntget(nd->path.mnt);
 		unlock_rcu_walk();
 	}
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index efdc94434c30..9169b91ea2d2 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -304,28 +304,6 @@ extern struct dentry *__d_lookup(const struct dentry *, const struct qstr *);
 extern struct dentry *__d_lookup_rcu(const struct dentry *parent,
 				const struct qstr *name, unsigned *seq);
 
-/**
- * __d_rcu_to_refcount - take a refcount on dentry if sequence check is ok
- * @dentry: dentry to take a ref on
- * @seq: seqcount to verify against
- * Returns: 0 on failure, else 1.
- *
- * __d_rcu_to_refcount operates on a dentry,seq pair that was returned
- * by __d_lookup_rcu, to get a reference on an rcu-walk dentry.
- */
-static inline int __d_rcu_to_refcount(struct dentry *dentry, unsigned seq)
-{
-	int ret = 0;
-
-	assert_spin_locked(&dentry->d_lock);
-	if (!read_seqcount_retry(&dentry->d_seq, seq)) {
-		ret = 1;
-		dentry->d_lockref.count++;
-	}
-
-	return ret;
-}
-
 static inline unsigned d_count(const struct dentry *dentry)
 {
 	return dentry->d_lockref.count;
diff --git a/include/linux/lockref.h b/include/linux/lockref.h
index 01233e01627a..ca07b5028b01 100644
--- a/include/linux/lockref.h
+++ b/include/linux/lockref.h
@@ -17,55 +17,20 @@
 #include <linux/spinlock.h>
 
 struct lockref {
-	spinlock_t lock;
-	unsigned int count;
+	union {
+#ifdef CONFIG_CMPXCHG_LOCKREF
+		aligned_u64 lock_count;
+#endif
+		struct {
+			spinlock_t lock;
+			unsigned int count;
+		};
+	};
 };
 
-/**
- * lockref_get - Increments reference count unconditionally
- * @lockcnt: pointer to lockref structure
- *
- * This operation is only valid if you already hold a reference
- * to the object, so you know the count cannot be zero.
- */
-static inline void lockref_get(struct lockref *lockref)
-{
-	spin_lock(&lockref->lock);
-	lockref->count++;
-	spin_unlock(&lockref->lock);
-}
-
-/**
- * lockref_get_not_zero - Increments count unless the count is 0
- * @lockcnt: pointer to lockref structure
- * Return: 1 if count updated successfully or 0 if count is 0
- */
-static inline int lockref_get_not_zero(struct lockref *lockref)
-{
-	int retval = 0;
-
-	spin_lock(&lockref->lock);
-	if (lockref->count) {
-		lockref->count++;
-		retval = 1;
-	}
-	spin_unlock(&lockref->lock);
-	return retval;
-}
-
-/**
- * lockref_put_or_lock - decrements count unless count <= 1 before decrement
- * @lockcnt: pointer to lockref structure
- * Return: 1 if count updated successfully or 0 if count <= 1 and lock taken
- */
-static inline int lockref_put_or_lock(struct lockref *lockref)
-{
-	spin_lock(&lockref->lock);
-	if (lockref->count <= 1)
-		return 0;
-	lockref->count--;
-	spin_unlock(&lockref->lock);
-	return 1;
-}
+extern void lockref_get(struct lockref *);
+extern int lockref_get_not_zero(struct lockref *);
+extern int lockref_get_or_lock(struct lockref *);
+extern int lockref_put_or_lock(struct lockref *);
 
 #endif /* __LINUX_LOCKREF_H */
diff --git a/lib/Kconfig b/lib/Kconfig
index 71d9f81f6eed..65561716c16c 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -48,6 +48,16 @@ config STMP_DEVICE
 config PERCPU_RWSEM
 	boolean
 
+config ARCH_USE_CMPXCHG_LOCKREF
+	bool
+
+config CMPXCHG_LOCKREF
+	def_bool y if ARCH_USE_CMPXCHG_LOCKREF
+	depends on SMP
+	depends on !GENERIC_LOCKBREAK
+	depends on !DEBUG_SPINLOCK
+	depends on !DEBUG_LOCK_ALLOC
+
 config CRC_CCITT
 	tristate "CRC-CCITT functions"
 	help
diff --git a/lib/Makefile b/lib/Makefile
index 7baccfd8a4e9..f2cb3082697c 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -20,6 +20,7 @@ lib-$(CONFIG_MMU) += ioremap.o
 lib-$(CONFIG_SMP) += cpumask.o
 
 lib-y	+= kobject.o klist.o
+obj-y	+= lockref.o
 
 obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \
 	 bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \
diff --git a/lib/lockref.c b/lib/lockref.c
new file mode 100644
index 000000000000..7819c2d1d315
--- /dev/null
+++ b/lib/lockref.c
@@ -0,0 +1,127 @@
+#include <linux/export.h>
+#include <linux/lockref.h>
+
+#ifdef CONFIG_CMPXCHG_LOCKREF
+
+/*
+ * Note that the "cmpxchg()" reloads the "old" value for the
+ * failure case.
+ */
+#define CMPXCHG_LOOP(CODE, SUCCESS) do {					\
+	struct lockref old;							\
+	BUILD_BUG_ON(sizeof(old) != 8);						\
+	old.lock_count = ACCESS_ONCE(lockref->lock_count);			\
+	while (likely(arch_spin_value_unlocked(old.lock.rlock.raw_lock))) {  	\
+		struct lockref new = old, prev = old;				\
+		CODE								\
+		old.lock_count = cmpxchg(&lockref->lock_count,			\
+					 old.lock_count, new.lock_count);	\
+		if (likely(old.lock_count == prev.lock_count)) {		\
+			SUCCESS;						\
+		}								\
+	}									\
+} while (0)
+
+#else
+
+#define CMPXCHG_LOOP(CODE, SUCCESS) do { } while (0)
+
+#endif
+
+/**
+ * lockref_get - Increments reference count unconditionally
+ * @lockcnt: pointer to lockref structure
+ *
+ * This operation is only valid if you already hold a reference
+ * to the object, so you know the count cannot be zero.
+ */
+void lockref_get(struct lockref *lockref)
+{
+	CMPXCHG_LOOP(
+		new.count++;
+	,
+		return;
+	);
+
+	spin_lock(&lockref->lock);
+	lockref->count++;
+	spin_unlock(&lockref->lock);
+}
+EXPORT_SYMBOL(lockref_get);
+
+/**
+ * lockref_get_not_zero - Increments count unless the count is 0
+ * @lockcnt: pointer to lockref structure
+ * Return: 1 if count updated successfully or 0 if count was zero
+ */
+int lockref_get_not_zero(struct lockref *lockref)
+{
+	int retval;
+
+	CMPXCHG_LOOP(
+		new.count++;
+		if (!old.count)
+			return 0;
+	,
+		return 1;
+	);
+
+	spin_lock(&lockref->lock);
+	retval = 0;
+	if (lockref->count) {
+		lockref->count++;
+		retval = 1;
+	}
+	spin_unlock(&lockref->lock);
+	return retval;
+}
+EXPORT_SYMBOL(lockref_get_not_zero);
+
+/**
+ * lockref_get_or_lock - Increments count unless the count is 0
+ * @lockcnt: pointer to lockref structure
+ * Return: 1 if count updated successfully or 0 if count was zero
+ * and we got the lock instead.
+ */
+int lockref_get_or_lock(struct lockref *lockref)
+{
+	CMPXCHG_LOOP(
+		new.count++;
+		if (!old.count)
+			break;
+	,
+		return 1;
+	);
+
+	spin_lock(&lockref->lock);
+	if (!lockref->count)
+		return 0;
+	lockref->count++;
+	spin_unlock(&lockref->lock);
+	return 1;
+}
+EXPORT_SYMBOL(lockref_get_or_lock);
+
+/**
+ * lockref_put_or_lock - decrements count unless count <= 1 before decrement
+ * @lockcnt: pointer to lockref structure
+ * Return: 1 if count updated successfully or 0 if count <= 1 and lock taken
+ */
+int lockref_put_or_lock(struct lockref *lockref)
+{
+	CMPXCHG_LOOP(
+		new.count--;
+		if (old.count <= 1)
+			break;
+	,
+		return 1;
+	);
+
+	spin_lock(&lockref->lock);
+	if (lockref->count <= 1)
+		return 0;
+	lockref->count--;
+	spin_unlock(&lockref->lock);
+	return 1;
+}
+EXPORT_SYMBOL(lockref_put_or_lock);

^ permalink raw reply related	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30  0:49                 ` Linus Torvalds
  2013-08-30  2:06                   ` Michael Neuling
@ 2013-08-30  7:16                   ` Ingo Molnar
  2013-08-30 15:28                     ` Linus Torvalds
  1 sibling, 1 reply; 151+ messages in thread
From: Ingo Molnar @ 2013-08-30  7:16 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Benjamin Herrenschmidt, Waiman Long, Alexander Viro, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J,
	Michael Neuling


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> > BTW. Do you have your test case at hand ?
> 
> My test-case is a joke. It's explicitly *trying* to get as much 
> contention as possible on a dentry, by just starting up a lot of threads 
> that look up one single pathname (the same one for everybody). It 
> defaults to using /tmp for this, but you can specify the filename.

Waiman's tests seemed to use sufficiently generic and varied workloads 
(AIM7) and they showed pretty nice unconditional improvements with his 
variant of this scheme, so I think testing with your simple testcase that 
intentionally magnifies the scalability issue is 100% legit and may in 
fact help tune the changes more accurately, because it has less inherent 
noise.

And that was on a 80 core system. The speedup should be exponentially more 
dramatic on silly large systems. A nicely parallel VFS isn't a bad thing 
to have, especially on ridiculously loud hardware you want to run a 
continent away from you.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30  3:54                 ` Linus Torvalds
@ 2013-08-30  7:55                   ` Sedat Dilek
  2013-08-30  8:10                     ` Sedat Dilek
  2013-08-30  9:27                     ` Sedat Dilek
  2013-08-30 18:33                   ` Waiman Long
  1 sibling, 2 replies; 151+ messages in thread
From: Sedat Dilek @ 2013-08-30  7:55 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Fri, Aug 30, 2013 at 5:54 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Thu, Aug 29, 2013 at 8:12 PM, Waiman Long <waiman.long@hp.com> wrote:
>> On 08/29/2013 07:42 PM, Linus Torvalds wrote:
>>>
>>> Waiman? Mind looking at this and testing? Linus
>>
>> Sure, I will try out the patch tomorrow morning and see how it works out for
>> my test case.
>
> Ok, thanks, please use this slightly updated patch attached here.
>
> It improves on the previous version in actually handling the
> "unlazy_walk()" case with native lockref handling, which means that
> one other not entirely odd case (symlink traversal) avoids the d_lock
> contention.
>
> It also refactored the __d_rcu_to_refcount() to be more readable, and
> adds a big comment about what the heck is going on. The old code was
> clever, but I suspect not very many people could possibly understand
> what it actually did. Plus it used nested spinlocks because it wanted
> to avoid checking the sequence count twice. Which is stupid, since
> nesting locks is how you get really bad contention, and the sequence
> count check is really cheap anyway. Plus the nesting *really* didn't
> work with the whole lockref model.
>
> With this, my stupid thread-lookup thing doesn't show any spinlock
> contention even for the "look up symlink" case.
>
> It also avoids the unnecessary aligned u64 for when we don't actually
> use cmpxchg at all.
>
> It's still one single patch, since I was working on lots of small
> cleanups. I think it's pretty close to done now (assuming your testing
> shows it performs fine - the powerpc numbers are promising, though),
> so I'll split it up into proper chunks rather than random commit
> points. But I'm done for today at least.
>
> NOTE NOTE NOTE! My test coverage really has been pretty pitiful. You
> may hit cases I didn't test. I think it should be *stable*, but maybe
> there's some other d_lock case that your tuned waiting hid, and that
> my "fastpath only for unlocked case" version ends up having problems
> with.
>

Following this thread with half an eye... Was that "unsigned" stuff
fixed (someone pointed to it).
How do you call that test-patch (subject)?
I would like to test it on my SNB ultrabook with your test-case script.

- Sedat -

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30  7:55                   ` Sedat Dilek
@ 2013-08-30  8:10                     ` Sedat Dilek
  2013-08-30  9:27                     ` Sedat Dilek
  1 sibling, 0 replies; 151+ messages in thread
From: Sedat Dilek @ 2013-08-30  8:10 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Fri, Aug 30, 2013 at 9:55 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> On Fri, Aug 30, 2013 at 5:54 AM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
>> On Thu, Aug 29, 2013 at 8:12 PM, Waiman Long <waiman.long@hp.com> wrote:
>>> On 08/29/2013 07:42 PM, Linus Torvalds wrote:
>>>>
>>>> Waiman? Mind looking at this and testing? Linus
>>>
>>> Sure, I will try out the patch tomorrow morning and see how it works out for
>>> my test case.
>>
>> Ok, thanks, please use this slightly updated patch attached here.
>>
>> It improves on the previous version in actually handling the
>> "unlazy_walk()" case with native lockref handling, which means that
>> one other not entirely odd case (symlink traversal) avoids the d_lock
>> contention.
>>
>> It also refactored the __d_rcu_to_refcount() to be more readable, and
>> adds a big comment about what the heck is going on. The old code was
>> clever, but I suspect not very many people could possibly understand
>> what it actually did. Plus it used nested spinlocks because it wanted
>> to avoid checking the sequence count twice. Which is stupid, since
>> nesting locks is how you get really bad contention, and the sequence
>> count check is really cheap anyway. Plus the nesting *really* didn't
>> work with the whole lockref model.
>>
>> With this, my stupid thread-lookup thing doesn't show any spinlock
>> contention even for the "look up symlink" case.
>>
>> It also avoids the unnecessary aligned u64 for when we don't actually
>> use cmpxchg at all.
>>
>> It's still one single patch, since I was working on lots of small
>> cleanups. I think it's pretty close to done now (assuming your testing
>> shows it performs fine - the powerpc numbers are promising, though),
>> so I'll split it up into proper chunks rather than random commit
>> points. But I'm done for today at least.
>>
>> NOTE NOTE NOTE! My test coverage really has been pretty pitiful. You
>> may hit cases I didn't test. I think it should be *stable*, but maybe
>> there's some other d_lock case that your tuned waiting hid, and that
>> my "fastpath only for unlocked case" version ends up having problems
>> with.
>>
>
> Following this thread with half an eye... Was that "unsigned" stuff
> fixed (someone pointed to it).
> How do you call that test-patch (subject)?
> I would like to test it on my SNB ultrabook with your test-case script.
>

Can you explain why CONFIG_DEBUG_SPINLOCK=n (here: x86-64)?
( Will this be changed in further releases? )

# CONFIG_DEBUG_SPINLOCK is not set
CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
CONFIG_CMPXCHG_LOCKREF=y

- Sedat -

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30  7:55                   ` Sedat Dilek
  2013-08-30  8:10                     ` Sedat Dilek
@ 2013-08-30  9:27                     ` Sedat Dilek
  2013-08-30  9:48                       ` Ingo Molnar
  2013-08-30 15:34                       ` Linus Torvalds
  1 sibling, 2 replies; 151+ messages in thread
From: Sedat Dilek @ 2013-08-30  9:27 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Fri, Aug 30, 2013 at 9:55 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> On Fri, Aug 30, 2013 at 5:54 AM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
>> On Thu, Aug 29, 2013 at 8:12 PM, Waiman Long <waiman.long@hp.com> wrote:
>>> On 08/29/2013 07:42 PM, Linus Torvalds wrote:
>>>>
>>>> Waiman? Mind looking at this and testing? Linus
>>>
>>> Sure, I will try out the patch tomorrow morning and see how it works out for
>>> my test case.
>>
>> Ok, thanks, please use this slightly updated patch attached here.
>>
>> It improves on the previous version in actually handling the
>> "unlazy_walk()" case with native lockref handling, which means that
>> one other not entirely odd case (symlink traversal) avoids the d_lock
>> contention.
>>
>> It also refactored the __d_rcu_to_refcount() to be more readable, and
>> adds a big comment about what the heck is going on. The old code was
>> clever, but I suspect not very many people could possibly understand
>> what it actually did. Plus it used nested spinlocks because it wanted
>> to avoid checking the sequence count twice. Which is stupid, since
>> nesting locks is how you get really bad contention, and the sequence
>> count check is really cheap anyway. Plus the nesting *really* didn't
>> work with the whole lockref model.
>>
>> With this, my stupid thread-lookup thing doesn't show any spinlock
>> contention even for the "look up symlink" case.
>>
>> It also avoids the unnecessary aligned u64 for when we don't actually
>> use cmpxchg at all.
>>
>> It's still one single patch, since I was working on lots of small
>> cleanups. I think it's pretty close to done now (assuming your testing
>> shows it performs fine - the powerpc numbers are promising, though),
>> so I'll split it up into proper chunks rather than random commit
>> points. But I'm done for today at least.
>>
>> NOTE NOTE NOTE! My test coverage really has been pretty pitiful. You
>> may hit cases I didn't test. I think it should be *stable*, but maybe
>> there's some other d_lock case that your tuned waiting hid, and that
>> my "fastpath only for unlocked case" version ends up having problems
>> with.
>>
>
> Following this thread with half an eye... Was that "unsigned" stuff
> fixed (someone pointed to it).
> How do you call that test-patch (subject)?
> I would like to test it on my SNB ultrabook with your test-case script.
>

Here on Ubuntu/precise v12.04.3 AMD64 I get these numbers for total loops:

lockref:  w/o patch | w/ patch
======================
Run #1: 2.688.094 | 2.643.004
Run #2: 2.678.884 | 2.652.787
Run #3: 2.686.450 | 2.650.142
Run #4: 2.688.435 | 2.648.409
Run #5: 2.693.770 | 2.651.514

Average: 2687126,6 VS. 2649171,2 ( −37955,4 )

- Sedat -

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30  9:27                     ` Sedat Dilek
@ 2013-08-30  9:48                       ` Ingo Molnar
  2013-08-30  9:56                         ` Sedat Dilek
  2013-08-30 15:34                       ` Linus Torvalds
  1 sibling, 1 reply; 151+ messages in thread
From: Ingo Molnar @ 2013-08-30  9:48 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Linus Torvalds, Waiman Long, Benjamin Herrenschmidt,
	Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Peter Zijlstra, Steven Rostedt, Andi Kleen, Chandramouleeswaran,
	Aswin, Norton, Scott J


* Sedat Dilek <sedat.dilek@gmail.com> wrote:

> On Fri, Aug 30, 2013 at 9:55 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> > On Fri, Aug 30, 2013 at 5:54 AM, Linus Torvalds
> > <torvalds@linux-foundation.org> wrote:
> >> On Thu, Aug 29, 2013 at 8:12 PM, Waiman Long <waiman.long@hp.com> wrote:
> >>> On 08/29/2013 07:42 PM, Linus Torvalds wrote:
> >>>>
> >>>> Waiman? Mind looking at this and testing? Linus
> >>>
> >>> Sure, I will try out the patch tomorrow morning and see how it works out for
> >>> my test case.
> >>
> >> Ok, thanks, please use this slightly updated patch attached here.
> >>
> >> It improves on the previous version in actually handling the
> >> "unlazy_walk()" case with native lockref handling, which means that
> >> one other not entirely odd case (symlink traversal) avoids the d_lock
> >> contention.
> >>
> >> It also refactored the __d_rcu_to_refcount() to be more readable, and
> >> adds a big comment about what the heck is going on. The old code was
> >> clever, but I suspect not very many people could possibly understand
> >> what it actually did. Plus it used nested spinlocks because it wanted
> >> to avoid checking the sequence count twice. Which is stupid, since
> >> nesting locks is how you get really bad contention, and the sequence
> >> count check is really cheap anyway. Plus the nesting *really* didn't
> >> work with the whole lockref model.
> >>
> >> With this, my stupid thread-lookup thing doesn't show any spinlock
> >> contention even for the "look up symlink" case.
> >>
> >> It also avoids the unnecessary aligned u64 for when we don't actually
> >> use cmpxchg at all.
> >>
> >> It's still one single patch, since I was working on lots of small
> >> cleanups. I think it's pretty close to done now (assuming your testing
> >> shows it performs fine - the powerpc numbers are promising, though),
> >> so I'll split it up into proper chunks rather than random commit
> >> points. But I'm done for today at least.
> >>
> >> NOTE NOTE NOTE! My test coverage really has been pretty pitiful. You
> >> may hit cases I didn't test. I think it should be *stable*, but maybe
> >> there's some other d_lock case that your tuned waiting hid, and that
> >> my "fastpath only for unlocked case" version ends up having problems
> >> with.
> >>
> >
> > Following this thread with half an eye... Was that "unsigned" stuff
> > fixed (someone pointed to it).
> > How do you call that test-patch (subject)?
> > I would like to test it on my SNB ultrabook with your test-case script.
> >
> 
> Here on Ubuntu/precise v12.04.3 AMD64 I get these numbers for total loops:
> 
> lockref:  w/o patch | w/ patch
> ======================
> Run #1: 2.688.094 | 2.643.004
> Run #2: 2.678.884 | 2.652.787
> Run #3: 2.686.450 | 2.650.142
> Run #4: 2.688.435 | 2.648.409
> Run #5: 2.693.770 | 2.651.514
> 
> Average: 2687126,6 VS. 2649171,2 ( ???37955,4 )

For precise stddev numbers you can run it like this:

   perf stat --null --repeat 5 ./test

and it will measure time only and print the stddev in percentage:

 Performance counter stats for './test' (5 runs):

       1.001008928 seconds time elapsed                                          ( +-  0.00% )

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30  9:48                       ` Ingo Molnar
@ 2013-08-30  9:56                         ` Sedat Dilek
  2013-08-30  9:58                           ` Sedat Dilek
  0 siblings, 1 reply; 151+ messages in thread
From: Sedat Dilek @ 2013-08-30  9:56 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Linus Torvalds, Waiman Long, Benjamin Herrenschmidt,
	Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Peter Zijlstra, Steven Rostedt, Andi Kleen, Chandramouleeswaran,
	Aswin, Norton, Scott J

On Fri, Aug 30, 2013 at 11:48 AM, Ingo Molnar <mingo@kernel.org> wrote:
>
> * Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
>> On Fri, Aug 30, 2013 at 9:55 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>> > On Fri, Aug 30, 2013 at 5:54 AM, Linus Torvalds
>> > <torvalds@linux-foundation.org> wrote:
>> >> On Thu, Aug 29, 2013 at 8:12 PM, Waiman Long <waiman.long@hp.com> wrote:
>> >>> On 08/29/2013 07:42 PM, Linus Torvalds wrote:
>> >>>>
>> >>>> Waiman? Mind looking at this and testing? Linus
>> >>>
>> >>> Sure, I will try out the patch tomorrow morning and see how it works out for
>> >>> my test case.
>> >>
>> >> Ok, thanks, please use this slightly updated patch attached here.
>> >>
>> >> It improves on the previous version in actually handling the
>> >> "unlazy_walk()" case with native lockref handling, which means that
>> >> one other not entirely odd case (symlink traversal) avoids the d_lock
>> >> contention.
>> >>
>> >> It also refactored the __d_rcu_to_refcount() to be more readable, and
>> >> adds a big comment about what the heck is going on. The old code was
>> >> clever, but I suspect not very many people could possibly understand
>> >> what it actually did. Plus it used nested spinlocks because it wanted
>> >> to avoid checking the sequence count twice. Which is stupid, since
>> >> nesting locks is how you get really bad contention, and the sequence
>> >> count check is really cheap anyway. Plus the nesting *really* didn't
>> >> work with the whole lockref model.
>> >>
>> >> With this, my stupid thread-lookup thing doesn't show any spinlock
>> >> contention even for the "look up symlink" case.
>> >>
>> >> It also avoids the unnecessary aligned u64 for when we don't actually
>> >> use cmpxchg at all.
>> >>
>> >> It's still one single patch, since I was working on lots of small
>> >> cleanups. I think it's pretty close to done now (assuming your testing
>> >> shows it performs fine - the powerpc numbers are promising, though),
>> >> so I'll split it up into proper chunks rather than random commit
>> >> points. But I'm done for today at least.
>> >>
>> >> NOTE NOTE NOTE! My test coverage really has been pretty pitiful. You
>> >> may hit cases I didn't test. I think it should be *stable*, but maybe
>> >> there's some other d_lock case that your tuned waiting hid, and that
>> >> my "fastpath only for unlocked case" version ends up having problems
>> >> with.
>> >>
>> >
>> > Following this thread with half an eye... Was that "unsigned" stuff
>> > fixed (someone pointed to it).
>> > How do you call that test-patch (subject)?
>> > I would like to test it on my SNB ultrabook with your test-case script.
>> >
>>
>> Here on Ubuntu/precise v12.04.3 AMD64 I get these numbers for total loops:
>>
>> lockref:  w/o patch | w/ patch
>> ======================
>> Run #1: 2.688.094 | 2.643.004
>> Run #2: 2.678.884 | 2.652.787
>> Run #3: 2.686.450 | 2.650.142
>> Run #4: 2.688.435 | 2.648.409
>> Run #5: 2.693.770 | 2.651.514
>>
>> Average: 2687126,6 VS. 2649171,2 ( ???37955,4 )
>
> For precise stddev numbers you can run it like this:
>
>    perf stat --null --repeat 5 ./test
>
> and it will measure time only and print the stddev in percentage:
>
>  Performance counter stats for './test' (5 runs):
>
>        1.001008928 seconds time elapsed                                          ( +-  0.00% )
>

Hi Ingo,

that sounds really good :-).

AFAICS 'make deb-pkg' does not have support to build linux-tools
Debian package where perf is included.
Can I run an older version of perf or should I / have to try with the
one shipped in Linux v3.11-rc7+ sources?
How can I build perf standalone, out of my sources?

- Sedat -

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30  9:56                         ` Sedat Dilek
@ 2013-08-30  9:58                           ` Sedat Dilek
  2013-08-30 10:29                             ` Sedat Dilek
  0 siblings, 1 reply; 151+ messages in thread
From: Sedat Dilek @ 2013-08-30  9:58 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Linus Torvalds, Waiman Long, Benjamin Herrenschmidt,
	Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Peter Zijlstra, Steven Rostedt, Andi Kleen, Chandramouleeswaran,
	Aswin, Norton, Scott J

On Fri, Aug 30, 2013 at 11:56 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> On Fri, Aug 30, 2013 at 11:48 AM, Ingo Molnar <mingo@kernel.org> wrote:
>>
>> * Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>
>>> On Fri, Aug 30, 2013 at 9:55 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>> > On Fri, Aug 30, 2013 at 5:54 AM, Linus Torvalds
>>> > <torvalds@linux-foundation.org> wrote:
>>> >> On Thu, Aug 29, 2013 at 8:12 PM, Waiman Long <waiman.long@hp.com> wrote:
>>> >>> On 08/29/2013 07:42 PM, Linus Torvalds wrote:
>>> >>>>
>>> >>>> Waiman? Mind looking at this and testing? Linus
>>> >>>
>>> >>> Sure, I will try out the patch tomorrow morning and see how it works out for
>>> >>> my test case.
>>> >>
>>> >> Ok, thanks, please use this slightly updated patch attached here.
>>> >>
>>> >> It improves on the previous version in actually handling the
>>> >> "unlazy_walk()" case with native lockref handling, which means that
>>> >> one other not entirely odd case (symlink traversal) avoids the d_lock
>>> >> contention.
>>> >>
>>> >> It also refactored the __d_rcu_to_refcount() to be more readable, and
>>> >> adds a big comment about what the heck is going on. The old code was
>>> >> clever, but I suspect not very many people could possibly understand
>>> >> what it actually did. Plus it used nested spinlocks because it wanted
>>> >> to avoid checking the sequence count twice. Which is stupid, since
>>> >> nesting locks is how you get really bad contention, and the sequence
>>> >> count check is really cheap anyway. Plus the nesting *really* didn't
>>> >> work with the whole lockref model.
>>> >>
>>> >> With this, my stupid thread-lookup thing doesn't show any spinlock
>>> >> contention even for the "look up symlink" case.
>>> >>
>>> >> It also avoids the unnecessary aligned u64 for when we don't actually
>>> >> use cmpxchg at all.
>>> >>
>>> >> It's still one single patch, since I was working on lots of small
>>> >> cleanups. I think it's pretty close to done now (assuming your testing
>>> >> shows it performs fine - the powerpc numbers are promising, though),
>>> >> so I'll split it up into proper chunks rather than random commit
>>> >> points. But I'm done for today at least.
>>> >>
>>> >> NOTE NOTE NOTE! My test coverage really has been pretty pitiful. You
>>> >> may hit cases I didn't test. I think it should be *stable*, but maybe
>>> >> there's some other d_lock case that your tuned waiting hid, and that
>>> >> my "fastpath only for unlocked case" version ends up having problems
>>> >> with.
>>> >>
>>> >
>>> > Following this thread with half an eye... Was that "unsigned" stuff
>>> > fixed (someone pointed to it).
>>> > How do you call that test-patch (subject)?
>>> > I would like to test it on my SNB ultrabook with your test-case script.
>>> >
>>>
>>> Here on Ubuntu/precise v12.04.3 AMD64 I get these numbers for total loops:
>>>
>>> lockref:  w/o patch | w/ patch
>>> ======================
>>> Run #1: 2.688.094 | 2.643.004
>>> Run #2: 2.678.884 | 2.652.787
>>> Run #3: 2.686.450 | 2.650.142
>>> Run #4: 2.688.435 | 2.648.409
>>> Run #5: 2.693.770 | 2.651.514
>>>
>>> Average: 2687126,6 VS. 2649171,2 ( ???37955,4 )
>>
>> For precise stddev numbers you can run it like this:
>>
>>    perf stat --null --repeat 5 ./test
>>
>> and it will measure time only and print the stddev in percentage:
>>
>>  Performance counter stats for './test' (5 runs):
>>
>>        1.001008928 seconds time elapsed                                          ( +-  0.00% )
>>
>
> Hi Ingo,
>
> that sounds really good :-).
>
> AFAICS 'make deb-pkg' does not have support to build linux-tools
> Debian package where perf is included.
> Can I run an older version of perf or should I / have to try with the
> one shipped in Linux v3.11-rc7+ sources?
> How can I build perf standalone, out of my sources?
>

Hmm, I installed linux-tools-common (3.2.0-53.81).

$ perf stat --null --repeat 5 ./t_lockref_from-linus
perf_3.11.0-rc7 not found
You may need to install linux-tools-3.11.0-rc7

- Sedat -

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30  9:58                           ` Sedat Dilek
@ 2013-08-30 10:29                             ` Sedat Dilek
  2013-08-30 10:36                               ` Peter Zijlstra
  2013-08-30 10:38                               ` Sedat Dilek
  0 siblings, 2 replies; 151+ messages in thread
From: Sedat Dilek @ 2013-08-30 10:29 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Linus Torvalds, Waiman Long, Benjamin Herrenschmidt,
	Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Peter Zijlstra, Steven Rostedt, Andi Kleen, Chandramouleeswaran,
	Aswin, Norton, Scott J

On Fri, Aug 30, 2013 at 11:58 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> On Fri, Aug 30, 2013 at 11:56 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>> On Fri, Aug 30, 2013 at 11:48 AM, Ingo Molnar <mingo@kernel.org> wrote:
>>>
>>> * Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>>
>>>> On Fri, Aug 30, 2013 at 9:55 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>>> > On Fri, Aug 30, 2013 at 5:54 AM, Linus Torvalds
>>>> > <torvalds@linux-foundation.org> wrote:
>>>> >> On Thu, Aug 29, 2013 at 8:12 PM, Waiman Long <waiman.long@hp.com> wrote:
>>>> >>> On 08/29/2013 07:42 PM, Linus Torvalds wrote:
>>>> >>>>
>>>> >>>> Waiman? Mind looking at this and testing? Linus
>>>> >>>
>>>> >>> Sure, I will try out the patch tomorrow morning and see how it works out for
>>>> >>> my test case.
>>>> >>
>>>> >> Ok, thanks, please use this slightly updated patch attached here.
>>>> >>
>>>> >> It improves on the previous version in actually handling the
>>>> >> "unlazy_walk()" case with native lockref handling, which means that
>>>> >> one other not entirely odd case (symlink traversal) avoids the d_lock
>>>> >> contention.
>>>> >>
>>>> >> It also refactored the __d_rcu_to_refcount() to be more readable, and
>>>> >> adds a big comment about what the heck is going on. The old code was
>>>> >> clever, but I suspect not very many people could possibly understand
>>>> >> what it actually did. Plus it used nested spinlocks because it wanted
>>>> >> to avoid checking the sequence count twice. Which is stupid, since
>>>> >> nesting locks is how you get really bad contention, and the sequence
>>>> >> count check is really cheap anyway. Plus the nesting *really* didn't
>>>> >> work with the whole lockref model.
>>>> >>
>>>> >> With this, my stupid thread-lookup thing doesn't show any spinlock
>>>> >> contention even for the "look up symlink" case.
>>>> >>
>>>> >> It also avoids the unnecessary aligned u64 for when we don't actually
>>>> >> use cmpxchg at all.
>>>> >>
>>>> >> It's still one single patch, since I was working on lots of small
>>>> >> cleanups. I think it's pretty close to done now (assuming your testing
>>>> >> shows it performs fine - the powerpc numbers are promising, though),
>>>> >> so I'll split it up into proper chunks rather than random commit
>>>> >> points. But I'm done for today at least.
>>>> >>
>>>> >> NOTE NOTE NOTE! My test coverage really has been pretty pitiful. You
>>>> >> may hit cases I didn't test. I think it should be *stable*, but maybe
>>>> >> there's some other d_lock case that your tuned waiting hid, and that
>>>> >> my "fastpath only for unlocked case" version ends up having problems
>>>> >> with.
>>>> >>
>>>> >
>>>> > Following this thread with half an eye... Was that "unsigned" stuff
>>>> > fixed (someone pointed to it).
>>>> > How do you call that test-patch (subject)?
>>>> > I would like to test it on my SNB ultrabook with your test-case script.
>>>> >
>>>>
>>>> Here on Ubuntu/precise v12.04.3 AMD64 I get these numbers for total loops:
>>>>
>>>> lockref:  w/o patch | w/ patch
>>>> ======================
>>>> Run #1: 2.688.094 | 2.643.004
>>>> Run #2: 2.678.884 | 2.652.787
>>>> Run #3: 2.686.450 | 2.650.142
>>>> Run #4: 2.688.435 | 2.648.409
>>>> Run #5: 2.693.770 | 2.651.514
>>>>
>>>> Average: 2687126,6 VS. 2649171,2 ( ???37955,4 )
>>>
>>> For precise stddev numbers you can run it like this:
>>>
>>>    perf stat --null --repeat 5 ./test
>>>
>>> and it will measure time only and print the stddev in percentage:
>>>
>>>  Performance counter stats for './test' (5 runs):
>>>
>>>        1.001008928 seconds time elapsed                                          ( +-  0.00% )
>>>
>>
>> Hi Ingo,
>>
>> that sounds really good :-).
>>
>> AFAICS 'make deb-pkg' does not have support to build linux-tools
>> Debian package where perf is included.
>> Can I run an older version of perf or should I / have to try with the
>> one shipped in Linux v3.11-rc7+ sources?
>> How can I build perf standalone, out of my sources?
>>
>
> Hmm, I installed linux-tools-common (3.2.0-53.81).
>
> $ perf stat --null --repeat 5 ./t_lockref_from-linus
> perf_3.11.0-rc7 not found
> You may need to install linux-tools-3.11.0-rc7
>

[ Sorry for being off-topic ]

Hey Ingo,

can you help, please?

I installed so far all missing -dev packages...

$ sudo apt-get install libelf-dev libdw-dev libunwind7-dev libslang2-dev

...and then want a perf-only build...

[ See tools/Makefile ]

$ LANG=C LC_ALL=C make -C tools/ perf_install 2>&1 | tee ../perf_install-log.txt

This ends up like this:
...
make[2]: Entering directory
`/home/wearefam/src/linux-kernel/linux/tools/lib/traceevent'
make[2]: Leaving directory
`/home/wearefam/src/linux-kernel/linux/tools/lib/traceevent'
    LINK perf
gcc: error: /home/wearefam/src/linux-kernel/linux/tools/lib/lk/liblk.a:
No such file or directory
make[1]: *** [perf] Error 1
make[1]: Leaving directory `/home/wearefam/src/linux-kernel/linux/tools/perf'
make: *** [perf_install] Error 2

$ LANG=C LC_ALL=C ll tools/lib/lk/
total 20
drwxr-xr-x 2 wearefam wearefam 4096 Aug 30 12:11 ./
drwxr-xr-x 4 wearefam wearefam 4096 Jul 11 19:42 ../
-rw-r--r-- 1 wearefam wearefam 1430 Aug 30 09:56 Makefile
-rw-r--r-- 1 wearefam wearefam 2144 Jul 11 19:42 debugfs.c
-rw-r--r-- 1 wearefam wearefam  619 Jul 11 19:42 debugfs.h

Why is liblk not built?

- Sedat -

P.S.: To clean perf build, run...

$ LANG=C LC_ALL=C make -C tools/ perf_clean

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 10:29                             ` Sedat Dilek
@ 2013-08-30 10:36                               ` Peter Zijlstra
  2013-08-30 10:44                                 ` Sedat Dilek
  2013-08-30 11:19                                 ` Sedat Dilek
  2013-08-30 10:38                               ` Sedat Dilek
  1 sibling, 2 replies; 151+ messages in thread
From: Peter Zijlstra @ 2013-08-30 10:36 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Ingo Molnar, Linus Torvalds, Waiman Long, Benjamin Herrenschmidt,
	Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Fri, Aug 30, 2013 at 12:29:34PM +0200, Sedat Dilek wrote:
> [ Sorry for being off-topic ]
> 
> Hey Ingo,
> 
> can you help, please?
> 
> I installed so far all missing -dev packages...
> 
> $ sudo apt-get install libelf-dev libdw-dev libunwind7-dev libslang2-dev

It seems to me the easier way is:

 $ apt-get build-dep linux-tools

> ...and then want a perf-only build...
> 
> [ See tools/Makefile ]
> 
> $ LANG=C LC_ALL=C make -C tools/ perf_install 2>&1 | tee ../perf_install-log.txt

The way I always build that stuff is simply:

$ cd tools/perf
$ make -j
$ cp perf `which perf`
$ cd -

No idea about liblk though, never had that issue but maybe something
like:

$ cd tools/lib/lk/
$ make clean
$ make

will get you a more useful error. dunno, its a fairly trivial little
library, only a single .c file.

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 10:29                             ` Sedat Dilek
  2013-08-30 10:36                               ` Peter Zijlstra
@ 2013-08-30 10:38                               ` Sedat Dilek
  1 sibling, 0 replies; 151+ messages in thread
From: Sedat Dilek @ 2013-08-30 10:38 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Linus Torvalds, Waiman Long, Benjamin Herrenschmidt,
	Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Peter Zijlstra, Steven Rostedt, Andi Kleen, Chandramouleeswaran,
	Aswin, Norton, Scott J

On Fri, Aug 30, 2013 at 12:29 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> On Fri, Aug 30, 2013 at 11:58 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>> On Fri, Aug 30, 2013 at 11:56 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>> On Fri, Aug 30, 2013 at 11:48 AM, Ingo Molnar <mingo@kernel.org> wrote:
>>>>
>>>> * Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>>>
>>>>> On Fri, Aug 30, 2013 at 9:55 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>>>> > On Fri, Aug 30, 2013 at 5:54 AM, Linus Torvalds
>>>>> > <torvalds@linux-foundation.org> wrote:
>>>>> >> On Thu, Aug 29, 2013 at 8:12 PM, Waiman Long <waiman.long@hp.com> wrote:
>>>>> >>> On 08/29/2013 07:42 PM, Linus Torvalds wrote:
>>>>> >>>>
>>>>> >>>> Waiman? Mind looking at this and testing? Linus
>>>>> >>>
>>>>> >>> Sure, I will try out the patch tomorrow morning and see how it works out for
>>>>> >>> my test case.
>>>>> >>
>>>>> >> Ok, thanks, please use this slightly updated patch attached here.
>>>>> >>
>>>>> >> It improves on the previous version in actually handling the
>>>>> >> "unlazy_walk()" case with native lockref handling, which means that
>>>>> >> one other not entirely odd case (symlink traversal) avoids the d_lock
>>>>> >> contention.
>>>>> >>
>>>>> >> It also refactored the __d_rcu_to_refcount() to be more readable, and
>>>>> >> adds a big comment about what the heck is going on. The old code was
>>>>> >> clever, but I suspect not very many people could possibly understand
>>>>> >> what it actually did. Plus it used nested spinlocks because it wanted
>>>>> >> to avoid checking the sequence count twice. Which is stupid, since
>>>>> >> nesting locks is how you get really bad contention, and the sequence
>>>>> >> count check is really cheap anyway. Plus the nesting *really* didn't
>>>>> >> work with the whole lockref model.
>>>>> >>
>>>>> >> With this, my stupid thread-lookup thing doesn't show any spinlock
>>>>> >> contention even for the "look up symlink" case.
>>>>> >>
>>>>> >> It also avoids the unnecessary aligned u64 for when we don't actually
>>>>> >> use cmpxchg at all.
>>>>> >>
>>>>> >> It's still one single patch, since I was working on lots of small
>>>>> >> cleanups. I think it's pretty close to done now (assuming your testing
>>>>> >> shows it performs fine - the powerpc numbers are promising, though),
>>>>> >> so I'll split it up into proper chunks rather than random commit
>>>>> >> points. But I'm done for today at least.
>>>>> >>
>>>>> >> NOTE NOTE NOTE! My test coverage really has been pretty pitiful. You
>>>>> >> may hit cases I didn't test. I think it should be *stable*, but maybe
>>>>> >> there's some other d_lock case that your tuned waiting hid, and that
>>>>> >> my "fastpath only for unlocked case" version ends up having problems
>>>>> >> with.
>>>>> >>
>>>>> >
>>>>> > Following this thread with half an eye... Was that "unsigned" stuff
>>>>> > fixed (someone pointed to it).
>>>>> > How do you call that test-patch (subject)?
>>>>> > I would like to test it on my SNB ultrabook with your test-case script.
>>>>> >
>>>>>
>>>>> Here on Ubuntu/precise v12.04.3 AMD64 I get these numbers for total loops:
>>>>>
>>>>> lockref:  w/o patch | w/ patch
>>>>> ======================
>>>>> Run #1: 2.688.094 | 2.643.004
>>>>> Run #2: 2.678.884 | 2.652.787
>>>>> Run #3: 2.686.450 | 2.650.142
>>>>> Run #4: 2.688.435 | 2.648.409
>>>>> Run #5: 2.693.770 | 2.651.514
>>>>>
>>>>> Average: 2687126,6 VS. 2649171,2 ( ???37955,4 )
>>>>
>>>> For precise stddev numbers you can run it like this:
>>>>
>>>>    perf stat --null --repeat 5 ./test
>>>>
>>>> and it will measure time only and print the stddev in percentage:
>>>>
>>>>  Performance counter stats for './test' (5 runs):
>>>>
>>>>        1.001008928 seconds time elapsed                                          ( +-  0.00% )
>>>>
>>>
>>> Hi Ingo,
>>>
>>> that sounds really good :-).
>>>
>>> AFAICS 'make deb-pkg' does not have support to build linux-tools
>>> Debian package where perf is included.
>>> Can I run an older version of perf or should I / have to try with the
>>> one shipped in Linux v3.11-rc7+ sources?
>>> How can I build perf standalone, out of my sources?
>>>
>>
>> Hmm, I installed linux-tools-common (3.2.0-53.81).
>>
>> $ perf stat --null --repeat 5 ./t_lockref_from-linus
>> perf_3.11.0-rc7 not found
>> You may need to install linux-tools-3.11.0-rc7
>>
>
> [ Sorry for being off-topic ]
>
> Hey Ingo,
>
> can you help, please?
>
> I installed so far all missing -dev packages...
>
> $ sudo apt-get install libelf-dev libdw-dev libunwind7-dev libslang2-dev
>
> ...and then want a perf-only build...
>
> [ See tools/Makefile ]
>
> $ LANG=C LC_ALL=C make -C tools/ perf_install 2>&1 | tee ../perf_install-log.txt
>
> This ends up like this:
> ...
> make[2]: Entering directory
> `/home/wearefam/src/linux-kernel/linux/tools/lib/traceevent'
> make[2]: Leaving directory
> `/home/wearefam/src/linux-kernel/linux/tools/lib/traceevent'
>     LINK perf
> gcc: error: /home/wearefam/src/linux-kernel/linux/tools/lib/lk/liblk.a:
> No such file or directory
> make[1]: *** [perf] Error 1
> make[1]: Leaving directory `/home/wearefam/src/linux-kernel/linux/tools/perf'
> make: *** [perf_install] Error 2
>
> $ LANG=C LC_ALL=C ll tools/lib/lk/
> total 20
> drwxr-xr-x 2 wearefam wearefam 4096 Aug 30 12:11 ./
> drwxr-xr-x 4 wearefam wearefam 4096 Jul 11 19:42 ../
> -rw-r--r-- 1 wearefam wearefam 1430 Aug 30 09:56 Makefile
> -rw-r--r-- 1 wearefam wearefam 2144 Jul 11 19:42 debugfs.c
> -rw-r--r-- 1 wearefam wearefam  619 Jul 11 19:42 debugfs.h
>
> Why is liblk not built?
>
> - Sedat -
>
> P.S.: To clean perf build, run...
>
> $ LANG=C LC_ALL=C make -C tools/ perf_clean

Sorry for flooding...

The tools/perf only build seems to be BROKEN in v3.11-rc7.

WORKAROUND:

$ sudo apt-get install libelf-dev libdw-dev libunwind7-dev
libslang2-dev libnuma-dev

$ LANG=C LC_ALL=C make -C tools/ liblk

$ LANG=C LC_ALL=C make -C tools/ perf_install

This works here.

- Sedat -

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 10:36                               ` Peter Zijlstra
@ 2013-08-30 10:44                                 ` Sedat Dilek
  2013-08-30 10:46                                   ` Sedat Dilek
  2013-08-30 10:52                                   ` Peter Zijlstra
  2013-08-30 11:19                                 ` Sedat Dilek
  1 sibling, 2 replies; 151+ messages in thread
From: Sedat Dilek @ 2013-08-30 10:44 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ingo Molnar, Linus Torvalds, Waiman Long, Benjamin Herrenschmidt,
	Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Fri, Aug 30, 2013 at 12:36 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> On Fri, Aug 30, 2013 at 12:29:34PM +0200, Sedat Dilek wrote:
>> [ Sorry for being off-topic ]
>>
>> Hey Ingo,
>>
>> can you help, please?
>>
>> I installed so far all missing -dev packages...
>>
>> $ sudo apt-get install libelf-dev libdw-dev libunwind7-dev libslang2-dev
>
> It seems to me the easier way is:
>
>  $ apt-get build-dep linux-tools
>

NO, se B-Ds for Ubuntu-kernel v3.2:

Build-Depends: dpkg (>= 1.13.19), debhelper (>= 5), gawk

http://archive.ubuntu.com/ubuntu/pool/main/l/linux-meta/linux-meta_3.2.0.52.62.dsc

>> ...and then want a perf-only build...
>>
>> [ See tools/Makefile ]
>>
>> $ LANG=C LC_ALL=C make -C tools/ perf_install 2>&1 | tee ../perf_install-log.txt
>
> The way I always build that stuff is simply:
>
> $ cd tools/perf
> $ make -j
> $ cp perf `which perf`
> $ cd -
>

Please, see advices in 'tools/Makefile':

        @echo 'You can do:'
        @echo ' $$ make -C tools/ <tool>_install'
        @echo ''
        @echo '  from the kernel command line to build and install one of'
        @echo '  the tools above'
        @echo ''
        @echo '  $$ make tools/install'
        @echo ''
        @echo '  installs all tools.'


> No idea about liblk though, never had that issue but maybe something
> like:
>
> $ cd tools/lib/lk/
> $ make clean
> $ make
>
> will get you a more useful error. dunno, its a fairly trivial little
> library, only a single .c file.

If looked quickly over diverse Makefile one was saying liblk FORCE, so
it should be built, but is NOT!

Thanks anyway, Peter for all the hints!

If you tell me where you discuss perf issues I can describe the problem.

- Sedat -

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 10:44                                 ` Sedat Dilek
@ 2013-08-30 10:46                                   ` Sedat Dilek
  2013-08-30 10:52                                   ` Peter Zijlstra
  1 sibling, 0 replies; 151+ messages in thread
From: Sedat Dilek @ 2013-08-30 10:46 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ingo Molnar, Linus Torvalds, Waiman Long, Benjamin Herrenschmidt,
	Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Fri, Aug 30, 2013 at 12:44 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> On Fri, Aug 30, 2013 at 12:36 PM, Peter Zijlstra <peterz@infradead.org> wrote:
>> On Fri, Aug 30, 2013 at 12:29:34PM +0200, Sedat Dilek wrote:
>>> [ Sorry for being off-topic ]
>>>
>>> Hey Ingo,
>>>
>>> can you help, please?
>>>
>>> I installed so far all missing -dev packages...
>>>
>>> $ sudo apt-get install libelf-dev libdw-dev libunwind7-dev libslang2-dev
>>
>> It seems to me the easier way is:
>>
>>  $ apt-get build-dep linux-tools
>>
>
> NO, se B-Ds for Ubuntu-kernel v3.2:
>
> Build-Depends: dpkg (>= 1.13.19), debhelper (>= 5), gawk
>
> http://archive.ubuntu.com/ubuntu/pool/main/l/linux-meta/linux-meta_3.2.0.52.62.dsc
>
>>> ...and then want a perf-only build...
>>>
>>> [ See tools/Makefile ]
>>>
>>> $ LANG=C LC_ALL=C make -C tools/ perf_install 2>&1 | tee ../perf_install-log.txt
>>
>> The way I always build that stuff is simply:
>>
>> $ cd tools/perf
>> $ make -j
>> $ cp perf `which perf`
>> $ cd -
>>
>
> Please, see advices in 'tools/Makefile':
>
>         @echo 'You can do:'
>         @echo ' $$ make -C tools/ <tool>_install'
>         @echo ''
>         @echo '  from the kernel command line to build and install one of'
>         @echo '  the tools above'
>         @echo ''
>         @echo '  $$ make tools/install'
>         @echo ''
>         @echo '  installs all tools.'
>
>
>> No idea about liblk though, never had that issue but maybe something
>> like:
>>
>> $ cd tools/lib/lk/
>> $ make clean
>> $ make
>>
>> will get you a more useful error. dunno, its a fairly trivial little
>> library, only a single .c file.
>
> If looked quickly over diverse Makefile one was saying liblk FORCE, so
> it should be built, but is NOT!
>
> Thanks anyway, Peter for all the hints!
>
> If you tell me where you discuss perf issues I can describe the problem.
>

Just as a sidenote for cleaning up (that seems to be the "official" way):

$ LANG=C LC_ALL=C make -C tools/ liblk_clean

$ LANG=C LC_ALL=C make -C tools/ perf_clean

- Sedat -

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 10:44                                 ` Sedat Dilek
  2013-08-30 10:46                                   ` Sedat Dilek
@ 2013-08-30 10:52                                   ` Peter Zijlstra
  2013-08-30 10:57                                     ` Sedat Dilek
  1 sibling, 1 reply; 151+ messages in thread
From: Peter Zijlstra @ 2013-08-30 10:52 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Ingo Molnar, Linus Torvalds, Waiman Long, Benjamin Herrenschmidt,
	Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Fri, Aug 30, 2013 at 12:44:29PM +0200, Sedat Dilek wrote:
> Please, see advices in 'tools/Makefile':
> 
>         @echo 'You can do:'
>         @echo ' $$ make -C tools/ <tool>_install'
>         @echo ''
>         @echo '  from the kernel command line to build and install one of'
>         @echo '  the tools above'
>         @echo ''
>         @echo '  $$ make tools/install'
>         @echo ''
>         @echo '  installs all tools.'

I never follow advice :-) Muwhaha, also I'm generally not interested in
'all' tools anywya.

> If you tell me where you discuss perf issues I can describe the problem.

On this list, start a new thread CC ingo, acme and me. There's also an
IRC channel but I keep forgetting what the official channel is and I'm
likely not on it. I do tend to abuse irc.oftc.net/#linux-rt for it since
most people are on there anyway.

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 10:52                                   ` Peter Zijlstra
@ 2013-08-30 10:57                                     ` Sedat Dilek
  2013-08-30 14:05                                       ` Sedat Dilek
  0 siblings, 1 reply; 151+ messages in thread
From: Sedat Dilek @ 2013-08-30 10:57 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ingo Molnar, Linus Torvalds, Waiman Long, Benjamin Herrenschmidt,
	Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Fri, Aug 30, 2013 at 12:52 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> On Fri, Aug 30, 2013 at 12:44:29PM +0200, Sedat Dilek wrote:
>> Please, see advices in 'tools/Makefile':
>>
>>         @echo 'You can do:'
>>         @echo ' $$ make -C tools/ <tool>_install'
>>         @echo ''
>>         @echo '  from the kernel command line to build and install one of'
>>         @echo '  the tools above'
>>         @echo ''
>>         @echo '  $$ make tools/install'
>>         @echo ''
>>         @echo '  installs all tools.'
>
> I never follow advice :-) Muwhaha, also I'm generally not interested in
> 'all' tools anywya.
>
>> If you tell me where you discuss perf issues I can describe the problem.
>
> On this list, start a new thread CC ingo, acme and me. There's also an
> IRC channel but I keep forgetting what the official channel is and I'm
> likely not on it. I do tend to abuse irc.oftc.net/#linux-rt for it since
> most people are on there anyway.

Hi rebel :-)!

I was away from IRC for quite a year.
I will write some words...

- Sedat -

P.S.: It worked...

$ ~/src/linux-kernel/linux/tools/perf/perf --version
perf version 3.11.rc7.ga7370

$ ~/src/linux-kernel/linux/tools/perf/perf stat --null --repeat 5
./t_lockref_from-linus
Total loops: 2652351
Total loops: 2604876
Total loops: 2649696
Total loops: 2651417
Total loops: 2644068

 Performance counter stats for './t_lockref_from-linus' (5 runs):

      10,002926693 seconds time elapsed
          ( +-  0,00% )

$ cat /proc/version
Linux version 3.11.0-rc7-1-lockref-small
(sedat.dilek@gmail.com@fambox) (gcc version 4.6.3 (Ubuntu/Linaro
4.6.3-1ubuntu5) ) #1 SMP Fri Aug 30 10:23:19 CEST 2013

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 10:36                               ` Peter Zijlstra
  2013-08-30 10:44                                 ` Sedat Dilek
@ 2013-08-30 11:19                                 ` Sedat Dilek
  1 sibling, 0 replies; 151+ messages in thread
From: Sedat Dilek @ 2013-08-30 11:19 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ingo Molnar, Linus Torvalds, Waiman Long, Benjamin Herrenschmidt,
	Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Fri, Aug 30, 2013 at 12:36 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> On Fri, Aug 30, 2013 at 12:29:34PM +0200, Sedat Dilek wrote:
>> [ Sorry for being off-topic ]
>>
>> Hey Ingo,
>>
>> can you help, please?
>>
>> I installed so far all missing -dev packages...
>>
>> $ sudo apt-get install libelf-dev libdw-dev libunwind7-dev libslang2-dev
>
> It seems to me the easier way is:
>
>  $ apt-get build-dep linux-tools
>

The B-Ds for latest linux-tools (3.11~rc4-1~exp1) in
Debian/experimental look like this:

Build-Depends: debhelper (>> 7), python, asciidoc, binutils-dev,
bison, flex, libdw-dev, libelf-dev, libnewt-dev, libperl-dev,
python-dev, xmlto, autoconf, automake, libtool, libglib2.0-dev,
libsysfs-dev, libwrap0-dev

- Sedat -

[1] http://ftp.de.debian.org/debian/pool/main/l/linux-tools/linux-tools_3.11~rc4-1~exp1.dsc

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 10:57                                     ` Sedat Dilek
@ 2013-08-30 14:05                                       ` Sedat Dilek
  0 siblings, 0 replies; 151+ messages in thread
From: Sedat Dilek @ 2013-08-30 14:05 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ingo Molnar, Linus Torvalds, Waiman Long, Benjamin Herrenschmidt,
	Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Fri, Aug 30, 2013 at 12:57 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> On Fri, Aug 30, 2013 at 12:52 PM, Peter Zijlstra <peterz@infradead.org> wrote:
>> On Fri, Aug 30, 2013 at 12:44:29PM +0200, Sedat Dilek wrote:

[...]

>>> If you tell me where you discuss perf issues I can describe the problem.
>>
>> On this list, start a new thread CC ingo, acme and me. There's also an
>> IRC channel but I keep forgetting what the official channel is and I'm
>> likely not on it. I do tend to abuse irc.oftc.net/#linux-rt for it since
>> most people are on there anyway.
>
> Hi rebel :-)!
>
> I was away from IRC for quite a year.
> I will write some words...
>

Here we go.

- Sedat -

[1] http://marc.info/?l=linux-kernel&m=137786590626809&w=2

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30  7:16                   ` Ingo Molnar
@ 2013-08-30 15:28                     ` Linus Torvalds
  0 siblings, 0 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-08-30 15:28 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Benjamin Herrenschmidt, Waiman Long, Alexander Viro, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J,
	Michael Neuling

On Fri, Aug 30, 2013 at 12:16 AM, Ingo Molnar <mingo@kernel.org> wrote:
>
> * Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
>> > BTW. Do you have your test case at hand ?
>>
>> My test-case is a joke. It's explicitly *trying* to get as much
>> contention as possible on a dentry, by just starting up a lot of threads
>> that look up one single pathname (the same one for everybody). It
>> defaults to using /tmp for this, but you can specify the filename.
>
> Waiman's tests seemed to use sufficiently generic and varied workloads
> (AIM7) and they showed pretty nice unconditional improvements with his
> variant of this scheme, so I think testing with your simple testcase that
> intentionally magnifies the scalability issue is 100% legit and may in
> fact help tune the changes more accurately, because it has less inherent
> noise.

Yes. However, what I am (not very) worried about is that people will
hit some particular codepath that ends up having bad behavior.

I think I covered all the normal hotpaths in pathname lookup, which is
why I'm not *that* worried, but it's still the case that my silly
test-case is very limited. It's limited for a good *reason* (to try to
show the worst-case scalability problem), but it's limited.

              Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30  9:27                     ` Sedat Dilek
  2013-08-30  9:48                       ` Ingo Molnar
@ 2013-08-30 15:34                       ` Linus Torvalds
  2013-08-30 15:38                         ` Sedat Dilek
  1 sibling, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-08-30 15:34 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Fri, Aug 30, 2013 at 2:27 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> Here on Ubuntu/precise v12.04.3 AMD64 I get these numbers for total loops:
>
> lockref:  w/o patch | w/ patch
> ======================
> Run #1: 2.688.094 | 2.643.004
> Run #2: 2.678.884 | 2.652.787
> Run #3: 2.686.450 | 2.650.142
> Run #4: 2.688.435 | 2.648.409
> Run #5: 2.693.770 | 2.651.514

Yes, so this is pretty much expected.

If you don't have a very high core count (you don't mention your
system, but that's pretty - I get ~65 million repetitions in 10
seconds on my i5-670), the cmpxchg will not help - because you don't
actually see the bad "wait on spinlock" behavior in the first place.

And a "cmpxchg" is slightly slower than the very optimized spinlocks,
and has that annoying "read original value" first issue too. So the
patch can make things a bit slower, although it will depends on the
microarchitecture (and as mentioned elsewhere, there are other things
that can make a bigger difference boot-to-boot - dentry allocation
details etc can have "sticky" performance impact).

So we may take a small hit in order to then *not* have horrible
scalability at the high end.

               Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 15:34                       ` Linus Torvalds
@ 2013-08-30 15:38                         ` Sedat Dilek
  2013-08-30 16:12                           ` Steven Rostedt
  2013-08-30 16:32                           ` Linus Torvalds
  0 siblings, 2 replies; 151+ messages in thread
From: Sedat Dilek @ 2013-08-30 15:38 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Fri, Aug 30, 2013 at 5:34 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Fri, Aug 30, 2013 at 2:27 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>
>> Here on Ubuntu/precise v12.04.3 AMD64 I get these numbers for total loops:
>>
>> lockref:  w/o patch | w/ patch
>> ======================
>> Run #1: 2.688.094 | 2.643.004
>> Run #2: 2.678.884 | 2.652.787
>> Run #3: 2.686.450 | 2.650.142
>> Run #4: 2.688.435 | 2.648.409
>> Run #5: 2.693.770 | 2.651.514
>
> Yes, so this is pretty much expected.
>
> If you don't have a very high core count (you don't mention your
> system, but that's pretty - I get ~65 million repetitions in 10
> seconds on my i5-670), the cmpxchg will not help - because you don't
> actually see the bad "wait on spinlock" behavior in the first place.
>
> And a "cmpxchg" is slightly slower than the very optimized spinlocks,
> and has that annoying "read original value" first issue too. So the
> patch can make things a bit slower, although it will depends on the
> microarchitecture (and as mentioned elsewhere, there are other things
> that can make a bigger difference boot-to-boot - dentry allocation
> details etc can have "sticky" performance impact).
>
> So we may take a small hit in order to then *not* have horrible
> scalability at the high end.
>

A Samsung series-5 ultrabook.

$ grep "model name" /proc/cpuinfo | uniq
model name      : Intel(R) Core(TM) i5-2467M CPU @ 1.60GHz

- Sedat -

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 15:38                         ` Sedat Dilek
@ 2013-08-30 16:12                           ` Steven Rostedt
  2013-08-30 16:16                             ` Sedat Dilek
  2013-08-30 18:42                             ` Linus Torvalds
  2013-08-30 16:32                           ` Linus Torvalds
  1 sibling, 2 replies; 151+ messages in thread
From: Steven Rostedt @ 2013-08-30 16:12 UTC (permalink / raw)
  To: sedat.dilek
  Cc: Linus Torvalds, Waiman Long, Ingo Molnar, Benjamin Herrenschmidt,
	Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Peter Zijlstra, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Fri, 30 Aug 2013 17:38:47 +0200
Sedat Dilek <sedat.dilek@gmail.com> wrote:


> A Samsung series-5 ultrabook.
> 
> $ grep "model name" /proc/cpuinfo | uniq
> model name      : Intel(R) Core(TM) i5-2467M CPU @ 1.60GHz

I believe the number of CPUs is more important. But as this is an
ultrabook, I doubt that is very high.

Now I know this isn't going to be popular, but I'll suggest it anyway.
What about only implementing the lockref locking when CPUs are greater
than 7, 7 or less will still use the normal optimized spinlocks.

-- Steve

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 16:12                           ` Steven Rostedt
@ 2013-08-30 16:16                             ` Sedat Dilek
  2013-08-30 18:42                             ` Linus Torvalds
  1 sibling, 0 replies; 151+ messages in thread
From: Sedat Dilek @ 2013-08-30 16:16 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Linus Torvalds, Waiman Long, Ingo Molnar, Benjamin Herrenschmidt,
	Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Peter Zijlstra, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Fri, Aug 30, 2013 at 6:12 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> On Fri, 30 Aug 2013 17:38:47 +0200
> Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
>
>> A Samsung series-5 ultrabook.
>>
>> $ grep "model name" /proc/cpuinfo | uniq
>> model name      : Intel(R) Core(TM) i5-2467M CPU @ 1.60GHz
>
> I believe the number of CPUs is more important. But as this is an
> ultrabook, I doubt that is very high.
>

Fantastic Four.

> Now I know this isn't going to be popular, but I'll suggest it anyway.
> What about only implementing the lockref locking when CPUs are greater
> than 7, 7 or less will still use the normal optimized spinlocks.
>

I have seen that spinlock-lockref stuff is more important on that
monster-machines.
It's good to see it does not break "smaller" systems.

- Sedat -

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 15:38                         ` Sedat Dilek
  2013-08-30 16:12                           ` Steven Rostedt
@ 2013-08-30 16:32                           ` Linus Torvalds
  2013-08-30 16:37                             ` Sedat Dilek
  1 sibling, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-08-30 16:32 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Fri, Aug 30, 2013 at 8:38 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> A Samsung series-5 ultrabook.
>
> $ grep "model name" /proc/cpuinfo | uniq
> model name      : Intel(R) Core(TM) i5-2467M CPU @ 1.60GHz

Hmm. Do you have debugging options enabled? Because that CPU should
have the same core count as mine (two+HT), a slightly smaller cache
(3M vs 4M) and runs at a noticeably lower frequency (1.6GHz vs 3.5).
It probably also has slower memory etc, but that should still make it
maybe half speed of mine. Not 1/20th.

As mentioned, I get numbers in the 65M range. Yours are under 2.7M.
Even with some thermal throttling, I would expect better than that.

My pixel (1.8GHz i5-3427U) should be a *bit* faster that yours. And I
get 54M iterations on that.

I saw you mentioned CONFIG_CMPXCHG_LOCKREF=y in your .config, so you
don't have spinlock debugging enabled, but maybe you have some other
expensive debug option enabled. Like DEBUG_PAGEALLOC etc.

If you get "perf" compiled, mind doing a

    perf record -f -e cycles:pp ./a.out
    perf report

on it and look what that says?

              Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 16:32                           ` Linus Torvalds
@ 2013-08-30 16:37                             ` Sedat Dilek
  2013-08-30 16:52                               ` Linus Torvalds
  0 siblings, 1 reply; 151+ messages in thread
From: Sedat Dilek @ 2013-08-30 16:37 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

[-- Attachment #1: Type: text/plain, Size: 1374 bytes --]

On Fri, Aug 30, 2013 at 6:32 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Fri, Aug 30, 2013 at 8:38 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>
>> A Samsung series-5 ultrabook.
>>
>> $ grep "model name" /proc/cpuinfo | uniq
>> model name      : Intel(R) Core(TM) i5-2467M CPU @ 1.60GHz
>
> Hmm. Do you have debugging options enabled? Because that CPU should
> have the same core count as mine (two+HT), a slightly smaller cache
> (3M vs 4M) and runs at a noticeably lower frequency (1.6GHz vs 3.5).
> It probably also has slower memory etc, but that should still make it
> maybe half speed of mine. Not 1/20th.
>
> As mentioned, I get numbers in the 65M range. Yours are under 2.7M.
> Even with some thermal throttling, I would expect better than that.
>
> My pixel (1.8GHz i5-3427U) should be a *bit* faster that yours. And I
> get 54M iterations on that.
>
> I saw you mentioned CONFIG_CMPXCHG_LOCKREF=y in your .config, so you
> don't have spinlock debugging enabled, but maybe you have some other
> expensive debug option enabled. Like DEBUG_PAGEALLOC etc.
>

Yeah, this was with some debug-options built (see my attached kernel-config).

> If you get "perf" compiled, mind doing a
>
>     perf record -f -e cycles:pp ./a.out
>     perf report
>
> on it and look what that says?
>

Where is this a.out file from or how to generate it?

- Sedat -

[-- Attachment #2: config-3.11.0-rc7-1-lockref-small --]
[-- Type: application/octet-stream, Size: 114992 bytes --]

#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 3.11.0-rc7 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_MMU=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_ARCH_HAS_CPU_AUTOPROBE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
CONFIG_ZONE_DMA32=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_HAVE_INTEL_TXT=y
CONFIG_X86_64_SMP=y
CONFIG_X86_HT=y
CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11"
CONFIG_ARCH_CPU_PROBE_RELEASE=y
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_EXTABLE_SORT=y

#
# General setup
#
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""
# CONFIG_COMPILE_TEST is not set
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_HAVE_KERNEL_LZ4=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
# CONFIG_KERNEL_LZ4 is not set
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_FHANDLE=y
CONFIG_AUDIT=y
CONFIG_AUDITSYSCALL=y
CONFIG_AUDIT_WATCH=y
CONFIG_AUDIT_TREE=y
# CONFIG_AUDIT_LOGINUID_IMMUTABLE is not set
CONFIG_HAVE_GENERIC_HARDIRQS=y

#
# IRQ subsystem
#
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_IRQ_DOMAIN=y
# CONFIG_IRQ_DOMAIN_DEBUG is not set
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_ARCH_CLOCKSOURCE_DATA=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
CONFIG_GENERIC_CMOS_UPDATE=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ_COMMON=y
# CONFIG_HZ_PERIODIC is not set
CONFIG_NO_HZ_IDLE=y
# CONFIG_NO_HZ_FULL is not set
# CONFIG_NO_HZ is not set
CONFIG_HIGH_RES_TIMERS=y

#
# CPU/Task time and stats accounting
#
CONFIG_VIRT_CPU_ACCOUNTING=y
# CONFIG_TICK_CPU_ACCOUNTING is not set
CONFIG_VIRT_CPU_ACCOUNTING_GEN=y
# CONFIG_IRQ_TIME_ACCOUNTING is not set
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y

#
# RCU Subsystem
#
CONFIG_TREE_RCU=y
# CONFIG_PREEMPT_RCU is not set
CONFIG_RCU_STALL_COMMON=y
CONFIG_CONTEXT_TRACKING=y
CONFIG_RCU_USER_QS=y
CONFIG_CONTEXT_TRACKING_FORCE=y
CONFIG_RCU_FANOUT=64
CONFIG_RCU_FANOUT_LEAF=16
# CONFIG_RCU_FANOUT_EXACT is not set
# CONFIG_RCU_FAST_NO_HZ is not set
# CONFIG_TREE_RCU_TRACE is not set
CONFIG_RCU_NOCB_CPU=y
CONFIG_RCU_NOCB_CPU_NONE=y
# CONFIG_RCU_NOCB_CPU_ZERO is not set
# CONFIG_RCU_NOCB_CPU_ALL is not set
CONFIG_IKCONFIG=m
# CONFIG_IKCONFIG_PROC is not set
CONFIG_LOG_BUF_SHIFT=18
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y
CONFIG_ARCH_WANTS_PROT_NUMA_PROT_NONE=y
# CONFIG_NUMA_BALANCING is not set
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CPUSETS=y
CONFIG_PROC_PID_CPUSET=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_RESOURCE_COUNTERS=y
CONFIG_MEMCG=y
CONFIG_MEMCG_SWAP=y
# CONFIG_MEMCG_SWAP_ENABLED is not set
# CONFIG_MEMCG_KMEM is not set
CONFIG_CGROUP_HUGETLB=y
CONFIG_CGROUP_PERF=y
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_CFS_BANDWIDTH=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_BLK_CGROUP=y
# CONFIG_DEBUG_BLK_CGROUP is not set
CONFIG_CHECKPOINT_RESTORE=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_SCHED_AUTOGROUP=y
CONFIG_MM_OWNER=y
# CONFIG_SYSFS_DEPRECATED is not set
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
CONFIG_RD_LZO=y
# CONFIG_RD_LZ4 is not set
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_SYSCTL=y
CONFIG_ANON_INODES=y
CONFIG_HAVE_UID16=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_HAVE_PCSPKR_PLATFORM=y
CONFIG_EXPERT=y
CONFIG_UID16=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_PCSPKR_PLATFORM=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_PCI_QUIRKS=y
# CONFIG_EMBEDDED is not set
CONFIG_HAVE_PERF_EVENTS=y

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
CONFIG_VM_EVENT_COUNTERS=y
# CONFIG_COMPAT_BRK is not set
CONFIG_SLAB=y
# CONFIG_SLUB is not set
# CONFIG_SLOB is not set
CONFIG_PROFILING=y
CONFIG_TRACEPOINTS=y
# CONFIG_OPROFILE is not set
CONFIG_HAVE_OPROFILE=y
CONFIG_OPROFILE_NMI_TIMER=y
CONFIG_KPROBES=y
CONFIG_JUMP_LABEL=y
CONFIG_OPTPROBES=y
CONFIG_KPROBES_ON_FTRACE=y
CONFIG_UPROBES=y
# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_ARCH_USE_BUILTIN_BSWAP=y
CONFIG_KRETPROBES=y
CONFIG_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_OPTPROBES=y
CONFIG_HAVE_KPROBES_ON_FTRACE=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_ATTRS=y
CONFIG_USE_GENERIC_SMP_HELPERS=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_HW_BREAKPOINT=y
CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
CONFIG_HAVE_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_PERF_EVENTS_NMI=y
CONFIG_HAVE_PERF_REGS=y
CONFIG_HAVE_PERF_USER_STACK_DUMP=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y
CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
CONFIG_HAVE_CMPXCHG_LOCAL=y
CONFIG_HAVE_CMPXCHG_DOUBLE=y
CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
CONFIG_SECCOMP_FILTER=y
CONFIG_HAVE_CONTEXT_TRACKING=y
CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
CONFIG_HAVE_ARCH_SOFT_DIRTY=y
CONFIG_MODULES_USE_ELF_RELA=y
CONFIG_OLD_SIGSUSPEND3=y
CONFIG_COMPAT_OLD_SIGACTION=y

#
# GCOV-based kernel profiling
#
# CONFIG_GCOV_KERNEL is not set
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
# CONFIG_MODULE_FORCE_LOAD is not set
CONFIG_MODULE_UNLOAD=y
# CONFIG_MODULE_FORCE_UNLOAD is not set
CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y
CONFIG_MODULE_SIG=y
# CONFIG_MODULE_SIG_FORCE is not set
CONFIG_MODULE_SIG_ALL=y
# CONFIG_MODULE_SIG_SHA1 is not set
# CONFIG_MODULE_SIG_SHA224 is not set
# CONFIG_MODULE_SIG_SHA256 is not set
# CONFIG_MODULE_SIG_SHA384 is not set
CONFIG_MODULE_SIG_SHA512=y
CONFIG_MODULE_SIG_HASH="sha512"
CONFIG_STOP_MACHINE=y
CONFIG_BLOCK=y
CONFIG_BLK_DEV_BSG=y
CONFIG_BLK_DEV_BSGLIB=y
CONFIG_BLK_DEV_INTEGRITY=y
CONFIG_BLK_DEV_THROTTLING=y

#
# Partition Types
#
CONFIG_PARTITION_ADVANCED=y
CONFIG_ACORN_PARTITION=y
# CONFIG_ACORN_PARTITION_CUMANA is not set
# CONFIG_ACORN_PARTITION_EESOX is not set
CONFIG_ACORN_PARTITION_ICS=y
# CONFIG_ACORN_PARTITION_ADFS is not set
# CONFIG_ACORN_PARTITION_POWERTEC is not set
CONFIG_ACORN_PARTITION_RISCIX=y
# CONFIG_AIX_PARTITION is not set
CONFIG_OSF_PARTITION=y
CONFIG_AMIGA_PARTITION=y
CONFIG_ATARI_PARTITION=y
CONFIG_MAC_PARTITION=y
CONFIG_MSDOS_PARTITION=y
CONFIG_BSD_DISKLABEL=y
CONFIG_MINIX_SUBPARTITION=y
CONFIG_SOLARIS_X86_PARTITION=y
CONFIG_UNIXWARE_DISKLABEL=y
CONFIG_LDM_PARTITION=y
# CONFIG_LDM_DEBUG is not set
CONFIG_SGI_PARTITION=y
CONFIG_ULTRIX_PARTITION=y
CONFIG_SUN_PARTITION=y
CONFIG_KARMA_PARTITION=y
CONFIG_EFI_PARTITION=y
CONFIG_SYSV68_PARTITION=y
CONFIG_BLOCK_COMPAT=y

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
CONFIG_CFQ_GROUP_IOSCHED=y
CONFIG_DEFAULT_DEADLINE=y
# CONFIG_DEFAULT_CFQ is not set
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="deadline"
CONFIG_PREEMPT_NOTIFIERS=y
CONFIG_ASN1=y
CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
CONFIG_INLINE_READ_UNLOCK=y
CONFIG_INLINE_READ_UNLOCK_IRQ=y
CONFIG_INLINE_WRITE_UNLOCK=y
CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
CONFIG_FREEZER=y

#
# Processor type and features
#
CONFIG_ZONE_DMA=y
CONFIG_SMP=y
CONFIG_X86_X2APIC=y
CONFIG_X86_MPPARSE=y
CONFIG_X86_EXTENDED_PLATFORM=y
CONFIG_X86_NUMACHIP=y
# CONFIG_X86_VSMP is not set
# CONFIG_X86_UV is not set
# CONFIG_X86_INTEL_LPSS is not set
CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
CONFIG_SCHED_OMIT_FRAME_POINTER=y
CONFIG_HYPERVISOR_GUEST=y
CONFIG_PARAVIRT=y
# CONFIG_PARAVIRT_DEBUG is not set
CONFIG_PARAVIRT_SPINLOCKS=y
CONFIG_XEN=y
CONFIG_XEN_DOM0=y
CONFIG_XEN_PRIVILEGED_GUEST=y
CONFIG_XEN_PVHVM=y
CONFIG_XEN_MAX_DOMAIN_MEMORY=500
CONFIG_XEN_SAVE_RESTORE=y
# CONFIG_XEN_DEBUG_FS is not set
CONFIG_KVM_GUEST=y
# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
CONFIG_PARAVIRT_CLOCK=y
CONFIG_NO_BOOTMEM=y
CONFIG_MEMTEST=y
# CONFIG_MK8 is not set
# CONFIG_MPSC is not set
# CONFIG_MCORE2 is not set
# CONFIG_MATOM is not set
CONFIG_GENERIC_CPU=y
CONFIG_X86_INTERNODE_CACHE_SHIFT=6
CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_TSC=y
CONFIG_X86_CMPXCHG64=y
CONFIG_X86_CMOV=y
CONFIG_X86_MINIMUM_CPU_FAMILY=64
CONFIG_X86_DEBUGCTLMSR=y
CONFIG_PROCESSOR_SELECT=y
CONFIG_CPU_SUP_INTEL=y
CONFIG_CPU_SUP_AMD=y
CONFIG_CPU_SUP_CENTAUR=y
CONFIG_HPET_TIMER=y
CONFIG_HPET_EMULATE_RTC=y
CONFIG_DMI=y
CONFIG_GART_IOMMU=y
CONFIG_CALGARY_IOMMU=y
CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y
CONFIG_SWIOTLB=y
CONFIG_IOMMU_HELPER=y
# CONFIG_MAXSMP is not set
CONFIG_NR_CPUS=256
CONFIG_SCHED_SMT=y
CONFIG_SCHED_MC=y
# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set
CONFIG_X86_LOCAL_APIC=y
CONFIG_X86_IO_APIC=y
CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
CONFIG_X86_MCE=y
CONFIG_X86_MCE_INTEL=y
CONFIG_X86_MCE_AMD=y
CONFIG_X86_MCE_THRESHOLD=y
# CONFIG_X86_MCE_INJECT is not set
CONFIG_X86_THERMAL_VECTOR=y
# CONFIG_I8K is not set
CONFIG_MICROCODE=y
CONFIG_MICROCODE_INTEL=y
CONFIG_MICROCODE_AMD=y
CONFIG_MICROCODE_OLD_INTERFACE=y
CONFIG_MICROCODE_INTEL_LIB=y
CONFIG_MICROCODE_INTEL_EARLY=y
CONFIG_MICROCODE_AMD_EARLY=y
CONFIG_MICROCODE_EARLY=y
# CONFIG_X86_MSR is not set
# CONFIG_X86_CPUID is not set
CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
CONFIG_DIRECT_GBPAGES=y
CONFIG_NUMA=y
CONFIG_AMD_NUMA=y
CONFIG_X86_64_ACPI_NUMA=y
CONFIG_NODES_SPAN_OTHER_NODES=y
# CONFIG_NUMA_EMU is not set
CONFIG_NODES_SHIFT=6
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ARCH_MEMORY_PROBE=y
CONFIG_ARCH_PROC_KCORE_TEXT=y
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_SPARSEMEM_MANUAL=y
CONFIG_SPARSEMEM=y
CONFIG_NEED_MULTIPLE_NODES=y
CONFIG_HAVE_MEMORY_PRESENT=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER=y
CONFIG_SPARSEMEM_VMEMMAP=y
CONFIG_HAVE_MEMBLOCK=y
CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
CONFIG_ARCH_DISCARD_MEMBLOCK=y
CONFIG_MEMORY_ISOLATION=y
# CONFIG_MOVABLE_NODE is not set
CONFIG_HAVE_BOOTMEM_INFO_NODE=y
CONFIG_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTPLUG_SPARSE=y
CONFIG_MEMORY_HOTREMOVE=y
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_COMPACTION=y
CONFIG_MIGRATION=y
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_ZONE_DMA_FLAG=1
CONFIG_BOUNCE=y
CONFIG_NEED_BOUNCE_POOL=y
CONFIG_VIRT_TO_BUS=y
CONFIG_MMU_NOTIFIER=y
CONFIG_KSM=y
CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
CONFIG_MEMORY_FAILURE=y
# CONFIG_HWPOISON_INJECT is not set
CONFIG_TRANSPARENT_HUGEPAGE=y
# CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS is not set
CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y
CONFIG_CROSS_MEMORY_ATTACH=y
CONFIG_CLEANCACHE=y
CONFIG_FRONTSWAP=y
# CONFIG_ZBUD is not set
# CONFIG_ZSWAP is not set
# CONFIG_MEM_SOFT_DIRTY is not set
CONFIG_X86_CHECK_BIOS_CORRUPTION=y
CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y
CONFIG_X86_RESERVE_LOW=64
CONFIG_MTRR=y
CONFIG_MTRR_SANITIZER=y
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=1
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
CONFIG_X86_PAT=y
CONFIG_ARCH_USES_PG_UNCACHED=y
CONFIG_ARCH_RANDOM=y
CONFIG_X86_SMAP=y
CONFIG_EFI=y
CONFIG_EFI_STUB=y
CONFIG_SECCOMP=y
CONFIG_CC_STACKPROTECTOR=y
# CONFIG_HZ_100 is not set
CONFIG_HZ_250=y
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=250
CONFIG_SCHED_HRTICK=y
CONFIG_KEXEC=y
CONFIG_CRASH_DUMP=y
CONFIG_KEXEC_JUMP=y
CONFIG_PHYSICAL_START=0x1000000
CONFIG_RELOCATABLE=y
CONFIG_PHYSICAL_ALIGN=0x1000000
CONFIG_HOTPLUG_CPU=y
# CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set
# CONFIG_DEBUG_HOTPLUG_CPU0 is not set
# CONFIG_COMPAT_VDSO is not set
# CONFIG_CMDLINE_BOOL is not set
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
CONFIG_USE_PERCPU_NUMA_NODE_ID=y

#
# Power management and ACPI options
#
CONFIG_ARCH_HIBERNATION_HEADER=y
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
CONFIG_HIBERNATE_CALLBACKS=y
CONFIG_HIBERNATION=y
CONFIG_PM_STD_PARTITION=""
CONFIG_PM_SLEEP=y
CONFIG_PM_SLEEP_SMP=y
# CONFIG_PM_AUTOSLEEP is not set
# CONFIG_PM_WAKELOCKS is not set
CONFIG_PM_RUNTIME=y
CONFIG_PM=y
CONFIG_PM_DEBUG=y
# CONFIG_PM_ADVANCED_DEBUG is not set
# CONFIG_PM_TEST_SUSPEND is not set
CONFIG_PM_SLEEP_DEBUG=y
# CONFIG_PM_TRACE_RTC is not set
# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
CONFIG_ACPI=y
CONFIG_ACPI_SLEEP=y
# CONFIG_ACPI_PROCFS is not set
# CONFIG_ACPI_PROCFS_POWER is not set
CONFIG_ACPI_EC_DEBUGFS=m
CONFIG_ACPI_PROC_EVENT=y
CONFIG_ACPI_AC=y
CONFIG_ACPI_BATTERY=y
CONFIG_ACPI_BUTTON=y
CONFIG_ACPI_VIDEO=m
CONFIG_ACPI_FAN=y
CONFIG_ACPI_DOCK=y
CONFIG_ACPI_I2C=y
CONFIG_ACPI_PROCESSOR=y
CONFIG_ACPI_HOTPLUG_CPU=y
# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set
CONFIG_ACPI_THERMAL=y
CONFIG_ACPI_NUMA=y
CONFIG_ACPI_CUSTOM_DSDT_FILE=""
# CONFIG_ACPI_CUSTOM_DSDT is not set
# CONFIG_ACPI_INITRD_TABLE_OVERRIDE is not set
CONFIG_ACPI_BLACKLIST_YEAR=0
# CONFIG_ACPI_DEBUG is not set
# CONFIG_ACPI_PCI_SLOT is not set
CONFIG_X86_PM_TIMER=y
CONFIG_ACPI_CONTAINER=y
# CONFIG_ACPI_HOTPLUG_MEMORY is not set
# CONFIG_ACPI_SBS is not set
CONFIG_ACPI_HED=y
# CONFIG_ACPI_CUSTOM_METHOD is not set
CONFIG_ACPI_BGRT=y
CONFIG_ACPI_APEI=y
CONFIG_ACPI_APEI_GHES=y
CONFIG_ACPI_APEI_PCIEAER=y
CONFIG_ACPI_APEI_MEMORY_FAILURE=y
# CONFIG_ACPI_APEI_EINJ is not set
# CONFIG_ACPI_APEI_ERST_DEBUG is not set
CONFIG_SFI=y

#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
CONFIG_CPU_FREQ_GOV_COMMON=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_STAT_DETAILS=y
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y

#
# x86 CPU frequency scaling drivers
#
CONFIG_X86_INTEL_PSTATE=y
CONFIG_X86_PCC_CPUFREQ=y
CONFIG_X86_ACPI_CPUFREQ=y
CONFIG_X86_ACPI_CPUFREQ_CPB=y
CONFIG_X86_POWERNOW_K8=y
# CONFIG_X86_AMD_FREQ_SENSITIVITY is not set
CONFIG_X86_SPEEDSTEP_CENTRINO=y
# CONFIG_X86_P4_CLOCKMOD is not set

#
# shared options
#
# CONFIG_X86_SPEEDSTEP_LIB is not set
CONFIG_CPU_IDLE=y
# CONFIG_CPU_IDLE_MULTIPLE_DRIVERS is not set
CONFIG_CPU_IDLE_GOV_LADDER=y
CONFIG_CPU_IDLE_GOV_MENU=y
# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
CONFIG_INTEL_IDLE=y

#
# Memory power savings
#
# CONFIG_I7300_IDLE is not set

#
# Bus options (PCI etc.)
#
CONFIG_PCI=y
CONFIG_PCI_DIRECT=y
CONFIG_PCI_MMCONFIG=y
CONFIG_PCI_XEN=y
CONFIG_PCI_DOMAINS=y
# CONFIG_PCI_CNB20LE_QUIRK is not set
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI_PCIE=y
CONFIG_PCIEAER=y
# CONFIG_PCIE_ECRC is not set
# CONFIG_PCIEAER_INJECT is not set
CONFIG_PCIEASPM=y
# CONFIG_PCIEASPM_DEBUG is not set
CONFIG_PCIEASPM_DEFAULT=y
# CONFIG_PCIEASPM_POWERSAVE is not set
# CONFIG_PCIEASPM_PERFORMANCE is not set
CONFIG_PCIE_PME=y
CONFIG_ARCH_SUPPORTS_MSI=y
CONFIG_PCI_MSI=y
# CONFIG_PCI_DEBUG is not set
CONFIG_PCI_REALLOC_ENABLE_AUTO=y
# CONFIG_PCI_STUB is not set
# CONFIG_XEN_PCIDEV_FRONTEND is not set
CONFIG_HT_IRQ=y
CONFIG_PCI_ATS=y
CONFIG_PCI_IOV=y
CONFIG_PCI_PRI=y
CONFIG_PCI_PASID=y
CONFIG_PCI_IOAPIC=y
CONFIG_PCI_LABEL=y

#
# PCI host controller drivers
#
CONFIG_ISA_DMA_API=y
CONFIG_AMD_NB=y
# CONFIG_PCCARD is not set
CONFIG_HOTPLUG_PCI=y
# CONFIG_HOTPLUG_PCI_ACPI is not set
CONFIG_HOTPLUG_PCI_CPCI=y
# CONFIG_HOTPLUG_PCI_CPCI_ZT5550 is not set
# CONFIG_HOTPLUG_PCI_CPCI_GENERIC is not set
# CONFIG_HOTPLUG_PCI_SHPC is not set
CONFIG_RAPIDIO=y
CONFIG_RAPIDIO_TSI721=y
CONFIG_RAPIDIO_DISC_TIMEOUT=30
# CONFIG_RAPIDIO_ENABLE_RX_TX_PORTS is not set
CONFIG_RAPIDIO_DMA_ENGINE=y
# CONFIG_RAPIDIO_DEBUG is not set
# CONFIG_RAPIDIO_ENUM_BASIC is not set

#
# RapidIO Switch drivers
#
CONFIG_RAPIDIO_TSI57X=y
CONFIG_RAPIDIO_CPS_XX=y
CONFIG_RAPIDIO_TSI568=y
CONFIG_RAPIDIO_CPS_GEN2=y

#
# Executable file formats / Emulations
#
CONFIG_BINFMT_ELF=y
CONFIG_COMPAT_BINFMT_ELF=y
CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
CONFIG_BINFMT_SCRIPT=y
# CONFIG_HAVE_AOUT is not set
# CONFIG_BINFMT_MISC is not set
CONFIG_COREDUMP=y
CONFIG_IA32_EMULATION=y
# CONFIG_IA32_AOUT is not set
CONFIG_X86_X32=y
CONFIG_COMPAT=y
CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
CONFIG_SYSVIPC_COMPAT=y
CONFIG_KEYS_COMPAT=y
CONFIG_HAVE_TEXT_POKE_SMP=y
CONFIG_X86_DEV_DMA_OPS=y
CONFIG_NET=y
CONFIG_COMPAT_NETLINK_MESSAGES=y

#
# Networking options
#
CONFIG_PACKET=y
# CONFIG_PACKET_DIAG is not set
CONFIG_UNIX=y
# CONFIG_UNIX_DIAG is not set
# CONFIG_XFRM_USER is not set
# CONFIG_NET_KEY is not set
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_FIB_TRIE_STATS=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_ROUTE_VERBOSE=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
# CONFIG_IP_PNP_BOOTP is not set
# CONFIG_IP_PNP_RARP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE_DEMUX is not set
# CONFIG_NET_IP_TUNNEL is not set
CONFIG_IP_MROUTE=y
# CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
# CONFIG_ARPD is not set
CONFIG_SYN_COOKIES=y
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_XFRM_TUNNEL is not set
# CONFIG_INET_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_BEET is not set
CONFIG_INET_LRO=y
# CONFIG_INET_DIAG is not set
CONFIG_TCP_CONG_ADVANCED=y
# CONFIG_TCP_CONG_BIC is not set
CONFIG_TCP_CONG_CUBIC=y
# CONFIG_TCP_CONG_WESTWOOD is not set
# CONFIG_TCP_CONG_HTCP is not set
# CONFIG_TCP_CONG_HSTCP is not set
# CONFIG_TCP_CONG_HYBLA is not set
# CONFIG_TCP_CONG_VEGAS is not set
# CONFIG_TCP_CONG_SCALABLE is not set
# CONFIG_TCP_CONG_LP is not set
# CONFIG_TCP_CONG_VENO is not set
# CONFIG_TCP_CONG_YEAH is not set
# CONFIG_TCP_CONG_ILLINOIS is not set
CONFIG_DEFAULT_CUBIC=y
# CONFIG_DEFAULT_RENO is not set
CONFIG_DEFAULT_TCP_CONG="cubic"
CONFIG_TCP_MD5SIG=y
CONFIG_IPV6=y
CONFIG_IPV6_PRIVACY=y
CONFIG_IPV6_ROUTER_PREF=y
CONFIG_IPV6_ROUTE_INFO=y
# CONFIG_IPV6_OPTIMISTIC_DAD is not set
# CONFIG_INET6_AH is not set
# CONFIG_INET6_ESP is not set
# CONFIG_INET6_IPCOMP is not set
# CONFIG_IPV6_MIP6 is not set
# CONFIG_INET6_XFRM_TUNNEL is not set
# CONFIG_INET6_TUNNEL is not set
# CONFIG_INET6_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET6_XFRM_MODE_TUNNEL is not set
# CONFIG_INET6_XFRM_MODE_BEET is not set
# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
# CONFIG_IPV6_SIT is not set
# CONFIG_IPV6_TUNNEL is not set
# CONFIG_IPV6_GRE is not set
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_MROUTE=y
CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
CONFIG_IPV6_PIMSM_V2=y
CONFIG_NETLABEL=y
CONFIG_NETWORK_SECMARK=y
# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
CONFIG_NETFILTER=y
# CONFIG_NETFILTER_DEBUG is not set
CONFIG_NETFILTER_ADVANCED=y

#
# Core Netfilter Configuration
#
# CONFIG_NETFILTER_NETLINK_ACCT is not set
# CONFIG_NETFILTER_NETLINK_QUEUE is not set
# CONFIG_NETFILTER_NETLINK_LOG is not set
# CONFIG_NF_CONNTRACK is not set
# CONFIG_NETFILTER_XTABLES is not set
# CONFIG_IP_VS is not set

#
# IP: Netfilter Configuration
#
# CONFIG_NF_DEFRAG_IPV4 is not set
# CONFIG_IP_NF_IPTABLES is not set
# CONFIG_IP_NF_ARPTABLES is not set

#
# IPv6: Netfilter Configuration
#
# CONFIG_NF_DEFRAG_IPV6 is not set
# CONFIG_IP6_NF_IPTABLES is not set
# CONFIG_IP_DCCP is not set
# CONFIG_IP_SCTP is not set
# CONFIG_RDS is not set
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
# CONFIG_L2TP is not set
# CONFIG_BRIDGE is not set
CONFIG_HAVE_NET_DSA=y
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_PHONET is not set
# CONFIG_IEEE802154 is not set
CONFIG_NET_SCHED=y

#
# Queueing/Scheduling
#
# CONFIG_NET_SCH_CBQ is not set
CONFIG_NET_SCH_HTB=m
# CONFIG_NET_SCH_HFSC is not set
# CONFIG_NET_SCH_PRIO is not set
# CONFIG_NET_SCH_MULTIQ is not set
# CONFIG_NET_SCH_RED is not set
# CONFIG_NET_SCH_SFB is not set
# CONFIG_NET_SCH_SFQ is not set
# CONFIG_NET_SCH_TEQL is not set
# CONFIG_NET_SCH_TBF is not set
# CONFIG_NET_SCH_GRED is not set
# CONFIG_NET_SCH_DSMARK is not set
# CONFIG_NET_SCH_NETEM is not set
# CONFIG_NET_SCH_DRR is not set
# CONFIG_NET_SCH_MQPRIO is not set
# CONFIG_NET_SCH_CHOKE is not set
# CONFIG_NET_SCH_QFQ is not set
CONFIG_NET_SCH_CODEL=m
CONFIG_NET_SCH_FQ_CODEL=m
# CONFIG_NET_SCH_INGRESS is not set
# CONFIG_NET_SCH_PLUG is not set

#
# Classification
#
CONFIG_NET_CLS=y
# CONFIG_NET_CLS_BASIC is not set
# CONFIG_NET_CLS_TCINDEX is not set
# CONFIG_NET_CLS_ROUTE4 is not set
# CONFIG_NET_CLS_FW is not set
# CONFIG_NET_CLS_U32 is not set
# CONFIG_NET_CLS_RSVP is not set
# CONFIG_NET_CLS_RSVP6 is not set
# CONFIG_NET_CLS_FLOW is not set
# CONFIG_NET_CLS_CGROUP is not set
CONFIG_NET_EMATCH=y
CONFIG_NET_EMATCH_STACK=32
# CONFIG_NET_EMATCH_CMP is not set
# CONFIG_NET_EMATCH_NBYTE is not set
# CONFIG_NET_EMATCH_U32 is not set
# CONFIG_NET_EMATCH_META is not set
# CONFIG_NET_EMATCH_TEXT is not set
CONFIG_NET_CLS_ACT=y
# CONFIG_NET_ACT_POLICE is not set
# CONFIG_NET_ACT_GACT is not set
# CONFIG_NET_ACT_MIRRED is not set
# CONFIG_NET_ACT_NAT is not set
# CONFIG_NET_ACT_PEDIT is not set
# CONFIG_NET_ACT_SIMP is not set
# CONFIG_NET_ACT_SKBEDIT is not set
# CONFIG_NET_ACT_CSUM is not set
CONFIG_NET_SCH_FIFO=y
CONFIG_DCB=y
CONFIG_DNS_RESOLVER=y
# CONFIG_BATMAN_ADV is not set
# CONFIG_OPENVSWITCH is not set
# CONFIG_VSOCKETS is not set
# CONFIG_NETLINK_MMAP is not set
# CONFIG_NETLINK_DIAG is not set
# CONFIG_NET_MPLS_GSO is not set
CONFIG_RPS=y
CONFIG_RFS_ACCEL=y
CONFIG_XPS=y
# CONFIG_NETPRIO_CGROUP is not set
CONFIG_NET_RX_BUSY_POLL=y
CONFIG_BQL=y
CONFIG_BPF_JIT=y
CONFIG_NET_FLOW_LIMIT=y

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_NET_TCPPROBE is not set
# CONFIG_NET_DROP_MONITOR is not set
CONFIG_HAMRADIO=y

#
# Packet Radio protocols
#
# CONFIG_AX25 is not set
# CONFIG_CAN is not set
# CONFIG_IRDA is not set
CONFIG_BT=m
CONFIG_BT_RFCOMM=m
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=m
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
# CONFIG_BT_HIDP is not set

#
# Bluetooth device drivers
#
CONFIG_BT_HCIBTUSB=m
# CONFIG_BT_HCIBTSDIO is not set
# CONFIG_BT_HCIUART is not set
# CONFIG_BT_HCIBCM203X is not set
# CONFIG_BT_HCIBPA10X is not set
# CONFIG_BT_HCIBFUSB is not set
# CONFIG_BT_HCIVHCI is not set
# CONFIG_BT_MRVL is not set
# CONFIG_BT_ATH3K is not set
# CONFIG_AF_RXRPC is not set
CONFIG_FIB_RULES=y
CONFIG_WIRELESS=y
CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
CONFIG_CFG80211=m
CONFIG_NL80211_TESTMODE=y
# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
# CONFIG_CFG80211_REG_DEBUG is not set
# CONFIG_CFG80211_CERTIFICATION_ONUS is not set
CONFIG_CFG80211_DEFAULT_PS=y
CONFIG_CFG80211_DEBUGFS=y
# CONFIG_CFG80211_INTERNAL_REGDB is not set
CONFIG_CFG80211_WEXT=y
# CONFIG_LIB80211 is not set
CONFIG_MAC80211=m
CONFIG_MAC80211_HAS_RC=y
CONFIG_MAC80211_RC_PID=y
CONFIG_MAC80211_RC_MINSTREL=y
CONFIG_MAC80211_RC_MINSTREL_HT=y
# CONFIG_MAC80211_RC_DEFAULT_PID is not set
CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
CONFIG_MAC80211_MESH=y
CONFIG_MAC80211_LEDS=y
CONFIG_MAC80211_DEBUGFS=y
# CONFIG_MAC80211_MESSAGE_TRACING is not set
# CONFIG_MAC80211_DEBUG_MENU is not set
# CONFIG_WIMAX is not set
CONFIG_RFKILL=y
CONFIG_RFKILL_LEDS=y
CONFIG_RFKILL_INPUT=y
# CONFIG_RFKILL_REGULATOR is not set
# CONFIG_NET_9P is not set
# CONFIG_CAIF is not set
# CONFIG_CEPH_LIB is not set
# CONFIG_NFC is not set
CONFIG_HAVE_BPF_JIT=y

#
# Device Drivers
#

#
# Generic Driver Options
#
CONFIG_UEVENT_HELPER_PATH=""
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_STANDALONE is not set
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
CONFIG_FIRMWARE_IN_KERNEL=y
CONFIG_EXTRA_FIRMWARE=""
CONFIG_FW_LOADER_USER_HELPER=y
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
CONFIG_SYS_HYPERVISOR=y
# CONFIG_GENERIC_CPU_DEVICES is not set
CONFIG_REGMAP=y
CONFIG_REGMAP_I2C=y
CONFIG_REGMAP_SPI=y
CONFIG_REGMAP_IRQ=y
CONFIG_DMA_SHARED_BUFFER=y

#
# Bus devices
#
CONFIG_CONNECTOR=y
CONFIG_PROC_EVENTS=y
# CONFIG_MTD is not set
CONFIG_PARPORT=m
CONFIG_PARPORT_PC=m
# CONFIG_PARPORT_SERIAL is not set
CONFIG_PARPORT_PC_FIFO=y
# CONFIG_PARPORT_PC_SUPERIO is not set
# CONFIG_PARPORT_GSC is not set
# CONFIG_PARPORT_AX88796 is not set
CONFIG_PARPORT_1284=y
CONFIG_PNP=y
# CONFIG_PNP_DEBUG_MESSAGES is not set

#
# Protocols
#
CONFIG_PNPACPI=y
CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_FD is not set
# CONFIG_PARIDE is not set
# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_LOOP_MIN_COUNT=8
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
# CONFIG_BLK_DEV_DRBD is not set
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_NVME is not set
# CONFIG_BLK_DEV_SX8 is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=65536
# CONFIG_BLK_DEV_XIP is not set
# CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set
CONFIG_XEN_BLKDEV_FRONTEND=y
# CONFIG_XEN_BLKDEV_BACKEND is not set
CONFIG_VIRTIO_BLK=y
# CONFIG_BLK_DEV_HD is not set
# CONFIG_BLK_DEV_RBD is not set
# CONFIG_BLK_DEV_RSXX is not set

#
# Misc devices
#
# CONFIG_SENSORS_LIS3LV02D is not set
# CONFIG_AD525X_DPOT is not set
# CONFIG_DUMMY_IRQ is not set
# CONFIG_IBM_ASM is not set
# CONFIG_PHANTOM is not set
# CONFIG_SGI_IOC4 is not set
# CONFIG_TIFM_CORE is not set
# CONFIG_ICS932S401 is not set
# CONFIG_ATMEL_SSC is not set
# CONFIG_ENCLOSURE_SERVICES is not set
# CONFIG_HP_ILO is not set
# CONFIG_APDS9802ALS is not set
# CONFIG_ISL29003 is not set
# CONFIG_ISL29020 is not set
# CONFIG_SENSORS_TSL2550 is not set
# CONFIG_SENSORS_BH1780 is not set
# CONFIG_SENSORS_BH1770 is not set
# CONFIG_SENSORS_APDS990X is not set
# CONFIG_HMC6352 is not set
# CONFIG_DS1682 is not set
# CONFIG_TI_DAC7512 is not set
# CONFIG_VMWARE_BALLOON is not set
# CONFIG_BMP085_I2C is not set
# CONFIG_BMP085_SPI is not set
# CONFIG_PCH_PHUB is not set
# CONFIG_USB_SWITCH_FSA9480 is not set
# CONFIG_LATTICE_ECP3_CONFIG is not set
# CONFIG_SRAM is not set
# CONFIG_C2PORT is not set

#
# EEPROM support
#
# CONFIG_EEPROM_AT24 is not set
# CONFIG_EEPROM_AT25 is not set
# CONFIG_EEPROM_LEGACY is not set
# CONFIG_EEPROM_MAX6875 is not set
# CONFIG_EEPROM_93CX6 is not set
# CONFIG_EEPROM_93XX46 is not set
# CONFIG_CB710_CORE is not set

#
# Texas Instruments shared transport line discipline
#
# CONFIG_TI_ST is not set
# CONFIG_SENSORS_LIS3_I2C is not set

#
# Altera FPGA firmware download module
#
# CONFIG_ALTERA_STAPL is not set
CONFIG_INTEL_MEI=y
CONFIG_INTEL_MEI_ME=y
# CONFIG_VMWARE_VMCI is not set
CONFIG_HAVE_IDE=y
# CONFIG_IDE is not set

#
# SCSI device support
#
CONFIG_SCSI_MOD=y
# CONFIG_RAID_ATTRS is not set
CONFIG_SCSI=y
CONFIG_SCSI_DMA=y
# CONFIG_SCSI_TGT is not set
# CONFIG_SCSI_NETLINK is not set
CONFIG_SCSI_PROC_FS=y

#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=y
# CONFIG_CHR_DEV_ST is not set
# CONFIG_CHR_DEV_OSST is not set
CONFIG_BLK_DEV_SR=y
# CONFIG_BLK_DEV_SR_VENDOR is not set
CONFIG_CHR_DEV_SG=y
# CONFIG_CHR_DEV_SCH is not set
CONFIG_SCSI_MULTI_LUN=y
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_LOGGING=y
CONFIG_SCSI_SCAN_ASYNC=y

#
# SCSI Transports
#
CONFIG_SCSI_SPI_ATTRS=y
# CONFIG_SCSI_FC_ATTRS is not set
# CONFIG_SCSI_ISCSI_ATTRS is not set
# CONFIG_SCSI_SAS_ATTRS is not set
# CONFIG_SCSI_SAS_LIBSAS is not set
# CONFIG_SCSI_SRP_ATTRS is not set
CONFIG_SCSI_LOWLEVEL=y
# CONFIG_ISCSI_TCP is not set
# CONFIG_ISCSI_BOOT_SYSFS is not set
# CONFIG_SCSI_CXGB3_ISCSI is not set
# CONFIG_SCSI_CXGB4_ISCSI is not set
# CONFIG_SCSI_BNX2_ISCSI is not set
# CONFIG_SCSI_BNX2X_FCOE is not set
# CONFIG_BE2ISCSI is not set
# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
# CONFIG_SCSI_HPSA is not set
# CONFIG_SCSI_3W_9XXX is not set
# CONFIG_SCSI_3W_SAS is not set
# CONFIG_SCSI_ACARD is not set
# CONFIG_SCSI_AACRAID is not set
# CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC7XXX_OLD is not set
# CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_AIC94XX is not set
# CONFIG_SCSI_MVSAS is not set
# CONFIG_SCSI_MVUMI is not set
# CONFIG_SCSI_DPT_I2O is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_ARCMSR is not set
CONFIG_MEGARAID_NEWGEN=y
# CONFIG_MEGARAID_MM is not set
# CONFIG_MEGARAID_LEGACY is not set
# CONFIG_MEGARAID_SAS is not set
# CONFIG_SCSI_MPT2SAS is not set
# CONFIG_SCSI_MPT3SAS is not set
# CONFIG_SCSI_UFSHCD is not set
# CONFIG_SCSI_HPTIOP is not set
# CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_VMWARE_PVSCSI is not set
# CONFIG_LIBFC is not set
# CONFIG_LIBFCOE is not set
# CONFIG_FCOE is not set
# CONFIG_FCOE_FNIC is not set
# CONFIG_SCSI_DMX3191D is not set
# CONFIG_SCSI_EATA is not set
# CONFIG_SCSI_FUTURE_DOMAIN is not set
# CONFIG_SCSI_GDTH is not set
# CONFIG_SCSI_ISCI is not set
# CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_INITIO is not set
# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_PPA is not set
# CONFIG_SCSI_IMM is not set
# CONFIG_SCSI_STEX is not set
# CONFIG_SCSI_SYM53C8XX_2 is not set
# CONFIG_SCSI_IPR is not set
# CONFIG_SCSI_QLOGIC_1280 is not set
# CONFIG_SCSI_QLA_FC is not set
# CONFIG_SCSI_QLA_ISCSI is not set
# CONFIG_SCSI_LPFC is not set
# CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_DC390T is not set
# CONFIG_SCSI_DEBUG is not set
# CONFIG_SCSI_PMCRAID is not set
# CONFIG_SCSI_PM8001 is not set
# CONFIG_SCSI_SRP is not set
# CONFIG_SCSI_BFA_FC is not set
# CONFIG_SCSI_VIRTIO is not set
# CONFIG_SCSI_CHELSIO_FCOE is not set
# CONFIG_SCSI_DH is not set
# CONFIG_SCSI_OSD_INITIATOR is not set
CONFIG_ATA=y
# CONFIG_ATA_NONSTANDARD is not set
CONFIG_ATA_VERBOSE_ERROR=y
CONFIG_ATA_ACPI=y
# CONFIG_SATA_ZPODD is not set
CONFIG_SATA_PMP=y

#
# Controllers with non-SFF native interface
#
CONFIG_SATA_AHCI=y
# CONFIG_SATA_AHCI_PLATFORM is not set
# CONFIG_SATA_INIC162X is not set
# CONFIG_SATA_ACARD_AHCI is not set
# CONFIG_SATA_SIL24 is not set
CONFIG_ATA_SFF=y

#
# SFF controllers with custom DMA interface
#
# CONFIG_PDC_ADMA is not set
# CONFIG_SATA_QSTOR is not set
# CONFIG_SATA_SX4 is not set
CONFIG_ATA_BMDMA=y

#
# SATA SFF controllers with BMDMA
#
CONFIG_ATA_PIIX=y
# CONFIG_SATA_HIGHBANK is not set
# CONFIG_SATA_MV is not set
# CONFIG_SATA_NV is not set
# CONFIG_SATA_PROMISE is not set
# CONFIG_SATA_RCAR is not set
# CONFIG_SATA_SIL is not set
# CONFIG_SATA_SIS is not set
# CONFIG_SATA_SVW is not set
# CONFIG_SATA_ULI is not set
# CONFIG_SATA_VIA is not set
# CONFIG_SATA_VITESSE is not set

#
# PATA SFF controllers with BMDMA
#
# CONFIG_PATA_ALI is not set
# CONFIG_PATA_AMD is not set
# CONFIG_PATA_ARASAN_CF is not set
# CONFIG_PATA_ARTOP is not set
# CONFIG_PATA_ATIIXP is not set
# CONFIG_PATA_ATP867X is not set
# CONFIG_PATA_CMD64X is not set
# CONFIG_PATA_CS5520 is not set
# CONFIG_PATA_CS5530 is not set
# CONFIG_PATA_CS5536 is not set
# CONFIG_PATA_CYPRESS is not set
# CONFIG_PATA_EFAR is not set
# CONFIG_PATA_HPT366 is not set
# CONFIG_PATA_HPT37X is not set
# CONFIG_PATA_HPT3X2N is not set
# CONFIG_PATA_HPT3X3 is not set
# CONFIG_PATA_IT8213 is not set
# CONFIG_PATA_IT821X is not set
# CONFIG_PATA_JMICRON is not set
# CONFIG_PATA_MARVELL is not set
# CONFIG_PATA_NETCELL is not set
# CONFIG_PATA_NINJA32 is not set
# CONFIG_PATA_NS87415 is not set
# CONFIG_PATA_OLDPIIX is not set
# CONFIG_PATA_OPTIDMA is not set
# CONFIG_PATA_PDC2027X is not set
# CONFIG_PATA_PDC_OLD is not set
# CONFIG_PATA_RADISYS is not set
# CONFIG_PATA_RDC is not set
# CONFIG_PATA_SC1200 is not set
# CONFIG_PATA_SCH is not set
# CONFIG_PATA_SERVERWORKS is not set
# CONFIG_PATA_SIL680 is not set
CONFIG_PATA_SIS=y
# CONFIG_PATA_TOSHIBA is not set
# CONFIG_PATA_TRIFLEX is not set
# CONFIG_PATA_VIA is not set
# CONFIG_PATA_WINBOND is not set

#
# PIO-only SFF controllers
#
# CONFIG_PATA_CMD640_PCI is not set
# CONFIG_PATA_MPIIX is not set
# CONFIG_PATA_NS87410 is not set
# CONFIG_PATA_OPTI is not set
# CONFIG_PATA_PLATFORM is not set
# CONFIG_PATA_RZ1000 is not set

#
# Generic fallback / legacy drivers
#
CONFIG_PATA_ACPI=y
CONFIG_ATA_GENERIC=y
# CONFIG_PATA_LEGACY is not set
CONFIG_MD=y
CONFIG_BLK_DEV_MD=y
CONFIG_MD_AUTODETECT=y
# CONFIG_MD_LINEAR is not set
# CONFIG_MD_RAID0 is not set
# CONFIG_MD_RAID1 is not set
# CONFIG_MD_RAID10 is not set
# CONFIG_MD_RAID456 is not set
# CONFIG_MD_MULTIPATH is not set
# CONFIG_MD_FAULTY is not set
# CONFIG_BCACHE is not set
CONFIG_BLK_DEV_DM=y
# CONFIG_DM_DEBUG is not set
# CONFIG_DM_CRYPT is not set
# CONFIG_DM_SNAPSHOT is not set
# CONFIG_DM_THIN_PROVISIONING is not set
# CONFIG_DM_CACHE is not set
# CONFIG_DM_MIRROR is not set
# CONFIG_DM_RAID is not set
# CONFIG_DM_ZERO is not set
# CONFIG_DM_MULTIPATH is not set
# CONFIG_DM_DELAY is not set
CONFIG_DM_UEVENT=y
# CONFIG_DM_FLAKEY is not set
# CONFIG_DM_VERITY is not set
# CONFIG_DM_SWITCH is not set
# CONFIG_TARGET_CORE is not set
CONFIG_FUSION=y
# CONFIG_FUSION_SPI is not set
# CONFIG_FUSION_FC is not set
# CONFIG_FUSION_SAS is not set
CONFIG_FUSION_MAX_SGE=128
CONFIG_FUSION_LOGGING=y

#
# IEEE 1394 (FireWire) support
#
# CONFIG_FIREWIRE is not set
# CONFIG_FIREWIRE_NOSY is not set
# CONFIG_I2O is not set
CONFIG_MACINTOSH_DRIVERS=y
CONFIG_MAC_EMUMOUSEBTN=m
CONFIG_NETDEVICES=y
CONFIG_MII=m
CONFIG_NET_CORE=y
# CONFIG_BONDING is not set
# CONFIG_DUMMY is not set
# CONFIG_EQUALIZER is not set
CONFIG_NET_FC=y
# CONFIG_IFB is not set
# CONFIG_NET_TEAM is not set
# CONFIG_MACVLAN is not set
# CONFIG_VXLAN is not set
# CONFIG_NETCONSOLE is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_RIONET is not set
CONFIG_TUN=y
# CONFIG_VETH is not set
CONFIG_VIRTIO_NET=y
# CONFIG_NLMON is not set
# CONFIG_ARCNET is not set

#
# CAIF transport drivers
#
# CONFIG_VHOST_NET is not set

#
# Distributed Switch Architecture drivers
#
# CONFIG_NET_DSA_MV88E6XXX is not set
# CONFIG_NET_DSA_MV88E6060 is not set
# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set
# CONFIG_NET_DSA_MV88E6131 is not set
# CONFIG_NET_DSA_MV88E6123_61_65 is not set
CONFIG_ETHERNET=y
CONFIG_NET_VENDOR_3COM=y
# CONFIG_VORTEX is not set
# CONFIG_TYPHOON is not set
CONFIG_NET_VENDOR_ADAPTEC=y
# CONFIG_ADAPTEC_STARFIRE is not set
CONFIG_NET_VENDOR_ALTEON=y
# CONFIG_ACENIC is not set
CONFIG_NET_VENDOR_AMD=y
# CONFIG_AMD8111_ETH is not set
# CONFIG_PCNET32 is not set
CONFIG_NET_VENDOR_ARC=y
CONFIG_NET_VENDOR_ATHEROS=y
# CONFIG_ATL2 is not set
# CONFIG_ATL1 is not set
# CONFIG_ATL1E is not set
# CONFIG_ATL1C is not set
# CONFIG_ALX is not set
CONFIG_NET_CADENCE=y
# CONFIG_ARM_AT91_ETHER is not set
# CONFIG_MACB is not set
CONFIG_NET_VENDOR_BROADCOM=y
# CONFIG_B44 is not set
# CONFIG_BNX2 is not set
# CONFIG_CNIC is not set
# CONFIG_TIGON3 is not set
# CONFIG_BNX2X is not set
CONFIG_NET_VENDOR_BROCADE=y
# CONFIG_BNA is not set
# CONFIG_NET_CALXEDA_XGMAC is not set
CONFIG_NET_VENDOR_CHELSIO=y
# CONFIG_CHELSIO_T1 is not set
# CONFIG_CHELSIO_T3 is not set
# CONFIG_CHELSIO_T4 is not set
# CONFIG_CHELSIO_T4VF is not set
CONFIG_NET_VENDOR_CISCO=y
# CONFIG_ENIC is not set
# CONFIG_DNET is not set
CONFIG_NET_VENDOR_DEC=y
CONFIG_NET_TULIP=y
# CONFIG_DE2104X is not set
# CONFIG_TULIP is not set
# CONFIG_DE4X5 is not set
# CONFIG_WINBOND_840 is not set
# CONFIG_DM9102 is not set
# CONFIG_ULI526X is not set
CONFIG_NET_VENDOR_DLINK=y
# CONFIG_DL2K is not set
# CONFIG_SUNDANCE is not set
CONFIG_NET_VENDOR_EMULEX=y
# CONFIG_BE2NET is not set
CONFIG_NET_VENDOR_EXAR=y
# CONFIG_S2IO is not set
# CONFIG_VXGE is not set
CONFIG_NET_VENDOR_HP=y
# CONFIG_HP100 is not set
CONFIG_NET_VENDOR_INTEL=y
# CONFIG_E100 is not set
# CONFIG_E1000 is not set
# CONFIG_E1000E is not set
# CONFIG_IGB is not set
# CONFIG_IGBVF is not set
# CONFIG_IXGB is not set
# CONFIG_IXGBE is not set
# CONFIG_IXGBEVF is not set
CONFIG_NET_VENDOR_I825XX=y
# CONFIG_IP1000 is not set
# CONFIG_JME is not set
CONFIG_NET_VENDOR_MARVELL=y
# CONFIG_MVMDIO is not set
# CONFIG_SKGE is not set
# CONFIG_SKY2 is not set
CONFIG_NET_VENDOR_MELLANOX=y
# CONFIG_MLX4_EN is not set
# CONFIG_MLX4_CORE is not set
# CONFIG_MLX5_CORE is not set
CONFIG_NET_VENDOR_MICREL=y
# CONFIG_KS8842 is not set
# CONFIG_KS8851 is not set
# CONFIG_KS8851_MLL is not set
# CONFIG_KSZ884X_PCI is not set
CONFIG_NET_VENDOR_MICROCHIP=y
# CONFIG_ENC28J60 is not set
CONFIG_NET_VENDOR_MYRI=y
# CONFIG_MYRI10GE is not set
# CONFIG_FEALNX is not set
CONFIG_NET_VENDOR_NATSEMI=y
# CONFIG_NATSEMI is not set
# CONFIG_NS83820 is not set
CONFIG_NET_VENDOR_8390=y
# CONFIG_NE2K_PCI is not set
CONFIG_NET_VENDOR_NVIDIA=y
# CONFIG_FORCEDETH is not set
CONFIG_NET_VENDOR_OKI=y
# CONFIG_PCH_GBE is not set
# CONFIG_ETHOC is not set
CONFIG_NET_PACKET_ENGINE=y
# CONFIG_HAMACHI is not set
# CONFIG_YELLOWFIN is not set
CONFIG_NET_VENDOR_QLOGIC=y
# CONFIG_QLA3XXX is not set
# CONFIG_QLCNIC is not set
# CONFIG_QLGE is not set
# CONFIG_NETXEN_NIC is not set
CONFIG_NET_VENDOR_REALTEK=y
# CONFIG_ATP is not set
# CONFIG_8139CP is not set
# CONFIG_8139TOO is not set
CONFIG_R8169=m
# CONFIG_SH_ETH is not set
CONFIG_NET_VENDOR_RDC=y
# CONFIG_R6040 is not set
CONFIG_NET_VENDOR_SEEQ=y
CONFIG_NET_VENDOR_SILAN=y
# CONFIG_SC92031 is not set
CONFIG_NET_VENDOR_SIS=y
# CONFIG_SIS900 is not set
# CONFIG_SIS190 is not set
# CONFIG_SFC is not set
CONFIG_NET_VENDOR_SMSC=y
# CONFIG_EPIC100 is not set
# CONFIG_SMSC911X is not set
# CONFIG_SMSC9420 is not set
CONFIG_NET_VENDOR_STMICRO=y
# CONFIG_STMMAC_ETH is not set
CONFIG_NET_VENDOR_SUN=y
# CONFIG_HAPPYMEAL is not set
# CONFIG_SUNGEM is not set
# CONFIG_CASSINI is not set
# CONFIG_NIU is not set
CONFIG_NET_VENDOR_TEHUTI=y
# CONFIG_TEHUTI is not set
CONFIG_NET_VENDOR_TI=y
# CONFIG_TLAN is not set
CONFIG_NET_VENDOR_VIA=y
# CONFIG_VIA_RHINE is not set
# CONFIG_VIA_VELOCITY is not set
CONFIG_NET_VENDOR_WIZNET=y
# CONFIG_WIZNET_W5100 is not set
# CONFIG_WIZNET_W5300 is not set
CONFIG_FDDI=y
# CONFIG_DEFXX is not set
# CONFIG_SKFP is not set
# CONFIG_HIPPI is not set
# CONFIG_NET_SB1000 is not set
CONFIG_PHYLIB=y

#
# MII PHY device drivers
#
CONFIG_AT803X_PHY=y
CONFIG_AMD_PHY=y
CONFIG_MARVELL_PHY=y
CONFIG_DAVICOM_PHY=y
CONFIG_QSEMI_PHY=y
CONFIG_LXT_PHY=y
CONFIG_CICADA_PHY=y
CONFIG_VITESSE_PHY=y
CONFIG_SMSC_PHY=y
CONFIG_BROADCOM_PHY=y
CONFIG_BCM87XX_PHY=y
CONFIG_ICPLUS_PHY=y
CONFIG_REALTEK_PHY=y
CONFIG_NATIONAL_PHY=y
CONFIG_STE10XP=y
CONFIG_LSI_ET1011C_PHY=y
CONFIG_MICREL_PHY=y
CONFIG_FIXED_PHY=y
CONFIG_MDIO_BITBANG=y
CONFIG_MDIO_GPIO=y
# CONFIG_MICREL_KS8995MA is not set
# CONFIG_PLIP is not set
CONFIG_PPP=y
# CONFIG_PPP_BSDCOMP is not set
# CONFIG_PPP_DEFLATE is not set
CONFIG_PPP_FILTER=y
# CONFIG_PPP_MPPE is not set
CONFIG_PPP_MULTILINK=y
# CONFIG_PPPOE is not set
# CONFIG_PPP_ASYNC is not set
# CONFIG_PPP_SYNC_TTY is not set
# CONFIG_SLIP is not set
CONFIG_SLHC=y

#
# USB Network Adapters
#
# CONFIG_USB_CATC is not set
# CONFIG_USB_KAWETH is not set
# CONFIG_USB_PEGASUS is not set
# CONFIG_USB_RTL8150 is not set
# CONFIG_USB_RTL8152 is not set
# CONFIG_USB_USBNET is not set
# CONFIG_USB_HSO is not set
# CONFIG_USB_IPHETH is not set
CONFIG_WLAN=y
# CONFIG_LIBERTAS_THINFIRM is not set
# CONFIG_AIRO is not set
# CONFIG_ATMEL is not set
# CONFIG_AT76C50X_USB is not set
# CONFIG_PRISM54 is not set
# CONFIG_USB_ZD1201 is not set
# CONFIG_USB_NET_RNDIS_WLAN is not set
# CONFIG_RTL8180 is not set
# CONFIG_RTL8187 is not set
# CONFIG_ADM8211 is not set
# CONFIG_MAC80211_HWSIM is not set
# CONFIG_MWL8K is not set
# CONFIG_ATH_CARDS is not set
# CONFIG_B43 is not set
# CONFIG_B43LEGACY is not set
# CONFIG_BRCMFMAC is not set
# CONFIG_HOSTAP is not set
# CONFIG_IPW2100 is not set
# CONFIG_IPW2200 is not set
CONFIG_IWLWIFI=m
CONFIG_IWLDVM=m
# CONFIG_IWLMVM is not set
CONFIG_IWLWIFI_OPMODE_MODULAR=y

#
# Debugging Options
#
CONFIG_IWLWIFI_DEBUG=y
CONFIG_IWLWIFI_DEBUGFS=y
# CONFIG_IWLWIFI_DEBUG_EXPERIMENTAL_UCODE is not set
CONFIG_IWLWIFI_DEVICE_TRACING=y
CONFIG_IWLWIFI_P2P=y
# CONFIG_IWL4965 is not set
# CONFIG_IWL3945 is not set
# CONFIG_LIBERTAS is not set
# CONFIG_HERMES is not set
# CONFIG_P54_COMMON is not set
# CONFIG_RT2X00 is not set
CONFIG_RTL_CARDS=m
# CONFIG_RTL8192CE is not set
# CONFIG_RTL8192SE is not set
# CONFIG_RTL8192DE is not set
# CONFIG_RTL8723AE is not set
# CONFIG_RTL8188EE is not set
# CONFIG_RTL8192CU is not set
CONFIG_WL_TI=y
# CONFIG_WL1251 is not set
# CONFIG_WL12XX is not set
# CONFIG_WL18XX is not set
# CONFIG_WLCORE is not set
# CONFIG_ZD1211RW is not set
# CONFIG_MWIFIEX is not set
# CONFIG_CW1200 is not set

#
# Enable WiMAX (Networking options) to see the WiMAX drivers
#
CONFIG_WAN=y
# CONFIG_HDLC is not set
# CONFIG_DLCI is not set
# CONFIG_SBNI is not set
CONFIG_XEN_NETDEV_FRONTEND=y
# CONFIG_XEN_NETDEV_BACKEND is not set
# CONFIG_VMXNET3 is not set
CONFIG_ISDN=y
# CONFIG_ISDN_I4L is not set
# CONFIG_ISDN_CAPI is not set
# CONFIG_ISDN_DRV_GIGASET is not set
# CONFIG_HYSDN is not set
# CONFIG_MISDN is not set

#
# Input device support
#
CONFIG_INPUT=y
# CONFIG_INPUT_FF_MEMLESS is not set
# CONFIG_INPUT_POLLDEV is not set
# CONFIG_INPUT_SPARSEKMAP is not set
# CONFIG_INPUT_MATRIXKMAP is not set

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
CONFIG_INPUT_JOYDEV=m
CONFIG_INPUT_EVDEV=y
# CONFIG_INPUT_EVBUG is not set

#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
# CONFIG_KEYBOARD_ADP5520 is not set
# CONFIG_KEYBOARD_ADP5588 is not set
# CONFIG_KEYBOARD_ADP5589 is not set
CONFIG_KEYBOARD_ATKBD=y
# CONFIG_KEYBOARD_QT1070 is not set
# CONFIG_KEYBOARD_QT2160 is not set
# CONFIG_KEYBOARD_LKKBD is not set
# CONFIG_KEYBOARD_GPIO is not set
# CONFIG_KEYBOARD_GPIO_POLLED is not set
# CONFIG_KEYBOARD_TCA6416 is not set
# CONFIG_KEYBOARD_TCA8418 is not set
# CONFIG_KEYBOARD_MATRIX is not set
# CONFIG_KEYBOARD_LM8323 is not set
# CONFIG_KEYBOARD_LM8333 is not set
# CONFIG_KEYBOARD_MAX7359 is not set
# CONFIG_KEYBOARD_MCS is not set
# CONFIG_KEYBOARD_MPR121 is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_OPENCORES is not set
# CONFIG_KEYBOARD_STOWAWAY is not set
# CONFIG_KEYBOARD_SUNKBD is not set
# CONFIG_KEYBOARD_STMPE is not set
# CONFIG_KEYBOARD_TC3589X is not set
# CONFIG_KEYBOARD_XTKBD is not set
CONFIG_INPUT_MOUSE=y
CONFIG_MOUSE_PS2=m
CONFIG_MOUSE_PS2_ALPS=y
CONFIG_MOUSE_PS2_LOGIPS2PP=y
CONFIG_MOUSE_PS2_SYNAPTICS=y
CONFIG_MOUSE_PS2_CYPRESS=y
CONFIG_MOUSE_PS2_LIFEBOOK=y
CONFIG_MOUSE_PS2_TRACKPOINT=y
CONFIG_MOUSE_PS2_ELANTECH=y
CONFIG_MOUSE_PS2_SENTELIC=y
CONFIG_MOUSE_PS2_TOUCHKIT=y
# CONFIG_MOUSE_SERIAL is not set
# CONFIG_MOUSE_APPLETOUCH is not set
# CONFIG_MOUSE_BCM5974 is not set
# CONFIG_MOUSE_CYAPA is not set
# CONFIG_MOUSE_VSXXXAA is not set
# CONFIG_MOUSE_GPIO is not set
# CONFIG_MOUSE_SYNAPTICS_I2C is not set
# CONFIG_MOUSE_SYNAPTICS_USB is not set
CONFIG_INPUT_JOYSTICK=y
# CONFIG_JOYSTICK_ANALOG is not set
# CONFIG_JOYSTICK_A3D is not set
# CONFIG_JOYSTICK_ADI is not set
# CONFIG_JOYSTICK_COBRA is not set
# CONFIG_JOYSTICK_GF2K is not set
# CONFIG_JOYSTICK_GRIP is not set
# CONFIG_JOYSTICK_GRIP_MP is not set
# CONFIG_JOYSTICK_GUILLEMOT is not set
# CONFIG_JOYSTICK_INTERACT is not set
# CONFIG_JOYSTICK_SIDEWINDER is not set
# CONFIG_JOYSTICK_TMDC is not set
# CONFIG_JOYSTICK_IFORCE is not set
# CONFIG_JOYSTICK_WARRIOR is not set
# CONFIG_JOYSTICK_MAGELLAN is not set
# CONFIG_JOYSTICK_SPACEORB is not set
# CONFIG_JOYSTICK_SPACEBALL is not set
# CONFIG_JOYSTICK_STINGER is not set
# CONFIG_JOYSTICK_TWIDJOY is not set
# CONFIG_JOYSTICK_ZHENHUA is not set
# CONFIG_JOYSTICK_DB9 is not set
# CONFIG_JOYSTICK_GAMECON is not set
# CONFIG_JOYSTICK_TURBOGRAFX is not set
# CONFIG_JOYSTICK_AS5011 is not set
# CONFIG_JOYSTICK_JOYDUMP is not set
# CONFIG_JOYSTICK_XPAD is not set
# CONFIG_JOYSTICK_WALKERA0701 is not set
CONFIG_INPUT_TABLET=y
# CONFIG_TABLET_USB_ACECAD is not set
# CONFIG_TABLET_USB_AIPTEK is not set
# CONFIG_TABLET_USB_GTCO is not set
# CONFIG_TABLET_USB_HANWANG is not set
# CONFIG_TABLET_USB_KBTAB is not set
# CONFIG_TABLET_USB_WACOM is not set
CONFIG_INPUT_TOUCHSCREEN=y
# CONFIG_TOUCHSCREEN_88PM860X is not set
# CONFIG_TOUCHSCREEN_ADS7846 is not set
# CONFIG_TOUCHSCREEN_AD7877 is not set
# CONFIG_TOUCHSCREEN_AD7879 is not set
# CONFIG_TOUCHSCREEN_ATMEL_MXT is not set
# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set
# CONFIG_TOUCHSCREEN_BU21013 is not set
# CONFIG_TOUCHSCREEN_CY8CTMG110 is not set
# CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set
# CONFIG_TOUCHSCREEN_CYTTSP4_CORE is not set
# CONFIG_TOUCHSCREEN_DA9034 is not set
# CONFIG_TOUCHSCREEN_DA9052 is not set
# CONFIG_TOUCHSCREEN_DYNAPRO is not set
# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set
# CONFIG_TOUCHSCREEN_EETI is not set
# CONFIG_TOUCHSCREEN_FUJITSU is not set
# CONFIG_TOUCHSCREEN_ILI210X is not set
# CONFIG_TOUCHSCREEN_GUNZE is not set
# CONFIG_TOUCHSCREEN_ELO is not set
# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
# CONFIG_TOUCHSCREEN_WACOM_I2C is not set
# CONFIG_TOUCHSCREEN_MAX11801 is not set
# CONFIG_TOUCHSCREEN_MCS5000 is not set
# CONFIG_TOUCHSCREEN_MMS114 is not set
# CONFIG_TOUCHSCREEN_MTOUCH is not set
# CONFIG_TOUCHSCREEN_INEXIO is not set
# CONFIG_TOUCHSCREEN_MK712 is not set
# CONFIG_TOUCHSCREEN_PENMOUNT is not set
# CONFIG_TOUCHSCREEN_EDT_FT5X06 is not set
# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
# CONFIG_TOUCHSCREEN_PIXCIR is not set
# CONFIG_TOUCHSCREEN_WM831X is not set
# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
# CONFIG_TOUCHSCREEN_TSC_SERIO is not set
# CONFIG_TOUCHSCREEN_TSC2005 is not set
# CONFIG_TOUCHSCREEN_TSC2007 is not set
# CONFIG_TOUCHSCREEN_PCAP is not set
# CONFIG_TOUCHSCREEN_ST1232 is not set
# CONFIG_TOUCHSCREEN_STMPE is not set
# CONFIG_TOUCHSCREEN_TPS6507X is not set
CONFIG_INPUT_MISC=y
# CONFIG_INPUT_88PM860X_ONKEY is not set
# CONFIG_INPUT_AD714X is not set
# CONFIG_INPUT_BMA150 is not set
# CONFIG_INPUT_PCSPKR is not set
# CONFIG_INPUT_MAX8925_ONKEY is not set
# CONFIG_INPUT_MMA8450 is not set
# CONFIG_INPUT_MPU3050 is not set
# CONFIG_INPUT_APANEL is not set
# CONFIG_INPUT_GP2A is not set
# CONFIG_INPUT_GPIO_TILT_POLLED is not set
# CONFIG_INPUT_ATLAS_BTNS is not set
# CONFIG_INPUT_ATI_REMOTE2 is not set
# CONFIG_INPUT_KEYSPAN_REMOTE is not set
# CONFIG_INPUT_KXTJ9 is not set
# CONFIG_INPUT_POWERMATE is not set
# CONFIG_INPUT_YEALINK is not set
# CONFIG_INPUT_CM109 is not set
# CONFIG_INPUT_TWL6040_VIBRA is not set
CONFIG_INPUT_UINPUT=y
# CONFIG_INPUT_PCF8574 is not set
# CONFIG_INPUT_PWM_BEEPER is not set
# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
# CONFIG_INPUT_DA9052_ONKEY is not set
# CONFIG_INPUT_DA9055_ONKEY is not set
# CONFIG_INPUT_WM831X_ON is not set
# CONFIG_INPUT_PCAP is not set
# CONFIG_INPUT_ADXL34X is not set
# CONFIG_INPUT_IMS_PCU is not set
# CONFIG_INPUT_CMA3000 is not set
# CONFIG_INPUT_XEN_KBDDEV_FRONTEND is not set

#
# Hardware I/O ports
#
CONFIG_SERIO=y
CONFIG_SERIO_I8042=y
# CONFIG_SERIO_SERPORT is not set
# CONFIG_SERIO_CT82C710 is not set
# CONFIG_SERIO_PARKBD is not set
# CONFIG_SERIO_PCIPS2 is not set
CONFIG_SERIO_LIBPS2=y
CONFIG_SERIO_RAW=m
# CONFIG_SERIO_ALTERA_PS2 is not set
# CONFIG_SERIO_PS2MULT is not set
# CONFIG_SERIO_ARC_PS2 is not set
# CONFIG_GAMEPORT is not set

#
# Character devices
#
CONFIG_TTY=y
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_VT_CONSOLE_SLEEP=y
CONFIG_HW_CONSOLE=y
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_UNIX98_PTYS=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=0
CONFIG_SERIAL_NONSTANDARD=y
# CONFIG_ROCKETPORT is not set
# CONFIG_CYCLADES is not set
# CONFIG_MOXA_INTELLIO is not set
# CONFIG_MOXA_SMARTIO is not set
# CONFIG_SYNCLINK is not set
# CONFIG_SYNCLINKMP is not set
# CONFIG_SYNCLINK_GT is not set
# CONFIG_NOZOMI is not set
# CONFIG_ISI is not set
# CONFIG_N_HDLC is not set
# CONFIG_N_GSM is not set
# CONFIG_TRACE_SINK is not set
# CONFIG_DEVKMEM is not set

#
# Serial drivers
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
CONFIG_SERIAL_8250_PNP=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_SERIAL_8250_DMA=y
CONFIG_SERIAL_8250_PCI=y
CONFIG_SERIAL_8250_NR_UARTS=48
CONFIG_SERIAL_8250_RUNTIME_UARTS=32
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_MANY_PORTS=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
# CONFIG_SERIAL_8250_DETECT_IRQ is not set
CONFIG_SERIAL_8250_RSA=y
# CONFIG_SERIAL_8250_DW is not set

#
# Non-8250 serial port support
#
CONFIG_SERIAL_KGDB_NMI=y
# CONFIG_SERIAL_MAX3100 is not set
CONFIG_SERIAL_MAX310X=y
# CONFIG_SERIAL_MFD_HSU is not set
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_CONSOLE_POLL=y
# CONFIG_SERIAL_JSM is not set
CONFIG_SERIAL_SCCNXP=y
CONFIG_SERIAL_SCCNXP_CONSOLE=y
# CONFIG_SERIAL_TIMBERDALE is not set
# CONFIG_SERIAL_ALTERA_JTAGUART is not set
# CONFIG_SERIAL_ALTERA_UART is not set
# CONFIG_SERIAL_IFX6X60 is not set
# CONFIG_SERIAL_PCH_UART is not set
# CONFIG_SERIAL_ARC is not set
# CONFIG_SERIAL_RP2 is not set
# CONFIG_SERIAL_FSL_LPUART is not set
CONFIG_TTY_PRINTK=y
CONFIG_PRINTER=m
# CONFIG_LP_CONSOLE is not set
CONFIG_PPDEV=m
CONFIG_HVC_DRIVER=y
CONFIG_HVC_IRQ=y
CONFIG_HVC_XEN=y
CONFIG_HVC_XEN_FRONTEND=y
# CONFIG_VIRTIO_CONSOLE is not set
# CONFIG_IPMI_HANDLER is not set
CONFIG_HW_RANDOM=y
# CONFIG_HW_RANDOM_TIMERIOMEM is not set
# CONFIG_HW_RANDOM_INTEL is not set
# CONFIG_HW_RANDOM_AMD is not set
# CONFIG_HW_RANDOM_VIA is not set
# CONFIG_HW_RANDOM_VIRTIO is not set
# CONFIG_HW_RANDOM_TPM is not set
# CONFIG_NVRAM is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
# CONFIG_MWAVE is not set
# CONFIG_RAW_DRIVER is not set
CONFIG_HPET=y
CONFIG_HPET_MMAP=y
# CONFIG_HANGCHECK_TIMER is not set
CONFIG_TCG_TPM=y
# CONFIG_TCG_TIS is not set
# CONFIG_TCG_TIS_I2C_INFINEON is not set
# CONFIG_TCG_NSC is not set
# CONFIG_TCG_ATMEL is not set
# CONFIG_TCG_INFINEON is not set
# CONFIG_TCG_ST33_I2C is not set
# CONFIG_TELCLOCK is not set
CONFIG_DEVPORT=y
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
# CONFIG_I2C_CHARDEV is not set
# CONFIG_I2C_MUX is not set
CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_ALGOBIT=m

#
# I2C Hardware Bus support
#

#
# PC SMBus host controller drivers
#
# CONFIG_I2C_ALI1535 is not set
# CONFIG_I2C_ALI1563 is not set
# CONFIG_I2C_ALI15X3 is not set
# CONFIG_I2C_AMD756 is not set
# CONFIG_I2C_AMD8111 is not set
# CONFIG_I2C_I801 is not set
# CONFIG_I2C_ISCH is not set
# CONFIG_I2C_ISMT is not set
# CONFIG_I2C_PIIX4 is not set
# CONFIG_I2C_NFORCE2 is not set
# CONFIG_I2C_SIS5595 is not set
# CONFIG_I2C_SIS630 is not set
# CONFIG_I2C_SIS96X is not set
# CONFIG_I2C_VIA is not set
# CONFIG_I2C_VIAPRO is not set

#
# ACPI drivers
#
# CONFIG_I2C_SCMI is not set

#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
# CONFIG_I2C_CBUS_GPIO is not set
# CONFIG_I2C_DESIGNWARE_PCI is not set
# CONFIG_I2C_EG20T is not set
# CONFIG_I2C_GPIO is not set
# CONFIG_I2C_OCORES is not set
# CONFIG_I2C_PCA_PLATFORM is not set
# CONFIG_I2C_PXA_PCI is not set
# CONFIG_I2C_SIMTEC is not set
# CONFIG_I2C_XILINX is not set

#
# External I2C/SMBus adapter drivers
#
# CONFIG_I2C_DIOLAN_U2C is not set
# CONFIG_I2C_PARPORT is not set
# CONFIG_I2C_PARPORT_LIGHT is not set
# CONFIG_I2C_TAOS_EVM is not set
# CONFIG_I2C_TINY_USB is not set

#
# Other I2C/SMBus bus drivers
#
# CONFIG_I2C_STUB is not set
# CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
CONFIG_SPI=y
# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y

#
# SPI Master Controller Drivers
#
# CONFIG_SPI_ALTERA is not set
# CONFIG_SPI_BITBANG is not set
# CONFIG_SPI_BUTTERFLY is not set
# CONFIG_SPI_GPIO is not set
# CONFIG_SPI_LM70_LLP is not set
# CONFIG_SPI_OC_TINY is not set
# CONFIG_SPI_PXA2XX is not set
# CONFIG_SPI_PXA2XX_PCI is not set
# CONFIG_SPI_SC18IS602 is not set
# CONFIG_SPI_TOPCLIFF_PCH is not set
# CONFIG_SPI_XCOMM is not set
# CONFIG_SPI_XILINX is not set
# CONFIG_SPI_DESIGNWARE is not set

#
# SPI Protocol Masters
#
# CONFIG_SPI_SPIDEV is not set
# CONFIG_SPI_TLE62X0 is not set
# CONFIG_HSI is not set

#
# PPS support
#
# CONFIG_PPS is not set

#
# PPS generators support
#

#
# PTP clock support
#
# CONFIG_PTP_1588_CLOCK is not set

#
# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
#
# CONFIG_PTP_1588_CLOCK_PCH is not set
CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
CONFIG_GPIO_DEVRES=y
CONFIG_GPIOLIB=y
CONFIG_GPIO_ACPI=y
# CONFIG_DEBUG_GPIO is not set
# CONFIG_GPIO_SYSFS is not set
# CONFIG_GPIO_DA9052 is not set
# CONFIG_GPIO_DA9055 is not set

#
# Memory mapped GPIO drivers:
#
# CONFIG_GPIO_GENERIC_PLATFORM is not set
# CONFIG_GPIO_IT8761E is not set
# CONFIG_GPIO_TS5500 is not set
# CONFIG_GPIO_SCH is not set
# CONFIG_GPIO_ICH is not set
# CONFIG_GPIO_VX855 is not set
# CONFIG_GPIO_LYNXPOINT is not set

#
# I2C GPIO expanders:
#
# CONFIG_GPIO_MAX7300 is not set
# CONFIG_GPIO_MAX732X is not set
# CONFIG_GPIO_PCA953X is not set
# CONFIG_GPIO_PCF857X is not set
CONFIG_GPIO_RC5T583=y
CONFIG_GPIO_SX150X=y
CONFIG_GPIO_STMPE=y
CONFIG_GPIO_TC3589X=y
# CONFIG_GPIO_TPS65912 is not set
# CONFIG_GPIO_TWL6040 is not set
# CONFIG_GPIO_WM831X is not set
# CONFIG_GPIO_WM8350 is not set
# CONFIG_GPIO_WM8994 is not set
# CONFIG_GPIO_ADP5520 is not set
# CONFIG_GPIO_ADP5588 is not set

#
# PCI GPIO expanders:
#
# CONFIG_GPIO_BT8XX is not set
# CONFIG_GPIO_AMD8111 is not set
CONFIG_GPIO_LANGWELL=y
# CONFIG_GPIO_PCH is not set
# CONFIG_GPIO_ML_IOH is not set
# CONFIG_GPIO_RDC321X is not set

#
# SPI GPIO expanders:
#
# CONFIG_GPIO_MAX7301 is not set
# CONFIG_GPIO_MCP23S08 is not set
# CONFIG_GPIO_MC33880 is not set
# CONFIG_GPIO_74X164 is not set

#
# AC97 GPIO expanders:
#

#
# MODULbus GPIO expanders:
#
# CONFIG_GPIO_PALMAS is not set
CONFIG_GPIO_TPS6586X=y
CONFIG_GPIO_TPS65910=y

#
# USB GPIO expanders:
#
# CONFIG_W1 is not set
CONFIG_POWER_SUPPLY=y
# CONFIG_POWER_SUPPLY_DEBUG is not set
# CONFIG_PDA_POWER is not set
# CONFIG_MAX8925_POWER is not set
# CONFIG_WM831X_BACKUP is not set
# CONFIG_WM831X_POWER is not set
# CONFIG_WM8350_POWER is not set
# CONFIG_TEST_POWER is not set
# CONFIG_BATTERY_88PM860X is not set
# CONFIG_BATTERY_DS2780 is not set
# CONFIG_BATTERY_DS2781 is not set
# CONFIG_BATTERY_DS2782 is not set
# CONFIG_BATTERY_SBS is not set
# CONFIG_BATTERY_BQ27x00 is not set
# CONFIG_BATTERY_DA9030 is not set
# CONFIG_BATTERY_DA9052 is not set
# CONFIG_BATTERY_MAX17040 is not set
# CONFIG_BATTERY_MAX17042 is not set
# CONFIG_CHARGER_MAX8903 is not set
# CONFIG_CHARGER_LP8727 is not set
# CONFIG_CHARGER_GPIO is not set
CONFIG_CHARGER_MANAGER=y
# CONFIG_CHARGER_BQ2415X is not set
# CONFIG_CHARGER_SMB347 is not set
# CONFIG_CHARGER_TPS65090 is not set
# CONFIG_BATTERY_GOLDFISH is not set
# CONFIG_POWER_RESET is not set
CONFIG_POWER_AVS=y
CONFIG_HWMON=y
# CONFIG_HWMON_VID is not set
# CONFIG_HWMON_DEBUG_CHIP is not set

#
# Native drivers
#
# CONFIG_SENSORS_ABITUGURU is not set
# CONFIG_SENSORS_ABITUGURU3 is not set
# CONFIG_SENSORS_AD7314 is not set
# CONFIG_SENSORS_AD7414 is not set
# CONFIG_SENSORS_AD7418 is not set
# CONFIG_SENSORS_ADCXX is not set
# CONFIG_SENSORS_ADM1021 is not set
# CONFIG_SENSORS_ADM1025 is not set
# CONFIG_SENSORS_ADM1026 is not set
# CONFIG_SENSORS_ADM1029 is not set
# CONFIG_SENSORS_ADM1031 is not set
# CONFIG_SENSORS_ADM9240 is not set
# CONFIG_SENSORS_ADT7310 is not set
# CONFIG_SENSORS_ADT7410 is not set
# CONFIG_SENSORS_ADT7411 is not set
# CONFIG_SENSORS_ADT7462 is not set
# CONFIG_SENSORS_ADT7470 is not set
# CONFIG_SENSORS_ADT7475 is not set
# CONFIG_SENSORS_ASC7621 is not set
# CONFIG_SENSORS_K8TEMP is not set
# CONFIG_SENSORS_K10TEMP is not set
# CONFIG_SENSORS_FAM15H_POWER is not set
# CONFIG_SENSORS_ASB100 is not set
# CONFIG_SENSORS_ATXP1 is not set
# CONFIG_SENSORS_DS620 is not set
# CONFIG_SENSORS_DS1621 is not set
# CONFIG_SENSORS_DA9052_ADC is not set
# CONFIG_SENSORS_DA9055 is not set
# CONFIG_SENSORS_I5K_AMB is not set
# CONFIG_SENSORS_F71805F is not set
# CONFIG_SENSORS_F71882FG is not set
# CONFIG_SENSORS_F75375S is not set
# CONFIG_SENSORS_FSCHMD is not set
# CONFIG_SENSORS_G760A is not set
# CONFIG_SENSORS_G762 is not set
# CONFIG_SENSORS_GL518SM is not set
# CONFIG_SENSORS_GL520SM is not set
# CONFIG_SENSORS_GPIO_FAN is not set
# CONFIG_SENSORS_HIH6130 is not set
CONFIG_SENSORS_CORETEMP=m
# CONFIG_SENSORS_IT87 is not set
# CONFIG_SENSORS_JC42 is not set
# CONFIG_SENSORS_LINEAGE is not set
# CONFIG_SENSORS_LM63 is not set
# CONFIG_SENSORS_LM70 is not set
# CONFIG_SENSORS_LM73 is not set
# CONFIG_SENSORS_LM75 is not set
# CONFIG_SENSORS_LM77 is not set
# CONFIG_SENSORS_LM78 is not set
# CONFIG_SENSORS_LM80 is not set
# CONFIG_SENSORS_LM83 is not set
# CONFIG_SENSORS_LM85 is not set
# CONFIG_SENSORS_LM87 is not set
# CONFIG_SENSORS_LM90 is not set
# CONFIG_SENSORS_LM92 is not set
# CONFIG_SENSORS_LM93 is not set
# CONFIG_SENSORS_LTC4151 is not set
# CONFIG_SENSORS_LTC4215 is not set
# CONFIG_SENSORS_LTC4245 is not set
# CONFIG_SENSORS_LTC4261 is not set
# CONFIG_SENSORS_LM95234 is not set
# CONFIG_SENSORS_LM95241 is not set
# CONFIG_SENSORS_LM95245 is not set
# CONFIG_SENSORS_MAX1111 is not set
# CONFIG_SENSORS_MAX16065 is not set
# CONFIG_SENSORS_MAX1619 is not set
# CONFIG_SENSORS_MAX1668 is not set
# CONFIG_SENSORS_MAX197 is not set
# CONFIG_SENSORS_MAX6639 is not set
# CONFIG_SENSORS_MAX6642 is not set
# CONFIG_SENSORS_MAX6650 is not set
# CONFIG_SENSORS_MAX6697 is not set
# CONFIG_SENSORS_MCP3021 is not set
# CONFIG_SENSORS_NCT6775 is not set
# CONFIG_SENSORS_NTC_THERMISTOR is not set
# CONFIG_SENSORS_PC87360 is not set
# CONFIG_SENSORS_PC87427 is not set
# CONFIG_SENSORS_PCF8591 is not set
# CONFIG_PMBUS is not set
# CONFIG_SENSORS_SHT15 is not set
# CONFIG_SENSORS_SHT21 is not set
# CONFIG_SENSORS_SIS5595 is not set
# CONFIG_SENSORS_SMM665 is not set
# CONFIG_SENSORS_DME1737 is not set
# CONFIG_SENSORS_EMC1403 is not set
# CONFIG_SENSORS_EMC2103 is not set
# CONFIG_SENSORS_EMC6W201 is not set
# CONFIG_SENSORS_SMSC47M1 is not set
# CONFIG_SENSORS_SMSC47M192 is not set
# CONFIG_SENSORS_SMSC47B397 is not set
# CONFIG_SENSORS_SCH56XX_COMMON is not set
# CONFIG_SENSORS_SCH5627 is not set
# CONFIG_SENSORS_SCH5636 is not set
# CONFIG_SENSORS_ADS1015 is not set
# CONFIG_SENSORS_ADS7828 is not set
# CONFIG_SENSORS_ADS7871 is not set
# CONFIG_SENSORS_AMC6821 is not set
# CONFIG_SENSORS_INA209 is not set
# CONFIG_SENSORS_INA2XX is not set
# CONFIG_SENSORS_THMC50 is not set
# CONFIG_SENSORS_TMP102 is not set
# CONFIG_SENSORS_TMP401 is not set
# CONFIG_SENSORS_TMP421 is not set
# CONFIG_SENSORS_VIA_CPUTEMP is not set
# CONFIG_SENSORS_VIA686A is not set
# CONFIG_SENSORS_VT1211 is not set
# CONFIG_SENSORS_VT8231 is not set
# CONFIG_SENSORS_W83781D is not set
# CONFIG_SENSORS_W83791D is not set
# CONFIG_SENSORS_W83792D is not set
# CONFIG_SENSORS_W83793 is not set
# CONFIG_SENSORS_W83795 is not set
# CONFIG_SENSORS_W83L785TS is not set
# CONFIG_SENSORS_W83L786NG is not set
# CONFIG_SENSORS_W83627HF is not set
# CONFIG_SENSORS_W83627EHF is not set
# CONFIG_SENSORS_WM831X is not set
# CONFIG_SENSORS_WM8350 is not set
# CONFIG_SENSORS_APPLESMC is not set

#
# ACPI drivers
#
# CONFIG_SENSORS_ACPI_POWER is not set
# CONFIG_SENSORS_ATK0110 is not set
CONFIG_THERMAL=y
CONFIG_THERMAL_HWMON=y
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set
# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set
# CONFIG_THERMAL_GOV_FAIR_SHARE is not set
CONFIG_THERMAL_GOV_STEP_WISE=y
CONFIG_THERMAL_GOV_USER_SPACE=y
CONFIG_CPU_THERMAL=y
# CONFIG_THERMAL_EMULATION is not set
# CONFIG_INTEL_POWERCLAMP is not set
CONFIG_X86_PKG_TEMP_THERMAL=m

#
# Texas Instruments thermal drivers
#
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_CORE=y
# CONFIG_WATCHDOG_NOWAYOUT is not set

#
# Watchdog Device Drivers
#
# CONFIG_SOFT_WATCHDOG is not set
# CONFIG_DA9052_WATCHDOG is not set
# CONFIG_DA9055_WATCHDOG is not set
# CONFIG_WM831X_WATCHDOG is not set
# CONFIG_WM8350_WATCHDOG is not set
# CONFIG_ACQUIRE_WDT is not set
# CONFIG_ADVANTECH_WDT is not set
# CONFIG_ALIM1535_WDT is not set
# CONFIG_ALIM7101_WDT is not set
# CONFIG_F71808E_WDT is not set
# CONFIG_SP5100_TCO is not set
# CONFIG_SC520_WDT is not set
# CONFIG_SBC_FITPC2_WATCHDOG is not set
# CONFIG_EUROTECH_WDT is not set
# CONFIG_IB700_WDT is not set
# CONFIG_IBMASR is not set
# CONFIG_WAFER_WDT is not set
# CONFIG_I6300ESB_WDT is not set
# CONFIG_IE6XX_WDT is not set
# CONFIG_ITCO_WDT is not set
# CONFIG_IT8712F_WDT is not set
# CONFIG_IT87_WDT is not set
# CONFIG_HP_WATCHDOG is not set
# CONFIG_SC1200_WDT is not set
# CONFIG_PC87413_WDT is not set
# CONFIG_NV_TCO is not set
# CONFIG_60XX_WDT is not set
# CONFIG_SBC8360_WDT is not set
# CONFIG_CPU5_WDT is not set
# CONFIG_SMSC_SCH311X_WDT is not set
# CONFIG_SMSC37B787_WDT is not set
# CONFIG_VIA_WDT is not set
# CONFIG_W83627HF_WDT is not set
# CONFIG_W83697HF_WDT is not set
# CONFIG_W83697UG_WDT is not set
# CONFIG_W83877F_WDT is not set
# CONFIG_W83977F_WDT is not set
# CONFIG_MACHZ_WDT is not set
# CONFIG_SBC_EPX_C3_WATCHDOG is not set
# CONFIG_MEN_A21_WDT is not set
# CONFIG_XEN_WDT is not set

#
# PCI-based Watchdog Cards
#
# CONFIG_PCIPCWATCHDOG is not set
# CONFIG_WDTPCI is not set

#
# USB-based Watchdog Cards
#
# CONFIG_USBPCWATCHDOG is not set
CONFIG_SSB_POSSIBLE=y

#
# Sonics Silicon Backplane
#
# CONFIG_SSB is not set
CONFIG_BCMA_POSSIBLE=y

#
# Broadcom specific AMBA
#
# CONFIG_BCMA is not set

#
# Multifunction device drivers
#
CONFIG_MFD_CORE=y
# CONFIG_MFD_CS5535 is not set
# CONFIG_MFD_AS3711 is not set
CONFIG_PMIC_ADP5520=y
CONFIG_MFD_AAT2870_CORE=y
# CONFIG_MFD_CROS_EC is not set
CONFIG_PMIC_DA903X=y
CONFIG_PMIC_DA9052=y
CONFIG_MFD_DA9052_SPI=y
CONFIG_MFD_DA9052_I2C=y
CONFIG_MFD_DA9055=y
# CONFIG_MFD_MC13XXX_SPI is not set
# CONFIG_MFD_MC13XXX_I2C is not set
# CONFIG_HTC_PASIC3 is not set
CONFIG_HTC_I2CPLD=y
CONFIG_LPC_ICH=m
# CONFIG_LPC_SCH is not set
# CONFIG_MFD_JANZ_CMODIO is not set
# CONFIG_MFD_KEMPLD is not set
# CONFIG_MFD_88PM800 is not set
# CONFIG_MFD_88PM805 is not set
CONFIG_MFD_88PM860X=y
CONFIG_MFD_MAX77686=y
CONFIG_MFD_MAX77693=y
# CONFIG_MFD_MAX8907 is not set
CONFIG_MFD_MAX8925=y
CONFIG_MFD_MAX8997=y
CONFIG_MFD_MAX8998=y
CONFIG_EZX_PCAP=y
# CONFIG_MFD_VIPERBOARD is not set
# CONFIG_MFD_RETU is not set
# CONFIG_MFD_PCF50633 is not set
# CONFIG_MFD_RDC321X is not set
# CONFIG_MFD_RTSX_PCI is not set
CONFIG_MFD_RC5T583=y
CONFIG_MFD_SEC_CORE=y
# CONFIG_MFD_SI476X_CORE is not set
# CONFIG_MFD_SM501 is not set
CONFIG_MFD_SMSC=y
CONFIG_ABX500_CORE=y
CONFIG_AB3100_CORE=y
# CONFIG_AB3100_OTP is not set
CONFIG_MFD_STMPE=y

#
# STMicroelectronics STMPE Interface Drivers
#
CONFIG_STMPE_I2C=y
CONFIG_STMPE_SPI=y
# CONFIG_MFD_SYSCON is not set
# CONFIG_MFD_TI_AM335X_TSCADC is not set
CONFIG_MFD_LP8788=y
CONFIG_MFD_PALMAS=y
# CONFIG_TPS6105X is not set
# CONFIG_TPS65010 is not set
# CONFIG_TPS6507X is not set
CONFIG_MFD_TPS65090=y
# CONFIG_MFD_TPS65217 is not set
CONFIG_MFD_TPS6586X=y
CONFIG_MFD_TPS65910=y
CONFIG_MFD_TPS65912=y
CONFIG_MFD_TPS65912_I2C=y
CONFIG_MFD_TPS65912_SPI=y
# CONFIG_MFD_TPS80031 is not set
# CONFIG_TWL4030_CORE is not set
CONFIG_TWL6040_CORE=y
# CONFIG_MFD_WL1273_CORE is not set
# CONFIG_MFD_LM3533 is not set
# CONFIG_MFD_TIMBERDALE is not set
CONFIG_MFD_TC3589X=y
# CONFIG_MFD_TMIO is not set
# CONFIG_MFD_VX855 is not set
# CONFIG_MFD_ARIZONA_I2C is not set
# CONFIG_MFD_ARIZONA_SPI is not set
CONFIG_MFD_WM8400=y
CONFIG_MFD_WM831X=y
CONFIG_MFD_WM831X_I2C=y
CONFIG_MFD_WM831X_SPI=y
CONFIG_MFD_WM8350=y
CONFIG_MFD_WM8350_I2C=y
CONFIG_MFD_WM8994=y
CONFIG_REGULATOR=y
# CONFIG_REGULATOR_DEBUG is not set
# CONFIG_REGULATOR_DUMMY is not set
# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
# CONFIG_REGULATOR_GPIO is not set
# CONFIG_REGULATOR_AD5398 is not set
# CONFIG_REGULATOR_AAT2870 is not set
# CONFIG_REGULATOR_DA903X is not set
# CONFIG_REGULATOR_DA9052 is not set
# CONFIG_REGULATOR_DA9055 is not set
# CONFIG_REGULATOR_FAN53555 is not set
# CONFIG_REGULATOR_ISL6271A is not set
CONFIG_REGULATOR_88PM8607=y
# CONFIG_REGULATOR_MAX1586 is not set
# CONFIG_REGULATOR_MAX8649 is not set
# CONFIG_REGULATOR_MAX8660 is not set
# CONFIG_REGULATOR_MAX8925 is not set
# CONFIG_REGULATOR_MAX8952 is not set
# CONFIG_REGULATOR_MAX8973 is not set
# CONFIG_REGULATOR_MAX8997 is not set
# CONFIG_REGULATOR_MAX8998 is not set
# CONFIG_REGULATOR_MAX77686 is not set
# CONFIG_REGULATOR_MAX77693 is not set
# CONFIG_REGULATOR_PCAP is not set
# CONFIG_REGULATOR_LP3971 is not set
# CONFIG_REGULATOR_LP3972 is not set
CONFIG_REGULATOR_LP872X=y
# CONFIG_REGULATOR_LP8755 is not set
CONFIG_REGULATOR_LP8788=y
# CONFIG_REGULATOR_RC5T583 is not set
# CONFIG_REGULATOR_S2MPS11 is not set
# CONFIG_REGULATOR_S5M8767 is not set
# CONFIG_REGULATOR_AB3100 is not set
# CONFIG_REGULATOR_PALMAS is not set
# CONFIG_REGULATOR_TPS51632 is not set
# CONFIG_REGULATOR_TPS62360 is not set
# CONFIG_REGULATOR_TPS65023 is not set
# CONFIG_REGULATOR_TPS6507X is not set
# CONFIG_REGULATOR_TPS65090 is not set
# CONFIG_REGULATOR_TPS6524X is not set
# CONFIG_REGULATOR_TPS6586X is not set
# CONFIG_REGULATOR_TPS65910 is not set
# CONFIG_REGULATOR_TPS65912 is not set
# CONFIG_REGULATOR_WM831X is not set
# CONFIG_REGULATOR_WM8350 is not set
# CONFIG_REGULATOR_WM8400 is not set
# CONFIG_REGULATOR_WM8994 is not set
CONFIG_MEDIA_SUPPORT=m

#
# Multimedia core support
#
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_MEDIA_ANALOG_TV_SUPPORT=y
CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
CONFIG_MEDIA_RADIO_SUPPORT=y
CONFIG_MEDIA_RC_SUPPORT=y
# CONFIG_MEDIA_CONTROLLER is not set
CONFIG_VIDEO_DEV=m
CONFIG_VIDEO_V4L2=m
# CONFIG_VIDEO_ADV_DEBUG is not set
# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
CONFIG_VIDEOBUF2_CORE=m
CONFIG_VIDEOBUF2_MEMOPS=m
CONFIG_VIDEOBUF2_VMALLOC=m
# CONFIG_VIDEO_V4L2_INT_DEVICE is not set
CONFIG_DVB_CORE=m
CONFIG_DVB_NET=y
# CONFIG_TTPCI_EEPROM is not set
CONFIG_DVB_MAX_ADAPTERS=8
CONFIG_DVB_DYNAMIC_MINORS=y

#
# Media drivers
#
CONFIG_RC_CORE=m
# CONFIG_RC_MAP is not set
CONFIG_RC_DECODERS=y
# CONFIG_LIRC is not set
# CONFIG_IR_NEC_DECODER is not set
# CONFIG_IR_RC5_DECODER is not set
# CONFIG_IR_RC6_DECODER is not set
# CONFIG_IR_JVC_DECODER is not set
# CONFIG_IR_SONY_DECODER is not set
# CONFIG_IR_RC5_SZ_DECODER is not set
# CONFIG_IR_SANYO_DECODER is not set
# CONFIG_IR_MCE_KBD_DECODER is not set
CONFIG_RC_DEVICES=y
# CONFIG_RC_ATI_REMOTE is not set
# CONFIG_IR_ENE is not set
# CONFIG_IR_IMON is not set
# CONFIG_IR_MCEUSB is not set
# CONFIG_IR_ITE_CIR is not set
# CONFIG_IR_FINTEK is not set
# CONFIG_IR_NUVOTON is not set
# CONFIG_IR_REDRAT3 is not set
# CONFIG_IR_STREAMZAP is not set
# CONFIG_IR_WINBOND_CIR is not set
# CONFIG_IR_IGUANA is not set
# CONFIG_IR_TTUSBIR is not set
# CONFIG_RC_LOOPBACK is not set
# CONFIG_IR_GPIO_CIR is not set
CONFIG_MEDIA_USB_SUPPORT=y

#
# Webcam devices
#
CONFIG_USB_VIDEO_CLASS=m
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
# CONFIG_USB_GSPCA is not set
# CONFIG_USB_PWC is not set
# CONFIG_VIDEO_CPIA2 is not set
# CONFIG_USB_ZR364XX is not set
# CONFIG_USB_STKWEBCAM is not set
# CONFIG_USB_S2255 is not set
# CONFIG_USB_SN9C102 is not set
# CONFIG_VIDEO_USBTV is not set

#
# Analog TV USB devices
#
# CONFIG_VIDEO_PVRUSB2 is not set
# CONFIG_VIDEO_HDPVR is not set
# CONFIG_VIDEO_TLG2300 is not set
# CONFIG_VIDEO_USBVISION is not set
# CONFIG_VIDEO_STK1160 is not set

#
# Analog/digital TV USB devices
#
# CONFIG_VIDEO_AU0828 is not set
# CONFIG_VIDEO_CX231XX is not set
# CONFIG_VIDEO_TM6000 is not set

#
# Digital TV USB devices
#
# CONFIG_DVB_USB is not set
# CONFIG_DVB_USB_V2 is not set
# CONFIG_DVB_TTUSB_BUDGET is not set
# CONFIG_DVB_TTUSB_DEC is not set
# CONFIG_SMS_USB_DRV is not set
# CONFIG_DVB_B2C2_FLEXCOP_USB is not set

#
# Webcam, TV (analog/digital) USB devices
#
# CONFIG_VIDEO_EM28XX is not set
CONFIG_MEDIA_PCI_SUPPORT=y

#
# Media capture support
#

#
# Media capture/analog TV support
#
# CONFIG_VIDEO_IVTV is not set
# CONFIG_VIDEO_ZORAN is not set
# CONFIG_VIDEO_HEXIUM_GEMINI is not set
# CONFIG_VIDEO_HEXIUM_ORION is not set
# CONFIG_VIDEO_MXB is not set

#
# Media capture/analog/hybrid TV support
#
# CONFIG_VIDEO_CX18 is not set
# CONFIG_VIDEO_CX23885 is not set
# CONFIG_VIDEO_CX25821 is not set
# CONFIG_VIDEO_CX88 is not set
# CONFIG_VIDEO_BT848 is not set
# CONFIG_VIDEO_SAA7134 is not set
# CONFIG_VIDEO_SAA7164 is not set

#
# Media digital TV PCI Adapters
#
# CONFIG_DVB_AV7110 is not set
# CONFIG_DVB_BUDGET_CORE is not set
# CONFIG_DVB_B2C2_FLEXCOP_PCI is not set
# CONFIG_DVB_PLUTO2 is not set
# CONFIG_DVB_DM1105 is not set
# CONFIG_DVB_PT1 is not set
# CONFIG_MANTIS_CORE is not set
# CONFIG_DVB_NGENE is not set
# CONFIG_DVB_DDBRIDGE is not set
CONFIG_V4L_PLATFORM_DRIVERS=y
# CONFIG_VIDEO_CAFE_CCIC is not set
# CONFIG_VIDEO_TIMBERDALE is not set
# CONFIG_SOC_CAMERA is not set
CONFIG_V4L_MEM2MEM_DRIVERS=y
# CONFIG_VIDEO_MEM2MEM_DEINTERLACE is not set
# CONFIG_VIDEO_SH_VEU is not set
CONFIG_V4L_TEST_DRIVERS=y
# CONFIG_VIDEO_VIVI is not set
# CONFIG_VIDEO_MEM2MEM_TESTDEV is not set

#
# Supported MMC/SDIO adapters
#
# CONFIG_SMS_SDIO_DRV is not set
CONFIG_MEDIA_PARPORT_SUPPORT=y
# CONFIG_VIDEO_BWQCAM is not set
# CONFIG_VIDEO_CQCAM is not set
# CONFIG_VIDEO_W9966 is not set
CONFIG_RADIO_ADAPTERS=y
CONFIG_RADIO_SI470X=y
# CONFIG_USB_SI470X is not set
# CONFIG_I2C_SI470X is not set
# CONFIG_USB_MR800 is not set
# CONFIG_USB_DSBR is not set
# CONFIG_RADIO_MAXIRADIO is not set
# CONFIG_RADIO_SHARK is not set
# CONFIG_RADIO_SHARK2 is not set
# CONFIG_I2C_SI4713 is not set
# CONFIG_RADIO_SI4713 is not set
# CONFIG_USB_KEENE is not set
# CONFIG_USB_MA901 is not set
# CONFIG_RADIO_TEA5764 is not set
# CONFIG_RADIO_SAA7706H is not set
# CONFIG_RADIO_TEF6862 is not set
# CONFIG_RADIO_WL1273 is not set

#
# Texas Instruments WL128x FM driver (ST based)
#
# CONFIG_RADIO_WL128X is not set
# CONFIG_CYPRESS_FIRMWARE is not set

#
# Media ancillary drivers (tuners, sensors, i2c, frontends)
#
CONFIG_MEDIA_SUBDRV_AUTOSELECT=y
CONFIG_MEDIA_ATTACH=y
CONFIG_VIDEO_IR_I2C=m

#
# Audio decoders, processors and mixers
#

#
# RDS decoders
#

#
# Video decoders
#

#
# Video and audio decoders
#

#
# Video encoders
#

#
# Camera sensor devices
#

#
# Flash devices
#

#
# Video improvement chips
#

#
# Miscelaneous helper chips
#

#
# Sensors used on soc_camera driver
#
CONFIG_MEDIA_TUNER=m
CONFIG_MEDIA_TUNER_SIMPLE=m
CONFIG_MEDIA_TUNER_TDA8290=m
CONFIG_MEDIA_TUNER_TDA827X=m
CONFIG_MEDIA_TUNER_TDA18271=m
CONFIG_MEDIA_TUNER_TDA9887=m
CONFIG_MEDIA_TUNER_TEA5761=m
CONFIG_MEDIA_TUNER_TEA5767=m
CONFIG_MEDIA_TUNER_MT20XX=m
CONFIG_MEDIA_TUNER_XC2028=m
CONFIG_MEDIA_TUNER_XC5000=m
CONFIG_MEDIA_TUNER_XC4000=m
CONFIG_MEDIA_TUNER_MC44S803=m

#
# Multistandard (satellite) frontends
#

#
# Multistandard (cable + terrestrial) frontends
#

#
# DVB-S (satellite) frontends
#

#
# DVB-T (terrestrial) frontends
#

#
# DVB-C (cable) frontends
#

#
# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
#

#
# ISDB-T (terrestrial) frontends
#

#
# Digital terrestrial only tuners/PLL
#

#
# SEC control devices for DVB-S
#

#
# Tools to develop new frontends
#
# CONFIG_DVB_DUMMY_FE is not set

#
# Graphics support
#
CONFIG_AGP=y
CONFIG_AGP_AMD64=y
CONFIG_AGP_INTEL=y
# CONFIG_AGP_SIS is not set
CONFIG_AGP_VIA=y
CONFIG_VGA_ARB=y
CONFIG_VGA_ARB_MAX_GPUS=16
CONFIG_VGA_SWITCHEROO=y
CONFIG_DRM=m
CONFIG_DRM_KMS_HELPER=m
CONFIG_DRM_LOAD_EDID_FIRMWARE=y

#
# I2C encoder or helper chips
#
# CONFIG_DRM_I2C_CH7006 is not set
# CONFIG_DRM_I2C_SIL164 is not set
# CONFIG_DRM_I2C_NXP_TDA998X is not set
# CONFIG_DRM_TDFX is not set
# CONFIG_DRM_R128 is not set
# CONFIG_DRM_RADEON is not set
# CONFIG_DRM_NOUVEAU is not set
# CONFIG_DRM_I810 is not set
CONFIG_DRM_I915=m
CONFIG_DRM_I915_KMS=y
# CONFIG_DRM_MGA is not set
# CONFIG_DRM_SIS is not set
# CONFIG_DRM_VIA is not set
# CONFIG_DRM_SAVAGE is not set
# CONFIG_DRM_VMWGFX is not set
# CONFIG_DRM_GMA500 is not set
# CONFIG_DRM_UDL is not set
# CONFIG_DRM_AST is not set
# CONFIG_DRM_MGAG200 is not set
# CONFIG_DRM_CIRRUS_QEMU is not set
# CONFIG_DRM_QXL is not set
# CONFIG_VGASTATE is not set
CONFIG_VIDEO_OUTPUT_CONTROL=m
CONFIG_HDMI=y
CONFIG_FB=y
CONFIG_FIRMWARE_EDID=y
# CONFIG_FB_DDC is not set
# CONFIG_FB_BOOT_VESA_SUPPORT is not set
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
# CONFIG_FB_SYS_FILLRECT is not set
# CONFIG_FB_SYS_COPYAREA is not set
# CONFIG_FB_SYS_IMAGEBLIT is not set
# CONFIG_FB_FOREIGN_ENDIAN is not set
# CONFIG_FB_SYS_FOPS is not set
# CONFIG_FB_SVGALIB is not set
# CONFIG_FB_MACMODES is not set
# CONFIG_FB_BACKLIGHT is not set
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_TILEBLITTING=y

#
# Frame buffer hardware drivers
#
# CONFIG_FB_CIRRUS is not set
# CONFIG_FB_PM2 is not set
# CONFIG_FB_CYBER2000 is not set
# CONFIG_FB_ARC is not set
CONFIG_FB_ASILIANT=y
CONFIG_FB_IMSTT=y
# CONFIG_FB_VGA16 is not set
# CONFIG_FB_UVESA is not set
# CONFIG_FB_VESA is not set
CONFIG_FB_EFI=y
# CONFIG_FB_N411 is not set
# CONFIG_FB_HGA is not set
# CONFIG_FB_S1D13XXX is not set
# CONFIG_FB_NVIDIA is not set
# CONFIG_FB_RIVA is not set
# CONFIG_FB_I740 is not set
# CONFIG_FB_LE80578 is not set
# CONFIG_FB_INTEL is not set
# CONFIG_FB_MATROX is not set
# CONFIG_FB_RADEON is not set
# CONFIG_FB_ATY128 is not set
# CONFIG_FB_ATY is not set
# CONFIG_FB_S3 is not set
# CONFIG_FB_SAVAGE is not set
# CONFIG_FB_SIS is not set
# CONFIG_FB_VIA is not set
# CONFIG_FB_NEOMAGIC is not set
# CONFIG_FB_KYRO is not set
# CONFIG_FB_3DFX is not set
# CONFIG_FB_VOODOO1 is not set
# CONFIG_FB_VT8623 is not set
# CONFIG_FB_TRIDENT is not set
# CONFIG_FB_ARK is not set
# CONFIG_FB_PM3 is not set
# CONFIG_FB_CARMINE is not set
# CONFIG_FB_TMIO is not set
# CONFIG_FB_SMSCUFX is not set
# CONFIG_FB_UDL is not set
# CONFIG_FB_GOLDFISH is not set
# CONFIG_FB_VIRTUAL is not set
# CONFIG_XEN_FBDEV_FRONTEND is not set
# CONFIG_FB_METRONOME is not set
# CONFIG_FB_MB862XX is not set
# CONFIG_FB_BROADSHEET is not set
# CONFIG_FB_AUO_K190X is not set
CONFIG_EXYNOS_VIDEO=y
CONFIG_BACKLIGHT_LCD_SUPPORT=y
# CONFIG_LCD_CLASS_DEVICE is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=y
# CONFIG_BACKLIGHT_GENERIC is not set
# CONFIG_BACKLIGHT_PWM is not set
# CONFIG_BACKLIGHT_DA903X is not set
# CONFIG_BACKLIGHT_DA9052 is not set
# CONFIG_BACKLIGHT_MAX8925 is not set
# CONFIG_BACKLIGHT_APPLE is not set
# CONFIG_BACKLIGHT_SAHARA is not set
# CONFIG_BACKLIGHT_WM831X is not set
# CONFIG_BACKLIGHT_ADP5520 is not set
# CONFIG_BACKLIGHT_ADP8860 is not set
# CONFIG_BACKLIGHT_ADP8870 is not set
# CONFIG_BACKLIGHT_88PM860X is not set
# CONFIG_BACKLIGHT_AAT2870 is not set
# CONFIG_BACKLIGHT_LM3630 is not set
# CONFIG_BACKLIGHT_LM3639 is not set
# CONFIG_BACKLIGHT_LP855X is not set
# CONFIG_BACKLIGHT_LP8788 is not set

#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
# CONFIG_VGACON_SOFT_SCROLLBACK is not set
CONFIG_DUMMY_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
# CONFIG_LOGO is not set
CONFIG_SOUND=m
# CONFIG_SOUND_OSS_CORE is not set
CONFIG_SND=m
CONFIG_SND_TIMER=m
CONFIG_SND_PCM=m
CONFIG_SND_HWDEP=m
CONFIG_SND_RAWMIDI=m
CONFIG_SND_JACK=y
CONFIG_SND_SEQUENCER=m
# CONFIG_SND_SEQ_DUMMY is not set
# CONFIG_SND_MIXER_OSS is not set
# CONFIG_SND_PCM_OSS is not set
# CONFIG_SND_SEQUENCER_OSS is not set
# CONFIG_SND_HRTIMER is not set
CONFIG_SND_DYNAMIC_MINORS=y
CONFIG_SND_MAX_CARDS=32
CONFIG_SND_SUPPORT_OLD_API=y
CONFIG_SND_VERBOSE_PROCFS=y
# CONFIG_SND_VERBOSE_PRINTK is not set
# CONFIG_SND_DEBUG is not set
CONFIG_SND_VMASTER=y
CONFIG_SND_KCTL_JACK=y
CONFIG_SND_DMA_SGBUF=y
CONFIG_SND_RAWMIDI_SEQ=m
# CONFIG_SND_OPL3_LIB_SEQ is not set
# CONFIG_SND_OPL4_LIB_SEQ is not set
# CONFIG_SND_SBAWE_SEQ is not set
# CONFIG_SND_EMU10K1_SEQ is not set
CONFIG_SND_DRIVERS=y
# CONFIG_SND_PCSP is not set
# CONFIG_SND_DUMMY is not set
# CONFIG_SND_ALOOP is not set
CONFIG_SND_VIRMIDI=m
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_MTS64 is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_MPU401 is not set
# CONFIG_SND_PORTMAN2X4 is not set
CONFIG_SND_PCI=y
# CONFIG_SND_AD1889 is not set
# CONFIG_SND_ALS300 is not set
# CONFIG_SND_ALS4000 is not set
# CONFIG_SND_ALI5451 is not set
# CONFIG_SND_ASIHPI is not set
# CONFIG_SND_ATIIXP is not set
# CONFIG_SND_ATIIXP_MODEM is not set
# CONFIG_SND_AU8810 is not set
# CONFIG_SND_AU8820 is not set
# CONFIG_SND_AU8830 is not set
# CONFIG_SND_AW2 is not set
# CONFIG_SND_AZT3328 is not set
# CONFIG_SND_BT87X is not set
# CONFIG_SND_CA0106 is not set
# CONFIG_SND_CMIPCI is not set
# CONFIG_SND_OXYGEN is not set
# CONFIG_SND_CS4281 is not set
# CONFIG_SND_CS46XX is not set
# CONFIG_SND_CS5530 is not set
# CONFIG_SND_CS5535AUDIO is not set
# CONFIG_SND_CTXFI is not set
# CONFIG_SND_DARLA20 is not set
# CONFIG_SND_GINA20 is not set
# CONFIG_SND_LAYLA20 is not set
# CONFIG_SND_DARLA24 is not set
# CONFIG_SND_GINA24 is not set
# CONFIG_SND_LAYLA24 is not set
# CONFIG_SND_MONA is not set
# CONFIG_SND_MIA is not set
# CONFIG_SND_ECHO3G is not set
# CONFIG_SND_INDIGO is not set
# CONFIG_SND_INDIGOIO is not set
# CONFIG_SND_INDIGODJ is not set
# CONFIG_SND_INDIGOIOX is not set
# CONFIG_SND_INDIGODJX is not set
# CONFIG_SND_EMU10K1 is not set
# CONFIG_SND_EMU10K1X is not set
# CONFIG_SND_ENS1370 is not set
# CONFIG_SND_ENS1371 is not set
# CONFIG_SND_ES1938 is not set
# CONFIG_SND_ES1968 is not set
# CONFIG_SND_FM801 is not set
CONFIG_SND_HDA_INTEL=m
CONFIG_SND_HDA_PREALLOC_SIZE=64
CONFIG_SND_HDA_HWDEP=y
CONFIG_SND_HDA_RECONFIG=y
CONFIG_SND_HDA_INPUT_BEEP=y
CONFIG_SND_HDA_INPUT_BEEP_MODE=0
CONFIG_SND_HDA_INPUT_JACK=y
CONFIG_SND_HDA_PATCH_LOADER=y
CONFIG_SND_HDA_CODEC_REALTEK=y
CONFIG_SND_HDA_CODEC_ANALOG=y
CONFIG_SND_HDA_CODEC_SIGMATEL=y
CONFIG_SND_HDA_CODEC_VIA=y
CONFIG_SND_HDA_CODEC_HDMI=y
# CONFIG_SND_HDA_I915 is not set
CONFIG_SND_HDA_CODEC_CIRRUS=y
CONFIG_SND_HDA_CODEC_CONEXANT=y
CONFIG_SND_HDA_CODEC_CA0110=y
CONFIG_SND_HDA_CODEC_CA0132=y
# CONFIG_SND_HDA_CODEC_CA0132_DSP is not set
CONFIG_SND_HDA_CODEC_CMEDIA=y
CONFIG_SND_HDA_CODEC_SI3054=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0
# CONFIG_SND_HDSP is not set
# CONFIG_SND_HDSPM is not set
# CONFIG_SND_ICE1712 is not set
# CONFIG_SND_ICE1724 is not set
# CONFIG_SND_INTEL8X0 is not set
# CONFIG_SND_INTEL8X0M is not set
# CONFIG_SND_KORG1212 is not set
# CONFIG_SND_LOLA is not set
# CONFIG_SND_LX6464ES is not set
# CONFIG_SND_MAESTRO3 is not set
# CONFIG_SND_MIXART is not set
# CONFIG_SND_NM256 is not set
# CONFIG_SND_PCXHR is not set
# CONFIG_SND_RIPTIDE is not set
# CONFIG_SND_RME32 is not set
# CONFIG_SND_RME96 is not set
# CONFIG_SND_RME9652 is not set
# CONFIG_SND_SONICVIBES is not set
# CONFIG_SND_TRIDENT is not set
# CONFIG_SND_VIA82XX is not set
# CONFIG_SND_VIA82XX_MODEM is not set
# CONFIG_SND_VIRTUOSO is not set
# CONFIG_SND_VX222 is not set
# CONFIG_SND_YMFPCI is not set
CONFIG_SND_SPI=y
CONFIG_SND_USB=y
# CONFIG_SND_USB_AUDIO is not set
# CONFIG_SND_USB_UA101 is not set
# CONFIG_SND_USB_USX2Y is not set
# CONFIG_SND_USB_CAIAQ is not set
# CONFIG_SND_USB_US122L is not set
# CONFIG_SND_USB_6FIRE is not set
# CONFIG_SND_USB_HIFACE is not set
# CONFIG_SND_SOC is not set
# CONFIG_SOUND_PRIME is not set

#
# HID support
#
CONFIG_HID=m
CONFIG_HIDRAW=y
# CONFIG_UHID is not set
CONFIG_HID_GENERIC=m

#
# Special HID drivers
#
# CONFIG_HID_A4TECH is not set
# CONFIG_HID_ACRUX is not set
# CONFIG_HID_APPLE is not set
# CONFIG_HID_APPLEIR is not set
# CONFIG_HID_AUREAL is not set
# CONFIG_HID_BELKIN is not set
# CONFIG_HID_CHERRY is not set
# CONFIG_HID_CHICONY is not set
# CONFIG_HID_PRODIKEYS is not set
# CONFIG_HID_CYPRESS is not set
# CONFIG_HID_DRAGONRISE is not set
# CONFIG_HID_EMS_FF is not set
# CONFIG_HID_ELECOM is not set
# CONFIG_HID_ELO is not set
# CONFIG_HID_EZKEY is not set
# CONFIG_HID_HOLTEK is not set
# CONFIG_HID_HUION is not set
# CONFIG_HID_KEYTOUCH is not set
# CONFIG_HID_KYE is not set
# CONFIG_HID_UCLOGIC is not set
# CONFIG_HID_WALTOP is not set
# CONFIG_HID_GYRATION is not set
# CONFIG_HID_ICADE is not set
# CONFIG_HID_TWINHAN is not set
# CONFIG_HID_KENSINGTON is not set
# CONFIG_HID_LCPOWER is not set
# CONFIG_HID_LENOVO_TPKBD is not set
# CONFIG_HID_LOGITECH is not set
# CONFIG_HID_MAGICMOUSE is not set
# CONFIG_HID_MICROSOFT is not set
# CONFIG_HID_MONTEREY is not set
# CONFIG_HID_MULTITOUCH is not set
# CONFIG_HID_NTRIG is not set
# CONFIG_HID_ORTEK is not set
# CONFIG_HID_PANTHERLORD is not set
# CONFIG_HID_PETALYNX is not set
# CONFIG_HID_PICOLCD is not set
# CONFIG_HID_PRIMAX is not set
# CONFIG_HID_ROCCAT is not set
# CONFIG_HID_SAITEK is not set
# CONFIG_HID_SAMSUNG is not set
# CONFIG_HID_SONY is not set
# CONFIG_HID_SPEEDLINK is not set
# CONFIG_HID_STEELSERIES is not set
# CONFIG_HID_SUNPLUS is not set
# CONFIG_HID_GREENASIA is not set
# CONFIG_HID_SMARTJOYPLUS is not set
# CONFIG_HID_TIVO is not set
# CONFIG_HID_TOPSEED is not set
# CONFIG_HID_THINGM is not set
# CONFIG_HID_THRUSTMASTER is not set
# CONFIG_HID_WACOM is not set
# CONFIG_HID_WIIMOTE is not set
# CONFIG_HID_ZEROPLUS is not set
# CONFIG_HID_ZYDACRON is not set
# CONFIG_HID_SENSOR_HUB is not set

#
# USB HID support
#
CONFIG_USB_HID=m
CONFIG_HID_PID=y
CONFIG_USB_HIDDEV=y

#
# USB HID Boot Protocol drivers
#
# CONFIG_USB_KBD is not set
# CONFIG_USB_MOUSE is not set

#
# I2C HID support
#
# CONFIG_I2C_HID is not set
CONFIG_USB_SUPPORT=y
CONFIG_USB_COMMON=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB=y
CONFIG_USB_DEBUG=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y

#
# Miscellaneous USB options
#
CONFIG_USB_DEFAULT_PERSIST=y
CONFIG_USB_DYNAMIC_MINORS=y
# CONFIG_USB_OTG is not set
# CONFIG_USB_OTG_WHITELIST is not set
# CONFIG_USB_OTG_BLACKLIST_HUB is not set
CONFIG_USB_MON=m
# CONFIG_USB_WUSB_CBAF is not set

#
# USB Host Controller Drivers
#
# CONFIG_USB_C67X00_HCD is not set
CONFIG_USB_XHCI_HCD=y
# CONFIG_USB_XHCI_HCD_DEBUGGING is not set
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_TT_NEWSCHED=y
CONFIG_USB_EHCI_PCI=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
# CONFIG_USB_OXU210HP_HCD is not set
# CONFIG_USB_ISP116X_HCD is not set
# CONFIG_USB_ISP1760_HCD is not set
# CONFIG_USB_ISP1362_HCD is not set
# CONFIG_USB_FUSBH200_HCD is not set
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PCI=y
CONFIG_USB_OHCI_HCD_PLATFORM=y
# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_UHCI_HCD=y
# CONFIG_USB_SL811_HCD is not set
# CONFIG_USB_R8A66597_HCD is not set

#
# USB Device Class drivers
#
# CONFIG_USB_ACM is not set
CONFIG_USB_PRINTER=m
# CONFIG_USB_WDM is not set
# CONFIG_USB_TMC is not set

#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
#

#
# also be needed; see USB_STORAGE Help for more info
#
CONFIG_USB_STORAGE=m
# CONFIG_USB_STORAGE_DEBUG is not set
# CONFIG_USB_STORAGE_REALTEK is not set
# CONFIG_USB_STORAGE_DATAFAB is not set
# CONFIG_USB_STORAGE_FREECOM is not set
# CONFIG_USB_STORAGE_ISD200 is not set
# CONFIG_USB_STORAGE_USBAT is not set
# CONFIG_USB_STORAGE_SDDR09 is not set
# CONFIG_USB_STORAGE_SDDR55 is not set
# CONFIG_USB_STORAGE_JUMPSHOT is not set
# CONFIG_USB_STORAGE_ALAUDA is not set
# CONFIG_USB_STORAGE_ONETOUCH is not set
# CONFIG_USB_STORAGE_KARMA is not set
# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
# CONFIG_USB_STORAGE_ENE_UB6250 is not set

#
# USB Imaging devices
#
# CONFIG_USB_MDC800 is not set
# CONFIG_USB_MICROTEK is not set
# CONFIG_USB_DWC3 is not set
# CONFIG_USB_CHIPIDEA is not set

#
# USB port drivers
#
# CONFIG_USB_USS720 is not set
# CONFIG_USB_SERIAL is not set

#
# USB Miscellaneous drivers
#
# CONFIG_USB_EMI62 is not set
# CONFIG_USB_EMI26 is not set
# CONFIG_USB_ADUTUX is not set
# CONFIG_USB_SEVSEG is not set
# CONFIG_USB_RIO500 is not set
# CONFIG_USB_LEGOTOWER is not set
# CONFIG_USB_LCD is not set
# CONFIG_USB_LED is not set
# CONFIG_USB_CYPRESS_CY7C63 is not set
# CONFIG_USB_CYTHERM is not set
# CONFIG_USB_IDMOUSE is not set
# CONFIG_USB_FTDI_ELAN is not set
# CONFIG_USB_APPLEDISPLAY is not set
# CONFIG_USB_SISUSBVGA is not set
# CONFIG_USB_LD is not set
# CONFIG_USB_TRANCEVIBRATOR is not set
# CONFIG_USB_IOWARRIOR is not set
# CONFIG_USB_TEST is not set
# CONFIG_USB_ISIGHTFW is not set
# CONFIG_USB_YUREX is not set
# CONFIG_USB_EZUSB_FX2 is not set
# CONFIG_USB_HSIC_USB3503 is not set
# CONFIG_USB_PHY is not set
# CONFIG_USB_GADGET is not set
# CONFIG_UWB is not set
CONFIG_MMC=y
# CONFIG_MMC_DEBUG is not set
# CONFIG_MMC_UNSAFE_RESUME is not set
# CONFIG_MMC_CLKGATE is not set

#
# MMC/SD/SDIO Card Drivers
#
CONFIG_MMC_BLOCK=m
CONFIG_MMC_BLOCK_MINORS=8
CONFIG_MMC_BLOCK_BOUNCE=y
# CONFIG_SDIO_UART is not set
# CONFIG_MMC_TEST is not set

#
# MMC/SD/SDIO Host Controller Drivers
#
CONFIG_MMC_SDHCI=m
CONFIG_MMC_SDHCI_PCI=m
# CONFIG_MMC_RICOH_MMC is not set
# CONFIG_MMC_SDHCI_ACPI is not set
# CONFIG_MMC_SDHCI_PLTFM is not set
# CONFIG_MMC_WBSD is not set
# CONFIG_MMC_TIFM_SD is not set
# CONFIG_MMC_SPI is not set
# CONFIG_MMC_CB710 is not set
# CONFIG_MMC_VIA_SDMMC is not set
# CONFIG_MMC_VUB300 is not set
# CONFIG_MMC_USHC is not set
# CONFIG_MEMSTICK is not set
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y

#
# LED drivers
#
# CONFIG_LEDS_88PM860X is not set
# CONFIG_LEDS_LM3530 is not set
# CONFIG_LEDS_LM3642 is not set
# CONFIG_LEDS_PCA9532 is not set
# CONFIG_LEDS_GPIO is not set
# CONFIG_LEDS_LP3944 is not set
# CONFIG_LEDS_LP5521 is not set
# CONFIG_LEDS_LP5523 is not set
# CONFIG_LEDS_LP5562 is not set
# CONFIG_LEDS_LP8788 is not set
# CONFIG_LEDS_CLEVO_MAIL is not set
# CONFIG_LEDS_PCA955X is not set
# CONFIG_LEDS_PCA9633 is not set
# CONFIG_LEDS_WM831X_STATUS is not set
# CONFIG_LEDS_WM8350 is not set
# CONFIG_LEDS_DA903X is not set
# CONFIG_LEDS_DA9052 is not set
# CONFIG_LEDS_DAC124S085 is not set
# CONFIG_LEDS_PWM is not set
# CONFIG_LEDS_REGULATOR is not set
# CONFIG_LEDS_BD2802 is not set
# CONFIG_LEDS_INTEL_SS4200 is not set
# CONFIG_LEDS_LT3593 is not set
# CONFIG_LEDS_ADP5520 is not set
# CONFIG_LEDS_DELL_NETBOOKS is not set
# CONFIG_LEDS_TCA6507 is not set
# CONFIG_LEDS_MAX8997 is not set
# CONFIG_LEDS_LM355x is not set
# CONFIG_LEDS_OT200 is not set
# CONFIG_LEDS_BLINKM is not set

#
# LED Triggers
#
CONFIG_LEDS_TRIGGERS=y
# CONFIG_LEDS_TRIGGER_TIMER is not set
# CONFIG_LEDS_TRIGGER_ONESHOT is not set
# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
CONFIG_LEDS_TRIGGER_CPU=y
# CONFIG_LEDS_TRIGGER_GPIO is not set
# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set

#
# iptables trigger is under Netfilter config (LED target)
#
# CONFIG_LEDS_TRIGGER_TRANSIENT is not set
# CONFIG_LEDS_TRIGGER_CAMERA is not set
# CONFIG_ACCESSIBILITY is not set
# CONFIG_INFINIBAND is not set
CONFIG_EDAC=y
CONFIG_EDAC_LEGACY_SYSFS=y
# CONFIG_EDAC_DEBUG is not set
# CONFIG_EDAC_DECODE_MCE is not set
# CONFIG_EDAC_MM_EDAC is not set
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_SYSTOHC=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
# CONFIG_RTC_DEBUG is not set

#
# RTC interfaces
#
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
# CONFIG_RTC_DRV_TEST is not set

#
# I2C RTC drivers
#
# CONFIG_RTC_DRV_88PM860X is not set
# CONFIG_RTC_DRV_DS1307 is not set
# CONFIG_RTC_DRV_DS1374 is not set
# CONFIG_RTC_DRV_DS1672 is not set
# CONFIG_RTC_DRV_DS3232 is not set
# CONFIG_RTC_DRV_LP8788 is not set
# CONFIG_RTC_DRV_MAX6900 is not set
# CONFIG_RTC_DRV_MAX8925 is not set
# CONFIG_RTC_DRV_MAX8998 is not set
# CONFIG_RTC_DRV_MAX8997 is not set
# CONFIG_RTC_DRV_MAX77686 is not set
# CONFIG_RTC_DRV_RS5C372 is not set
# CONFIG_RTC_DRV_ISL1208 is not set
# CONFIG_RTC_DRV_ISL12022 is not set
# CONFIG_RTC_DRV_X1205 is not set
# CONFIG_RTC_DRV_PALMAS is not set
# CONFIG_RTC_DRV_PCF2127 is not set
# CONFIG_RTC_DRV_PCF8523 is not set
# CONFIG_RTC_DRV_PCF8563 is not set
# CONFIG_RTC_DRV_PCF8583 is not set
# CONFIG_RTC_DRV_M41T80 is not set
# CONFIG_RTC_DRV_BQ32K is not set
# CONFIG_RTC_DRV_TPS6586X is not set
# CONFIG_RTC_DRV_TPS65910 is not set
# CONFIG_RTC_DRV_RC5T583 is not set
# CONFIG_RTC_DRV_S35390A is not set
# CONFIG_RTC_DRV_FM3130 is not set
# CONFIG_RTC_DRV_RX8581 is not set
# CONFIG_RTC_DRV_RX8025 is not set
# CONFIG_RTC_DRV_EM3027 is not set
# CONFIG_RTC_DRV_RV3029C2 is not set

#
# SPI RTC drivers
#
# CONFIG_RTC_DRV_M41T93 is not set
# CONFIG_RTC_DRV_M41T94 is not set
# CONFIG_RTC_DRV_DS1305 is not set
# CONFIG_RTC_DRV_DS1390 is not set
# CONFIG_RTC_DRV_MAX6902 is not set
# CONFIG_RTC_DRV_R9701 is not set
# CONFIG_RTC_DRV_RS5C348 is not set
# CONFIG_RTC_DRV_DS3234 is not set
# CONFIG_RTC_DRV_PCF2123 is not set
# CONFIG_RTC_DRV_RX4581 is not set

#
# Platform RTC drivers
#
CONFIG_RTC_DRV_CMOS=y
# CONFIG_RTC_DRV_DS1286 is not set
# CONFIG_RTC_DRV_DS1511 is not set
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_DA9052 is not set
# CONFIG_RTC_DRV_DA9055 is not set
# CONFIG_RTC_DRV_STK17TA8 is not set
# CONFIG_RTC_DRV_M48T86 is not set
# CONFIG_RTC_DRV_M48T35 is not set
# CONFIG_RTC_DRV_M48T59 is not set
# CONFIG_RTC_DRV_MSM6242 is not set
# CONFIG_RTC_DRV_BQ4802 is not set
# CONFIG_RTC_DRV_RP5C01 is not set
# CONFIG_RTC_DRV_V3020 is not set
# CONFIG_RTC_DRV_DS2404 is not set
# CONFIG_RTC_DRV_WM831X is not set
# CONFIG_RTC_DRV_WM8350 is not set
# CONFIG_RTC_DRV_AB3100 is not set

#
# on-CPU RTC drivers
#
# CONFIG_RTC_DRV_PCAP is not set

#
# HID Sensor RTC drivers
#
# CONFIG_RTC_DRV_HID_SENSOR_TIME is not set
CONFIG_DMADEVICES=y
# CONFIG_DMADEVICES_DEBUG is not set

#
# DMA Devices
#
# CONFIG_INTEL_MID_DMAC is not set
# CONFIG_INTEL_IOATDMA is not set
# CONFIG_DW_DMAC_CORE is not set
# CONFIG_DW_DMAC is not set
# CONFIG_DW_DMAC_PCI is not set
# CONFIG_TIMB_DMA is not set
# CONFIG_PCH_DMA is not set
CONFIG_DMA_ENGINE=y
CONFIG_DMA_ACPI=y

#
# DMA Clients
#
CONFIG_NET_DMA=y
# CONFIG_ASYNC_TX_DMA is not set
# CONFIG_DMATEST is not set
CONFIG_AUXDISPLAY=y
# CONFIG_KS0108 is not set
# CONFIG_UIO is not set
# CONFIG_VFIO is not set
CONFIG_VIRT_DRIVERS=y
CONFIG_VIRTIO=y

#
# Virtio drivers
#
CONFIG_VIRTIO_PCI=y
# CONFIG_VIRTIO_BALLOON is not set
# CONFIG_VIRTIO_MMIO is not set

#
# Microsoft Hyper-V guest support
#
# CONFIG_HYPERV is not set

#
# Xen driver support
#
CONFIG_XEN_BALLOON=y
CONFIG_XEN_SELFBALLOONING=y
CONFIG_XEN_BALLOON_MEMORY_HOTPLUG=y
CONFIG_XEN_SCRUB_PAGES=y
# CONFIG_XEN_DEV_EVTCHN is not set
CONFIG_XEN_BACKEND=y
# CONFIG_XENFS is not set
CONFIG_XEN_SYS_HYPERVISOR=y
CONFIG_XEN_XENBUS_FRONTEND=y
# CONFIG_XEN_GNTDEV is not set
# CONFIG_XEN_GRANT_DEV_ALLOC is not set
CONFIG_SWIOTLB_XEN=y
CONFIG_XEN_TMEM=m
# CONFIG_XEN_PCIDEV_BACKEND is not set
CONFIG_XEN_PRIVCMD=m
CONFIG_XEN_ACPI_PROCESSOR=y
CONFIG_XEN_MCE_LOG=y
CONFIG_XEN_HAVE_PVMMU=y
CONFIG_STAGING=y
# CONFIG_ET131X is not set
# CONFIG_SLICOSS is not set
# CONFIG_USBIP_CORE is not set
# CONFIG_W35UND is not set
# CONFIG_PRISM2_USB is not set
# CONFIG_ECHO is not set
# CONFIG_COMEDI is not set
# CONFIG_ASUS_OLED is not set
# CONFIG_PANEL is not set
# CONFIG_R8187SE is not set
# CONFIG_RTL8192U is not set
# CONFIG_RTLLIB is not set
# CONFIG_R8712U is not set
# CONFIG_RTS5139 is not set
# CONFIG_TRANZPORT is not set
# CONFIG_IDE_PHISON is not set
# CONFIG_LINE6_USB is not set
# CONFIG_VT6655 is not set
# CONFIG_VT6656 is not set
# CONFIG_DX_SEP is not set
CONFIG_ZSMALLOC=y
# CONFIG_ZRAM is not set
# CONFIG_FB_SM7XX is not set
# CONFIG_CRYSTALHD is not set
# CONFIG_FB_XGI is not set
# CONFIG_ACPI_QUICKSTART is not set
# CONFIG_USB_ENESTORAGE is not set
# CONFIG_BCM_WIMAX is not set
# CONFIG_FT1000 is not set

#
# Speakup console speech
#
# CONFIG_SPEAKUP is not set
# CONFIG_TOUCHSCREEN_CLEARPAD_TM1217 is not set
# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set
CONFIG_STAGING_MEDIA=y
# CONFIG_DVB_AS102 is not set
# CONFIG_DVB_CXD2099 is not set
# CONFIG_VIDEO_DT3155 is not set
# CONFIG_VIDEO_GO7007 is not set
# CONFIG_SOLO6X10 is not set

#
# Android
#
CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ASHMEM=y
# CONFIG_ANDROID_LOGGER is not set
CONFIG_ANDROID_TIMED_OUTPUT=y
# CONFIG_ANDROID_TIMED_GPIO is not set
CONFIG_ANDROID_LOW_MEMORY_KILLER=y
CONFIG_ANDROID_INTF_ALARM_DEV=y
# CONFIG_SYNC is not set
# CONFIG_USB_WPAN_HCD is not set
# CONFIG_WIMAX_GDM72XX is not set
CONFIG_NET_VENDOR_SILICOM=y
# CONFIG_SBYPASS is not set
# CONFIG_BPCTL is not set
# CONFIG_CED1401 is not set
# CONFIG_DGRP is not set
# CONFIG_ZCACHE is not set
# CONFIG_USB_DWC2 is not set
# CONFIG_USB_BTMTK is not set
CONFIG_X86_PLATFORM_DEVICES=y
# CONFIG_ACER_WMI is not set
# CONFIG_ACERHDF is not set
# CONFIG_ASUS_LAPTOP is not set
# CONFIG_CHROMEOS_LAPTOP is not set
# CONFIG_DELL_WMI is not set
# CONFIG_DELL_WMI_AIO is not set
# CONFIG_FUJITSU_LAPTOP is not set
# CONFIG_FUJITSU_TABLET is not set
# CONFIG_AMILO_RFKILL is not set
# CONFIG_HP_ACCEL is not set
# CONFIG_HP_WMI is not set
# CONFIG_MSI_LAPTOP is not set
# CONFIG_PANASONIC_LAPTOP is not set
# CONFIG_COMPAL_LAPTOP is not set
# CONFIG_SONY_LAPTOP is not set
# CONFIG_IDEAPAD_LAPTOP is not set
# CONFIG_THINKPAD_ACPI is not set
# CONFIG_SENSORS_HDAPS is not set
# CONFIG_INTEL_MENLOW is not set
# CONFIG_EEEPC_LAPTOP is not set
# CONFIG_ASUS_WMI is not set
CONFIG_ACPI_WMI=m
# CONFIG_MSI_WMI is not set
# CONFIG_TOPSTAR_LAPTOP is not set
# CONFIG_ACPI_TOSHIBA is not set
# CONFIG_TOSHIBA_BT_RFKILL is not set
# CONFIG_ACPI_CMPC is not set
# CONFIG_INTEL_IPS is not set
# CONFIG_IBM_RTL is not set
# CONFIG_XO15_EBOOK is not set
CONFIG_SAMSUNG_LAPTOP=m
# CONFIG_MXM_WMI is not set
# CONFIG_INTEL_OAKTRAIL is not set
# CONFIG_SAMSUNG_Q10 is not set
# CONFIG_APPLE_GMUX is not set
# CONFIG_INTEL_RST is not set
# CONFIG_INTEL_SMARTCONNECT is not set
# CONFIG_PVPANIC is not set

#
# Hardware Spinlock drivers
#
CONFIG_CLKEVT_I8253=y
CONFIG_I8253_LOCK=y
CONFIG_CLKBLD_I8253=y
# CONFIG_MAILBOX is not set
CONFIG_IOMMU_API=y
CONFIG_IOMMU_SUPPORT=y
CONFIG_AMD_IOMMU=y
CONFIG_AMD_IOMMU_STATS=y
# CONFIG_AMD_IOMMU_V2 is not set
CONFIG_DMAR_TABLE=y
CONFIG_INTEL_IOMMU=y
# CONFIG_INTEL_IOMMU_DEFAULT_ON is not set
CONFIG_INTEL_IOMMU_FLOPPY_WA=y
CONFIG_IRQ_REMAP=y

#
# Remoteproc drivers
#
# CONFIG_STE_MODEM_RPROC is not set

#
# Rpmsg drivers
#
CONFIG_PM_DEVFREQ=y

#
# DEVFREQ Governors
#
CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y
CONFIG_DEVFREQ_GOV_PERFORMANCE=y
CONFIG_DEVFREQ_GOV_POWERSAVE=y
CONFIG_DEVFREQ_GOV_USERSPACE=y

#
# DEVFREQ Drivers
#
CONFIG_EXTCON=y

#
# Extcon Device Drivers
#
# CONFIG_EXTCON_GPIO is not set
# CONFIG_EXTCON_MAX77693 is not set
# CONFIG_EXTCON_MAX8997 is not set
# CONFIG_EXTCON_PALMAS is not set
CONFIG_MEMORY=y
# CONFIG_IIO is not set
# CONFIG_NTB is not set
# CONFIG_VME_BUS is not set
CONFIG_PWM=y
CONFIG_PWM_SYSFS=y
# CONFIG_IPACK_BUS is not set
# CONFIG_RESET_CONTROLLER is not set
# CONFIG_FMC is not set

#
# Firmware Drivers
#
CONFIG_EDD=y
CONFIG_EDD_OFF=y
CONFIG_FIRMWARE_MEMMAP=y
# CONFIG_DELL_RBU is not set
# CONFIG_DCDBAS is not set
CONFIG_DMIID=y
# CONFIG_DMI_SYSFS is not set
CONFIG_ISCSI_IBFT_FIND=y
# CONFIG_ISCSI_IBFT is not set
# CONFIG_GOOGLE_FIRMWARE is not set

#
# EFI (Extensible Firmware Interface) Support
#
CONFIG_EFI_VARS=y
CONFIG_EFI_VARS_PSTORE=y
# CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE is not set

#
# File systems
#
CONFIG_DCACHE_WORD_ACCESS=y
# CONFIG_EXT2_FS is not set
CONFIG_EXT3_FS=y
CONFIG_EXT3_DEFAULTS_TO_ORDERED=y
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT23=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
CONFIG_EXT4_DEBUG=y
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
CONFIG_JBD2=y
CONFIG_JBD2_DEBUG=y
CONFIG_FS_MBCACHE=y
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
CONFIG_XFS_FS=m
CONFIG_XFS_QUOTA=y
CONFIG_XFS_POSIX_ACL=y
CONFIG_XFS_RT=y
# CONFIG_XFS_WARN is not set
# CONFIG_XFS_DEBUG is not set
# CONFIG_GFS2_FS is not set
CONFIG_BTRFS_FS=m
CONFIG_BTRFS_FS_POSIX_ACL=y
# CONFIG_BTRFS_FS_CHECK_INTEGRITY is not set
# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set
# CONFIG_BTRFS_DEBUG is not set
# CONFIG_NILFS2_FS is not set
CONFIG_FS_POSIX_ACL=y
CONFIG_EXPORTFS=y
CONFIG_FILE_LOCKING=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY_USER=y
CONFIG_FANOTIFY=y
CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
# CONFIG_PRINT_QUOTA_WARNING is not set
# CONFIG_QUOTA_DEBUG is not set
# CONFIG_QFMT_V1 is not set
# CONFIG_QFMT_V2 is not set
CONFIG_QUOTACTL=y
CONFIG_QUOTACTL_COMPAT=y
# CONFIG_AUTOFS4_FS is not set
CONFIG_FUSE_FS=y
# CONFIG_CUSE is not set
CONFIG_GENERIC_ACL=y

#
# Caches
#
# CONFIG_FSCACHE is not set

#
# CD-ROM/DVD Filesystems
#
CONFIG_ISO9660_FS=m
CONFIG_JOLIET=y
# CONFIG_ZISOFS is not set
CONFIG_UDF_FS=m
CONFIG_UDF_NLS=y

#
# DOS/FAT/NT Filesystems
#
CONFIG_FAT_FS=y
# CONFIG_MSDOS_FS is not set
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
# CONFIG_NTFS_FS is not set

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_VMCORE=y
CONFIG_PROC_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_TMPFS_XATTR=y
CONFIG_HUGETLBFS=y
CONFIG_HUGETLB_PAGE=y
# CONFIG_CONFIGFS_FS is not set
CONFIG_MISC_FILESYSTEMS=y
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
CONFIG_ECRYPT_FS=y
# CONFIG_ECRYPT_FS_MESSAGING is not set
# CONFIG_HFS_FS is not set
# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_LOGFS is not set
# CONFIG_CRAMFS is not set
CONFIG_SQUASHFS=m
CONFIG_SQUASHFS_XATTR=y
CONFIG_SQUASHFS_ZLIB=y
CONFIG_SQUASHFS_LZO=y
CONFIG_SQUASHFS_XZ=y
# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set
# CONFIG_SQUASHFS_EMBEDDED is not set
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
# CONFIG_VXFS_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_OMFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_QNX6FS_FS is not set
# CONFIG_ROMFS_FS is not set
CONFIG_PSTORE=y
# CONFIG_PSTORE_CONSOLE is not set
# CONFIG_PSTORE_FTRACE is not set
# CONFIG_PSTORE_RAM is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set
# CONFIG_F2FS_FS is not set
# CONFIG_EFIVAR_FS is not set
CONFIG_NETWORK_FILESYSTEMS=y
# CONFIG_NFS_FS is not set
# CONFIG_NFSD is not set
# CONFIG_CEPH_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=y
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
# CONFIG_NLS_CODEPAGE_850 is not set
# CONFIG_NLS_CODEPAGE_852 is not set
# CONFIG_NLS_CODEPAGE_855 is not set
# CONFIG_NLS_CODEPAGE_857 is not set
# CONFIG_NLS_CODEPAGE_860 is not set
# CONFIG_NLS_CODEPAGE_861 is not set
# CONFIG_NLS_CODEPAGE_862 is not set
# CONFIG_NLS_CODEPAGE_863 is not set
# CONFIG_NLS_CODEPAGE_864 is not set
# CONFIG_NLS_CODEPAGE_865 is not set
# CONFIG_NLS_CODEPAGE_866 is not set
# CONFIG_NLS_CODEPAGE_869 is not set
# CONFIG_NLS_CODEPAGE_936 is not set
# CONFIG_NLS_CODEPAGE_950 is not set
# CONFIG_NLS_CODEPAGE_932 is not set
# CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
# CONFIG_NLS_ASCII is not set
CONFIG_NLS_ISO8859_1=m
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
# CONFIG_NLS_ISO8859_4 is not set
# CONFIG_NLS_ISO8859_5 is not set
# CONFIG_NLS_ISO8859_6 is not set
# CONFIG_NLS_ISO8859_7 is not set
# CONFIG_NLS_ISO8859_9 is not set
# CONFIG_NLS_ISO8859_13 is not set
# CONFIG_NLS_ISO8859_14 is not set
# CONFIG_NLS_ISO8859_15 is not set
# CONFIG_NLS_KOI8_R is not set
# CONFIG_NLS_KOI8_U is not set
# CONFIG_NLS_MAC_ROMAN is not set
# CONFIG_NLS_MAC_CELTIC is not set
# CONFIG_NLS_MAC_CENTEURO is not set
# CONFIG_NLS_MAC_CROATIAN is not set
# CONFIG_NLS_MAC_CYRILLIC is not set
# CONFIG_NLS_MAC_GAELIC is not set
# CONFIG_NLS_MAC_GREEK is not set
# CONFIG_NLS_MAC_ICELAND is not set
# CONFIG_NLS_MAC_INUIT is not set
# CONFIG_NLS_MAC_ROMANIAN is not set
# CONFIG_NLS_MAC_TURKISH is not set
# CONFIG_NLS_UTF8 is not set

#
# Kernel hacking
#
CONFIG_TRACE_IRQFLAGS_SUPPORT=y

#
# printk and dmesg options
#
CONFIG_PRINTK_TIME=y
CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
CONFIG_BOOT_PRINTK_DELAY=y
# CONFIG_DYNAMIC_DEBUG is not set

#
# Compile-time checks and compiler options
#
# CONFIG_DEBUG_INFO is not set
# CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_FRAME_WARN=1024
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_READABLE_ASM is not set
CONFIG_UNUSED_SYMBOLS=y
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
# CONFIG_DEBUG_SECTION_MISMATCH is not set
CONFIG_ARCH_WANT_FRAME_POINTERS=y
CONFIG_FRAME_POINTER=y
# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_KERNEL=y

#
# Memory Debugging
#
# CONFIG_DEBUG_PAGEALLOC is not set
CONFIG_DEBUG_OBJECTS=y
# CONFIG_DEBUG_OBJECTS_SELFTEST is not set
# CONFIG_DEBUG_OBJECTS_FREE is not set
# CONFIG_DEBUG_OBJECTS_TIMERS is not set
# CONFIG_DEBUG_OBJECTS_WORK is not set
CONFIG_DEBUG_OBJECTS_RCU_HEAD=y
# CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER is not set
CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
CONFIG_DEBUG_SLAB=y
# CONFIG_DEBUG_SLAB_LEAK is not set
CONFIG_HAVE_DEBUG_KMEMLEAK=y
# CONFIG_DEBUG_KMEMLEAK is not set
# CONFIG_DEBUG_STACK_USAGE is not set
# CONFIG_DEBUG_VM is not set
# CONFIG_DEBUG_VIRTUAL is not set
CONFIG_DEBUG_MEMORY_INIT=y
# CONFIG_DEBUG_PER_CPU_MAPS is not set
CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
# CONFIG_DEBUG_STACKOVERFLOW is not set
CONFIG_HAVE_ARCH_KMEMCHECK=y
# CONFIG_DEBUG_SHIRQ is not set

#
# Debug Lockups and Hangs
#
CONFIG_LOCKUP_DETECTOR=y
CONFIG_HARDLOCKUP_DETECTOR=y
# CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set
CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=0
# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
CONFIG_DETECT_HUNG_TASK=y
CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120
# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
# CONFIG_PANIC_ON_OOPS is not set
CONFIG_PANIC_ON_OOPS_VALUE=0
CONFIG_SCHED_DEBUG=y
CONFIG_SCHEDSTATS=y
CONFIG_TIMER_STATS=y

#
# Lock Debugging (spinlocks, mutexes, etc...)
#
# CONFIG_DEBUG_RT_MUTEXES is not set
# CONFIG_RT_MUTEX_TESTER is not set
# CONFIG_DEBUG_SPINLOCK is not set
CONFIG_DEBUG_MUTEXES=y
# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set
# CONFIG_DEBUG_LOCK_ALLOC is not set
# CONFIG_PROVE_LOCKING is not set
# CONFIG_LOCK_STAT is not set
# CONFIG_DEBUG_ATOMIC_SLEEP is not set
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
CONFIG_STACKTRACE=y
# CONFIG_DEBUG_KOBJECT is not set
CONFIG_DEBUG_BUGVERBOSE=y
# CONFIG_DEBUG_WRITECOUNT is not set
# CONFIG_DEBUG_LIST is not set
# CONFIG_DEBUG_SG is not set
# CONFIG_DEBUG_NOTIFIERS is not set
# CONFIG_DEBUG_CREDENTIALS is not set

#
# RCU Debugging
#
# CONFIG_SPARSE_RCU_POINTER is not set
# CONFIG_RCU_TORTURE_TEST is not set
CONFIG_RCU_CPU_STALL_TIMEOUT=60
# CONFIG_RCU_CPU_STALL_INFO is not set
# CONFIG_RCU_TRACE is not set
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
# CONFIG_NOTIFIER_ERROR_INJECTION is not set
# CONFIG_FAULT_INJECTION is not set
CONFIG_LATENCYTOP=y
CONFIG_ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS=y
# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set
CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_NOP_TRACER=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_FENTRY=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_TRACER_MAX_TRACE=y
CONFIG_TRACE_CLOCK=y
CONFIG_RING_BUFFER=y
CONFIG_EVENT_TRACING=y
CONFIG_CONTEXT_SWITCH_TRACER=y
CONFIG_TRACING=y
CONFIG_GENERIC_TRACER=y
CONFIG_TRACING_SUPPORT=y
CONFIG_FTRACE=y
CONFIG_FUNCTION_TRACER=y
CONFIG_FUNCTION_GRAPH_TRACER=y
# CONFIG_IRQSOFF_TRACER is not set
CONFIG_SCHED_TRACER=y
CONFIG_FTRACE_SYSCALLS=y
CONFIG_TRACER_SNAPSHOT=y
# CONFIG_TRACER_SNAPSHOT_PER_CPU_SWAP is not set
CONFIG_BRANCH_PROFILE_NONE=y
# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
# CONFIG_PROFILE_ALL_BRANCHES is not set
CONFIG_STACK_TRACER=y
CONFIG_BLK_DEV_IO_TRACE=y
CONFIG_KPROBE_EVENT=y
CONFIG_UPROBE_EVENT=y
CONFIG_PROBE_EVENTS=y
CONFIG_DYNAMIC_FTRACE=y
CONFIG_DYNAMIC_FTRACE_WITH_REGS=y
CONFIG_FUNCTION_PROFILER=y
CONFIG_FTRACE_MCOUNT_RECORD=y
# CONFIG_FTRACE_STARTUP_TEST is not set
CONFIG_MMIOTRACE=y
# CONFIG_MMIOTRACE_TEST is not set
# CONFIG_RING_BUFFER_BENCHMARK is not set
# CONFIG_RING_BUFFER_STARTUP_TEST is not set

#
# Runtime Testing
#
# CONFIG_LKDTM is not set
# CONFIG_TEST_LIST_SORT is not set
# CONFIG_KPROBES_SANITY_TEST is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_RBTREE_TEST is not set
# CONFIG_INTERVAL_TREE_TEST is not set
# CONFIG_ATOMIC64_SELFTEST is not set
# CONFIG_TEST_STRING_HELPERS is not set
# CONFIG_TEST_KSTRTOX is not set
# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_KGDB=y
CONFIG_KGDB_SERIAL_CONSOLE=y
# CONFIG_KGDB_TESTS is not set
CONFIG_KGDB_LOW_LEVEL_TRAP=y
CONFIG_KGDB_KDB=y
CONFIG_KDB_KEYBOARD=y
CONFIG_KDB_CONTINUE_CATASTROPHIC=0
CONFIG_STRICT_DEVMEM=y
# CONFIG_X86_VERBOSE_BOOTUP is not set
CONFIG_EARLY_PRINTK=y
CONFIG_EARLY_PRINTK_DBGP=y
# CONFIG_X86_PTDUMP is not set
CONFIG_DEBUG_RODATA=y
# CONFIG_DEBUG_RODATA_TEST is not set
CONFIG_DEBUG_SET_MODULE_RONX=y
# CONFIG_DEBUG_NX_TEST is not set
CONFIG_DOUBLEFAULT=y
# CONFIG_DEBUG_TLBFLUSH is not set
# CONFIG_IOMMU_DEBUG is not set
# CONFIG_IOMMU_STRESS is not set
CONFIG_HAVE_MMIOTRACE_SUPPORT=y
# CONFIG_X86_DECODER_SELFTEST is not set
CONFIG_IO_DELAY_TYPE_0X80=0
CONFIG_IO_DELAY_TYPE_0XED=1
CONFIG_IO_DELAY_TYPE_UDELAY=2
CONFIG_IO_DELAY_TYPE_NONE=3
# CONFIG_IO_DELAY_0X80 is not set
CONFIG_IO_DELAY_0XED=y
# CONFIG_IO_DELAY_UDELAY is not set
# CONFIG_IO_DELAY_NONE is not set
CONFIG_DEFAULT_IO_DELAY_TYPE=1
# CONFIG_DEBUG_BOOT_PARAMS is not set
# CONFIG_CPA_DEBUG is not set
CONFIG_OPTIMIZE_INLINING=y
# CONFIG_DEBUG_NMI_SELFTEST is not set
# CONFIG_X86_DEBUG_STATIC_CPU_HAS is not set

#
# Security options
#
CONFIG_KEYS=y
CONFIG_TRUSTED_KEYS=y
CONFIG_ENCRYPTED_KEYS=y
# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
# CONFIG_SECURITY_DMESG_RESTRICT is not set
CONFIG_SECURITY=y
CONFIG_SECURITYFS=y
CONFIG_SECURITY_NETWORK=y
CONFIG_SECURITY_PATH=y
CONFIG_INTEL_TXT=y
CONFIG_LSM_MMAP_MIN_ADDR=0
CONFIG_SECURITY_SELINUX=y
CONFIG_SECURITY_SELINUX_BOOTPARAM=y
CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
CONFIG_SECURITY_SELINUX_DISABLE=y
CONFIG_SECURITY_SELINUX_DEVELOP=y
CONFIG_SECURITY_SELINUX_AVC_STATS=y
CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set
CONFIG_SECURITY_SMACK=y
CONFIG_SECURITY_TOMOYO=y
CONFIG_SECURITY_TOMOYO_MAX_ACCEPT_ENTRY=2048
CONFIG_SECURITY_TOMOYO_MAX_AUDIT_LOG=1024
# CONFIG_SECURITY_TOMOYO_OMIT_USERSPACE_LOADER is not set
CONFIG_SECURITY_TOMOYO_POLICY_LOADER="/sbin/tomoyo-init"
CONFIG_SECURITY_TOMOYO_ACTIVATION_TRIGGER="/sbin/init"
CONFIG_SECURITY_APPARMOR=y
CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1
CONFIG_SECURITY_YAMA=y
CONFIG_SECURITY_YAMA_STACKED=y
CONFIG_INTEGRITY=y
CONFIG_INTEGRITY_SIGNATURE=y
CONFIG_INTEGRITY_AUDIT=y
# CONFIG_INTEGRITY_ASYMMETRIC_KEYS is not set
# CONFIG_IMA is not set
CONFIG_EVM=y
CONFIG_EVM_HMAC_VERSION=2
# CONFIG_DEFAULT_SECURITY_SELINUX is not set
# CONFIG_DEFAULT_SECURITY_SMACK is not set
# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
CONFIG_DEFAULT_SECURITY_APPARMOR=y
# CONFIG_DEFAULT_SECURITY_YAMA is not set
# CONFIG_DEFAULT_SECURITY_DAC is not set
CONFIG_DEFAULT_SECURITY="apparmor"
CONFIG_XOR_BLOCKS=m
CONFIG_CRYPTO=y

#
# Crypto core or helper
#
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_BLKCIPHER=y
CONFIG_CRYPTO_BLKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG=y
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_PCOMP2=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
# CONFIG_CRYPTO_USER is not set
CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
CONFIG_CRYPTO_GF128MUL=m
# CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_PCRYPT is not set
CONFIG_CRYPTO_WORKQUEUE=y
CONFIG_CRYPTO_CRYPTD=m
# CONFIG_CRYPTO_AUTHENC is not set
# CONFIG_CRYPTO_TEST is not set
CONFIG_CRYPTO_ABLK_HELPER_X86=m
CONFIG_CRYPTO_GLUE_HELPER_X86=m

#
# Authenticated Encryption with Associated Data
#
# CONFIG_CRYPTO_CCM is not set
# CONFIG_CRYPTO_GCM is not set
# CONFIG_CRYPTO_SEQIV is not set

#
# Block modes
#
CONFIG_CRYPTO_CBC=y
# CONFIG_CRYPTO_CTR is not set
# CONFIG_CRYPTO_CTS is not set
CONFIG_CRYPTO_ECB=y
CONFIG_CRYPTO_LRW=m
# CONFIG_CRYPTO_PCBC is not set
CONFIG_CRYPTO_XTS=m

#
# Hash modes
#
# CONFIG_CRYPTO_CMAC is not set
CONFIG_CRYPTO_HMAC=y
# CONFIG_CRYPTO_XCBC is not set
# CONFIG_CRYPTO_VMAC is not set

#
# Digest
#
CONFIG_CRYPTO_CRC32C=y
CONFIG_CRYPTO_CRC32C_INTEL=y
# CONFIG_CRYPTO_CRC32 is not set
# CONFIG_CRYPTO_CRC32_PCLMUL is not set
# CONFIG_CRYPTO_GHASH is not set
# CONFIG_CRYPTO_MD4 is not set
CONFIG_CRYPTO_MD5=y
# CONFIG_CRYPTO_MICHAEL_MIC is not set
# CONFIG_CRYPTO_RMD128 is not set
# CONFIG_CRYPTO_RMD160 is not set
# CONFIG_CRYPTO_RMD256 is not set
# CONFIG_CRYPTO_RMD320 is not set
CONFIG_CRYPTO_SHA1=y
# CONFIG_CRYPTO_SHA1_SSSE3 is not set
# CONFIG_CRYPTO_SHA256_SSSE3 is not set
# CONFIG_CRYPTO_SHA512_SSSE3 is not set
CONFIG_CRYPTO_SHA256=y
CONFIG_CRYPTO_SHA512=y
# CONFIG_CRYPTO_TGR192 is not set
# CONFIG_CRYPTO_WP512 is not set
CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=m

#
# Ciphers
#
CONFIG_CRYPTO_AES=y
CONFIG_CRYPTO_AES_X86_64=m
CONFIG_CRYPTO_AES_NI_INTEL=m
# CONFIG_CRYPTO_ANUBIS is not set
CONFIG_CRYPTO_ARC4=m
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_BLOWFISH_X86_64 is not set
# CONFIG_CRYPTO_CAMELLIA is not set
# CONFIG_CRYPTO_CAMELLIA_X86_64 is not set
# CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64 is not set
# CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64 is not set
# CONFIG_CRYPTO_CAST5 is not set
# CONFIG_CRYPTO_CAST5_AVX_X86_64 is not set
# CONFIG_CRYPTO_CAST6 is not set
# CONFIG_CRYPTO_CAST6_AVX_X86_64 is not set
# CONFIG_CRYPTO_DES is not set
# CONFIG_CRYPTO_FCRYPT is not set
# CONFIG_CRYPTO_KHAZAD is not set
# CONFIG_CRYPTO_SALSA20 is not set
# CONFIG_CRYPTO_SALSA20_X86_64 is not set
# CONFIG_CRYPTO_SEED is not set
# CONFIG_CRYPTO_SERPENT is not set
# CONFIG_CRYPTO_SERPENT_SSE2_X86_64 is not set
# CONFIG_CRYPTO_SERPENT_AVX_X86_64 is not set
# CONFIG_CRYPTO_SERPENT_AVX2_X86_64 is not set
# CONFIG_CRYPTO_TEA is not set
# CONFIG_CRYPTO_TWOFISH is not set
# CONFIG_CRYPTO_TWOFISH_X86_64 is not set
# CONFIG_CRYPTO_TWOFISH_X86_64_3WAY is not set
# CONFIG_CRYPTO_TWOFISH_AVX_X86_64 is not set

#
# Compression
#
# CONFIG_CRYPTO_DEFLATE is not set
# CONFIG_CRYPTO_ZLIB is not set
CONFIG_CRYPTO_LZO=y
# CONFIG_CRYPTO_LZ4 is not set
# CONFIG_CRYPTO_LZ4HC is not set

#
# Random Number Generation
#
# CONFIG_CRYPTO_ANSI_CPRNG is not set
# CONFIG_CRYPTO_USER_API_HASH is not set
# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
CONFIG_CRYPTO_HW=y
CONFIG_CRYPTO_DEV_PADLOCK=y
# CONFIG_CRYPTO_DEV_PADLOCK_AES is not set
# CONFIG_CRYPTO_DEV_PADLOCK_SHA is not set
CONFIG_ASYMMETRIC_KEY_TYPE=y
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
CONFIG_PUBLIC_KEY_ALGO_RSA=y
CONFIG_X509_CERTIFICATE_PARSER=y
CONFIG_HAVE_KVM=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_IRQ_ROUTING=y
CONFIG_HAVE_KVM_EVENTFD=y
CONFIG_KVM_APIC_ARCHITECTURE=y
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
CONFIG_HAVE_KVM_MSI=y
CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=m
CONFIG_KVM_INTEL=m
# CONFIG_KVM_AMD is not set
# CONFIG_KVM_MMU_AUDIT is not set
CONFIG_KVM_DEVICE_ASSIGNMENT=y
CONFIG_BINARY_PRINTF=y

#
# Library routines
#
CONFIG_RAID6_PQ=m
CONFIG_BITREVERSE=y
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GENERIC_NET_UTILS=y
CONFIG_GENERIC_FIND_FIRST_BIT=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_IO=y
CONFIG_PERCPU_RWSEM=y
CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
CONFIG_CMPXCHG_LOCKREF=y
# CONFIG_CRC_CCITT is not set
CONFIG_CRC16=y
CONFIG_CRC_T10DIF=y
CONFIG_CRC_ITU_T=m
CONFIG_CRC32=y
# CONFIG_CRC32_SELFTEST is not set
CONFIG_CRC32_SLICEBY8=y
# CONFIG_CRC32_SLICEBY4 is not set
# CONFIG_CRC32_SARWATE is not set
# CONFIG_CRC32_BIT is not set
# CONFIG_CRC7 is not set
CONFIG_LIBCRC32C=m
# CONFIG_CRC8 is not set
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=m
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_XZ_DEC=y
CONFIG_XZ_DEC_X86=y
CONFIG_XZ_DEC_POWERPC=y
CONFIG_XZ_DEC_IA64=y
CONFIG_XZ_DEC_ARM=y
CONFIG_XZ_DEC_ARMTHUMB=y
CONFIG_XZ_DEC_SPARC=y
CONFIG_XZ_DEC_BCJ=y
# CONFIG_XZ_DEC_TEST is not set
CONFIG_DECOMPRESS_GZIP=y
CONFIG_DECOMPRESS_BZIP2=y
CONFIG_DECOMPRESS_LZMA=y
CONFIG_DECOMPRESS_XZ=y
CONFIG_DECOMPRESS_LZO=y
CONFIG_GENERIC_ALLOCATOR=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_CPU_RMAP=y
CONFIG_DQL=y
CONFIG_NLATTR=y
CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
CONFIG_AVERAGE=y
CONFIG_CLZ_TAB=y
# CONFIG_CORDIC is not set
CONFIG_DDR=y
CONFIG_MPILIB=y
CONFIG_SIGNATURE=y
CONFIG_OID_REGISTRY=y
CONFIG_UCS2_STRING=y
CONFIG_FONT_SUPPORT=y
# CONFIG_FONTS is not set
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 16:37                             ` Sedat Dilek
@ 2013-08-30 16:52                               ` Linus Torvalds
  2013-08-30 17:11                                 ` Sedat Dilek
  2013-09-01 10:01                                 ` Sedat Dilek
  0 siblings, 2 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-08-30 16:52 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Fri, Aug 30, 2013 at 9:37 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> Where is this a.out file from or how to generate it?

Oh, that's just the silly threaded test-binary. I don't know what you
called it.

As to your config options, yesh, you have some expensive stuff.
DEBUG_OBJECTS and DEBUG_MUTEXES in particular tend to cause lots of
horrible performance issues. I didn't check if there might be other
things..

                Linusc

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 16:52                               ` Linus Torvalds
@ 2013-08-30 17:11                                 ` Sedat Dilek
  2013-08-30 17:26                                   ` Linus Torvalds
  2013-09-01 10:01                                 ` Sedat Dilek
  1 sibling, 1 reply; 151+ messages in thread
From: Sedat Dilek @ 2013-08-30 17:11 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Fri, Aug 30, 2013 at 6:52 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Fri, Aug 30, 2013 at 9:37 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>
>> Where is this a.out file from or how to generate it?
>
> Oh, that's just the silly threaded test-binary. I don't know what you
> called it.
>
> As to your config options, yesh, you have some expensive stuff.
> DEBUG_OBJECTS and DEBUG_MUTEXES in particular tend to cause lots of
> horrible performance issues. I didn't check if there might be other
> things..
>

There is no -f option for record but for report, so I swapped them:

$ sudo ~/src/linux-kernel/linux/tools/perf/perf record -e cycles:pp
./scripts/t_lockref_from-linus
Total loops: 2240273
[ perf record: Woken up 25 times to write data ]
[ perf record: Captured and wrote 6.080 MB perf.data (~265641 samples) ]

$ sudo ~/src/linux-kernel/linux/tools/perf/perf report -f

Samples: 159K of event 'cycles:pp', Event count (approx.): 76535356682
 84,10%  t_lockref_from-  [kernel.kallsyms]     [k] check_poison_obj
  5,22%  t_lockref_from-  [kernel.kallsyms]     [k] memset
  1,15%  t_lockref_from-  [kernel.kallsyms]     [k] irq_return
  0,45%  t_lockref_from-  [kernel.kallsyms]     [k] kmem_cache_alloc
  0,44%  t_lockref_from-  [kernel.kallsyms]     [k] kmem_cache_free
  0,36%  t_lockref_from-  [kernel.kallsyms]     [k] __ticket_spin_lock
  0,35%  t_lockref_from-  [kernel.kallsyms]     [k] cache_free_debugcheck
  0,35%  t_lockref_from-  [kernel.kallsyms]     [k] __acct_update_integrals
  0,34%  t_lockref_from-  [kernel.kallsyms]     [k] user_exit
  0,33%  t_lockref_from-  [kernel.kallsyms]     [k] __d_lookup_rcu
  0,26%  t_lockref_from-  libc-2.15.so          [.] __xstat64
  0,25%  t_lockref_from-  [kernel.kallsyms]     [k] poison_obj
  0,24%  t_lockref_from-  [kernel.kallsyms]     [k] local_clock
  0,19%  t_lockref_from-  [kernel.kallsyms]     [k] lockref_get_or_lock
  0,19%  t_lockref_from-  [kernel.kallsyms]     [k] link_path_walk
  0,19%  t_lockref_from-  [kernel.kallsyms]     [k] rcu_eqs_enter_common.isra.43
  0,19%  t_lockref_from-  [kernel.kallsyms]     [k] rcu_eqs_exit_common.isra.41
  0,17%  t_lockref_from-  [kernel.kallsyms]     [k] native_read_tsc
  0,17%  t_lockref_from-  [kernel.kallsyms]     [k] user_enter
  0,16%  t_lockref_from-  [kernel.kallsyms]     [k] sched_clock_cpu
  0,16%  t_lockref_from-  [kernel.kallsyms]     [k] path_lookupat
  0,14%  t_lockref_from-  [kernel.kallsyms]     [k] vfs_getattr
  0,14%  t_lockref_from-  [kernel.kallsyms]     [k] lockref_put_or_lock
  0,14%  t_lockref_from-  [kernel.kallsyms]     [k] path_init
  0,13%  t_lockref_from-  [kernel.kallsyms]     [k] tracesys
  0,13%  t_lockref_from-  [kernel.kallsyms]     [k] native_sched_clock
  0,13%  t_lockref_from-  [kernel.kallsyms]     [k] strncpy_from_user
  0,12%  t_lockref_from-  [kernel.kallsyms]     [k] cp_new_stat
  0,12%  t_lockref_from-  [kernel.kallsyms]     [k]
cache_alloc_debugcheck_after.isra.61
  0,12%  t_lockref_from-  [kernel.kallsyms]     [k] account_system_time
  0,12%  t_lockref_from-  [kernel.kallsyms]     [k] copy_user_generic_unrolled
  0,12%  t_lockref_from-  [kernel.kallsyms]     [k] syscall_trace_enter
  0,12%  t_lockref_from-  [kernel.kallsyms]     [k] jiffies_to_timeval
  0,11%  t_lockref_from-  [kernel.kallsyms]     [k] get_vtime_delta
  0,11%  t_lockref_from-  t_lockref_from-linus  [.] __stat
  0,10%  t_lockref_from-  [kernel.kallsyms]     [k] check_irq_off
  0,10%  t_lockref_from-  [kernel.kallsyms]     [k] common_perm
  0,10%  t_lockref_from-  [kernel.kallsyms]     [k] lookup_fast
  0,09%  t_lockref_from-  [kernel.kallsyms]     [k] getname_flags
  0,09%  t_lockref_from-  [kernel.kallsyms]     [k] syscall_trace_leave
  0,08%  t_lockref_from-  t_lockref_from-linus  [.] start_routine
  0,08%  t_lockref_from-  [kernel.kallsyms]     [k] vfs_fstatat
  0,08%  t_lockref_from-  [kernel.kallsyms]     [k] system_call_after_swapgs
  0,08%  t_lockref_from-  [kernel.kallsyms]     [k] user_path_at_empty
  0,08%  t_lockref_from-  [kernel.kallsyms]     [k] account_user_time
  0,07%  t_lockref_from-  [kernel.kallsyms]     [k] generic_fillattr
  0,07%  t_lockref_from-  [kernel.kallsyms]     [k] complete_walk
  0,06%  t_lockref_from-  [kernel.kallsyms]     [k] security_inode_getattr
  0,06%  t_lockref_from-  [kernel.kallsyms]     [k] _raw_spin_lock
  0,06%  t_lockref_from-  [kernel.kallsyms]     [k] rcu_eqs_exit
  0,06%  t_lockref_from-  [kernel.kallsyms]     [k] vtime_account_user
  0,06%  t_lockref_from-  [kernel.kallsyms]     [k] dput
  0,06%  t_lockref_from-  [kernel.kallsyms]     [k] rcu_eqs_enter
  0,06%  t_lockref_from-  [kernel.kallsyms]     [k] __virt_addr_valid

- Sedat -

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-29 16:43         ` Linus Torvalds
  2013-08-29 19:25           ` Linus Torvalds
@ 2013-08-30 17:17           ` Peter Zijlstra
  2013-08-30 17:28             ` Linus Torvalds
  1 sibling, 1 reply; 151+ messages in thread
From: Peter Zijlstra @ 2013-08-30 17:17 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ingo Molnar, Benjamin Herrenschmidt, Waiman Long, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Thu, Aug 29, 2013 at 09:43:07AM -0700, Linus Torvalds wrote:

> We'll see. The real problem is that I'm not sure if I can even see the
> scalability issue on any machine I actually personally want to use
> (read: silent). On my current  system I can only get up to 15%
> _raw_spin_lock by just stat'ing the same file over and over and over
> again from lots of threads.

Yeah, silent basically limits you to i7 single socket systems and sadly
Intel doesn't seem to want to make those with more than 4 cores on :/

I've got a i7-K part (SNB iirc) with a _huge_ scythe cooler and a high
efficiency fanless PSU for a system that's near noiseless -- as in my
Thinkpad actually makes more noise.

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 17:11                                 ` Sedat Dilek
@ 2013-08-30 17:26                                   ` Linus Torvalds
  0 siblings, 0 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-08-30 17:26 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Fri, Aug 30, 2013 at 10:11 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> There is no -f option for record but for report, so I swapped them:

That's odd. "perf record -f" very much works for me, and I use it all
the time to make sure that I don't mix perf data from older runs..

[ Time passes. I check current 'perf'. Dammit. This has changed. I
seldom rebuild "perf", so I never noticed. It was removed in commit
4a4d371a4dfb, apparently because the old "append" mode no longer even
exists ]

But never mind, that doesn't matter for your numbers:

> $ sudo ~/src/linux-kernel/linux/tools/perf/perf report -f
>
> Samples: 159K of event 'cycles:pp', Event count (approx.): 76535356682
>  84,10%  t_lockref_from-  [kernel.kallsyms]     [k] check_poison_obj
>   5,22%  t_lockref_from-  [kernel.kallsyms]     [k] memset
>   1,15%  t_lockref_from-  [kernel.kallsyms]     [k] irq_return
>   0,45%  t_lockref_from-  [kernel.kallsyms]     [k] kmem_cache_alloc
>   0,44%  t_lockref_from-  [kernel.kallsyms]     [k] kmem_cache_free

You're wasting all the time in slab debugging, probably due to the
object debug option.

None of the rest is even remotely interesting, and the spinlock hits
you do have are more likely to come from the same object debug code
than from pathname lookup.

                Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 17:17           ` Peter Zijlstra
@ 2013-08-30 17:28             ` Linus Torvalds
  2013-08-30 17:33               ` Linus Torvalds
  0 siblings, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-08-30 17:28 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ingo Molnar, Benjamin Herrenschmidt, Waiman Long, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Fri, Aug 30, 2013 at 10:17 AM, Peter Zijlstra <peterz@infradead.org> wrote:
>
> Yeah, silent basically limits you to i7 single socket systems and sadly
> Intel doesn't seem to want to make those with more than 4 cores on :/

Yup. And even if they had more cores in a single socket, the real
scalability issues won't happen until you start crossing sockets and
serialization slows down by a big amount due to cachelines moving
outside the die.

> I've got a i7-K part (SNB iirc) with a _huge_ scythe cooler and a high
> efficiency fanless PSU for a system that's near noiseless -- as in my
> Thinkpad actually makes more noise.

I've got a 4770S on order, it should arrive tomorrow. It's the 65W
part, and it has TSX. But no, I doubt I'll see any real scalability
issues with it, but at least I can test any TSX codepaths.

                  Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 17:28             ` Linus Torvalds
@ 2013-08-30 17:33               ` Linus Torvalds
  0 siblings, 0 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-08-30 17:33 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ingo Molnar, Benjamin Herrenschmidt, Waiman Long, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Fri, Aug 30, 2013 at 10:28 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> I've got a 4770S on order, it should arrive tomorrow. It's the 65W
> part, and it has TSX. But no, I doubt I'll see any real scalability
> issues with it, but at least I can test any TSX codepaths.

Side note: whatever marketing person inside Intel that decided that
the "K" parts shouldn't get TSX-NI support should be fired. Or at
least have a stern talking to (and by "stern" I obviously mean that
thumbscrews and hot pins under their nails should be involved).

If I wanted to build a peak performance machine (rather than a silent
one), I wouldn't have had TSX. What the hell is wrong with Intel
marketing? Their "lets fragment things" crap is making it harder to
actually support their new technologies.

                Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30  3:54                 ` Linus Torvalds
  2013-08-30  7:55                   ` Sedat Dilek
@ 2013-08-30 18:33                   ` Waiman Long
  2013-08-30 18:53                     ` Linus Torvalds
  1 sibling, 1 reply; 151+ messages in thread
From: Waiman Long @ 2013-08-30 18:33 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On 08/29/2013 11:54 PM, Linus Torvalds wrote:
> On Thu, Aug 29, 2013 at 8:12 PM, Waiman Long<waiman.long@hp.com>  wrote:
>> On 08/29/2013 07:42 PM, Linus Torvalds wrote:
>>> Waiman? Mind looking at this and testing? Linus
>> Sure, I will try out the patch tomorrow morning and see how it works out for
>> my test case.
> Ok, thanks, please use this slightly updated pCMPXCHG_LOOPatch attached here.
>
>

I tested your patch on a 2-socket (12 cores, 24 threads) DL380 with 
2.9GHz Westmere-EX CPUs, the test results of your test program (max 
threads increased to 24 to match the thread count) were:

with patch = 68M
w/o patch = 12M

So it was an almost 6X improvement. I think that is really good. A 
dual-socket machine, these days, shouldn't be considered as a "BIG" 
machine. They are pretty common in different organizations.

I have reviewed the patch, and it looks good to me with the exception 
that I added a cpu_relax() call at the end of while loop in the 
CMPXCHG_LOOP macro.

I also got the perf data of the test runs with and without the patch.

With patch:

  29.24%    a.out  [kernel.kallsyms]    [k] lockref_get_or_lock
  19.65%    a.out  [kernel.kallsyms]    [k] lockref_put_or_lock
  14.11%    a.out  [kernel.kallsyms]    [k] dput
   5.37%    a.out  [kernel.kallsyms]    [k] __d_lookup_rcu
   5.29%    a.out  [kernel.kallsyms]    [k] lg_local_lock
   4.59%    a.out  [kernel.kallsyms]    [k] d_rcu_to_refcount
     :
   0.13%    a.out  [kernel.kallsyms]    [k] complete_walk
     :
   0.01%    a.out  [kernel.kallsyms]    [k] _raw_spin_lock

Without patch:

  93.50%    a.out  [kernel.kallsyms]    [k] _raw_spin_lock
   0.96%    a.out  [kernel.kallsyms]    [k] dput
   0.80%    a.out  [kernel.kallsyms]    [k] kmem_cache_free
   0.75%    a.out  [kernel.kallsyms]    [k] lg_local_lock
   0.48%    a.out  [kernel.kallsyms]    [k] complete_walk
   0.45%    a.out  [kernel.kallsyms]    [k] __d_lookup_rcu

For the other test cases that I am interested in, like the AIM7 
benchmark, your patch may not be as good as my original one. I got 1-3M 
JPM (varied quite a lot in different runs) in the short workloads on a 
80-core system. My original one got 6M JPM. However, the test was done 
on 3.10 based kernel. So I need to do more test to see if that has an 
effect on the JPM results.

Anyway, I think this patch is good performance-wise. I remembered that 
awhile ago that an internal reported a lock contention problem in dentry 
involving probably complete_walk(). This patch will certainly help for 
that case.

I will do more investigation to see how to make this patch work better 
for my test cases.

Thank for taking the effort in optimizing the complete_walk() and 
unlazy_walk() function that are not in my original patch. That will make 
the patch work even better under more circumstances. I really appreciate 
that.

Best regards,
Longman

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 16:12                           ` Steven Rostedt
  2013-08-30 16:16                             ` Sedat Dilek
@ 2013-08-30 18:42                             ` Linus Torvalds
  1 sibling, 0 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-08-30 18:42 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Sedat Dilek, Waiman Long, Ingo Molnar, Benjamin Herrenschmidt,
	Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Peter Zijlstra, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Fri, Aug 30, 2013 at 9:12 AM, Steven Rostedt <rostedt@goodmis.org> wrote:
>
> Now I know this isn't going to be popular, but I'll suggest it anyway.
> What about only implementing the lockref locking when CPUs are greater
> than 7, 7 or less will still use the normal optimized spinlocks.

I considered it. It's not hugely difficult to do, in that we could
make it a static key thing, but I'd actually rather make it depend on
some actual user-settable thing than on some arbitrary number of
cpu's.

See the CMPXCHG_LOOP() macro in lib/lockref.c: it would be easy to
just enclose the whole thing in a

    if (static_key_enabled(&cmpxchg_lockref)) { .. }

and then it could be enabled/disabled at will with very little
performance downside. And I don't think it's necessarily a bad idea.
The code has a very natural "fall back to spinlock" model.

THAT SAID.

Even though uncontended spinlocks are faster than a cmpxchg, under any
real normal load I don't think you can necessarily measure the
difference. Remember: this particular benchmark does absolutely
*nothing* but pathname lookups, and even then it's pretty close to
noise. And the biggest disadvantage of cmpxchg - the fact that you
have to read the cache line before you do the r-m-w cycle, and thus
might have an extra cache coherency cycle - shouldn't be an issue for
the dentry use when you don't try to hit the same dentry over and over
again, because the code has already read the dentry hash etc.

So I'm not sure it's really worth it. It might be interesting to try
that static_key approach simply for benchmarking, though. That way you
could benchmark the exact same boot with pretty much the exact same
dentry population, just switch the static key around and run a few
path-intensive benchmarks.

If anybody is willing to write the patch and do the benchmarking (I
would suggest *not* using my idiotic test-program for this), and then
send it to me with numbers, that would be interesting...

                   Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 18:33                   ` Waiman Long
@ 2013-08-30 18:53                     ` Linus Torvalds
  2013-08-30 19:20                       ` Waiman Long
  0 siblings, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-08-30 18:53 UTC (permalink / raw)
  To: Waiman Long
  Cc: Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Fri, Aug 30, 2013 at 11:33 AM, Waiman Long <waiman.long@hp.com> wrote:
>
> I tested your patch on a 2-socket (12 cores, 24 threads) DL380 with 2.9GHz
> Westmere-EX CPUs, the test results of your test program (max threads
> increased to 24 to match the thread count) were:
>
> with patch = 68M
> w/o patch = 12M

Ok, that's certainly noticeable.

> I have reviewed the patch, and it looks good to me with the exception that I
> added a cpu_relax() call at the end of while loop in the CMPXCHG_LOOP macro.

Yeah, that's probably a good idea.

> I also got the perf data of the test runs with and without the patch.

So the perf data would be *much* more interesting for a more varied
load. I know pretty much exactly what happens with my silly
test-program, and as you can see it never really gets to the actual
spinlock, because that test program will only ever hit the fast-path
case.

It would be much more interesting to see another load that may trigger
the d_lock actually being taken. So:

> For the other test cases that I am interested in, like the AIM7 benchmark,
> your patch may not be as good as my original one. I got 1-3M JPM (varied
> quite a lot in different runs) in the short workloads on a 80-core system.
> My original one got 6M JPM. However, the test was done on 3.10 based kernel.
> So I need to do more test to see if that has an effect on the JPM results.

I'd really like to see a perf profile of that, particularly with some
call chain data for the relevant functions (ie "what it is that causes
us to get to spinlocks"). Because it may well be that you're hitting
some of the cases that I didn't see, and thus didn't notice.

In particular, I suspect AIM7 actually creates/deletes files and/or
renames them too. Or maybe I screwed up the dget_parent() special case
thing, which mattered because AIM7 did a lot of getcwd() calls or
someting odd like that.

                Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 18:53                     ` Linus Torvalds
@ 2013-08-30 19:20                       ` Waiman Long
  2013-08-30 19:33                         ` Linus Torvalds
  2013-08-30 19:40                         ` Al Viro
  0 siblings, 2 replies; 151+ messages in thread
From: Waiman Long @ 2013-08-30 19:20 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On 08/30/2013 02:53 PM, Linus Torvalds wrote:
> So the perf data would be *much* more interesting for a more varied 
> load. I know pretty much exactly what happens with my silly 
> test-program, and as you can see it never really gets to the actual 
> spinlock, because that test program will only ever hit the fast-path 
> case. It would be much more interesting to see another load that may 
> trigger the d_lock actually being taken. So:
>> For the other test cases that I am interested in, like the AIM7 benchmark,
>> your patch may not be as good as my original one. I got 1-3M JPM (varied
>> quite a lot in different runs) in the short workloads on a 80-core system.
>> My original one got 6M JPM. However, the test was done on 3.10 based kernel.
>> So I need to do more test to see if that has an effect on the JPM results.
> I'd really like to see a perf profile of that, particularly with some
> call chain data for the relevant functions (ie "what it is that causes
> us to get to spinlocks"). Because it may well be that you're hitting
> some of the cases that I didn't see, and thus didn't notice.
>
> In particular, I suspect AIM7 actually creates/deletes files and/or
> renames them too. Or maybe I screwed up the dget_parent() special case
> thing, which mattered because AIM7 did a lot of getcwd() calls or
> someting odd like that.
>
>                  Linus

Below is the perf data of my short workloads run in an 80-core DL980:

     13.60%            reaim  [kernel.kallsyms]        [k] 
_raw_spin_lock_irqsave
                          |--48.79%-- tty_ldisc_try
                          |--48.58%-- tty_ldisc_deref
                           --2.63%-- [...]

     11.31%          swapper  [kernel.kallsyms]        [k] intel_idle
                        |--99.94%-- cpuidle_enter_state
                         --0.06%-- [...]

      4.86%            reaim  [kernel.kallsyms]        [k] lg_local_lock
                          |--59.41%-- mntput_no_expire
                          |--19.37%-- path_init
                          |--15.14%-- d_path
                          |--5.88%-- sys_getcwd
                           --0.21%-- [...]

      3.00%            reaim  reaim                    [.] mul_short

      2.41%            reaim  reaim                    [.] mul_long
                          |--87.21%-- 0xbc614e
                           --12.79%-- (nil)

      2.29%            reaim  reaim                    [.] mul_int

      2.20%            reaim  [kernel.kallsyms]        [k] _raw_spin_lock
                          |--12.81%-- prepend_path
                          |--9.90%-- lockref_put_or_lock
                          |--9.62%-- __rcu_process_callbacks
                          |--8.77%-- load_balance
                          |--6.40%-- lockref_get
                          |--5.55%-- __mutex_lock_slowpath
                          |--4.85%-- __mutex_unlock_slowpath
                          |--4.83%-- inet_twsk_schedule
                          |--4.27%-- lockref_get_or_lock
                          |--2.19%-- task_rq_lock
                          |--2.13%-- sem_lock
                          |--2.09%-- scheduler_tick
                          |--1.88%-- try_to_wake_up
                          |--1.53%-- kmem_cache_free
                          |--1.30%-- unix_create1
                          |--1.22%-- unix_release_sock
                          |--1.21%-- process_backlog
                          |--1.11%-- unix_stream_sendmsg
                          |--1.03%-- enqueue_to_backlog
                          |--0.85%-- rcu_accelerate_cbs
                          |--0.79%-- unix_dgram_sendmsg
                          |--0.76%-- do_anonymous_page
                          |--0.70%-- unix_stream_recvmsg
                          |--0.69%-- unix_stream_connect
                          |--0.64%-- net_rx_action
                          |--0.61%-- tcp_v4_rcv
                          |--0.59%-- __do_fault
                          |--0.54%-- new_inode_pseudo
                          |--0.52%-- __d_lookup
                           --10.62%-- [...]

      1.19%            reaim  [kernel.kallsyms]        [k] mspin_lock
                          |--99.82%-- __mutex_lock_slowpath
                           --0.18%-- [...]

      1.01%            reaim  [kernel.kallsyms]        [k] lg_global_lock
                          |--51.62%-- __shmdt
                           --48.38%-- __shmctl

There are more contention in the lglock than I remember for the run in 
3.10. This is an area that I need to look at. In fact, lglock is 
becoming a problem for really large machine with a lot of cores. We have 
a prototype 16-socket machine with 240 cores under development. The cost 
of doing a lg_global_lock will be very high in that type of machine 
given that it is already high in this 80-core machine. I have been 
thinking about instead of per-cpu spinlocks, we could change the locking 
to per-node level. While there will be more contention for 
lg_local_lock, the cost of doing a lg_global_lock will be much lower and 
contention within the local die should not be too bad. That will require 
either a per-node variable infrastructure or simulated with the existing 
per-cpu subsystem.

I will also need to look at ways reduce the need of taking d_lock in 
existing code. One area that I am looking at is whether we can take out 
the lock/unlock pair in prepend_path(). This function can only be called 
with the rename_lock taken. So no filename change or deletion will be 
allowed. It will only be a problem if somehow the dentry itself got 
killed or dropped while the name is being copied out. The first dentry 
referenced by the path structure should have a non-zero reference count, 
so that shouldn't happen. I am not so sure about the parents of that 
dentry as I am not so familiar with that part of the filesystem code.

Regards,
Longman

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 19:20                       ` Waiman Long
@ 2013-08-30 19:33                         ` Linus Torvalds
  2013-08-30 20:15                           ` Waiman Long
  2013-08-30 19:40                         ` Al Viro
  1 sibling, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-08-30 19:33 UTC (permalink / raw)
  To: Waiman Long
  Cc: Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Fri, Aug 30, 2013 at 12:20 PM, Waiman Long <waiman.long@hp.com> wrote:
>
> Below is the perf data of my short workloads run in an 80-core DL980:

Ok, that doesn't look much like d_lock any more. Sure, there's a small
amount of spinlocking going on with lockref being involved, but on the
whole even that looks more like getcwd and other random things.

I do agree that getcwd() can probably be hugely optimized. Nobody has
ever bothered, because it's never really performance-critical, and I
think AIM7 ends up just doing something really odd. I bet we could fix
it entirely if we cared enough.

I just wonder if it's even worth it (I assume AIM7 is something HP
uses internally, because I've never really heard of anybody else
caring)

But I'll look at getcwd anyway.

                Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 19:20                       ` Waiman Long
  2013-08-30 19:33                         ` Linus Torvalds
@ 2013-08-30 19:40                         ` Al Viro
  2013-08-30 19:52                           ` Waiman Long
  1 sibling, 1 reply; 151+ messages in thread
From: Al Viro @ 2013-08-30 19:40 UTC (permalink / raw)
  To: Waiman Long
  Cc: Linus Torvalds, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Fri, Aug 30, 2013 at 03:20:48PM -0400, Waiman Long wrote:

> There are more contention in the lglock than I remember for the run
> in 3.10. This is an area that I need to look at. In fact, lglock is
> becoming a problem for really large machine with a lot of cores. We
> have a prototype 16-socket machine with 240 cores under development.
> The cost of doing a lg_global_lock will be very high in that type of
> machine given that it is already high in this 80-core machine. I
> have been thinking about instead of per-cpu spinlocks, we could
> change the locking to per-node level. While there will be more
> contention for lg_local_lock, the cost of doing a lg_global_lock
> will be much lower and contention within the local die should not be
> too bad. That will require either a per-node variable infrastructure
> or simulated with the existing per-cpu subsystem.

Speaking of lglock, there's a low-hanging fruit in that area: we have
no reason whatsoever to put anything but regular files with FMODE_WRITE
on the damn per-superblock list - the *only* thing it's used for is
mark_files_ro(), which will skip everything except those.  And since
read opens normally outnumber the writes quite a bit...  Could you
try the diff below and see if it changes the picture?  files_lglock
situation ought to get better...

diff --git a/fs/file_table.c b/fs/file_table.c
index b44e4c5..322cd37 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -385,6 +385,10 @@ static inline void __file_sb_list_add(struct file *file, struct super_block *sb)
  */
 void file_sb_list_add(struct file *file, struct super_block *sb)
 {
+	if (likely(!(file->f_mode & FMODE_WRITE)))
+		return;
+	if (!S_ISREG(file_inode(file)->i_mode))
+		return;
 	lg_local_lock(&files_lglock);
 	__file_sb_list_add(file, sb);
 	lg_local_unlock(&files_lglock);
@@ -450,8 +454,6 @@ void mark_files_ro(struct super_block *sb)
 
 	lg_global_lock(&files_lglock);
 	do_file_list_for_each_entry(sb, f) {
-		if (!S_ISREG(file_inode(f)->i_mode))
-		       continue;
 		if (!file_count(f))
 			continue;
 		if (!(f->f_mode & FMODE_WRITE))

^ permalink raw reply related	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 19:40                         ` Al Viro
@ 2013-08-30 19:52                           ` Waiman Long
  2013-08-30 20:26                             ` Al Viro
  0 siblings, 1 reply; 151+ messages in thread
From: Waiman Long @ 2013-08-30 19:52 UTC (permalink / raw)
  To: Al Viro
  Cc: Linus Torvalds, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On 08/30/2013 03:40 PM, Al Viro wrote:
> On Fri, Aug 30, 2013 at 03:20:48PM -0400, Waiman Long wrote:
>
>> There are more contention in the lglock than I remember for the run
>> in 3.10. This is an area that I need to look at. In fact, lglock is
>> becoming a problem for really large machine with a lot of cores. We
>> have a prototype 16-socket machine with 240 cores under development.
>> The cost of doing a lg_global_lock will be very high in that type of
>> machine given that it is already high in this 80-core machine. I
>> have been thinking about instead of per-cpu spinlocks, we could
>> change the locking to per-node level. While there will be more
>> contention for lg_local_lock, the cost of doing a lg_global_lock
>> will be much lower and contention within the local die should not be
>> too bad. That will require either a per-node variable infrastructure
>> or simulated with the existing per-cpu subsystem.
> Speaking of lglock, there's a low-hanging fruit in that area: we have
> no reason whatsoever to put anything but regular files with FMODE_WRITE
> on the damn per-superblock list - the *only* thing it's used for is
> mark_files_ro(), which will skip everything except those.  And since
> read opens normally outnumber the writes quite a bit...  Could you
> try the diff below and see if it changes the picture?  files_lglock
> situation ought to get better...
>
>

Sure. I will try that out, but it probably won't help too much in this 
test case. The perf profile that I sent out in my previous mail is only 
partial. The actual one for lg_global_lock was:

      1.01%            reaim  [kernel.kallsyms]        [k] lg_global_lock
                       |
                       --- lg_global_lock
                           mntput_no_expire
                           mntput
                           __fput
                           ____fput
                           task_work_run
                           do_notify_resume
                           int_signal
                          |
                          |--51.62%-- __shmdt
                          |
                           --48.38%-- __shmctl

So it is the mnput_no_expire() function that is doing all the 
lg_global_lock() calls.

Regards,
Longman

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 19:33                         ` Linus Torvalds
@ 2013-08-30 20:15                           ` Waiman Long
  2013-08-30 20:43                             ` Linus Torvalds
  0 siblings, 1 reply; 151+ messages in thread
From: Waiman Long @ 2013-08-30 20:15 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On 08/30/2013 03:33 PM, Linus Torvalds wrote:
> On Fri, Aug 30, 2013 at 12:20 PM, Waiman Long<waiman.long@hp.com>  wrote:
>> Below is the perf data of my short workloads run in an 80-core DL980:
> Ok, that doesn't look much like d_lock any more. Sure, there's a small
> amount of spinlocking going on with lockref being involved, but on the
> whole even that looks more like getcwd and other random things.

Yes, d_lock contention isn't a major one in the perf profile. However, 
sometimes a small improvement can lead to a noticeable improvement in 
performance.
> I do agree that getcwd() can probably be hugely optimized. Nobody has
> ever bothered, because it's never really performance-critical, and I
> think AIM7 ends up just doing something really odd. I bet we could fix
> it entirely if we cared enough.
The prepend_path() isn't all due to getcwd. The correct profile should be


|--12.81%-- prepend_path
                          |          |
                          |          |--67.35%-- d_path
                          |          |          |
                          |          |          |--60.72%-- 
proc_pid_readlink
                          |          |          |          sys_readlinkat
                          |          |          |          sys_readlink
                          |          |          |          
system_call_fastpath
                          |          |          |          __GI___readlink
                          |          |          |          0x302f64662f666c
                          |          |          |
                          |          |           --39.28%-- 
perf_event_mmap_event
                          |          |
                          |           --32.65%-- sys_getcwd
                          |                     system_call_fastpath
                          |                     __getcwd

Yes, the perf subsystem itself can contribute a sizeable portion of the 
spinlock contention. In fact, I have also applied my seqlock patch that 
was sent a while ago to the test kernel in order to get a more accurate 
perf profile. The seqlock patch will allow concurrent d_path() calls 
without one blocking the others. In the 240-core prototype machine, it 
was not possible to get an accurate perf profile for some workloads 
because more than 50% of the time was spent in spinlock contention due 
to the use of perf. An accurate perf profile can only be obtained in 
those cases by applying my lockref and seqlock patches. I hope someone 
will have the time to review my seqlock patch to see what additional 
changes will be needed. I really like to see it merged in some form to 
3.12.

> I just wonder if it's even worth it (I assume AIM7 is something HP
> uses internally, because I've never really heard of anybody else
> caring)

Our performance group is actually pretty new. It was formed 2 years ago 
and we began actively participating in the Linux kernel development just 
in the past year.

We use the AIM7 benchmark internally primarily because it is easy to run 
and cover quite a lot of different areas in the kernel. We are also 
using specJBB and SwingBench for performance benchmarking problem. We 
are also trying to look for more benchmarks to use in the future.

Regards,
Longman

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 19:52                           ` Waiman Long
@ 2013-08-30 20:26                             ` Al Viro
  2013-08-30 20:35                               ` Waiman Long
  0 siblings, 1 reply; 151+ messages in thread
From: Al Viro @ 2013-08-30 20:26 UTC (permalink / raw)
  To: Waiman Long
  Cc: Linus Torvalds, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Fri, Aug 30, 2013 at 03:52:49PM -0400, Waiman Long wrote:

> So it is the mnput_no_expire() function that is doing all the
> lg_global_lock() calls.

Interesting...  So you are getting a lot of mntput() with ->mnt_ns being
NULL?  I wonder which type it is...  Note that anything mounted will
have non-NULL ->mnt_ns until umount and anything obtained via
kern_mount/kern_mount_data will also have a non-NULL ->mnt_ns - until
kern_unmount().

Could you try to gather stats of that sort?  Normally that path should
be only hit by fput() when we have a lazy-unmounted fs and close an opened
file on it...

I see one potential stupidity in that area (simple_pin_fs() ought to set
->mnt_ns, with simple_release_fs() clearing it), but there's not a lot
of fs types that would use the damn thing...

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 20:26                             ` Al Viro
@ 2013-08-30 20:35                               ` Waiman Long
  2013-08-30 20:48                                 ` Al Viro
  0 siblings, 1 reply; 151+ messages in thread
From: Waiman Long @ 2013-08-30 20:35 UTC (permalink / raw)
  To: Al Viro
  Cc: Linus Torvalds, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On 08/30/2013 04:26 PM, Al Viro wrote:
> On Fri, Aug 30, 2013 at 03:52:49PM -0400, Waiman Long wrote:
>
>> So it is the mnput_no_expire() function that is doing all the
>> lg_global_lock() calls.
> Interesting...  So you are getting a lot of mntput() with ->mnt_ns being
> NULL?  I wonder which type it is...  Note that anything mounted will
> have non-NULL ->mnt_ns until umount and anything obtained via
> kern_mount/kern_mount_data will also have a non-NULL ->mnt_ns - until
> kern_unmount().
>
> Could you try to gather stats of that sort?  Normally that path should
> be only hit by fput() when we have a lazy-unmounted fs and close an opened
> file on it...
>
> I see one potential stupidity in that area (simple_pin_fs() ought to set
> ->mnt_ns, with simple_release_fs() clearing it), but there's not a lot
> of fs types that would use the damn thing...

The AIM7 test was run on a set of 16 ramdisk formated with ext3 
filesystem with the following mount options: 
barrier=0,async,noatime,nodiratime. Maybe that is a factor.

Regards,
Longman

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 20:15                           ` Waiman Long
@ 2013-08-30 20:43                             ` Linus Torvalds
  2013-08-30 20:54                               ` Al Viro
  0 siblings, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-08-30 20:43 UTC (permalink / raw)
  To: Waiman Long
  Cc: Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Fri, Aug 30, 2013 at 1:15 PM, Waiman Long <waiman.long@hp.com> wrote:
>
> The prepend_path() isn't all due to getcwd. The correct profile should be

Ugh. I really think that prepend_path() should just be rewritten to
run entirely under RCU.

Then we can remove *all* the stupid locking, and replace it with doing
a read-lock on the rename sequence count, and repeating if requited.

That shouldn't even be hard to do, it just requires mindless massaging
and being careful.

             Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 20:35                               ` Waiman Long
@ 2013-08-30 20:48                                 ` Al Viro
  2013-08-31  2:02                                   ` Waiman Long
  0 siblings, 1 reply; 151+ messages in thread
From: Al Viro @ 2013-08-30 20:48 UTC (permalink / raw)
  To: Waiman Long
  Cc: Linus Torvalds, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Fri, Aug 30, 2013 at 04:35:49PM -0400, Waiman Long wrote:

> The AIM7 test was run on a set of 16 ramdisk formated with ext3
> filesystem with the following mount options:
> barrier=0,async,noatime,nodiratime. Maybe that is a factor.

I would be really surprised if it was...  Could you slap the following
into __fput():

	struct mount *m = real_mount(mnt);
	if (unlikely(!m->mnt_ns)) {
		printk(KERN_INFO "type = %s",
			mnt->mnt_sb->s_type->name);
		WARN_ON(1);
	}
and see what it catches?  That'll need #include "fs/mount.h" in
fs/file_table.c to compile...

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 20:43                             ` Linus Torvalds
@ 2013-08-30 20:54                               ` Al Viro
  2013-08-30 21:03                                 ` Linus Torvalds
  2013-08-30 21:10                                 ` Waiman Long
  0 siblings, 2 replies; 151+ messages in thread
From: Al Viro @ 2013-08-30 20:54 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Fri, Aug 30, 2013 at 01:43:11PM -0700, Linus Torvalds wrote:
> On Fri, Aug 30, 2013 at 1:15 PM, Waiman Long <waiman.long@hp.com> wrote:
> >
> > The prepend_path() isn't all due to getcwd. The correct profile should be
> 
> Ugh. I really think that prepend_path() should just be rewritten to
> run entirely under RCU.
> 
> Then we can remove *all* the stupid locking, and replace it with doing
> a read-lock on the rename sequence count, and repeating if requited.
> 
> That shouldn't even be hard to do, it just requires mindless massaging
> and being careful.

Not really.  Sure, you'll retry it if you race with d_move(); that's not
the real problem - access past the end of the object containing ->d_name.name
would screw you and that's what ->d_lock is preventing there.  Delayed freeing
of what ->d_name is pointing into is fine, but it's not the only way to get
hurt there...

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 20:54                               ` Al Viro
@ 2013-08-30 21:03                                 ` Linus Torvalds
  2013-08-30 21:44                                   ` Al Viro
  2013-08-30 21:10                                 ` Waiman Long
  1 sibling, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-08-30 21:03 UTC (permalink / raw)
  To: Al Viro
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Fri, Aug 30, 2013 at 1:54 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> Not really.  Sure, you'll retry it if you race with d_move(); that's not
> the real problem - access past the end of the object containing ->d_name.name
> would screw you and that's what ->d_lock is preventing there.  Delayed freeing
> of what ->d_name is pointing into is fine, but it's not the only way to get
> hurt there...

Umm? We follow d->d_name.name without d_lock under RCU all the time -
that's what the pathname lookup is all about, after all.

Yes, yes, you haev to be careful and cannot just blindly trust the
length: you also have to check for NUL character as you are copying it
and stop if you hit it. But that's trivial.

Why would d_prepend be any different?

            Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 20:54                               ` Al Viro
  2013-08-30 21:03                                 ` Linus Torvalds
@ 2013-08-30 21:10                                 ` Waiman Long
  2013-08-30 21:22                                   ` Linus Torvalds
  2013-08-30 21:30                                   ` Al Viro
  1 sibling, 2 replies; 151+ messages in thread
From: Waiman Long @ 2013-08-30 21:10 UTC (permalink / raw)
  To: Al Viro
  Cc: Linus Torvalds, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On 08/30/2013 04:54 PM, Al Viro wrote:
> On Fri, Aug 30, 2013 at 01:43:11PM -0700, Linus Torvalds wrote:
>> On Fri, Aug 30, 2013 at 1:15 PM, Waiman Long<waiman.long@hp.com>  wrote:
>>> The prepend_path() isn't all due to getcwd. The correct profile should be
>> Ugh. I really think that prepend_path() should just be rewritten to
>> run entirely under RCU.
>>
>> Then we can remove *all* the stupid locking, and replace it with doing
>> a read-lock on the rename sequence count, and repeating if requited.
>>
>> That shouldn't even be hard to do, it just requires mindless massaging
>> and being careful.
> Not really.  Sure, you'll retry it if you race with d_move(); that's not
> the real problem - access past the end of the object containing ->d_name.name
> would screw you and that's what ->d_lock is preventing there.  Delayed freeing
> of what ->d_name is pointing into is fine, but it's not the only way to get
> hurt there...

Actually, prepend_path() was called with rename_lock taken. So d_move() 
couldn't be run at the same time. Am I right?

Regards,
Longman

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 21:10                                 ` Waiman Long
@ 2013-08-30 21:22                                   ` Linus Torvalds
  2013-08-30 21:30                                   ` Al Viro
  1 sibling, 0 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-08-30 21:22 UTC (permalink / raw)
  To: Waiman Long
  Cc: Al Viro, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Fri, Aug 30, 2013 at 2:10 PM, Waiman Long <waiman.long@hp.com> wrote:
>
> Actually, prepend_path() was called with rename_lock taken. So d_move()
> couldn't be run at the same time. Am I right?

Al was discussing the case I mentioned: getting rid of that lock
entirely, running it all just under RCU, and then just checking the
rename sequence count around it all and retrying if required.

It would have the advantage of not only not having to get the lock,
but by doing it as an RCU walk, we would avoid all the nasty reference
counting costs too. We wouldn't even need to get refcounts on the
root/pwd entries (which currently cost us quite a bit), since we could
just check the sequence number in "struct fs_struct" too. That also
gets rid of the necessity for the fs->lock spinlock.

You do have to be a bit careful when following the dentry pointers
under RCU (and you cannot just do a "memcpy()" on the name, as Al
points out), but it really doesn't look nasty. It just looks "you have
to be careful".

              Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 21:10                                 ` Waiman Long
  2013-08-30 21:22                                   ` Linus Torvalds
@ 2013-08-30 21:30                                   ` Al Viro
  2013-08-30 21:42                                     ` Waiman Long
  1 sibling, 1 reply; 151+ messages in thread
From: Al Viro @ 2013-08-30 21:30 UTC (permalink / raw)
  To: Waiman Long
  Cc: Linus Torvalds, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Fri, Aug 30, 2013 at 05:10:45PM -0400, Waiman Long wrote:
> On 08/30/2013 04:54 PM, Al Viro wrote:
> >On Fri, Aug 30, 2013 at 01:43:11PM -0700, Linus Torvalds wrote:
> >>On Fri, Aug 30, 2013 at 1:15 PM, Waiman Long<waiman.long@hp.com>  wrote:
> >>>The prepend_path() isn't all due to getcwd. The correct profile should be
> >>Ugh. I really think that prepend_path() should just be rewritten to
> >>run entirely under RCU.
> >>
> >>Then we can remove *all* the stupid locking, and replace it with doing
                                                     ^^^^^^^^^^^^^^^^^^^^^
> >>a read-lock on the rename sequence count, and repeating if requited.
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >>
> >>That shouldn't even be hard to do, it just requires mindless massaging
> >>and being careful.
> >Not really.  Sure, you'll retry it if you race with d_move(); that's not
> >the real problem - access past the end of the object containing ->d_name.name
> >would screw you and that's what ->d_lock is preventing there.  Delayed freeing
> >of what ->d_name is pointing into is fine, but it's not the only way to get
> >hurt there...
> 
> Actually, prepend_path() was called with rename_lock taken. So
> d_move() couldn't be run at the same time. Am I right?

See above.  You are right, but if Linus wants to turn that sucker into
reader (which is possible - see e.g. cifs build_path_from_dentry() and its
ilk), d_move() races will start to play.

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 21:30                                   ` Al Viro
@ 2013-08-30 21:42                                     ` Waiman Long
  0 siblings, 0 replies; 151+ messages in thread
From: Waiman Long @ 2013-08-30 21:42 UTC (permalink / raw)
  To: Al Viro
  Cc: Linus Torvalds, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On 08/30/2013 05:30 PM, Al Viro wrote:
> On Fri, Aug 30, 2013 at 05:10:45PM -0400, Waiman Long wrote:
> See above. You are right, but if Linus wants to turn that sucker into 
> reader (which is possible - see e.g. cifs build_path_from_dentry() and 
> its ilk), d_move() races will start to play. 

Thank for the clarification.

-Longman

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 21:03                                 ` Linus Torvalds
@ 2013-08-30 21:44                                   ` Al Viro
  2013-08-30 22:30                                     ` Linus Torvalds
  0 siblings, 1 reply; 151+ messages in thread
From: Al Viro @ 2013-08-30 21:44 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Fri, Aug 30, 2013 at 02:03:59PM -0700, Linus Torvalds wrote:

> Yes, yes, you haev to be careful and cannot just blindly trust the
> length: you also have to check for NUL character as you are copying it
> and stop if you hit it. But that's trivial.

Point...  Actually, I wonder if _that_ could be a solution for ->d_name.name
printk races as well.  Remember that story?  You objected against taking
spinlocks in printk, no matter how specialized and how narrow the area
over which those are taken, but rcu_read_lock/rcu_read_unlock should be
OK...  Something like %pd expecting dentry pointer and producing dentry
name.  Sure, we still get garbage if we race with d_move(), but at least
it's a contained garbage that way...

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 21:44                                   ` Al Viro
@ 2013-08-30 22:30                                     ` Linus Torvalds
  2013-08-31 21:23                                       ` Al Viro
  0 siblings, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-08-30 22:30 UTC (permalink / raw)
  To: Al Viro
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Fri, Aug 30, 2013 at 2:44 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> Point...  Actually, I wonder if _that_ could be a solution for ->d_name.name
> printk races as well.  Remember that story?  You objected against taking
> spinlocks in printk, no matter how specialized and how narrow the area
> over which those are taken, but rcu_read_lock/rcu_read_unlock should be
> OK...  Something like %pd expecting dentry pointer and producing dentry
> name.  Sure, we still get garbage if we race with d_move(), but at least
> it's a contained garbage that way...

Yes, that sounds quite reasonable. For printk, we'd probably want to
limit the max size and depth to something fairly small (32 bytes, max
four deep or something), and we cannot take cwd/root into account
since it can happen from interrupts, but other than that it doesn't
sound horrible.

           Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 20:48                                 ` Al Viro
@ 2013-08-31  2:02                                   ` Waiman Long
  2013-08-31  2:35                                     ` Al Viro
  0 siblings, 1 reply; 151+ messages in thread
From: Waiman Long @ 2013-08-31  2:02 UTC (permalink / raw)
  To: Al Viro
  Cc: Linus Torvalds, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On 08/30/2013 04:48 PM, Al Viro wrote:
> On Fri, Aug 30, 2013 at 04:35:49PM -0400, Waiman Long wrote:
>
>> The AIM7 test was run on a set of 16 ramdisk formated with ext3
>> filesystem with the following mount options:
>> barrier=0,async,noatime,nodiratime. Maybe that is a factor.
> I would be really surprised if it was...  Could you slap the following
> into __fput():
>
> 	struct mount *m = real_mount(mnt);
> 	if (unlikely(!m->mnt_ns)) {
> 		printk(KERN_INFO "type = %s",
> 			mnt->mnt_sb->s_type->name);
> 		WARN_ON(1);
> 	}
> and see what it catches?  That'll need #include "fs/mount.h" in
> fs/file_table.c to compile...

I slapped in the code segment, and the following was logged:

[  340.871590] type = tmpfs
[  340.871596] ------------[ cut here ]------------
[  340.871606] WARNING: CPU: 37 PID: 63276 at fs/file_table.c:239 
__fput+0x23d/0x270()
[  340.871607] Modules linked in: brd(F) ip6table_filter(F) 
ip6_tables(F) iptable_filter(F) ip_tables(F) ebtable_nat(F) ebtables(F) 
x_tables(F) edd(F) af_packet(F) bridge(F) stp(F) llc(F) 
cpufreq_conservative(F) cpufreq_userspace(F) cpufreq_powersave(F) 
pcc_cpufreq(F) microcode(F) fuse(F) loop(F) vhost_net(F) macvtap(F) 
macvlan(F) vhost(F) tun(F) kvm_intel(F) ipv6(F) kvm(F) iTCO_wdt(F) 
iTCO_vendor_support(F) joydev(F) igb(F) tpm_infineon(F) dca(F) ptp(F) 
hid_generic(F) i7core_edac(F) sr_mod(F) tpm_tis(F) pps_core(F) qlcnic(F) 
tpm(F) edac_core(F) be2net(F) netxen_nic(F) lpc_ich(F) ehci_pci(F) 
mfd_core(F) hpwdt(F) hpilo(F) pcspkr(F) serio_raw(F) cdrom(F) 
tpm_bios(F) sg(F) rtc_cmos(F) mperf(F) button(F) acpi_power_meter(F) 
ext3(F) jbd(F) mbcache(F) dm_mirror(F) dm_region_hash(F) dm_log(F) 
linear(F) radeon(F) ttm(F) drm_kms_helper(F) drm(F) i2c_algo_bit(F) 
i2c_core(F) usbhid(F) hid(F) uhci_hcd(F) ehci_hcd(F) usbcore(F) 
qla2xxx(F) sd_mod(F) usb_common(F) thermal(F) processor(F) 
thermal_sys(F) hwmon(F) scsi_dh_emc(F) scsi_dh_rdac(F) scsi_dh_hp_sw(F) 
scsi_dh_alua(F) scsi_dh(F) dm_snapshot(F) dm_mod(F) ata_generic(F) 
ata_piix(F) libata(F) hpsa(F) lpfc(F) scsi_transport_fc(F) scsi_tgt(F) 
crc_t10dif(F) cciss(F) scsi_mod(F)
[  340.871663] CPU: 37 PID: 63276 Comm: reaim Tainted: GF       W    
3.11.0-rc7-lockref-0.11-default #4
[  340.871665] Hardware name: HP ProLiant DL980 G7, BIOS P66 07/30/2012
[  340.871667]  00000000000000ef ffff899f6b03dd88 ffffffff814992f5 
ffff899f6b03ddc8
[  340.871681]  ffffffff8104a187 ffff899f6b03dda8 0000000000000000 
ffff899f6b03aa40
[  340.871686]  ffff899f68fc7cc0 ffff899f69ee8ae0 ffff899f69ee8ae0 
ffff899f6b03ddd8
[  340.871692] Call Trace:
[  340.871700]  [<ffffffff814992f5>] dump_stack+0x6a/0x7d
[  340.871705]  [<ffffffff8104a187>] warn_slowpath_common+0x87/0xb0
[  340.871709]  [<ffffffff8104a1c5>] warn_slowpath_null+0x15/0x20
[  340.871712]  [<ffffffff8116c5bd>] __fput+0x23d/0x270
[  340.871715]  [<ffffffff8116c699>] ____fput+0x9/0x10
[  340.871719]  [<ffffffff81068ae1>] task_work_run+0xb1/0xe0
[  340.871724]  [<ffffffff81002990>] do_notify_resume+0x80/0x1b0
[  340.871728]  [<ffffffff811ed120>] ? ipc_lock+0x30/0x50
[  340.871732]  [<ffffffff8113a356>] ? remove_vma+0x56/0x60
[  340.871736]  [<ffffffff8113c1bf>] ? do_munmap+0x34f/0x380
[  340.871741]  [<ffffffff814a5fda>] int_signal+0x12/0x17
[  340.871744] ---[ end trace aafa6c45f3388d65 ]---

Regards,
Longman

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-31  2:02                                   ` Waiman Long
@ 2013-08-31  2:35                                     ` Al Viro
  2013-08-31  2:42                                       ` Al Viro
  0 siblings, 1 reply; 151+ messages in thread
From: Al Viro @ 2013-08-31  2:35 UTC (permalink / raw)
  To: Waiman Long
  Cc: Linus Torvalds, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Fri, Aug 30, 2013 at 10:02:36PM -0400, Waiman Long wrote:

> I slapped in the code segment, and the following was logged:
> 
> [  340.871590] type = tmpfs
> [  340.871712]  [<ffffffff8116c5bd>] __fput+0x23d/0x270
> [  340.871715]  [<ffffffff8116c699>] ____fput+0x9/0x10
> [  340.871719]  [<ffffffff81068ae1>] task_work_run+0xb1/0xe0
> [  340.871724]  [<ffffffff81002990>] do_notify_resume+0x80/0x1b0
> [  340.871728]  [<ffffffff811ed120>] ? ipc_lock+0x30/0x50
> [  340.871732]  [<ffffffff8113a356>] ? remove_vma+0x56/0x60
> [  340.871736]  [<ffffffff8113c1bf>] ? do_munmap+0x34f/0x380
> [  340.871741]  [<ffffffff814a5fda>] int_signal+0x12/0x17
> [  340.871744] ---[ end trace aafa6c45f3388d65 ]---

Aha...  OK, I see what's going on.  We end up with shm_mnt *not* marked
as long-living vfsmount, even though it lives forever.  See if the
following helps; if it does (and I very much expect it to), we want to
put it in -stable.  As it is, you get slow path in mntput() each time
a file created by shmem_file_setup() gets closed.  For no reason whatsoever...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
diff --git a/mm/shmem.c b/mm/shmem.c
index e43dc55..445162c 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2615,7 +2615,7 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent)
 	 * tmpfs instance, limiting inodes to one per page of lowmem;
 	 * but the internal instance is left unlimited.
 	 */
-	if (!(sb->s_flags & MS_NOUSER)) {
+	if (!(sb->s_flags & MS_KERNMOUNT)) {
 		sbinfo->max_blocks = shmem_default_max_blocks();
 		sbinfo->max_inodes = shmem_default_max_inodes();
 		if (shmem_parse_options(data, sbinfo, false)) {
@@ -2831,8 +2831,7 @@ int __init shmem_init(void)
 		goto out2;
 	}
 
-	shm_mnt = vfs_kern_mount(&shmem_fs_type, MS_NOUSER,
-				 shmem_fs_type.name, NULL);
+	shm_mnt = kern_mount(&shmem_fs_type);
 	if (IS_ERR(shm_mnt)) {
 		error = PTR_ERR(shm_mnt);
 		printk(KERN_ERR "Could not kern_mount tmpfs\n");

^ permalink raw reply related	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-31  2:35                                     ` Al Viro
@ 2013-08-31  2:42                                       ` Al Viro
  2013-09-02 19:25                                         ` Waiman Long
  0 siblings, 1 reply; 151+ messages in thread
From: Al Viro @ 2013-08-31  2:42 UTC (permalink / raw)
  To: Waiman Long
  Cc: Linus Torvalds, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Sat, Aug 31, 2013 at 03:35:16AM +0100, Al Viro wrote:

> Aha...  OK, I see what's going on.  We end up with shm_mnt *not* marked
> as long-living vfsmount, even though it lives forever.  See if the
> following helps; if it does (and I very much expect it to), we want to
> put it in -stable.  As it is, you get slow path in mntput() each time
> a file created by shmem_file_setup() gets closed.  For no reason whatsoever...

We still want MS_NOUSER on shm_mnt, so we'd better make sure that
shmem_fill_super() sets it on the internal instance...  Fixed variant
follows:

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
diff --git a/mm/shmem.c b/mm/shmem.c
index e43dc55..5261498 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2615,13 +2615,15 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent)
 	 * tmpfs instance, limiting inodes to one per page of lowmem;
 	 * but the internal instance is left unlimited.
 	 */
-	if (!(sb->s_flags & MS_NOUSER)) {
+	if (!(sb->s_flags & MS_KERNMOUNT)) {
 		sbinfo->max_blocks = shmem_default_max_blocks();
 		sbinfo->max_inodes = shmem_default_max_inodes();
 		if (shmem_parse_options(data, sbinfo, false)) {
 			err = -EINVAL;
 			goto failed;
 		}
+	} else {
+		sb->s_flags |= MS_NOUSER;
 	}
 	sb->s_export_op = &shmem_export_ops;
 	sb->s_flags |= MS_NOSEC;
@@ -2831,8 +2833,7 @@ int __init shmem_init(void)
 		goto out2;
 	}
 
-	shm_mnt = vfs_kern_mount(&shmem_fs_type, MS_NOUSER,
-				 shmem_fs_type.name, NULL);
+	shm_mnt = kern_mount(&shmem_fs_type);
 	if (IS_ERR(shm_mnt)) {
 		error = PTR_ERR(shm_mnt);
 		printk(KERN_ERR "Could not kern_mount tmpfs\n");

^ permalink raw reply related	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 22:30                                     ` Linus Torvalds
@ 2013-08-31 21:23                                       ` Al Viro
  2013-08-31 22:49                                         ` Linus Torvalds
  0 siblings, 1 reply; 151+ messages in thread
From: Al Viro @ 2013-08-31 21:23 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Fri, Aug 30, 2013 at 03:30:14PM -0700, Linus Torvalds wrote:
> On Fri, Aug 30, 2013 at 2:44 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> >
> > Point...  Actually, I wonder if _that_ could be a solution for ->d_name.name
> > printk races as well.  Remember that story?  You objected against taking
> > spinlocks in printk, no matter how specialized and how narrow the area
> > over which those are taken, but rcu_read_lock/rcu_read_unlock should be
> > OK...  Something like %pd expecting dentry pointer and producing dentry
> > name.  Sure, we still get garbage if we race with d_move(), but at least
> > it's a contained garbage that way...
> 
> Yes, that sounds quite reasonable. For printk, we'd probably want to
> limit the max size and depth to something fairly small (32 bytes, max
> four deep or something), and we cannot take cwd/root into account
> since it can happen from interrupts, but other than that it doesn't
> sound horrible.

Hmm...  OK, most of these suckers are actually doing just one component;
we can look into 'print the ancestors as well' later, but the minimal
variant would be something like this and it already covers a lot of those
guys.  Comments?

diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt
index 3e8cb73..259f8c3 100644
--- a/Documentation/printk-formats.txt
+++ b/Documentation/printk-formats.txt
@@ -168,6 +168,13 @@ UUID/GUID addresses:
 	Where no additional specifiers are used the default little endian
 	order with lower case hex characters will be printed.
 
+dentry names:
+	%pd
+
+	For printing dentry name; if we race with d_move(), the name might be
+	a mix of old and new ones, but it won't oops.  %pd dentry is safer
+	equivalent of %s dentry->d_name.name we used to use.
+
 struct va_format:
 
 	%pV
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 739a3636..941509e 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -26,6 +26,7 @@
 #include <linux/math64.h>
 #include <linux/uaccess.h>
 #include <linux/ioport.h>
+#include <linux/dcache.h>
 #include <net/addrconf.h>
 
 #include <asm/page.h>		/* for PAGE_SIZE */
@@ -532,6 +533,56 @@ char *string(char *buf, char *end, const char *s, struct printf_spec spec)
 	return buf;
 }
 
+static void widen(char *buf, char *end, unsigned len, unsigned spaces)
+{
+	size_t size;
+	if (buf >= end)	/* nowhere to put anything */
+		return;
+	size = end - buf;
+	if (size <= spaces) {
+		memset(buf, ' ', size);
+		return;
+	}
+	if (len) {
+		if (len > size - spaces)
+			len = size - spaces;
+		memmove(buf + spaces, buf, len);
+	}
+	memset(buf, ' ', spaces);
+}
+
+static noinline_for_stack
+char *dentry_name(char *buf, char *end, const struct dentry *d, struct printf_spec spec)
+{
+	int n;
+	const char *s;
+	char *p = buf;
+	char c;
+
+	rcu_read_lock();
+	s = ACCESS_ONCE(d->d_name.name);
+	for (n = 0; n != spec.precision && (c = *s++) != 0; n++) {
+		if (buf < end)
+			*buf = c;
+		buf++;
+	}
+	rcu_read_unlock();
+	if (n < spec.field_width) {
+		/* we want to pad the sucker */
+		unsigned spaces = spec.field_width - n;
+		if (!(spec.flags & LEFT)) {
+			widen(p, end, n, spaces);
+			return buf + spaces;
+		}
+		while (spaces--) {
+			if (buf < end)
+				*buf = ' ';
+			++buf;
+		}
+	}
+	return buf;
+}
+
 static noinline_for_stack
 char *symbol_string(char *buf, char *end, void *ptr,
 		    struct printf_spec spec, const char *fmt)
@@ -1253,6 +1304,8 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
 		spec.base = 16;
 		return number(buf, end,
 			      (unsigned long long) *((phys_addr_t *)ptr), spec);
+	case 'd':
+		return dentry_name(buf, end, ptr, spec);
 	}
 	spec.flags |= SMALL;
 	if (spec.field_width == -1) {

^ permalink raw reply related	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-31 21:23                                       ` Al Viro
@ 2013-08-31 22:49                                         ` Linus Torvalds
  2013-08-31 23:27                                           ` Al Viro
  0 siblings, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-08-31 22:49 UTC (permalink / raw)
  To: Al Viro
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Sat, Aug 31, 2013 at 2:23 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> Hmm...  OK, most of these suckers are actually doing just one component;
> we can look into 'print the ancestors as well' later, but the minimal
> variant would be something like this and it already covers a lot of those
> guys.  Comments?

Doesn't look wrong, but remember the /proc debugging thing? We
definitely wanted more than just one pathname component, and I don't
think that's completely rare.

So I think it would be better to prepare for that, and simply print to
a local buffer, and then use the "string()" function on the end
result. Rather than do it directly from the dentry like you do, and
then having to do that widen() thing because you couldn't do the
strnlen() that that code wanted..

Hmm?

          Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-31 22:49                                         ` Linus Torvalds
@ 2013-08-31 23:27                                           ` Al Viro
  2013-09-01  0:13                                             ` Al Viro
  0 siblings, 1 reply; 151+ messages in thread
From: Al Viro @ 2013-08-31 23:27 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Sat, Aug 31, 2013 at 03:49:31PM -0700, Linus Torvalds wrote:
> On Sat, Aug 31, 2013 at 2:23 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> >
> > Hmm...  OK, most of these suckers are actually doing just one component;
> > we can look into 'print the ancestors as well' later, but the minimal
> > variant would be something like this and it already covers a lot of those
> > guys.  Comments?
> 
> Doesn't look wrong, but remember the /proc debugging thing? We
> definitely wanted more than just one pathname component, and I don't
> think that's completely rare.
> 
> So I think it would be better to prepare for that, and simply print to
> a local buffer, and then use the "string()" function on the end
> result. Rather than do it directly from the dentry like you do, and
> then having to do that widen() thing because you couldn't do the
> strnlen() that that code wanted..

Actually, right now I'm debugging a variant that avoids local buffers; use
is %pD3 for grandparent/parent/name, etc., up to %pD4.  %pd is equivalent
to %pD1 (just the dentry name).  Keep in mind that things like NFS use
a _lot_ of what would be %pD2 in debugging printks and the string can grow
fairly long, so I'd rather live with widen() than mess with local buffers
here.  I'll send an updated variant when I'm more or less satisfied with
it...

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-31 23:27                                           ` Al Viro
@ 2013-09-01  0:13                                             ` Al Viro
  2013-09-01 17:48                                               ` Al Viro
  2013-09-09  8:30                                               ` Peter Zijlstra
  0 siblings, 2 replies; 151+ messages in thread
From: Al Viro @ 2013-09-01  0:13 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Sun, Sep 01, 2013 at 12:27:58AM +0100, Al Viro wrote:
> On Sat, Aug 31, 2013 at 03:49:31PM -0700, Linus Torvalds wrote:
> > On Sat, Aug 31, 2013 at 2:23 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> > >
> > > Hmm...  OK, most of these suckers are actually doing just one component;
> > > we can look into 'print the ancestors as well' later, but the minimal
> > > variant would be something like this and it already covers a lot of those
> > > guys.  Comments?
> > 
> > Doesn't look wrong, but remember the /proc debugging thing? We
> > definitely wanted more than just one pathname component, and I don't
> > think that's completely rare.
> > 
> > So I think it would be better to prepare for that, and simply print to
> > a local buffer, and then use the "string()" function on the end
> > result. Rather than do it directly from the dentry like you do, and
> > then having to do that widen() thing because you couldn't do the
> > strnlen() that that code wanted..
> 
> Actually, right now I'm debugging a variant that avoids local buffers; use
> is %pD3 for grandparent/parent/name, etc., up to %pD4.  %pd is equivalent
> to %pD1 (just the dentry name).  Keep in mind that things like NFS use
> a _lot_ of what would be %pD2 in debugging printks and the string can grow
> fairly long, so I'd rather live with widen() than mess with local buffers
> here.  I'll send an updated variant when I'm more or less satisfied with
> it...

Seems to be working...  This doesn't include the metric arseload of
conversions in fs/*/* - just the sprintf part.

diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt
index 3e8cb73..826147b 100644
--- a/Documentation/printk-formats.txt
+++ b/Documentation/printk-formats.txt
@@ -168,6 +168,17 @@ UUID/GUID addresses:
 	Where no additional specifiers are used the default little endian
 	order with lower case hex characters will be printed.
 
+dentry names:
+	%pd
+	%pD1
+	...
+	%pD4
+
+	For printing dentry name; if we race with d_move(), the name might be
+	a mix of old and new ones, but it won't oops.  %pd dentry is a safer
+	equivalent of %s dentry->d_name.name we used to use, %pD<n> prints
+	n last components (IOW, %pD1 is equivalent to %pd).
+
 struct va_format:
 
 	%pV
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 739a3636..5db62bf 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -26,6 +26,7 @@
 #include <linux/math64.h>
 #include <linux/uaccess.h>
 #include <linux/ioport.h>
+#include <linux/dcache.h>
 #include <net/addrconf.h>
 
 #include <asm/page.h>		/* for PAGE_SIZE */
@@ -532,6 +533,88 @@ char *string(char *buf, char *end, const char *s, struct printf_spec spec)
 	return buf;
 }
 
+static void widen(char *buf, char *end, unsigned len, unsigned spaces)
+{
+	size_t size;
+	if (buf >= end)	/* nowhere to put anything */
+		return;
+	size = end - buf;
+	if (size <= spaces) {
+		memset(buf, ' ', size);
+		return;
+	}
+	if (len) {
+		if (len > size - spaces)
+			len = size - spaces;
+		memmove(buf + spaces, buf, len);
+	}
+	memset(buf, ' ', spaces);
+}
+
+static noinline_for_stack
+char *dentry_name(char *buf, char *end, const struct dentry *d, struct printf_spec spec,
+		  int depth)
+{
+	int i, n = 0;
+	const char *s;
+	char *p = buf;
+	const struct dentry *array[4];
+	char c;
+
+	if (depth < 0) {
+		depth = 1;
+		WARN_ON(1);
+	}
+	if (depth > 4) {
+		depth = 4;
+		WARN_ON(1);
+	}
+
+	rcu_read_lock();
+	for (i = 0; i < depth; i++) {
+		struct dentry *p = ACCESS_ONCE(d->d_parent);
+		array[i] = d;
+		if (d == p)
+			break;
+		d = p;
+	}
+	if (!i) {	/* root dentry has a bloody inconvenient name */
+		i++;
+		goto do_name;
+	}
+	if (i == depth)
+		goto do_name;
+	while (i && n != spec.precision) {
+		if (buf < end)
+			*buf = '/';
+		buf++;
+		n++;
+do_name:
+		s = ACCESS_ONCE(array[--i]->d_name.name);
+		while (n != spec.precision && (c = *s++) != '\0') {
+			if (buf < end)
+				*buf = c;
+			buf++;
+			n++;
+		}
+	}
+	rcu_read_unlock();
+	if (n < spec.field_width) {
+		/* we want to pad the sucker */
+		unsigned spaces = spec.field_width - n;
+		if (!(spec.flags & LEFT)) {
+			widen(p, end, n, spaces);
+			return buf + spaces;
+		}
+		while (spaces--) {
+			if (buf < end)
+				*buf = ' ';
+			++buf;
+		}
+	}
+	return buf;
+}
+
 static noinline_for_stack
 char *symbol_string(char *buf, char *end, void *ptr,
 		    struct printf_spec spec, const char *fmt)
@@ -1253,6 +1336,14 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
 		spec.base = 16;
 		return number(buf, end,
 			      (unsigned long long) *((phys_addr_t *)ptr), spec);
+	case 'd':
+		return dentry_name(buf, end, ptr, spec, 1);
+	case 'D':
+		switch (fmt[1]) {
+		case '1': case '2': case '3': case '4':
+			return dentry_name(buf, end, ptr, spec, fmt[1] - '0');
+		}
+		break;
 	}
 	spec.flags |= SMALL;
 	if (spec.field_width == -1) {

^ permalink raw reply related	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-30 16:52                               ` Linus Torvalds
  2013-08-30 17:11                                 ` Sedat Dilek
@ 2013-09-01 10:01                                 ` Sedat Dilek
  2013-09-01 10:33                                   ` Sedat Dilek
  2013-09-01 15:32                                   ` Linus Torvalds
  1 sibling, 2 replies; 151+ messages in thread
From: Sedat Dilek @ 2013-09-01 10:01 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

[-- Attachment #1: Type: text/plain, Size: 7451 bytes --]

On Fri, Aug 30, 2013 at 6:52 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Fri, Aug 30, 2013 at 9:37 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>
>> Where is this a.out file from or how to generate it?
>
> Oh, that's just the silly threaded test-binary. I don't know what you
> called it.
>
> As to your config options, yesh, you have some expensive stuff.
> DEBUG_OBJECTS and DEBUG_MUTEXES in particular tend to cause lots of
> horrible performance issues. I didn't check if there might be other
> things..
>

I tried w/o DEBUG_OBJECTS and DEBUG_MUTEXES and disabled some
unnecessary debug-options, too (see attached diff).

This is what I get now...

[ TEST-CASE ]

$ ~/src/linux-kernel/linux/tools/perf/perf stat --null --repeat 5
./scripts/t_lockref_from-linus
Total loops: 26480075
Total loops: 27002388
Total loops: 25761463
Total loops: 26877615
Total loops: 27047644

 Performance counter stats for './scripts/t_lockref_from-linus' (5 runs):

      10,008617789 seconds time elapsed
          ( +-  0,07% )


Looks like this is now 10x faster: ~2.66Mloops (debug) VS.
~26.60Mloops (no-debug).

[ PERF-RECORD ]

$ sudo ~/src/linux-kernel/linux/tools/perf/perf record -e cycles:pp
./scripts/t_lockref_from-linus
Total loops: 26601346
[ perf record: Woken up 25 times to write data ]
[ perf record: Captured and wrote 6.100 MB perf.data (~266501 samples) ]

[ PERF-REPORT ]

$ sudo ~/src/linux-kernel/linux/tools/perf/perf report -f

Samples: 159K of event 'cycles:pp', Event count (approx.): 76968896763
 12,79%  t_lockref_from-  [kernel.kallsyms]     [k] irq_return
  4,36%  t_lockref_from-  [kernel.kallsyms]     [k] __ticket_spin_lock
  4,36%  t_lockref_from-  [kernel.kallsyms]     [k] __acct_update_integrals
  4,07%  t_lockref_from-  [kernel.kallsyms]     [k] user_exit
  3,12%  t_lockref_from-  [kernel.kallsyms]     [k] local_clock
  2,83%  t_lockref_from-  [kernel.kallsyms]     [k] lockref_get_or_lock
  2,73%  t_lockref_from-  [kernel.kallsyms]     [k] kmem_cache_alloc
  2,62%  t_lockref_from-  [kernel.kallsyms]     [k] __d_lookup_rcu
  2,53%  t_lockref_from-  libc-2.15.so          [.] __xstat64
  2,53%  t_lockref_from-  [kernel.kallsyms]     [k] kmem_cache_free
  2,28%  t_lockref_from-  [kernel.kallsyms]     [k] path_init
  2,27%  t_lockref_from-  [kernel.kallsyms]     [k] link_path_walk
  1,86%  t_lockref_from-  [kernel.kallsyms]     [k] user_enter
  1,85%  t_lockref_from-  [kernel.kallsyms]     [k] rcu_eqs_exit_common.isra.43
  1,81%  t_lockref_from-  [kernel.kallsyms]     [k] sched_clock_cpu
  1,79%  t_lockref_from-  [kernel.kallsyms]     [k] rcu_eqs_enter_common.isra.45
  1,78%  t_lockref_from-  [kernel.kallsyms]     [k] path_lookupat
  1,67%  t_lockref_from-  [kernel.kallsyms]     [k] native_read_tsc
  1,63%  t_lockref_from-  [kernel.kallsyms]     [k] cp_new_stat
  1,61%  t_lockref_from-  [kernel.kallsyms]     [k] lockref_put_or_lock
  1,53%  t_lockref_from-  [kernel.kallsyms]     [k] account_system_time
  1,48%  t_lockref_from-  [kernel.kallsyms]     [k] tracesys
  1,47%  t_lockref_from-  [kernel.kallsyms]     [k] copy_user_generic_unrolled
  1,46%  t_lockref_from-  [kernel.kallsyms]     [k] syscall_trace_enter
  1,39%  t_lockref_from-  [kernel.kallsyms]     [k] jiffies_to_timeval
  1,33%  t_lockref_from-  [kernel.kallsyms]     [k] native_sched_clock
  1,27%  t_lockref_from-  [kernel.kallsyms]     [k] getname_flags
  1,27%  t_lockref_from-  [kernel.kallsyms]     [k] lookup_fast
  1,18%  t_lockref_from-  [kernel.kallsyms]     [k] get_vtime_delta
  1,05%  t_lockref_from-  [kernel.kallsyms]     [k] syscall_trace_leave
  1,03%  t_lockref_from-  [kernel.kallsyms]     [k] generic_fillattr
  1,02%  t_lockref_from-  [kernel.kallsyms]     [k] strncpy_from_user
  1,00%  t_lockref_from-  [kernel.kallsyms]     [k] user_path_at_empty
  0,97%  t_lockref_from-  [kernel.kallsyms]     [k] account_user_time
  0,95%  t_lockref_from-  [kernel.kallsyms]     [k] vfs_fstatat
  0,95%  t_lockref_from-  [kernel.kallsyms]     [k] system_call_after_swapgs
  0,92%  t_lockref_from-  [kernel.kallsyms]     [k] generic_permission
  0,91%  t_lockref_from-  [kernel.kallsyms]     [k] filename_lookup
  0,80%  t_lockref_from-  [kernel.kallsyms]     [k] vfs_getattr
  0,78%  t_lockref_from-  [kernel.kallsyms]     [k] __ticket_spin_unlock
  0,74%  t_lockref_from-  [kernel.kallsyms]     [k] complete_walk
  0,70%  t_lockref_from-  [kernel.kallsyms]     [k] vtime_account_user
  0,68%  t_lockref_from-  [kernel.kallsyms]     [k] d_rcu_to_refcount
  0,65%  t_lockref_from-  [kernel.kallsyms]     [k] common_perm
  0,62%  t_lockref_from-  [kernel.kallsyms]     [k] rcu_eqs_enter
  0,58%  t_lockref_from-  [kernel.kallsyms]     [k] vtime_user_enter
  0,57%  t_lockref_from-  [kernel.kallsyms]     [k] __inode_permission
  0,55%  t_lockref_from-  [kernel.kallsyms]     [k] dput
  0,52%  t_lockref_from-  [kernel.kallsyms]     [k] apparmor_inode_getattr
  0,52%  t_lockref_from-  [kernel.kallsyms]     [k] SYSC_newstat
  0,52%  t_lockref_from-  [kernel.kallsyms]     [k] mntget
  0,49%  t_lockref_from-  [kernel.kallsyms]     [k] cpuacct_account_field
  0,48%  t_lockref_from-  [kernel.kallsyms]     [k] __vtime_account_system
  0,46%  t_lockref_from-  t_lockref_from-linus  [.] start_routine

Thanks for all the explanations and hints.

Regards,
- Sedat -

P.S.: Some words to "perf -f"...

$ sudo ~/src/linux-kernel/linux/tools/perf/perf record -f -e cycles:pp
./scripts/t_lockref_from-linus
[sudo] password for wearefam:
  Error: unknown switch `f'

 usage: perf record [<options>] [<command>]
    or: perf record [<options>] -- <command> [<options>]

    -e, --event <event>   event selector. use 'perf list' to list
available events
        --filter <filter>
                          event filter
    -p, --pid <pid>       record events on existing process id
    -t, --tid <tid>       record events on existing thread id
    -r, --realtime <n>    collect data with this RT SCHED_FIFO priority
    -D, --no-delay        collect data without buffering
    -R, --raw-samples     collect raw sample records from all opened counters
    -a, --all-cpus        system-wide collection from all CPUs
    -C, --cpu <cpu>       list of cpus to monitor
    -c, --count <n>       event period to sample
    -o, --output <file>   output file name
    -i, --no-inherit      child tasks do not inherit counters
    -F, --freq <n>        profile at this frequency
    -m, --mmap-pages <n>  number of mmap data pages
        --group           put the counters into a counter group
    -g, --call-graph <mode[,dump_size]>
                          do call-graph (stack chain/backtrace)
recording: [fp] dwarf
    -v, --verbose         be more verbose (show counter open errors, etc)
    -q, --quiet           don't print any message
    -s, --stat            per thread counts
    -d, --data            Sample addresses
    -T, --timestamp       Sample timestamps
    -P, --period          Sample period
    -n, --no-samples      don't sample
    -N, --no-buildid-cache
                          do not update the buildid cache
    -B, --no-buildid      do not collect buildids in perf.data
    -G, --cgroup <name>   monitor event in cgroup name only
    -u, --uid <user>      user to profile
    -b, --branch-any      sample any taken branches
    -j, --branch-filter <branch filter mask>
                          branch stack filter modes
    -W, --weight          sample by weight (on special events only)

- EOT -

[-- Attachment #2: kernel-config.diff --]
[-- Type: application/octet-stream, Size: 2837 bytes --]

--- /boot/config-3.11.0-rc7-1-lockref-small	2013-08-30 10:23:42.000000000 +0200
+++ /boot/config-3.11.0-rc7-3-lockref-small	2013-09-01 11:23:21.000000000 +0200
@@ -351,6 +351,7 @@ CONFIG_INLINE_READ_UNLOCK=y
 CONFIG_INLINE_READ_UNLOCK_IRQ=y
 CONFIG_INLINE_WRITE_UNLOCK=y
 CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
+CONFIG_MUTEX_SPIN_ON_OWNER=y
 CONFIG_FREEZER=y
 
 #
@@ -542,11 +543,7 @@ CONFIG_PM_SLEEP_SMP=y
 # CONFIG_PM_WAKELOCKS is not set
 CONFIG_PM_RUNTIME=y
 CONFIG_PM=y
-CONFIG_PM_DEBUG=y
-# CONFIG_PM_ADVANCED_DEBUG is not set
-# CONFIG_PM_TEST_SUSPEND is not set
-CONFIG_PM_SLEEP_DEBUG=y
-# CONFIG_PM_TRACE_RTC is not set
+# CONFIG_PM_DEBUG is not set
 # CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
 CONFIG_ACPI=y
 CONFIG_ACPI_SLEEP=y
@@ -1625,9 +1622,8 @@ CONFIG_IWLWIFI_OPMODE_MODULAR=y
 #
 # Debugging Options
 #
-CONFIG_IWLWIFI_DEBUG=y
+# CONFIG_IWLWIFI_DEBUG is not set
 CONFIG_IWLWIFI_DEBUGFS=y
-# CONFIG_IWLWIFI_DEBUG_EXPERIMENTAL_UCODE is not set
 CONFIG_IWLWIFI_DEVICE_TRACING=y
 CONFIG_IWLWIFI_P2P=y
 # CONFIG_IWL4965 is not set
@@ -3181,7 +3177,7 @@ CONFIG_USB_SUPPORT=y
 CONFIG_USB_COMMON=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB=y
-CONFIG_USB_DEBUG=y
+# CONFIG_USB_DEBUG is not set
 CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 
 #
@@ -3743,11 +3739,11 @@ CONFIG_EXT4_FS=y
 CONFIG_EXT4_USE_FOR_EXT23=y
 CONFIG_EXT4_FS_POSIX_ACL=y
 CONFIG_EXT4_FS_SECURITY=y
-CONFIG_EXT4_DEBUG=y
+# CONFIG_EXT4_DEBUG is not set
 CONFIG_JBD=y
 # CONFIG_JBD_DEBUG is not set
 CONFIG_JBD2=y
-CONFIG_JBD2_DEBUG=y
+# CONFIG_JBD2_DEBUG is not set
 CONFIG_FS_MBCACHE=y
 # CONFIG_REISERFS_FS is not set
 # CONFIG_JFS_FS is not set
@@ -3955,22 +3951,14 @@ CONFIG_DEBUG_KERNEL=y
 # Memory Debugging
 #
 # CONFIG_DEBUG_PAGEALLOC is not set
-CONFIG_DEBUG_OBJECTS=y
-# CONFIG_DEBUG_OBJECTS_SELFTEST is not set
-# CONFIG_DEBUG_OBJECTS_FREE is not set
-# CONFIG_DEBUG_OBJECTS_TIMERS is not set
-# CONFIG_DEBUG_OBJECTS_WORK is not set
-CONFIG_DEBUG_OBJECTS_RCU_HEAD=y
-# CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER is not set
-CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
-CONFIG_DEBUG_SLAB=y
-# CONFIG_DEBUG_SLAB_LEAK is not set
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_DEBUG_SLAB is not set
 CONFIG_HAVE_DEBUG_KMEMLEAK=y
 # CONFIG_DEBUG_KMEMLEAK is not set
 # CONFIG_DEBUG_STACK_USAGE is not set
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_VIRTUAL is not set
-CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_DEBUG_MEMORY_INIT is not set
 # CONFIG_DEBUG_PER_CPU_MAPS is not set
 CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
 # CONFIG_DEBUG_STACKOVERFLOW is not set
@@ -4002,7 +3990,7 @@ CONFIG_TIMER_STATS=y
 # CONFIG_DEBUG_RT_MUTEXES is not set
 # CONFIG_RT_MUTEX_TESTER is not set
 # CONFIG_DEBUG_SPINLOCK is not set
-CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_MUTEXES is not set
 # CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set
 # CONFIG_DEBUG_LOCK_ALLOC is not set
 # CONFIG_PROVE_LOCKING is not set

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01 10:01                                 ` Sedat Dilek
@ 2013-09-01 10:33                                   ` Sedat Dilek
  2013-09-01 15:32                                   ` Linus Torvalds
  1 sibling, 0 replies; 151+ messages in thread
From: Sedat Dilek @ 2013-09-01 10:33 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

[-- Attachment #1: Type: text/plain, Size: 7882 bytes --]

On Sun, Sep 1, 2013 at 12:01 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> On Fri, Aug 30, 2013 at 6:52 PM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
>> On Fri, Aug 30, 2013 at 9:37 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>>
>>> Where is this a.out file from or how to generate it?
>>
>> Oh, that's just the silly threaded test-binary. I don't know what you
>> called it.
>>
>> As to your config options, yesh, you have some expensive stuff.
>> DEBUG_OBJECTS and DEBUG_MUTEXES in particular tend to cause lots of
>> horrible performance issues. I didn't check if there might be other
>> things..
>>
>
> I tried w/o DEBUG_OBJECTS and DEBUG_MUTEXES and disabled some
> unnecessary debug-options, too (see attached diff).
>
> This is what I get now...
>
> [ TEST-CASE ]
>
> $ ~/src/linux-kernel/linux/tools/perf/perf stat --null --repeat 5
> ./scripts/t_lockref_from-linus
> Total loops: 26480075
> Total loops: 27002388
> Total loops: 25761463
> Total loops: 26877615
> Total loops: 27047644
>
>  Performance counter stats for './scripts/t_lockref_from-linus' (5 runs):
>
>       10,008617789 seconds time elapsed
>           ( +-  0,07% )
>
>
> Looks like this is now 10x faster: ~2.66Mloops (debug) VS.
> ~26.60Mloops (no-debug).
>
> [ PERF-RECORD ]
>
> $ sudo ~/src/linux-kernel/linux/tools/perf/perf record -e cycles:pp
> ./scripts/t_lockref_from-linus
> Total loops: 26601346
> [ perf record: Woken up 25 times to write data ]
> [ perf record: Captured and wrote 6.100 MB perf.data (~266501 samples) ]
>
> [ PERF-REPORT ]
>
> $ sudo ~/src/linux-kernel/linux/tools/perf/perf report -f
>
> Samples: 159K of event 'cycles:pp', Event count (approx.): 76968896763
>  12,79%  t_lockref_from-  [kernel.kallsyms]     [k] irq_return
>   4,36%  t_lockref_from-  [kernel.kallsyms]     [k] __ticket_spin_lock
>   4,36%  t_lockref_from-  [kernel.kallsyms]     [k] __acct_update_integrals
>   4,07%  t_lockref_from-  [kernel.kallsyms]     [k] user_exit
>   3,12%  t_lockref_from-  [kernel.kallsyms]     [k] local_clock
>   2,83%  t_lockref_from-  [kernel.kallsyms]     [k] lockref_get_or_lock
>   2,73%  t_lockref_from-  [kernel.kallsyms]     [k] kmem_cache_alloc
>   2,62%  t_lockref_from-  [kernel.kallsyms]     [k] __d_lookup_rcu
>   2,53%  t_lockref_from-  libc-2.15.so          [.] __xstat64
>   2,53%  t_lockref_from-  [kernel.kallsyms]     [k] kmem_cache_free
>   2,28%  t_lockref_from-  [kernel.kallsyms]     [k] path_init
>   2,27%  t_lockref_from-  [kernel.kallsyms]     [k] link_path_walk
>   1,86%  t_lockref_from-  [kernel.kallsyms]     [k] user_enter
>   1,85%  t_lockref_from-  [kernel.kallsyms]     [k] rcu_eqs_exit_common.isra.43
>   1,81%  t_lockref_from-  [kernel.kallsyms]     [k] sched_clock_cpu
>   1,79%  t_lockref_from-  [kernel.kallsyms]     [k] rcu_eqs_enter_common.isra.45
>   1,78%  t_lockref_from-  [kernel.kallsyms]     [k] path_lookupat
>   1,67%  t_lockref_from-  [kernel.kallsyms]     [k] native_read_tsc
>   1,63%  t_lockref_from-  [kernel.kallsyms]     [k] cp_new_stat
>   1,61%  t_lockref_from-  [kernel.kallsyms]     [k] lockref_put_or_lock
>   1,53%  t_lockref_from-  [kernel.kallsyms]     [k] account_system_time
>   1,48%  t_lockref_from-  [kernel.kallsyms]     [k] tracesys
>   1,47%  t_lockref_from-  [kernel.kallsyms]     [k] copy_user_generic_unrolled
>   1,46%  t_lockref_from-  [kernel.kallsyms]     [k] syscall_trace_enter
>   1,39%  t_lockref_from-  [kernel.kallsyms]     [k] jiffies_to_timeval
>   1,33%  t_lockref_from-  [kernel.kallsyms]     [k] native_sched_clock
>   1,27%  t_lockref_from-  [kernel.kallsyms]     [k] getname_flags
>   1,27%  t_lockref_from-  [kernel.kallsyms]     [k] lookup_fast
>   1,18%  t_lockref_from-  [kernel.kallsyms]     [k] get_vtime_delta
>   1,05%  t_lockref_from-  [kernel.kallsyms]     [k] syscall_trace_leave
>   1,03%  t_lockref_from-  [kernel.kallsyms]     [k] generic_fillattr
>   1,02%  t_lockref_from-  [kernel.kallsyms]     [k] strncpy_from_user
>   1,00%  t_lockref_from-  [kernel.kallsyms]     [k] user_path_at_empty
>   0,97%  t_lockref_from-  [kernel.kallsyms]     [k] account_user_time
>   0,95%  t_lockref_from-  [kernel.kallsyms]     [k] vfs_fstatat
>   0,95%  t_lockref_from-  [kernel.kallsyms]     [k] system_call_after_swapgs
>   0,92%  t_lockref_from-  [kernel.kallsyms]     [k] generic_permission
>   0,91%  t_lockref_from-  [kernel.kallsyms]     [k] filename_lookup
>   0,80%  t_lockref_from-  [kernel.kallsyms]     [k] vfs_getattr
>   0,78%  t_lockref_from-  [kernel.kallsyms]     [k] __ticket_spin_unlock
>   0,74%  t_lockref_from-  [kernel.kallsyms]     [k] complete_walk
>   0,70%  t_lockref_from-  [kernel.kallsyms]     [k] vtime_account_user
>   0,68%  t_lockref_from-  [kernel.kallsyms]     [k] d_rcu_to_refcount
>   0,65%  t_lockref_from-  [kernel.kallsyms]     [k] common_perm
>   0,62%  t_lockref_from-  [kernel.kallsyms]     [k] rcu_eqs_enter
>   0,58%  t_lockref_from-  [kernel.kallsyms]     [k] vtime_user_enter
>   0,57%  t_lockref_from-  [kernel.kallsyms]     [k] __inode_permission
>   0,55%  t_lockref_from-  [kernel.kallsyms]     [k] dput
>   0,52%  t_lockref_from-  [kernel.kallsyms]     [k] apparmor_inode_getattr
>   0,52%  t_lockref_from-  [kernel.kallsyms]     [k] SYSC_newstat
>   0,52%  t_lockref_from-  [kernel.kallsyms]     [k] mntget
>   0,49%  t_lockref_from-  [kernel.kallsyms]     [k] cpuacct_account_field
>   0,48%  t_lockref_from-  [kernel.kallsyms]     [k] __vtime_account_system
>   0,46%  t_lockref_from-  t_lockref_from-linus  [.] start_routine
>
> Thanks for all the explanations and hints.
>
> Regards,
> - Sedat -
>
> P.S.: Some words to "perf -f"...
>
> $ sudo ~/src/linux-kernel/linux/tools/perf/perf record -f -e cycles:pp
> ./scripts/t_lockref_from-linus
> [sudo] password for wearefam:
>   Error: unknown switch `f'
>
>  usage: perf record [<options>] [<command>]
>     or: perf record [<options>] -- <command> [<options>]
>
>     -e, --event <event>   event selector. use 'perf list' to list
> available events
>         --filter <filter>
>                           event filter
>     -p, --pid <pid>       record events on existing process id
>     -t, --tid <tid>       record events on existing thread id
>     -r, --realtime <n>    collect data with this RT SCHED_FIFO priority
>     -D, --no-delay        collect data without buffering
>     -R, --raw-samples     collect raw sample records from all opened counters
>     -a, --all-cpus        system-wide collection from all CPUs
>     -C, --cpu <cpu>       list of cpus to monitor
>     -c, --count <n>       event period to sample
>     -o, --output <file>   output file name
>     -i, --no-inherit      child tasks do not inherit counters
>     -F, --freq <n>        profile at this frequency
>     -m, --mmap-pages <n>  number of mmap data pages
>         --group           put the counters into a counter group
>     -g, --call-graph <mode[,dump_size]>
>                           do call-graph (stack chain/backtrace)
> recording: [fp] dwarf
>     -v, --verbose         be more verbose (show counter open errors, etc)
>     -q, --quiet           don't print any message
>     -s, --stat            per thread counts
>     -d, --data            Sample addresses
>     -T, --timestamp       Sample timestamps
>     -P, --period          Sample period
>     -n, --no-samples      don't sample
>     -N, --no-buildid-cache
>                           do not update the buildid cache
>     -B, --no-buildid      do not collect buildids in perf.data
>     -G, --cgroup <name>   monitor event in cgroup name only
>     -u, --uid <user>      user to profile
>     -b, --branch-any      sample any taken branches
>     -j, --branch-filter <branch filter mask>
>                           branch stack filter modes
>     -W, --weight          sample by weight (on special events only)
>
> - EOT -

Attached are the results without the patch from Linus.

- Sedat -

[-- Attachment #2: RESULTS_SPINLOCK-LOCKREF-TESTING_WITHOUT-PATCH_3.11.0-rc7-3-iniza-small.txt --]
[-- Type: text/plain, Size: 5302 bytes --]

$ diff -uprN /boot/config-3.11.0-rc7-3-iniza-small /boot/config-3.11.0-rc7-3-lockref-small 
--- /boot/config-3.11.0-rc7-3-iniza-small       2013-09-01 12:17:51.000000000 +0200
+++ /boot/config-3.11.0-rc7-3-lockref-small     2013-09-01 11:23:21.000000000 +0200
@@ -4334,6 +4334,8 @@ CONFIG_GENERIC_PCI_IOMAP=y
 CONFIG_GENERIC_IOMAP=y
 CONFIG_GENERIC_IO=y
 CONFIG_PERCPU_RWSEM=y
+CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
+CONFIG_CMPXCHG_LOCKREF=y
 # CONFIG_CRC_CCITT is not set
 CONFIG_CRC16=y
 CONFIG_CRC_T10DIF=y


$ cat /proc/version 
Linux version 3.11.0-rc7-3-iniza-small (sedat.dilek@gmail.com@fambox) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #1 SMP Sun Sep 1 12:17:33 CEST 2013


$ ~/src/linux-kernel/linux/tools/perf/perf stat --null --repeat 5 ./scripts/t_lockref_from-linus
Total loops: 25528348
Total loops: 25924080
Total loops: 25513405
Total loops: 25619812
Total loops: 25634107

 Performance counter stats for './scripts/t_lockref_from-linus' (5 runs):

      10,002293452 seconds time elapsed                                          ( +-  0,00% )


$ sudo ~/src/linux-kernel/linux/tools/perf/perf record -e cycles:pp ./scripts/t_lockref_from-linus
Total loops: 25251507
[ perf record: Woken up 25 times to write data ]
[ perf record: Captured and wrote 6.108 MB perf.data (~266857 samples) ]


Samples: 159K of event 'cycles:pp', Event count (approx.): 76914824256                                                                                                                                                  
 12,16%  t_lockref_from-  [kernel.kallsyms]     [k] irq_return
 10,74%  t_lockref_from-  [kernel.kallsyms]     [k] __ticket_spin_lock
  4,10%  t_lockref_from-  [kernel.kallsyms]     [k] __acct_update_integrals
  3,79%  t_lockref_from-  [kernel.kallsyms]     [k] user_exit
  2,98%  t_lockref_from-  [kernel.kallsyms]     [k] local_clock
  2,56%  t_lockref_from-  [kernel.kallsyms]     [k] __d_lookup_rcu
  2,50%  t_lockref_from-  libc-2.15.so          [.] __xstat64
  2,47%  t_lockref_from-  [kernel.kallsyms]     [k] kmem_cache_alloc
  2,36%  t_lockref_from-  [kernel.kallsyms]     [k] kmem_cache_free
  2,36%  t_lockref_from-  [kernel.kallsyms]     [k] link_path_walk
  1,82%  t_lockref_from-  [kernel.kallsyms]     [k] tracesys
  1,78%  t_lockref_from-  [kernel.kallsyms]     [k] rcu_eqs_enter_common.isra.45
  1,76%  t_lockref_from-  [kernel.kallsyms]     [k] rcu_eqs_exit_common.isra.43
  1,75%  t_lockref_from-  [kernel.kallsyms]     [k] user_enter
  1,68%  t_lockref_from-  [kernel.kallsyms]     [k] path_lookupat
  1,68%  t_lockref_from-  [kernel.kallsyms]     [k] sched_clock_cpu
  1,53%  t_lockref_from-  [kernel.kallsyms]     [k] native_read_tsc
  1,50%  t_lockref_from-  [kernel.kallsyms]     [k] cp_new_stat
  1,49%  t_lockref_from-  [kernel.kallsyms]     [k] dput
  1,43%  t_lockref_from-  [kernel.kallsyms]     [k] copy_user_generic_unrolled
  1,39%  t_lockref_from-  [kernel.kallsyms]     [k] path_init
  1,39%  t_lockref_from-  [kernel.kallsyms]     [k] account_system_time
  1,38%  t_lockref_from-  [kernel.kallsyms]     [k] syscall_trace_enter
  1,35%  t_lockref_from-  [kernel.kallsyms]     [k] __ticket_spin_unlock
  1,31%  t_lockref_from-  [kernel.kallsyms]     [k] jiffies_to_timeval
  1,27%  t_lockref_from-  [kernel.kallsyms]     [k] native_sched_clock
  1,24%  t_lockref_from-  [kernel.kallsyms]     [k] lookup_fast
  1,24%  t_lockref_from-  [kernel.kallsyms]     [k] complete_walk
  1,23%  t_lockref_from-  [kernel.kallsyms]     [k] vfs_getattr
  1,17%  t_lockref_from-  [kernel.kallsyms]     [k] getname_flags
  1,06%  t_lockref_from-  [kernel.kallsyms]     [k] get_vtime_delta
  1,06%  t_lockref_from-  [kernel.kallsyms]     [k] syscall_trace_leave
  0,94%  t_lockref_from-  [kernel.kallsyms]     [k] generic_fillattr
  0,93%  t_lockref_from-  [kernel.kallsyms]     [k] account_user_time
  0,92%  t_lockref_from-  [kernel.kallsyms]     [k] strncpy_from_user
  0,91%  t_lockref_from-  [kernel.kallsyms]     [k] user_path_at_empty
  0,90%  t_lockref_from-  [kernel.kallsyms]     [k] system_call_after_swapgs
  0,88%  t_lockref_from-  [kernel.kallsyms]     [k] filename_lookup
  0,77%  t_lockref_from-  [kernel.kallsyms]     [k] apparmor_inode_getattr
  0,74%  t_lockref_from-  [kernel.kallsyms]     [k] generic_permission
  0,73%  t_lockref_from-  [kernel.kallsyms]     [k] vfs_fstatat
  0,69%  t_lockref_from-  [kernel.kallsyms]     [k] _raw_spin_lock
  0,67%  t_lockref_from-  [kernel.kallsyms]     [k] __inode_permission
  0,65%  t_lockref_from-  [kernel.kallsyms]     [k] vtime_account_user
  0,64%  t_lockref_from-  [kernel.kallsyms]     [k] __ticket_spin_is_locked
  0,57%  t_lockref_from-  [kernel.kallsyms]     [k] vtime_user_enter
  0,56%  t_lockref_from-  [kernel.kallsyms]     [k] common_perm
  0,56%  t_lockref_from-  [kernel.kallsyms]     [k] rcu_eqs_enter
  0,56%  t_lockref_from-  [kernel.kallsyms]     [k] mntget
  0,51%  t_lockref_from-  [kernel.kallsyms]     [k] cpuacct_account_field
  0,47%  t_lockref_from-  [kernel.kallsyms]     [k] __vtime_account_system
  0,44%  t_lockref_from-  [kernel.kallsyms]     [k] lg_local_lock
  0,43%  t_lockref_from-  t_lockref_from-linus  [.] start_routine
  0,43%  t_lockref_from-  [kernel.kallsyms]     [k] acct_account_cputime
Press '?' for help on key bindings


-dileks // 01-Sep-2013



^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01 10:01                                 ` Sedat Dilek
  2013-09-01 10:33                                   ` Sedat Dilek
@ 2013-09-01 15:32                                   ` Linus Torvalds
  2013-09-01 15:45                                     ` Sedat Dilek
                                                       ` (2 more replies)
  1 sibling, 3 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-09-01 15:32 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Sun, Sep 1, 2013 at 3:01 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> Looks like this is now 10x faster: ~2.66Mloops (debug) VS.
> ~26.60Mloops (no-debug).

Ok, that's getting to be in the right ballpark.

But your profile is still odd.

> Samples: 159K of event 'cycles:pp', Event count (approx.): 76968896763
>  12,79%  t_lockref_from-  [kernel.kallsyms]     [k] irq_return
>   4,36%  t_lockref_from-  [kernel.kallsyms]     [k] __ticket_spin_lock

If you do the profile with "-g", what are the top callers of this? You
shouldn't see any spinlock load from the path lookup, but you have all
these other things going on..

>   4,36%  t_lockref_from-  [kernel.kallsyms]     [k] __acct_update_integrals
>   4,07%  t_lockref_from-  [kernel.kallsyms]     [k] user_exit
>   3,12%  t_lockref_from-  [kernel.kallsyms]     [k] local_clock
>   2,83%  t_lockref_from-  [kernel.kallsyms]     [k] lockref_get_or_lock
>   2,73%  t_lockref_from-  [kernel.kallsyms]     [k] kmem_cache_alloc
>   2,62%  t_lockref_from-  [kernel.kallsyms]     [k] __d_lookup_rcu

You're spending more time on the task stats than on the actual lookup.
Maybe you should turn off CONFIG_TASKSTATS..But why that whole
irq_return thing? Odd.

                   Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01 15:32                                   ` Linus Torvalds
@ 2013-09-01 15:45                                     ` Sedat Dilek
  2013-09-01 15:55                                       ` Linus Torvalds
  2013-09-01 20:59                                     ` Linus Torvalds
  2013-09-03 22:37                                     ` Sedat Dilek
  2 siblings, 1 reply; 151+ messages in thread
From: Sedat Dilek @ 2013-09-01 15:45 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Sun, Sep 1, 2013 at 5:32 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Sun, Sep 1, 2013 at 3:01 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>
>> Looks like this is now 10x faster: ~2.66Mloops (debug) VS.
>> ~26.60Mloops (no-debug).
>
> Ok, that's getting to be in the right ballpark.
>
> But your profile is still odd.
>
>> Samples: 159K of event 'cycles:pp', Event count (approx.): 76968896763
>>  12,79%  t_lockref_from-  [kernel.kallsyms]     [k] irq_return
>>   4,36%  t_lockref_from-  [kernel.kallsyms]     [k] __ticket_spin_lock
>
> If you do the profile with "-g", what are the top callers of this? You
> shouldn't see any spinlock load from the path lookup, but you have all
> these other things going on..
>

$ sudo ~/src/linux-kernel/linux/tools/perf/perf record -g -e cycles:pp
./scripts/t_lockref_from-linus
Total loops: 26205085
[ perf record: Woken up 77 times to write data ]
[ perf record: Captured and wrote 19.778 MB perf.data (~864092 samples) ]


$ sudo ~/src/linux-kernel/linux/tools/perf/perf report <--- I used
here with -f option, the last one, dropped here.

Samples: 160K of event 'cycles:pp', Event count (approx.): 77003901089
+  12,46%  t_lockref_from-  [kernel.kallsyms]     [k] irq_return
+   4,86%  t_lockref_from-  [kernel.kallsyms]     [k] lockref_get_or_lock
+   4,42%  t_lockref_from-  [kernel.kallsyms]     [k] __ticket_spin_lock
+   4,28%  t_lockref_from-  [kernel.kallsyms]     [k] __acct_update_integrals
+   3,97%  t_lockref_from-  [kernel.kallsyms]     [k] user_exit
+   3,04%  t_lockref_from-  [kernel.kallsyms]     [k] local_clock
+   2,71%  t_lockref_from-  [kernel.kallsyms]     [k] kmem_cache_alloc
+   2,50%  t_lockref_from-  [kernel.kallsyms]     [k] link_path_walk
+   2,46%  t_lockref_from-  libc-2.15.so          [.] __xstat64
+   2,38%  t_lockref_from-  [kernel.kallsyms]     [k] kmem_cache_free
+   1,96%  t_lockref_from-  [kernel.kallsyms]     [k] path_lookupat
+   1,88%  t_lockref_from-  [kernel.kallsyms]     [k] __d_lookup_rcu
+   1,87%  t_lockref_from-  [kernel.kallsyms]     [k] tracesys
+   1,84%  t_lockref_from-  [kernel.kallsyms]     [k]
rcu_eqs_exit_common.isra.43
+   1,81%  t_lockref_from-  [kernel.kallsyms]     [k]
rcu_eqs_enter_common.isra.45
+   1,80%  t_lockref_from-  [kernel.kallsyms]     [k] user_enter
+   1,79%  t_lockref_from-  [kernel.kallsyms]     [k] sched_clock_cpu
+   1,61%  t_lockref_from-  [kernel.kallsyms]     [k] native_read_tsc
+   1,56%  t_lockref_from-  [kernel.kallsyms]     [k] cp_new_stat
+   1,52%  t_lockref_from-  [kernel.kallsyms]     [k] lockref_put_or_lock
+   1,51%  t_lockref_from-  [kernel.kallsyms]     [k] account_system_time
+   1,46%  t_lockref_from-  [kernel.kallsyms]     [k] path_init
+   1,46%  t_lockref_from-  [kernel.kallsyms]     [k] copy_user_generic_unrolled
+   1,42%  t_lockref_from-  [kernel.kallsyms]     [k] syscall_trace_enter
+   1,38%  t_lockref_from-  [kernel.kallsyms]     [k] jiffies_to_timeval
+   1,32%  t_lockref_from-  [kernel.kallsyms]     [k] lookup_fast
+   1,31%  t_lockref_from-  [kernel.kallsyms]     [k] native_sched_clock
+   1,24%  t_lockref_from-  [kernel.kallsyms]     [k] getname_flags
+   1,17%  t_lockref_from-  [kernel.kallsyms]     [k] vfs_getattr
+   1,15%  t_lockref_from-  [kernel.kallsyms]     [k] get_vtime_delta
+   1,03%  t_lockref_from-  [kernel.kallsyms]     [k] syscall_trace_leave
+   0,95%  t_lockref_from-  [kernel.kallsyms]     [k] generic_fillattr
+   0,94%  t_lockref_from-  [kernel.kallsyms]     [k] user_path_at_empty
+   0,93%  t_lockref_from-  [kernel.kallsyms]     [k] system_call_after_swapgs
+   0,93%  t_lockref_from-  [kernel.kallsyms]     [k] account_user_time
+   0,89%  t_lockref_from-  [kernel.kallsyms]     [k] strncpy_from_user
+   0,86%  t_lockref_from-  [kernel.kallsyms]     [k] complete_walk
+   0,80%  t_lockref_from-  [kernel.kallsyms]     [k] filename_lookup
+   0,80%  t_lockref_from-  [kernel.kallsyms]     [k] vfs_fstatat
+   0,78%  t_lockref_from-  [kernel.kallsyms]     [k] generic_permission
+   0,77%  t_lockref_from-  [kernel.kallsyms]     [k] __ticket_spin_unlock
+   0,73%  t_lockref_from-  [kernel.kallsyms]     [k] __inode_permission
+   0,69%  t_lockref_from-  [kernel.kallsyms]     [k] vtime_account_user
+   0,66%  t_lockref_from-  [kernel.kallsyms]     [k] d_rcu_to_refcount
+   0,61%  t_lockref_from-  [kernel.kallsyms]     [k] common_perm
+   0,60%  t_lockref_from-  [kernel.kallsyms]     [k] rcu_eqs_enter
+   0,59%  t_lockref_from-  [kernel.kallsyms]     [k] dput
+   0,54%  t_lockref_from-  [kernel.kallsyms]     [k] vtime_user_enter
+   0,51%  t_lockref_from-  [kernel.kallsyms]     [k] cpuacct_account_field
+   0,50%  t_lockref_from-  [kernel.kallsyms]     [k] mntput
+   0,48%  t_lockref_from-  [kernel.kallsyms]     [k] lg_local_lock
+   0,48%  t_lockref_from-  [kernel.kallsyms]     [k] apparmor_inode_getattr
+   0,45%  t_lockref_from-  t_lockref_from-linus  [.] start_routine
+   0,45%  t_lockref_from-  [kernel.kallsyms]     [k] __vtime_account_system
Press '?' for help on key bindings

- Sedat -

>>   4,36%  t_lockref_from-  [kernel.kallsyms]     [k] __acct_update_integrals
>>   4,07%  t_lockref_from-  [kernel.kallsyms]     [k] user_exit
>>   3,12%  t_lockref_from-  [kernel.kallsyms]     [k] local_clock
>>   2,83%  t_lockref_from-  [kernel.kallsyms]     [k] lockref_get_or_lock
>>   2,73%  t_lockref_from-  [kernel.kallsyms]     [k] kmem_cache_alloc
>>   2,62%  t_lockref_from-  [kernel.kallsyms]     [k] __d_lookup_rcu
>
> You're spending more time on the task stats than on the actual lookup.
> Maybe you should turn off CONFIG_TASKSTATS..But why that whole
> irq_return thing? Odd.
>

Yes, I have CONFIG_TASKSTATS=y.
I can try a -4 build w/o it.

- Sedat -

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01 15:45                                     ` Sedat Dilek
@ 2013-09-01 15:55                                       ` Linus Torvalds
  2013-09-02 10:30                                         ` Sedat Dilek
  0 siblings, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-09-01 15:55 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Sun, Sep 1, 2013 at 8:45 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> Samples: 160K of event 'cycles:pp', Event count (approx.): 77003901089
> +  12,46%  t_lockref_from-  [kernel.kallsyms]     [k] irq_return
> +   4,86%  t_lockref_from-  [kernel.kallsyms]     [k] lockref_get_or_lock
> +   4,42%  t_lockref_from-  [kernel.kallsyms]     [k] __ticket_spin_lock
> +   4,28%  t_lockref_from-  [kernel.kallsyms]     [k] __acct_update_integrals

You need to go into __ticket_spin_lock to see who the callers are.

Just go down to it and press enter to expand it (and then you need to
go and expand that entry too to get the callers)

I still don't know how you get to irq_return. It should use sysret. Odd.

            Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01  0:13                                             ` Al Viro
@ 2013-09-01 17:48                                               ` Al Viro
  2013-09-09  8:30                                               ` Peter Zijlstra
  1 sibling, 0 replies; 151+ messages in thread
From: Al Viro @ 2013-09-01 17:48 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Sun, Sep 01, 2013 at 01:13:06AM +0100, Al Viro wrote:
> > Actually, right now I'm debugging a variant that avoids local buffers; use
> > is %pD3 for grandparent/parent/name, etc., up to %pD4.  %pd is equivalent
> > to %pD1 (just the dentry name).  Keep in mind that things like NFS use
> > a _lot_ of what would be %pD2 in debugging printks and the string can grow
> > fairly long, so I'd rather live with widen() than mess with local buffers
> > here.  I'll send an updated variant when I'm more or less satisfied with
> > it...
> 
> Seems to be working...  This doesn't include the metric arseload of
> conversions in fs/*/* - just the sprintf part.

FWIW, now that I've looked at more users (and we do have a shitload
of those), it seems that we need the following set:
	dentry name
	dentry path 2--4 levels deep (most of the users want 2 right now,
but that's mostly a matter of arguments being too painful to type for
deeper ones)
	same for file - sure, we can just pass file->f_path.dentry,
but there's a lot of such guys and I'd like to reduce the amount of
places where we have ->f_path.dentry mentioned in source.

Suggestions regarding formats to use would be welcome.  For now I'm using
pd/pd<n>/pD/pD<n>, the latter two being for struct file, but I'd gladly
take anything prettier than that.

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01 15:32                                   ` Linus Torvalds
  2013-09-01 15:45                                     ` Sedat Dilek
@ 2013-09-01 20:59                                     ` Linus Torvalds
  2013-09-01 21:23                                       ` Al Viro
  2013-09-03 22:37                                     ` Sedat Dilek
  2 siblings, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-09-01 20:59 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Sun, Sep 1, 2013 at 8:32 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Sun, Sep 1, 2013 at 3:01 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>
>> Looks like this is now 10x faster: ~2.66Mloops (debug) VS.
>> ~26.60Mloops (no-debug).
>
> Ok, that's getting to be in the right ballpark.

So I installed my new i7-4770S yesterday - somewhat lower frequency
than my previous CPU, but it has four cores plus HT, and boy does that
show the scalability problems better.

My test-program used to get maybe 15% time in spinlock. On the 4770S,
with current -git (so no lockref) I get this:

   [torvalds@i5 test-lookup]$ for i in 1 2 3 4 5; do ./a.out ; done
   Total loops: 26656873
   Total loops: 26701572
   Total loops: 26698526
   Total loops: 26752993
   Total loops: 26710556

with a profile that looks roughly like:

  84.14%  a.out   _raw_spin_lock
   3.04%  a.out   lg_local_lock
   2.16%  a.out   vfs_getattr
   1.16%  a.out   dput.part.15
   0.67%  a.out   copy_user_enhanced_fast_string
   0.55%  a.out   complete_walk

[ Side note: Al, that lg_local_lock really is annoying: it's
br_read_lock(mntput_no_expire), with two thirds of the calls coming
from mntput_no_expire, and the rest from path_init -> lock_rcu_walk.

  I really really wonder if we could get rid of the
br_read_lock(&vfsmount_lock) for rcu_walk_init(), and use just the RCU
read accesses for the mount-namespaces too. What is that lock really
protecting against during lookup anyway? ]

With the last lockref patch I sent out, it looks like this:

   [torvalds@i5 test-lookup]$ for i in 1 2 3 4 5; do ./a.out ; done
   Total loops: 54740529
   Total loops: 54568346
   Total loops: 54715686
   Total loops: 54715854
   Total loops: 54790592

  28.55%  a.out   lockref_get_or_lock
  20.65%  a.out   lockref_put_or_lock
   9.06%  a.out   dput
   6.37%  a.out   lg_local_lock
   5.45%  a.out   lookup_fast
   3.77%  a.out   d_rcu_to_refcount
   2.03%  a.out   vfs_getattr
   1.75%  a.out   copy_user_enhanced_fast_string
   1.16%  a.out   link_path_walk
   1.15%  a.out   avc_has_perm_noaudit
   1.14%  a.out   __lookup_mnt

so performance more than doubled (on that admittedly stupid
benchmark), and you can see that the cacheline bouncing for that
reference count is still a big deal, but at least it gets some real
work done now because we're not spinning waiting for it.

So you can see the bad case with even just a single socket when the
benchmark is just targeted enough. But two cores just wasn't enough to
show any performance advantage.

                Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01 20:59                                     ` Linus Torvalds
@ 2013-09-01 21:23                                       ` Al Viro
  2013-09-01 22:16                                         ` Linus Torvalds
  0 siblings, 1 reply; 151+ messages in thread
From: Al Viro @ 2013-09-01 21:23 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Sedat Dilek, Waiman Long, Ingo Molnar, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Sun, Sep 01, 2013 at 01:59:22PM -0700, Linus Torvalds wrote:

> [ Side note: Al, that lg_local_lock really is annoying: it's
> br_read_lock(mntput_no_expire), with two thirds of the calls coming
> from mntput_no_expire, and the rest from path_init -> lock_rcu_walk.

How much of that is due to br_write_lock() taken in mntput_no_expire()
for no good reason?  IOW, could you try shmem.c patch I've sent yesterday
and see how much effect does it have?[1]  Basically, we get it grabbed
exclusive on each final fput() of a struct file created by shmem_file_setup(),
which is _not_ a rare event.  And the only reason for that is not having
shm_mnt marked long-living, even though its refcount never hits 0...
 
>   I really really wonder if we could get rid of the
> br_read_lock(&vfsmount_lock) for rcu_walk_init(), and use just the RCU
> read accesses for the mount-namespaces too. What is that lock really
> protecting against during lookup anyway? ]

A lot of things, I'm afraid.  It's not as simple as just the access
to vfsmount hash... ;-/  I'll need to do some digging to put together
a full analysis, but there had been quite a few subtle issues where
it played...

[1] sits in the local queue, will push tonight:

commit e7db6c4c1d01032f53262f03b5f38899f9db8add
Author: Al Viro <viro@zeniv.linux.org.uk>
Date:   Sat Aug 31 12:57:10 2013 -0400

shm_mnt is as longterm as it gets, TYVM...
    
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

diff --git a/mm/shmem.c b/mm/shmem.c
index e43dc55..5261498 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2615,13 +2615,15 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent)
 	 * tmpfs instance, limiting inodes to one per page of lowmem;
 	 * but the internal instance is left unlimited.
 	 */
-	if (!(sb->s_flags & MS_NOUSER)) {
+	if (!(sb->s_flags & MS_KERNMOUNT)) {
 		sbinfo->max_blocks = shmem_default_max_blocks();
 		sbinfo->max_inodes = shmem_default_max_inodes();
 		if (shmem_parse_options(data, sbinfo, false)) {
 			err = -EINVAL;
 			goto failed;
 		}
+	} else {
+		sb->s_flags |= MS_NOUSER;
 	}
 	sb->s_export_op = &shmem_export_ops;
 	sb->s_flags |= MS_NOSEC;
@@ -2831,8 +2833,7 @@ int __init shmem_init(void)
 		goto out2;
 	}
 
-	shm_mnt = vfs_kern_mount(&shmem_fs_type, MS_NOUSER,
-				 shmem_fs_type.name, NULL);
+	shm_mnt = kern_mount(&shmem_fs_type);
 	if (IS_ERR(shm_mnt)) {
 		error = PTR_ERR(shm_mnt);
 		printk(KERN_ERR "Could not kern_mount tmpfs\n");

^ permalink raw reply related	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01 21:23                                       ` Al Viro
@ 2013-09-01 22:16                                         ` Linus Torvalds
  2013-09-01 22:35                                           ` Al Viro
  2013-09-01 22:48                                           ` Linus Torvalds
  0 siblings, 2 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-09-01 22:16 UTC (permalink / raw)
  To: Al Viro
  Cc: Sedat Dilek, Waiman Long, Ingo Molnar, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Sun, Sep 1, 2013 at 2:23 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> How much of that is due to br_write_lock() taken in mntput_no_expire()
> for no good reason?  IOW, could you try shmem.c patch I've sent yesterday
> and see how much effect does it have?[1]  Basically, we get it grabbed
> exclusive on each final fput() of a struct file created by shmem_file_setup(),
> which is _not_ a rare event.  And the only reason for that is not having
> shm_mnt marked long-living, even though its refcount never hits 0...

Does not seem to matter. Still 66% mntput_no_expire, 31% path_init.
And that lg_local_lock() takes 5-6% of CPU, pretty much all of which
is that single xadd instruction that implements the spinlock.

This is on /tmp, which is tmpfs. But I don't see how any of that could
matter. "mntput()" does an unconditional call to mntput_no_expire(),
and mntput_no_expire() does that br_read_lock() unconditionally too.

Note that I'm talking about that "cheap" *read* lock being expensive.
It's the local one, not the global one. So it's not what Waiman saw
with the global lock. This is a local per-cpu thing.

That read-lock is supposed to be very cheap - it's just a per-cpu
spinlock. But it ends up being very expensive for some reason. I'm not
quite sure why - I don't see any lg_global_lock() calls at all, so...

I wonder if there is some false sharing going on. But I don't see that
either, this is the percpu offset map afaik:

  000000000000f560 d files_lglock_lock
  000000000000f564 d nr_dentry
  000000000000f568 d last_ino
  000000000000f56c d nr_unused
  000000000000f570 d nr_inodes
  000000000000f574 d vfsmount_lock_lock
  000000000000f580 d bh_accounting

and I don't see anything there that would get cross-cpu accesses, so
there shouldn't be any cacheline bouncing. That's the whole point of
percpu variables, after all.

Odd. What am I missing?

            Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01 22:16                                         ` Linus Torvalds
@ 2013-09-01 22:35                                           ` Al Viro
  2013-09-01 22:44                                             ` Al Viro
  2013-09-01 22:48                                           ` Linus Torvalds
  1 sibling, 1 reply; 151+ messages in thread
From: Al Viro @ 2013-09-01 22:35 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Sedat Dilek, Waiman Long, Ingo Molnar, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Sun, Sep 01, 2013 at 03:16:24PM -0700, Linus Torvalds wrote:

> Does not seem to matter. Still 66% mntput_no_expire, 31% path_init.
> And that lg_local_lock() takes 5-6% of CPU, pretty much all of which
> is that single xadd instruction that implements the spinlock.
> 
> This is on /tmp, which is tmpfs. But I don't see how any of that could
> matter. "mntput()" does an unconditional call to mntput_no_expire(),
> and mntput_no_expire() does that br_read_lock() unconditionally too.
> 
> Note that I'm talking about that "cheap" *read* lock being expensive.
> It's the local one, not the global one. So it's not what Waiman saw
> with the global lock. This is a local per-cpu thing.
> 
> That read-lock is supposed to be very cheap - it's just a per-cpu
> spinlock. But it ends up being very expensive for some reason. I'm not
> quite sure why - I don't see any lg_global_lock() calls at all, so...
> 
> I wonder if there is some false sharing going on. But I don't see that
> either, this is the percpu offset map afaik:
> 
>   000000000000f560 d files_lglock_lock
>   000000000000f564 d nr_dentry
>   000000000000f568 d last_ino
>   000000000000f56c d nr_unused
>   000000000000f570 d nr_inodes
>   000000000000f574 d vfsmount_lock_lock
>   000000000000f580 d bh_accounting
> 
> and I don't see anything there that would get cross-cpu accesses, so
> there shouldn't be any cacheline bouncing. That's the whole point of
> percpu variables, after all.

Hell knows...  Are you sure you don't see br_write_lock() at all?  I don't
see anything else that would cause cross-cpu traffic with that layout...

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01 22:35                                           ` Al Viro
@ 2013-09-01 22:44                                             ` Al Viro
  2013-09-01 22:58                                               ` Linus Torvalds
  0 siblings, 1 reply; 151+ messages in thread
From: Al Viro @ 2013-09-01 22:44 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Sedat Dilek, Waiman Long, Ingo Molnar, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Sun, Sep 01, 2013 at 11:35:21PM +0100, Al Viro wrote:
> > I wonder if there is some false sharing going on. But I don't see that
> > either, this is the percpu offset map afaik:
> > 
> >   000000000000f560 d files_lglock_lock
> >   000000000000f564 d nr_dentry
> >   000000000000f568 d last_ino
> >   000000000000f56c d nr_unused
> >   000000000000f570 d nr_inodes
> >   000000000000f574 d vfsmount_lock_lock
> >   000000000000f580 d bh_accounting
> > 
> > and I don't see anything there that would get cross-cpu accesses, so
> > there shouldn't be any cacheline bouncing. That's the whole point of
> > percpu variables, after all.
> 
> Hell knows...  Are you sure you don't see br_write_lock() at all?  I don't
> see anything else that would cause cross-cpu traffic with that layout...

GRRR...  I see something else:
void file_sb_list_del(struct file *file)
{
        if (!list_empty(&file->f_u.fu_list)) {
                lg_local_lock_cpu(&files_lglock, file_list_cpu(file));
                list_del_init(&file->f_u.fu_list);
                lg_local_unlock_cpu(&files_lglock, file_list_cpu(file));
        }
}
will cheerfully cause cross-CPU traffic.  If that's what is going on, the
earlier patch I've sent (not putting non-regulars and files opened r/o
on ->s_list) should reduce the cacheline bouncing on that cacheline.

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01 22:16                                         ` Linus Torvalds
  2013-09-01 22:35                                           ` Al Viro
@ 2013-09-01 22:48                                           ` Linus Torvalds
  2013-09-01 23:30                                             ` Al Viro
  1 sibling, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-09-01 22:48 UTC (permalink / raw)
  To: Al Viro
  Cc: Sedat Dilek, Waiman Long, Ingo Molnar, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Sun, Sep 1, 2013 at 3:16 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> I wonder if there is some false sharing going on. But I don't see that
> either, this is the percpu offset map afaik:
>
>   000000000000f560 d files_lglock_lock
>   000000000000f564 d nr_dentry
>   000000000000f568 d last_ino
>   000000000000f56c d nr_unused
>   000000000000f570 d nr_inodes
>   000000000000f574 d vfsmount_lock_lock
>   000000000000f580 d bh_accounting

I made DEFINE_LGLOCK use DEFINE_PER_CPU_SHARED_ALIGNED for the
spinlock, so that each local lock gets its own cacheline, and the
total loops jumped to 62M (from 52-54M before). So when I looked at
the numbers, I thought "oh, that helped".

But then I looked closer, and realized that I just see a fair amount
of boot-to-boot variation anyway (probably a lot to do with cache
placement and how dentries got allocated etc). And it didn't actually
help at all, the problem is stilte there, and lg_local_lock is still
really really high on the profile, at 8% cpu time:

-   8.00%  lg_local_lock
   - lg_local_lock
      + 64.83% mntput_no_expire
      + 33.81% path_init
      + 0.78% mntput
      + 0.58% path_lookupat

which just looks insane. And no, no lg_global_lock visible anywhere..

So it's not false sharing. But something is bouncing *that* particular
lock around.

              Linus

---
  34.60%      lockref_get_or_lock
  23.35%      lockref_put_or_lock
  10.57%      dput
   8.00%      lg_local_lock
   1.79%      copy_user_enhanced_fast_string
   1.15%      link_path_walk
   1.04%      path_lookupat
   1.03%      sysret_check
   1.01%      kmem_cache_alloc
   1.00%      selinux_inode_permission
   0.97%      __d_lookup_rcu
   0.95%      kmem_cache_free
   0.90%      0x00007f03e0800ee3
   0.88%      avc_has_perm_noaudit
   0.79%      cp_new_stat
   0.76%      avc_has_perm_flags
   0.69%      path_init
   0.68%      getname_flags
   0.66%      system_call
   0.58%      generic_permission
   0.55%      lookup_fast
   0.54%      user_path_at_empty
   0.51%      vfs_fstatat
   0.49%      vfs_getattr
   0.49%      filename_lookup
   0.49%      strncpy_from_user
   0.44%      generic_fillattr
   0.40%      inode_has_perm.isra.32.constprop.61
   0.38%      ext4_getattr
   0.34%      complete_walk
   0.34%      lg_local_unlock
   0.27%      d_rcu_to_refcount
   0.25%      __inode_permission
   0.23%      _copy_to_user
   0.23%      security_inode_getattr
   0.22%      mntget
   0.22%      selinux_inode_getattr
   0.21%      SYSC_newstat
   0.21%      mntput_no_expire
   0.20%      putname
   0.17%      path_put
   0.16%      security_inode_permission
   0.16%      start_routine
   0.14%      mntput
   0.14%      final_putname
   0.14%      _cond_resched
   0.12%      inode_permission
   0.10%      user_path_at
   0.09%      __xstat64
   0.07%      sys_newstat
   0.03%      __xstat@plt
   0.03%      update_cfs_rq_blocked_load
   0.02%      task_tick_fair
   0.01%      common_interrupt
   0.01%      ktime_get
   0.01%      lapic_next_deadline
   0.01%      run_timer_softirq
   0.01%      hsw_unclaimed_reg_check.isra.6
   0.01%      sched_clock_cpu
   0.01%      rcu_check_callbacks
   0.01%      update_cfs_shares
   0.01%      _raw_spin_lock
   0.01%      irqtime_account_irq
   0.01%      __do_softirq
   0.01%      ret_from_sys_call
   0.01%      i915_read32
   0.01%      hrtimer_interrupt
   0.01%      update_curr
   0.01%      profile_tick
   0.00%      intel_pmu_disable_all
   0.00%      intel_pmu_enable_all
   0.00%      tg_load_down
   0.00%      native_sched_clock
   0.00%      native_apic_msr_eoi_write
   0.00%      irqtime_account_process_tick.isra.2
   0.00%      perf_event_task_tick
   0.00%      clockevents_program_event
   0.00%      __acct_update_integrals
   0.00%      rcu_irq_exit

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01 22:44                                             ` Al Viro
@ 2013-09-01 22:58                                               ` Linus Torvalds
  0 siblings, 0 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-09-01 22:58 UTC (permalink / raw)
  To: Al Viro
  Cc: Sedat Dilek, Waiman Long, Ingo Molnar, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Sun, Sep 1, 2013 at 3:44 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> GRRR...  I see something else:
> void file_sb_list_del(struct file *file)
> {
>         if (!list_empty(&file->f_u.fu_list)) {
>                 lg_local_lock_cpu(&files_lglock, file_list_cpu(file));
>                 list_del_init(&file->f_u.fu_list);
>                 lg_local_unlock_cpu(&files_lglock, file_list_cpu(file));
>         }
> }
> will cheerfully cause cross-CPU traffic.  If that's what is going on, the
> earlier patch I've sent (not putting non-regulars and files opened r/o
> on ->s_list) should reduce the cacheline bouncing on that cacheline.

Hmm. That might indeed be a bad sources of cross-cpu bouncing on some
loads, but the load I test doesn't actually open any files. It just
does "stat()" on a filename.

So no "struct file *" anywhere for me..It really seems to be
vfsmount_lock itself somehow.

              Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01 22:48                                           ` Linus Torvalds
@ 2013-09-01 23:30                                             ` Al Viro
  2013-09-02  0:12                                               ` Linus Torvalds
  0 siblings, 1 reply; 151+ messages in thread
From: Al Viro @ 2013-09-01 23:30 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Sedat Dilek, Waiman Long, Ingo Molnar, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Sun, Sep 01, 2013 at 03:48:01PM -0700, Linus Torvalds wrote:
> I made DEFINE_LGLOCK use DEFINE_PER_CPU_SHARED_ALIGNED for the
> spinlock, so that each local lock gets its own cacheline, and the
> total loops jumped to 62M (from 52-54M before). So when I looked at
> the numbers, I thought "oh, that helped".
> 
> But then I looked closer, and realized that I just see a fair amount
> of boot-to-boot variation anyway (probably a lot to do with cache
> placement and how dentries got allocated etc). And it didn't actually
> help at all, the problem is stilte there, and lg_local_lock is still
> really really high on the profile, at 8% cpu time:
> 
> -   8.00%  lg_local_lock
>    - lg_local_lock
>       + 64.83% mntput_no_expire
>       + 33.81% path_init
>       + 0.78% mntput
>       + 0.58% path_lookupat
> 
> which just looks insane. And no, no lg_global_lock visible anywhere..
> 
> So it's not false sharing. But something is bouncing *that* particular
> lock around.

Hrm...  It excludes sharing between the locks, all right.  AFAICS, that
won't exclude sharing with plain per-cpu vars, will it?  Could you
tell what vfsmount_lock is sharing with on that build?  The stuff between
it and files_lock doesn't have any cross-CPU writers, but with that
change it's the stuff after it that becomes interesting...

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01 23:30                                             ` Al Viro
@ 2013-09-02  0:12                                               ` Linus Torvalds
  2013-09-02  0:50                                                 ` Linus Torvalds
  0 siblings, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-09-02  0:12 UTC (permalink / raw)
  To: Al Viro
  Cc: Sedat Dilek, Waiman Long, Ingo Molnar, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Sun, Sep 1, 2013 at 4:30 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> Hrm...  It excludes sharing between the locks, all right.  AFAICS, that
> won't exclude sharing with plain per-cpu vars, will it?

Yes it will. DEFINE_PER_CPU_SHARED_ALIGNED not only aligns the data,
it also puts it in a separate section with only other aligned data
entries. So now the percpu address map around it looks like this:

  ...
  0000000000013a80 d call_single_queue
  0000000000013ac0 d cfd_data
  0000000000013b00 d files_lglock_lock
  0000000000013b40 d vfsmount_lock_lock
  0000000000013b80 d file_lock_lglock_lock
  0000000000013bc0 D softnet_data
  0000000000013d40 D __per_cpu_end
   ..

So there shouldn't be anything to share falsely with.

I'd like to say that the profile is bad, but this is *so* consistent,
and the profile data really looks perfectly fine in every other way.
I'm using "-e cycles:pp", so it's using hardware profiling and all the
other functions really look correct.

It *is* one of the few locked accesses remaining, and it's clearly
getting called a lot (three calls per system call: two mntput's  - one
for the root path, one for the result path, and one from path_init ->
rcu_walk_init), but with up to 8% CPU time for basically that one
"lock xadd" instruction is damn odd. I can't see how that could happen
without seriously nasty cacheline bouncing, but I can't see how *that*
can happen when all the accesses seem to be from the current CPU.

This is a new Haswell-based machine that I put together yesterdat, and
I haven't used it for profiling before. So maybe it _is_ something odd
with the profiling after all, and atomic serializing instructions get
incorrect profile counts.

             Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-02  0:12                                               ` Linus Torvalds
@ 2013-09-02  0:50                                                 ` Linus Torvalds
  2013-09-02  7:05                                                   ` Ingo Molnar
  0 siblings, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-09-02  0:50 UTC (permalink / raw)
  To: Al Viro
  Cc: Sedat Dilek, Waiman Long, Ingo Molnar, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Sun, Sep 1, 2013 at 5:12 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> It *is* one of the few locked accesses remaining, and it's clearly
> getting called a lot (three calls per system call: two mntput's  - one
> for the root path, one for the result path, and one from path_init ->
> rcu_walk_init), but with up to 8% CPU time for basically that one
> "lock xadd" instruction is damn odd. I can't see how that could happen
> without seriously nasty cacheline bouncing, but I can't see how *that*
> can happen when all the accesses seem to be from the current CPU.

So, I wanted to double-check that "it can only be that expensive if
there's cacheline bouncing" statement. Thinking "maybe it's just
really expensive. Even when running just a single thread".

So I set MAX_THREADS to 1 in my stupid benchmark, just to see what happens..

And almost everything changes as expected: now we don't have any
cacheline bouncing any more, so lockref_put_or_lock() and
lockref_get_or_lock() no longer dominate - instead of being 20%+ each,
they are now just 3%.

What _didn't_ change? Right. lg_local_lock() is still 6.40%. Even when
single-threaded. It's now the #1 function in my profile:

   6.40%   lg_local_lock
   5.42%   copy_user_enhanced_fast_string
   5.14%   sysret_check
   4.79%   link_path_walk
   4.41%   0x00007ff861834ee3
   4.33%   avc_has_perm_flags
   4.19%   __lookup_mnt
   3.83%   lookup_fast

(that "copy_user_enhanced_fast_string" is when we copy the "struct
stat" from kernel space to user space)

The instruction-level profile just looking like

       │    ffffffff81078e70 <lg_local_lock>:
  2.06 │      push   %rbp
  1.06 │      mov    %rsp,%rbp
  0.11 │      mov    (%rdi),%rdx
  2.13 │      add    %gs:0xcd48,%rdx
  0.92 │      mov    $0x100,%eax
 85.87 │      lock   xadd   %ax,(%rdx)
  0.04 │      movzbl %ah,%ecx
       │      cmp    %al,%cl
  3.60 │    ↓ je     31
       │      nop
       │28:   pause
       │      movzbl (%rdx),%eax
       │      cmp    %cl,%al
       │    ↑ jne    28
       │31:   pop    %rbp
  4.22 │    ← retq

so that instruction sequence is just expensive, and it is expensive
without any cacheline bouncing. The expense seems to be 100% simply
due to the fact that it's an atomic serializing instruction, and it
just gets called way too much.

So lockref_[get|put]_or_lock() are each called once per pathname
lookup (because the RCU accesses to the dentries get turned into a
refcount, and then that refcount gets dropped). But lg_local_lock()
gets called twice: once for path_init(), and once for mntput() - I
think I was wrong about mntput getting called twice.

So it doesn't seem to be cacheline bouncing at all. It's just
"serializing instructions are really expensive" together with calling
that function too much. And we've optimized pathname lookup so much
that even a single locked instruction shows up like a sort thumb.

I guess we should be proud.

              Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-02  0:50                                                 ` Linus Torvalds
@ 2013-09-02  7:05                                                   ` Ingo Molnar
  2013-09-02 16:44                                                     ` Linus Torvalds
  0 siblings, 1 reply; 151+ messages in thread
From: Ingo Molnar @ 2013-09-02  7:05 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Al Viro, Sedat Dilek, Waiman Long, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J, Peter Zijlstra, Arnaldo Carvalho de Melo


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Sun, Sep 1, 2013 at 5:12 PM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > It *is* one of the few locked accesses remaining, and it's clearly
> > getting called a lot (three calls per system call: two mntput's  - one
> > for the root path, one for the result path, and one from path_init ->
> > rcu_walk_init), but with up to 8% CPU time for basically that one
> > "lock xadd" instruction is damn odd. I can't see how that could happen
> > without seriously nasty cacheline bouncing, but I can't see how *that*
> > can happen when all the accesses seem to be from the current CPU.
> 
> So, I wanted to double-check that "it can only be that expensive if
> there's cacheline bouncing" statement. Thinking "maybe it's just
> really expensive. Even when running just a single thread".
> 
> So I set MAX_THREADS to 1 in my stupid benchmark, just to see what happens..
> 
> And almost everything changes as expected: now we don't have any
> cacheline bouncing any more, so lockref_put_or_lock() and
> lockref_get_or_lock() no longer dominate - instead of being 20%+ each,
> they are now just 3%.
> 
> What _didn't_ change? Right. lg_local_lock() is still 6.40%. Even when
> single-threaded. It's now the #1 function in my profile:
> 
>    6.40%   lg_local_lock
>    5.42%   copy_user_enhanced_fast_string
>    5.14%   sysret_check
>    4.79%   link_path_walk
>    4.41%   0x00007ff861834ee3
>    4.33%   avc_has_perm_flags
>    4.19%   __lookup_mnt
>    3.83%   lookup_fast
> 
> (that "copy_user_enhanced_fast_string" is when we copy the "struct
> stat" from kernel space to user space)
> 
> The instruction-level profile just looking like
> 
>        ???    ffffffff81078e70 <lg_local_lock>:
>   2.06 ???      push   %rbp
>   1.06 ???      mov    %rsp,%rbp
>   0.11 ???      mov    (%rdi),%rdx
>   2.13 ???      add    %gs:0xcd48,%rdx
>   0.92 ???      mov    $0x100,%eax
>  85.87 ???      lock   xadd   %ax,(%rdx)
>   0.04 ???      movzbl %ah,%ecx
>        ???      cmp    %al,%cl
>   3.60 ???    ??? je     31
>        ???      nop
>        ???28:   pause
>        ???      movzbl (%rdx),%eax
>        ???      cmp    %cl,%al
>        ???    ??? jne    28
>        ???31:   pop    %rbp
>   4.22 ???    ??? retq

The Haswell perf code isn't very widely tested yet as it took quite some 
time to get it ready for upstream and thus got merged late, but on its 
face this looks like a pretty good profile.

With one detail:

> so that instruction sequence is just expensive, and it is expensive 
> without any cacheline bouncing. The expense seems to be 100% simply due 
> to the fact that it's an atomic serializing instruction, and it just 
> gets called way too much.
> 
> So lockref_[get|put]_or_lock() are each called once per pathname lookup 
> (because the RCU accesses to the dentries get turned into a refcount, 
> and then that refcount gets dropped). But lg_local_lock() gets called 
> twice: once for path_init(), and once for mntput() - I think I was wrong 
> about mntput getting called twice.
> 
> So it doesn't seem to be cacheline bouncing at all. It's just 
> "serializing instructions are really expensive" together with calling 
> that function too much. And we've optimized pathname lookup so much that 
> even a single locked instruction shows up like a sort thumb.
> 
> I guess we should be proud.

It still looks anomalous to me, on fresh Intel hardware. One suggestion: 
could you, just for pure testing purposes, turn HT off and do a quick 
profile that way?

The XADD, even if it's all in the fast path, could be a pretty natural 
point to 'yield' an SMT context on a given core, giving it artificially 
high overhead.

Note that to test HT off an intrusive reboot is probably not needed, if 
the HT siblings are right after each other in the CPU enumeration sequence 
then you can turn HT "off" effectively by running the workload only on 4 
cores:

  taskset 0x55 ./my-test

and reducing the # of your workload threads to 4 or so.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01 15:55                                       ` Linus Torvalds
@ 2013-09-02 10:30                                         ` Sedat Dilek
  2013-09-02 16:09                                           ` David Ahern
  0 siblings, 1 reply; 151+ messages in thread
From: Sedat Dilek @ 2013-09-02 10:30 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Sun, Sep 1, 2013 at 5:55 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Sun, Sep 1, 2013 at 8:45 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>
>> Samples: 160K of event 'cycles:pp', Event count (approx.): 77003901089
>> +  12,46%  t_lockref_from-  [kernel.kallsyms]     [k] irq_return
>> +   4,86%  t_lockref_from-  [kernel.kallsyms]     [k] lockref_get_or_lock
>> +   4,42%  t_lockref_from-  [kernel.kallsyms]     [k] __ticket_spin_lock
>> +   4,28%  t_lockref_from-  [kernel.kallsyms]     [k] __acct_update_integrals
>
> You need to go into __ticket_spin_lock to see who the callers are.
>
> Just go down to it and press enter to expand it (and then you need to
> go and expand that entry too to get the callers)
>

I am new to perf usage.

  4,60%  t_lockref_from-  [kernel.kallsyms]     [k] __ticket_spin_lock

Which entry to select?

Annotate __ticket_spin_lock
Zoom into t_lockref_from-(3962) thread
Zoom into the Kernel DSO
Browse map details
Run scripts for samples of thread [t_lockref_from-]
Run scripts for samples of symbol [__ticket_spin_lock]
Run scripts for all samples
Switch to another data file in PWD
Exit

> I still don't know how you get to irq_return. It should use sysret. Odd.

- Sedat -

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-02 10:30                                         ` Sedat Dilek
@ 2013-09-02 16:09                                           ` David Ahern
  0 siblings, 0 replies; 151+ messages in thread
From: David Ahern @ 2013-09-02 16:09 UTC (permalink / raw)
  To: sedat.dilek
  Cc: Linus Torvalds, Waiman Long, Ingo Molnar, Benjamin Herrenschmidt,
	Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Peter Zijlstra, Steven Rostedt, Andi Kleen, Chandramouleeswaran,
	Aswin, Norton, Scott J

On 9/2/13 4:30 AM, Sedat Dilek wrote:
> On Sun, Sep 1, 2013 at 5:55 PM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
>> On Sun, Sep 1, 2013 at 8:45 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>>
>>> Samples: 160K of event 'cycles:pp', Event count (approx.): 77003901089
>>> +  12,46%  t_lockref_from-  [kernel.kallsyms]     [k] irq_return
>>> +   4,86%  t_lockref_from-  [kernel.kallsyms]     [k] lockref_get_or_lock
>>> +   4,42%  t_lockref_from-  [kernel.kallsyms]     [k] __ticket_spin_lock
>>> +   4,28%  t_lockref_from-  [kernel.kallsyms]     [k] __acct_update_integrals
>>
>> You need to go into __ticket_spin_lock to see who the callers are.
>>
>> Just go down to it and press enter to expand it (and then you need to
>> go and expand that entry too to get the callers)
>>
>
> I am new to perf usage.

One option for you is 'perf report --stdio ..'. That bypasses the tui.

David

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-02  7:05                                                   ` Ingo Molnar
@ 2013-09-02 16:44                                                     ` Linus Torvalds
  2013-09-03 10:15                                                       ` Ingo Molnar
  2013-09-03 14:08                                                       ` Pavel Machek
  0 siblings, 2 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-09-02 16:44 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Al Viro, Sedat Dilek, Waiman Long, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J, Peter Zijlstra, Arnaldo Carvalho de Melo

On Mon, Sep 2, 2013 at 12:05 AM, Ingo Molnar <mingo@kernel.org> wrote:
>
> The Haswell perf code isn't very widely tested yet as it took quite some
> time to get it ready for upstream and thus got merged late, but on its
> face this looks like a pretty good profile.

Yes. And everything else looks fine too. Profiles without locked
instructions all look very reasonable, and have the expected patterns.

\> It still looks anomalous to me, on fresh Intel hardware. One suggestion:
> could you, just for pure testing purposes, turn HT off and do a quick
> profile that way?
>
> The XADD, even if it's all in the fast path, could be a pretty natural
> point to 'yield' an SMT context on a given core, giving it artificially
> high overhead.
>
> Note that to test HT off an intrusive reboot is probably not needed, if
> the HT siblings are right after each other in the CPU enumeration sequence
> then you can turn HT "off" effectively by running the workload only on 4
> cores:
>
>   taskset 0x55 ./my-test
>
> and reducing the # of your workload threads to 4 or so.

Remember: I see the exact same profile for single-thread behavior.
Other things change (iow, lockref_get_or_lock() is either ~3% or ~30%
- the latter case is for when there are bouncing cachelines), but
lg_local_lock() stays pretty constant.

So it's not a HT artifact or anything like that.

I've timed "lock xadd" separately, and it's not a slow instruction. I
also tried (in user space, using thread-local storage) to see if it's
the combination of creating the address through a segment load and
that somehow causing a micro-exception or something (the P4 used to
have things like that), and that doesn't seem to account for it
either.

It is entirely possible that it is just a "cycles:pp" oddity - because
the "lock xadd" is serializing, it can't retire until everything
around it has been sorted out, and maybe it just shows up in profiles
more than is really "fair" to the instruction itself, because it ends
up being that stable point for potentially hundreds of instructions
around it.

                 Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-31  2:42                                       ` Al Viro
@ 2013-09-02 19:25                                         ` Waiman Long
  2013-09-03  6:01                                           ` Ingo Molnar
  0 siblings, 1 reply; 151+ messages in thread
From: Waiman Long @ 2013-09-02 19:25 UTC (permalink / raw)
  To: Al Viro
  Cc: Linus Torvalds, Ingo Molnar, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On 08/30/2013 10:42 PM, Al Viro wrote:
> On Sat, Aug 31, 2013 at 03:35:16AM +0100, Al Viro wrote:
>
>> Aha...  OK, I see what's going on.  We end up with shm_mnt *not* marked
>> as long-living vfsmount, even though it lives forever.  See if the
>> following helps; if it does (and I very much expect it to), we want to
>> put it in -stable.  As it is, you get slow path in mntput() each time
>> a file created by shmem_file_setup() gets closed.  For no reason whatsoever...
> We still want MS_NOUSER on shm_mnt, so we'd better make sure that
> shmem_fill_super() sets it on the internal instance...  Fixed variant
> follows:
>
> Signed-off-by: Al Viro<viro@zeniv.linux.org.uk>
> diff --git a/mm/shmem.c b/mm/shmem.c
> index e43dc55..5261498 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -2615,13 +2615,15 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent)
>   	 * tmpfs instance, limiting inodes to one per page of lowmem;
>   	 * but the internal instance is left unlimited.
>   	 */
> -	if (!(sb->s_flags&  MS_NOUSER)) {
> +	if (!(sb->s_flags&  MS_KERNMOUNT)) {
>   		sbinfo->max_blocks = shmem_default_max_blocks();
>   		sbinfo->max_inodes = shmem_default_max_inodes();
>   		if (shmem_parse_options(data, sbinfo, false)) {
>   			err = -EINVAL;
>   			goto failed;
>   		}
> +	} else {
> +		sb->s_flags |= MS_NOUSER;
>   	}
>   	sb->s_export_op =&shmem_export_ops;
>   	sb->s_flags |= MS_NOSEC;
> @@ -2831,8 +2833,7 @@ int __init shmem_init(void)
>   		goto out2;
>   	}
>
> -	shm_mnt = vfs_kern_mount(&shmem_fs_type, MS_NOUSER,
> -				 shmem_fs_type.name, NULL);
> +	shm_mnt = kern_mount(&shmem_fs_type);
>   	if (IS_ERR(shm_mnt)) {
>   		error = PTR_ERR(shm_mnt);
>   		printk(KERN_ERR "Could not kern_mount tmpfs\n");

Yes, that patch worked. It eliminated the lglock as a bottleneck in the 
AIM7 workload. The lg_global_lock did not show up in the perf profile, 
whereas the lg_local_lock was only 0.07%.

Regards,
Longman

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-02 19:25                                         ` Waiman Long
@ 2013-09-03  6:01                                           ` Ingo Molnar
  2013-09-03  7:24                                             ` Sedat Dilek
  2013-09-03 15:14                                             ` Waiman Long
  0 siblings, 2 replies; 151+ messages in thread
From: Ingo Molnar @ 2013-09-03  6:01 UTC (permalink / raw)
  To: Waiman Long
  Cc: Al Viro, Linus Torvalds, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J


* Waiman Long <waiman.long@hp.com> wrote:

> On 08/30/2013 10:42 PM, Al Viro wrote:
> >On Sat, Aug 31, 2013 at 03:35:16AM +0100, Al Viro wrote:
> >
> >>Aha...  OK, I see what's going on.  We end up with shm_mnt *not* marked
> >>as long-living vfsmount, even though it lives forever.  See if the
> >>following helps; if it does (and I very much expect it to), we want to
> >>put it in -stable.  As it is, you get slow path in mntput() each time
> >>a file created by shmem_file_setup() gets closed.  For no reason whatsoever...
> >We still want MS_NOUSER on shm_mnt, so we'd better make sure that
> >shmem_fill_super() sets it on the internal instance...  Fixed variant
> >follows:
> >
> >Signed-off-by: Al Viro<viro@zeniv.linux.org.uk>
> >diff --git a/mm/shmem.c b/mm/shmem.c
> >index e43dc55..5261498 100644
> >--- a/mm/shmem.c
> >+++ b/mm/shmem.c
> >@@ -2615,13 +2615,15 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent)
> >  	 * tmpfs instance, limiting inodes to one per page of lowmem;
> >  	 * but the internal instance is left unlimited.
> >  	 */
> >-	if (!(sb->s_flags&  MS_NOUSER)) {
> >+	if (!(sb->s_flags&  MS_KERNMOUNT)) {
> >  		sbinfo->max_blocks = shmem_default_max_blocks();
> >  		sbinfo->max_inodes = shmem_default_max_inodes();
> >  		if (shmem_parse_options(data, sbinfo, false)) {
> >  			err = -EINVAL;
> >  			goto failed;
> >  		}
> >+	} else {
> >+		sb->s_flags |= MS_NOUSER;
> >  	}
> >  	sb->s_export_op =&shmem_export_ops;
> >  	sb->s_flags |= MS_NOSEC;
> >@@ -2831,8 +2833,7 @@ int __init shmem_init(void)
> >  		goto out2;
> >  	}
> >
> >-	shm_mnt = vfs_kern_mount(&shmem_fs_type, MS_NOUSER,
> >-				 shmem_fs_type.name, NULL);
> >+	shm_mnt = kern_mount(&shmem_fs_type);
> >  	if (IS_ERR(shm_mnt)) {
> >  		error = PTR_ERR(shm_mnt);
> >  		printk(KERN_ERR "Could not kern_mount tmpfs\n");
> 
> Yes, that patch worked. It eliminated the lglock as a bottleneck in
> the AIM7 workload. The lg_global_lock did not show up in the perf
> profile, whereas the lg_local_lock was only 0.07%.

Just curious: what's the worst bottleneck now in the optimized kernel? :-)

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03  6:01                                           ` Ingo Molnar
@ 2013-09-03  7:24                                             ` Sedat Dilek
  2013-09-03 15:38                                               ` Linus Torvalds
  2013-09-03 15:14                                             ` Waiman Long
  1 sibling, 1 reply; 151+ messages in thread
From: Sedat Dilek @ 2013-09-03  7:24 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Waiman Long, Al Viro, Linus Torvalds, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Tue, Sep 3, 2013 at 8:01 AM, Ingo Molnar <mingo@kernel.org> wrote:
>
> * Waiman Long <waiman.long@hp.com> wrote:
>
>> On 08/30/2013 10:42 PM, Al Viro wrote:
>> >On Sat, Aug 31, 2013 at 03:35:16AM +0100, Al Viro wrote:
>> >
>> >>Aha...  OK, I see what's going on.  We end up with shm_mnt *not* marked
>> >>as long-living vfsmount, even though it lives forever.  See if the
>> >>following helps; if it does (and I very much expect it to), we want to
>> >>put it in -stable.  As it is, you get slow path in mntput() each time
>> >>a file created by shmem_file_setup() gets closed.  For no reason whatsoever...
>> >We still want MS_NOUSER on shm_mnt, so we'd better make sure that
>> >shmem_fill_super() sets it on the internal instance...  Fixed variant
>> >follows:
>> >
>> >Signed-off-by: Al Viro<viro@zeniv.linux.org.uk>
>> >diff --git a/mm/shmem.c b/mm/shmem.c
>> >index e43dc55..5261498 100644
>> >--- a/mm/shmem.c
>> >+++ b/mm/shmem.c
>> >@@ -2615,13 +2615,15 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent)
>> >      * tmpfs instance, limiting inodes to one per page of lowmem;
>> >      * but the internal instance is left unlimited.
>> >      */
>> >-    if (!(sb->s_flags&  MS_NOUSER)) {
>> >+    if (!(sb->s_flags&  MS_KERNMOUNT)) {
>> >             sbinfo->max_blocks = shmem_default_max_blocks();
>> >             sbinfo->max_inodes = shmem_default_max_inodes();
>> >             if (shmem_parse_options(data, sbinfo, false)) {
>> >                     err = -EINVAL;
>> >                     goto failed;
>> >             }
>> >+    } else {
>> >+            sb->s_flags |= MS_NOUSER;
>> >     }
>> >     sb->s_export_op =&shmem_export_ops;
>> >     sb->s_flags |= MS_NOSEC;
>> >@@ -2831,8 +2833,7 @@ int __init shmem_init(void)
>> >             goto out2;
>> >     }
>> >
>> >-    shm_mnt = vfs_kern_mount(&shmem_fs_type, MS_NOUSER,
>> >-                             shmem_fs_type.name, NULL);
>> >+    shm_mnt = kern_mount(&shmem_fs_type);
>> >     if (IS_ERR(shm_mnt)) {
>> >             error = PTR_ERR(shm_mnt);
>> >             printk(KERN_ERR "Could not kern_mount tmpfs\n");
>>
>> Yes, that patch worked. It eliminated the lglock as a bottleneck in
>> the AIM7 workload. The lg_global_lock did not show up in the perf
>> profile, whereas the lg_local_lock was only 0.07%.
>
> Just curious: what's the worst bottleneck now in the optimized kernel? :-)
>
> Thanks,
>
>         Ingo

Can someone summarize this thread (70+ postings)?
Which patches are needed? And fixing what?
( Can people provide separate patches with a proper changelog? )
Improvements?


Thanks.

- Sedat (still struggling with perf) -

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-02 16:44                                                     ` Linus Torvalds
@ 2013-09-03 10:15                                                       ` Ingo Molnar
  2013-09-03 15:41                                                         ` Linus Torvalds
  2013-09-03 14:08                                                       ` Pavel Machek
  1 sibling, 1 reply; 151+ messages in thread
From: Ingo Molnar @ 2013-09-03 10:15 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Al Viro, Sedat Dilek, Waiman Long, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J, Peter Zijlstra, Arnaldo Carvalho de Melo


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Mon, Sep 2, 2013 at 12:05 AM, Ingo Molnar <mingo@kernel.org> wrote:
> >
> > The Haswell perf code isn't very widely tested yet as it took quite some
> > time to get it ready for upstream and thus got merged late, but on its
> > face this looks like a pretty good profile.
> 
> Yes. And everything else looks fine too. Profiles without locked
> instructions all look very reasonable, and have the expected patterns.
> 
> \> It still looks anomalous to me, on fresh Intel hardware. One suggestion:
> > could you, just for pure testing purposes, turn HT off and do a quick
> > profile that way?
> >
> > The XADD, even if it's all in the fast path, could be a pretty natural
> > point to 'yield' an SMT context on a given core, giving it artificially
> > high overhead.
> >
> > Note that to test HT off an intrusive reboot is probably not needed, if
> > the HT siblings are right after each other in the CPU enumeration sequence
> > then you can turn HT "off" effectively by running the workload only on 4
> > cores:
> >
> >   taskset 0x55 ./my-test
> >
> > and reducing the # of your workload threads to 4 or so.
> 
> Remember: I see the exact same profile for single-thread behavior.

Oh, indeed.

> Other things change (iow, lockref_get_or_lock() is either ~3% or ~30% - 
> the latter case is for when there are bouncing cachelines), but 
> lg_local_lock() stays pretty constant.
> 
> So it's not a HT artifact or anything like that.
> 
> I've timed "lock xadd" separately, and it's not a slow instruction. I 
> also tried (in user space, using thread-local storage) to see if it's 
> the combination of creating the address through a segment load and that 
> somehow causing a micro-exception or something (the P4 used to have 
> things like that), and that doesn't seem to account for it either.
> 
> It is entirely possible that it is just a "cycles:pp" oddity - because 
> the "lock xadd" is serializing, it can't retire until everything around 
> it has been sorted out, and maybe it just shows up in profiles more than 
> is really "fair" to the instruction itself, because it ends up being 
> that stable point for potentially hundreds of instructions around it.

One more thing to try would be a regular '-e cycles' non-PEBS run and see 
whether there's still largish overhead visible around that instruction.

That reintroduces skid, but it eliminates any PEBS and LBR funnies, as our 
cycles:pp event is a really tricky/complex beast internally.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-02 16:44                                                     ` Linus Torvalds
  2013-09-03 10:15                                                       ` Ingo Molnar
@ 2013-09-03 14:08                                                       ` Pavel Machek
  1 sibling, 0 replies; 151+ messages in thread
From: Pavel Machek @ 2013-09-03 14:08 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ingo Molnar, Al Viro, Sedat Dilek, Waiman Long,
	Benjamin Herrenschmidt, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Peter Zijlstra, Steven Rostedt, Andi Kleen, Chandramouleeswaran,
	Aswin, Norton, Scott J, Peter Zijlstra, Arnaldo Carvalho de Melo

Hi!

> It is entirely possible that it is just a "cycles:pp" oddity - because
> the "lock xadd" is serializing, it can't retire until everything
> around it has been sorted out, and maybe it just shows up in profiles
> more than is really "fair" to the instruction itself, because it ends
> up being that stable point for potentially hundreds of instructions
> around it.

Hmm, turn "lock xadd" into plain add, and see if it improves loops per
second? Preferably on scratch filesystem, because you may corrupt it...
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03  6:01                                           ` Ingo Molnar
  2013-09-03  7:24                                             ` Sedat Dilek
@ 2013-09-03 15:14                                             ` Waiman Long
  2013-09-03 15:34                                               ` Linus Torvalds
  2013-09-03 22:41                                               ` Sedat Dilek
  1 sibling, 2 replies; 151+ messages in thread
From: Waiman Long @ 2013-09-03 15:14 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Al Viro, Linus Torvalds, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On 09/03/2013 02:01 AM, Ingo Molnar wrote:
> * Waiman Long<waiman.long@hp.com>  wrote:
>
>> Yes, that patch worked. It eliminated the lglock as a bottleneck in 
>> the AIM7 workload. The lg_global_lock did not show up in the perf 
>> profile, whereas the lg_local_lock was only 0.07%. 
> Just curious: what's the worst bottleneck now in the optimized kernel? :-)
>
> Thanks,
>
> 	Ingo
With the following patches on v3.11:
1. Linus's version of lockref patch
2. Al's lglock patch
3. My preliminary patch to convert prepend_path under RCU

The perf profile of the kernel portion of the short workload in a 
80-core system became like this:

     29.87%     reaim  [kernel.kallsyms]  [k] _raw_spin_lock_irqsave
                   |--50.00%-- tty_ldisc_deref
                   |--49.01%-- tty_ldisc_try
                    --0.99%-- [...]

      7.55%   swapper  [kernel.kallsyms]  [k] intel_idle
      1.03%     reaim  [kernel.kallsyms]  [k] copy_user_generic_string
      0.91%     reaim  [kernel.kallsyms]  [k] _raw_spin_lock
                   |--15.88%-- __rcu_process_callbacks
                   |--6.55%-- load_balance
                   |--6.02%-- sem_lock
                   |--4.77%-- enqueue_to_backlog
                   |--4.21%-- task_rq_lock
                   |--3.97%-- process_backlog
                   |--3.35%-- unix_dgram_sendmsg
                   |--3.28%-- kmem_cache_free
                   |--3.16%-- tcp_v4_rcv
                   |--2.77%-- unix_stream_sendmsg
                   |--2.36%-- rcu_accelerate_cbs
                   |--2.02%-- do_wp_page
                   |--2.02%-- unix_create1
                   |--1.83%-- unix_peer_get
                   |--1.67%-- udp_lib_get_port
                   |--1.66%-- unix_stream_recvmsg
                   |--1.63%-- handle_pte_fault
                   |--1.63%-- udp_queue_rcv_skb
                   |--1.54%-- unix_release_sock
                   |--1.48%-- try_to_wake_up
                   |--1.37%-- do_anonymous_page
                   |--1.37%-- new_inode_pseudo
                   |--1.33%-- __d_lookup
                   |--1.20%-- free_one_page
                   |--1.11%-- __do_fault
                   |--1.06%-- scheduler_tick
                   |--0.90%-- __drain_alien_cache
                   |--0.81%-- inet_csk_get_port
                   |--0.76%-- sock_alloc
                   |--0.76%-- shmem_lock
                   |--0.75%-- __d_instantiate
                   |--0.70%-- __inet_hash_connect
                   |--0.69%-- __inet_hash_nolisten
                   |--0.68%-- ip_local_deliver_finish
                   |--0.64%-- inet_hash
                   |--0.64%-- kfree
                   |--0.60%-- d_path
                   |--0.58%-- __close_fd
                   |--0.51%-- evict
                    --11.76%-- [...]

      0.51%     reaim  [ip_tables]        [k] ipt_do_table
      0.46%     reaim  [kernel.kallsyms]  [k] __alloc_skb
      0.38%     reaim  [kernel.kallsyms]  [k] kfree
      0.36%     reaim  [kernel.kallsyms]  [k] kmem_cache_free
      0.34%     reaim  [kernel.kallsyms]  [k] system_call_after_swapg
      0.32%     reaim  [kernel.kallsyms]  [k] fsnotify
      0.32%     reaim  [kernel.kallsyms]  [k] ip_finish_output
      0.27%     reaim  [kernel.kallsyms]  [k] system_call

Other than the global tty_ldisc_lock, there is no other major
bottleneck. I am not that worry about the tty_ldisc_lock bottleneck
as real world applications probably won't have that many calls to
set the tty driver.

Regards,
Longman


^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03 15:14                                             ` Waiman Long
@ 2013-09-03 15:34                                               ` Linus Torvalds
  2013-09-03 19:09                                                 ` Linus Torvalds
  2013-09-03 22:41                                               ` Sedat Dilek
  1 sibling, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-09-03 15:34 UTC (permalink / raw)
  To: Waiman Long
  Cc: Ingo Molnar, Al Viro, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Tue, Sep 3, 2013 at 8:14 AM, Waiman Long <waiman.long@hp.com> wrote:
>
> Other than the global tty_ldisc_lock, there is no other major
> bottleneck. I am not that worry about the tty_ldisc_lock bottleneck
> as real world applications probably won't have that many calls to
> set the tty driver.

I suspect the tty_ldisc_lock() could be made to go away if we care.
Making the ldisc be rcu-free'd, coupled with just optimistically
updating the count using "atomic_inc_not_zero()" and re-checking the
ldisc pointer afterwards should probably do it. But I agree that it
probably isn't worth it for any actual real load.

              Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03  7:24                                             ` Sedat Dilek
@ 2013-09-03 15:38                                               ` Linus Torvalds
  0 siblings, 0 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-09-03 15:38 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Ingo Molnar, Waiman Long, Al Viro, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Tue, Sep 3, 2013 at 12:24 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> Can someone summarize this thread (70+ postings)?
> Which patches are needed? And fixing what?
> ( Can people provide separate patches with a proper changelog? )
> Improvements?

The core lockref part is now merged and available in my git tree (and
yes, as individual patches with proper logs).

Al's patch to avoid the lg_lock is still pending, I'm assuming I'll
get it through his VFS tree.

            Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03 10:15                                                       ` Ingo Molnar
@ 2013-09-03 15:41                                                         ` Linus Torvalds
  2013-09-03 18:34                                                           ` Linus Torvalds
  0 siblings, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-09-03 15:41 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Al Viro, Sedat Dilek, Waiman Long, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J, Peter Zijlstra, Arnaldo Carvalho de Melo

On Tue, Sep 3, 2013 at 3:15 AM, Ingo Molnar <mingo@kernel.org> wrote:
>
> One more thing to try would be a regular '-e cycles' non-PEBS run and see
> whether there's still largish overhead visible around that instruction.

I've done that, and it matches the PEBS runs, except obviously with
the instruction skew (so then depending on run it's 95% the
instruction after the xadd). So the PEBS profiles are entirely
consistent with other data.

              Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03 15:41                                                         ` Linus Torvalds
@ 2013-09-03 18:34                                                           ` Linus Torvalds
  2013-09-03 19:19                                                             ` Ingo Molnar
  0 siblings, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-09-03 18:34 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Al Viro, Sedat Dilek, Waiman Long, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J, Peter Zijlstra, Arnaldo Carvalho de Melo

On Tue, Sep 3, 2013 at 8:41 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> I've done that, and it matches the PEBS runs, except obviously with
> the instruction skew (so then depending on run it's 95% the
> instruction after the xadd). So the PEBS profiles are entirely
> consistent with other data.

So one thing that strikes me about our lg-locks is that they are
designed to be cheap, but they force this insane 3-deep memory access
chain to lock them.

That may be a large part of why lg_local_lock shows up so clearly on
my profiles: the single "lock xadd" instruction ends up not just being
serializing, but it is what actually consumes the previous memory
reads.

The core of the lg_local_lock sequence ends up being this
four-instruction sequence:

    mov    (%rdi),%rdx
    add    %gs:0xcd48,%rdx
    mov    $0x100,%eax
    lock   xadd   %ax,(%rdx)

and that's a nasty chain of dependent memory loads. First we load the
percpu address, then we add the percpu offset to that, and then we do
the xadd on the result.

It's kind of sad, because in *theory* we could get rid of that whole
thing entirely, and just do it as one single

    mov    $0x100,%eax
    lock xadd %ax,%gs:vfsmount_lock

that only has one single memory access, not three dependent ones.

But the two extra memory accesses come from:

 - the lglock data structure isn't a percpu data structure, it's this
stupid global data structure that has a percpu pointer in it.  So that
first "mov (%rdi),%rdx" is purely to load what is effectively a
constant address (per lglock).

   And that's not because it wants to be, but because we associate
global lockdep data with it. Ugh. If it wasn't for that, we could just
make them percpu.

 - we don't have a percpu spinlock accessor, so we always need to turn
the percpu address into a global address by adding the percpu base
(and that's the "add %gsL...,%rdx" part).

Oh well. This whole "lg_local_lock" is really noticeable on my
test-case mainly because my test-case only stat's a pathname with a
single path component, so the whole lookup really is dominated by all
the "setup/teardown" code. Real loads tend to look up much longer
pathnames, so the setup/teardown isn't so dominant, and actually
looking up the dentries from the hash chain is where most of the time
goes. But it's annoying to have that one big spike in the profile and
not being able to do anything about it.

           Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03 15:34                                               ` Linus Torvalds
@ 2013-09-03 19:09                                                 ` Linus Torvalds
  2013-09-03 21:01                                                   ` Waiman Long
  2013-09-04 14:52                                                   ` Waiman Long
  0 siblings, 2 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-09-03 19:09 UTC (permalink / raw)
  To: Waiman Long
  Cc: Ingo Molnar, Al Viro, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Tue, Sep 3, 2013 at 8:34 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> I suspect the tty_ldisc_lock() could be made to go away if we care.

Heh. I just pulled the tty patches from Greg, and the locking has
changed completely.

It may actually fix your AIM7 test-case, because while the global
spinlock remains (it got renamed to "tty_ldiscs_lock" - there's an
added "s"), the common operations now take the per-tty lock to get the
ldisc for that tty, rather than that global spinlock (which just
protects the actual ldisk array now).

That said, I don't know what AIM7 really ends up doing, but your
profile seems to have every access through tty_ldisc_[de]ref() that
now uses only the per-tty lock. Of course, how much that helps ends up
depending on whether AIM7 uses lots of tty's or just one shared one.

Anyway, it might be worth testing my current -git tree.

                  Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03 18:34                                                           ` Linus Torvalds
@ 2013-09-03 19:19                                                             ` Ingo Molnar
  2013-09-03 21:05                                                               ` Linus Torvalds
  0 siblings, 1 reply; 151+ messages in thread
From: Ingo Molnar @ 2013-09-03 19:19 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Al Viro, Sedat Dilek, Waiman Long, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J, Peter Zijlstra, Arnaldo Carvalho de Melo


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Tue, Sep 3, 2013 at 8:41 AM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > I've done that, and it matches the PEBS runs, except obviously with
> > the instruction skew (so then depending on run it's 95% the
> > instruction after the xadd). So the PEBS profiles are entirely
> > consistent with other data.
> 
> So one thing that strikes me about our lg-locks is that they are 
> designed to be cheap, but they force this insane 3-deep memory access 
> chain to lock them.
> 
> That may be a large part of why lg_local_lock shows up so clearly on my 
> profiles: the single "lock xadd" instruction ends up not just being 
> serializing, but it is what actually consumes the previous memory reads.
> 
> The core of the lg_local_lock sequence ends up being this 
> four-instruction sequence:
> 
>     mov    (%rdi),%rdx
>     add    %gs:0xcd48,%rdx
>     mov    $0x100,%eax
>     lock   xadd   %ax,(%rdx)
> 
> and that's a nasty chain of dependent memory loads. First we load the 
> percpu address, then we add the percpu offset to that, and then we do 
> the xadd on the result.
> 
> It's kind of sad, because in *theory* we could get rid of that whole 
> thing entirely, and just do it as one single
> 
>     mov    $0x100,%eax
>     lock xadd %ax,%gs:vfsmount_lock
> 
> that only has one single memory access, not three dependent ones.
> 
> But the two extra memory accesses come from:
> 
>  - the lglock data structure isn't a percpu data structure, it's this 
> stupid global data structure that has a percpu pointer in it.  So that 
> first "mov (%rdi),%rdx" is purely to load what is effectively a constant 
> address (per lglock).
> 
>    And that's not because it wants to be, but because we associate 
> global lockdep data with it. Ugh. If it wasn't for that, we could just 
> make them percpu.

I don't think that's fundamental - the per CPU lock was percpu before:

 #define DEFINE_LGLOCK(name)                                            \
-                                                                       \
- DEFINE_SPINLOCK(name##_cpu_lock);                                     \
- DEFINE_PER_CPU(arch_spinlock_t, name##_lock);                         \
- DEFINE_LGLOCK_LOCKDEP(name);                                          \


but AFAICS got converted to a pointer via this commit:

 commit eea62f831b8030b0eeea8314eed73b6132d1de26
 Author: Andi Kleen <ak@linux.intel.com>
 Date:   Tue May 8 13:32:24 2012 +0930

    brlocks/lglocks: turn into functions
    
    lglocks and brlocks are currently generated with some complicated 
    macros in lglock.h.  But there's no reason to not just use common 
    utility functions and put all the data into a common data structure.
    
    Since there are at least two users it makes sense to share this code 
    in a library.  This is also easier maintainable than a macro forest.
    
    This will also make it later possible to dynamically allocate lglocks 
    and also use them in modules (this would both still need some 
    additional, but now straightforward, code)

Which was a rather misguided premise IMHO.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03 19:09                                                 ` Linus Torvalds
@ 2013-09-03 21:01                                                   ` Waiman Long
  2013-09-04 14:52                                                   ` Waiman Long
  1 sibling, 0 replies; 151+ messages in thread
From: Waiman Long @ 2013-09-03 21:01 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ingo Molnar, Al Viro, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On 09/03/2013 03:09 PM, Linus Torvalds wrote:
> On Tue, Sep 3, 2013 at 8:34 AM, Linus Torvalds
> <torvalds@linux-foundation.org>  wrote:
>> I suspect the tty_ldisc_lock() could be made to go away if we care.
> Heh. I just pulled the tty patches from Greg, and the locking has
> changed completely.
>
> It may actually fix your AIM7 test-case, because while the global
> spinlock remains (it got renamed to "tty_ldiscs_lock" - there's an
> added "s"), the common operations now take the per-tty lock to get the
> ldisc for that tty, rather than that global spinlock (which just
> protects the actual ldisk array now).
>
> That said, I don't know what AIM7 really ends up doing, but your
> profile seems to have every access through tty_ldisc_[de]ref() that
> now uses only the per-tty lock. Of course, how much that helps ends up
> depending on whether AIM7 uses lots of tty's or just one shared one.
>
> Anyway, it might be worth testing my current -git tree.
>
>                    Linus

Thank for the news. I will fetch your latest git tree and try it out.

-Longman

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03 19:19                                                             ` Ingo Molnar
@ 2013-09-03 21:05                                                               ` Linus Torvalds
  2013-09-03 21:13                                                                 ` Linus Torvalds
  0 siblings, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-09-03 21:05 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Al Viro, Sedat Dilek, Waiman Long, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J, Peter Zijlstra, Arnaldo Carvalho de Melo

[-- Attachment #1: Type: text/plain, Size: 1662 bytes --]

On Tue, Sep 3, 2013 at 12:19 PM, Ingo Molnar <mingo@kernel.org> wrote:
>
> * Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
>>
>>  - the lglock data structure isn't a percpu data structure, it's this
>> stupid global data structure that has a percpu pointer in it.  So that
>> first "mov (%rdi),%rdx" is purely to load what is effectively a constant
>> address (per lglock).
>>
>>    And that's not because it wants to be, but because we associate
>> global lockdep data with it. Ugh. If it wasn't for that, we could just
>> make them percpu.
>
> I don't think that's fundamental - the per CPU lock was percpu before:
[...]
> but AFAICS got converted to a pointer via this commit:
>
>  commit eea62f831b8030b0eeea8314eed73b6132d1de26
>  Author: Andi Kleen <ak@linux.intel.com>
>  Date:   Tue May 8 13:32:24 2012 +0930
>
>     brlocks/lglocks: turn into functions

So instead of reverting that entirely, how about making "struct
lglock" always per entirely per-cpu, and replacing the percpu pointer
with the lock itself.

Then, we say "the lockdep map is always on CPU#0".

TOTALLY UNTESTED PATCH ATTACHED. It compiles in at least a couple of
configurations, and I checked that this removes _one_ of the
indirections (the other one is because we don't have a native per-cpu
spinlock helper function, so we need to do that percpu base addition),
but I haven't dared try to actually try to boot it.

Comments?

I'll try booting it and seeing if it actually works (and if it makes
any difference), but it seems to be a reasonable approach. I think it
actually cleans things up a bit, but maybe that's just because I
touched the code now.

            Linus

[-- Attachment #2: patch.diff --]
[-- Type: application/octet-stream, Size: 6425 bytes --]

 fs/file_table.c        |  2 +-
 fs/internal.h          |  2 +-
 fs/locks.c             |  2 +-
 include/linux/lglock.h | 29 ++++++++++++-----------------
 kernel/lglock.c        | 46 ++++++++++++++++++++++++++--------------------
 5 files changed, 41 insertions(+), 40 deletions(-)

diff --git a/fs/file_table.c b/fs/file_table.c
index b44e4c559786..e0bee9e05db9 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -36,7 +36,7 @@ struct files_stat_struct files_stat = {
 	.max_files = NR_FILE
 };
 
-DEFINE_STATIC_LGLOCK(files_lglock);
+static DEFINE_LGLOCK(files_lglock);
 
 /* SLAB cache for file structures */
 static struct kmem_cache *filp_cachep __read_mostly;
diff --git a/fs/internal.h b/fs/internal.h
index 7c5f01cf619d..9710df6fef4b 100644
--- a/fs/internal.h
+++ b/fs/internal.h
@@ -59,7 +59,7 @@ extern int sb_prepare_remount_readonly(struct super_block *);
 
 extern void __init mnt_init(void);
 
-extern struct lglock vfsmount_lock;
+extern DECLARE_LGLOCK(vfsmount_lock);
 
 extern int __mnt_want_write(struct vfsmount *);
 extern int __mnt_want_write_file(struct file *);
diff --git a/fs/locks.c b/fs/locks.c
index b27a3005d78d..4b4704aee6c6 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -162,7 +162,7 @@ int lease_break_time = 45;
  * the file_lock_lglock. Note that alterations to the list also require that
  * the relevant i_lock is held.
  */
-DEFINE_STATIC_LGLOCK(file_lock_lglock);
+static DEFINE_LGLOCK(file_lock_lglock);
 static DEFINE_PER_CPU(struct hlist_head, file_lock_list);
 
 /*
diff --git a/include/linux/lglock.h b/include/linux/lglock.h
index 0d24e932db0b..f937b27a0bee 100644
--- a/include/linux/lglock.h
+++ b/include/linux/lglock.h
@@ -42,29 +42,24 @@
 #endif
 
 struct lglock {
-	arch_spinlock_t __percpu *lock;
+	arch_spinlock_t lock;
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 	struct lock_class_key lock_key;
 	struct lockdep_map    lock_dep_map;
 #endif
 };
 
-#define DEFINE_LGLOCK(name)						\
-	static DEFINE_PER_CPU(arch_spinlock_t, name ## _lock)		\
-	= __ARCH_SPIN_LOCK_UNLOCKED;					\
-	struct lglock name = { .lock = &name ## _lock }
+#define DECLARE_LGLOCK(name) \
+	DEFINE_PER_CPU(struct lglock, name)
+#define DEFINE_LGLOCK(name) \
+	DEFINE_PER_CPU(struct lglock, name) = { .lock = __ARCH_SPIN_LOCK_UNLOCKED }
 
-#define DEFINE_STATIC_LGLOCK(name)					\
-	static DEFINE_PER_CPU(arch_spinlock_t, name ## _lock)		\
-	= __ARCH_SPIN_LOCK_UNLOCKED;					\
-	static struct lglock name = { .lock = &name ## _lock }
-
-void lg_lock_init(struct lglock *lg, char *name);
-void lg_local_lock(struct lglock *lg);
-void lg_local_unlock(struct lglock *lg);
-void lg_local_lock_cpu(struct lglock *lg, int cpu);
-void lg_local_unlock_cpu(struct lglock *lg, int cpu);
-void lg_global_lock(struct lglock *lg);
-void lg_global_unlock(struct lglock *lg);
+void lg_lock_init(struct lglock __percpu *lg, char *name);
+void lg_local_lock(struct lglock __percpu *lg);
+void lg_local_unlock(struct lglock __percpu *lg);
+void lg_local_lock_cpu(struct lglock __percpu *lg, int cpu);
+void lg_local_unlock_cpu(struct lglock __percpu *lg, int cpu);
+void lg_global_lock(struct lglock __percpu *lg);
+void lg_global_unlock(struct lglock __percpu *lg);
 
 #endif
diff --git a/kernel/lglock.c b/kernel/lglock.c
index 6535a667a5a7..a9e327ba89e6 100644
--- a/kernel/lglock.c
+++ b/kernel/lglock.c
@@ -4,84 +4,90 @@
 #include <linux/cpu.h>
 #include <linux/string.h>
 
+/* We only fill in the name and lock_dep_map for the first CPU */
+#define lg_lock_dep_map(lg) \
+	per_cpu_ptr(&lg->lock_dep_map,0)
+#define lg_lock_key(lg) \
+	per_cpu_ptr(&lg->lock_key,0)
+
 /*
  * Note there is no uninit, so lglocks cannot be defined in
  * modules (but it's fine to use them from there)
  * Could be added though, just undo lg_lock_init
  */
 
-void lg_lock_init(struct lglock *lg, char *name)
+void lg_lock_init(struct lglock __percpu *lg, char *name)
 {
-	LOCKDEP_INIT_MAP(&lg->lock_dep_map, name, &lg->lock_key, 0);
+	LOCKDEP_INIT_MAP(lg_lock_dep_map(lg), name, lg_lock_key(lg), 0);
 }
 EXPORT_SYMBOL(lg_lock_init);
 
-void lg_local_lock(struct lglock *lg)
+void lg_local_lock(struct lglock __percpu *lg)
 {
 	arch_spinlock_t *lock;
 
 	preempt_disable();
-	rwlock_acquire_read(&lg->lock_dep_map, 0, 0, _RET_IP_);
-	lock = this_cpu_ptr(lg->lock);
+	rwlock_acquire_read(lg_lock_dep_map(lg), 0, 0, _RET_IP_);
+	lock = this_cpu_ptr(&lg->lock);
 	arch_spin_lock(lock);
 }
 EXPORT_SYMBOL(lg_local_lock);
 
-void lg_local_unlock(struct lglock *lg)
+void lg_local_unlock(struct lglock __percpu *lg)
 {
 	arch_spinlock_t *lock;
 
-	rwlock_release(&lg->lock_dep_map, 1, _RET_IP_);
-	lock = this_cpu_ptr(lg->lock);
+	rwlock_release(lg_lock_dep_map(lg), 1, _RET_IP_);
+	lock = this_cpu_ptr(&lg->lock);
 	arch_spin_unlock(lock);
 	preempt_enable();
 }
 EXPORT_SYMBOL(lg_local_unlock);
 
-void lg_local_lock_cpu(struct lglock *lg, int cpu)
+void lg_local_lock_cpu(struct lglock __percpu *lg, int cpu)
 {
 	arch_spinlock_t *lock;
 
 	preempt_disable();
-	rwlock_acquire_read(&lg->lock_dep_map, 0, 0, _RET_IP_);
-	lock = per_cpu_ptr(lg->lock, cpu);
+	rwlock_acquire_read(lg_lock_dep_map(lg), 0, 0, _RET_IP_);
+	lock = per_cpu_ptr(&lg->lock, cpu);
 	arch_spin_lock(lock);
 }
 EXPORT_SYMBOL(lg_local_lock_cpu);
 
-void lg_local_unlock_cpu(struct lglock *lg, int cpu)
+void lg_local_unlock_cpu(struct lglock __percpu *lg, int cpu)
 {
 	arch_spinlock_t *lock;
 
-	rwlock_release(&lg->lock_dep_map, 1, _RET_IP_);
-	lock = per_cpu_ptr(lg->lock, cpu);
+	rwlock_release(lg_lock_dep_map(lg), 1, _RET_IP_);
+	lock = per_cpu_ptr(&lg->lock, cpu);
 	arch_spin_unlock(lock);
 	preempt_enable();
 }
 EXPORT_SYMBOL(lg_local_unlock_cpu);
 
-void lg_global_lock(struct lglock *lg)
+void lg_global_lock(struct lglock __percpu *lg)
 {
 	int i;
 
 	preempt_disable();
-	rwlock_acquire(&lg->lock_dep_map, 0, 0, _RET_IP_);
+	rwlock_acquire(lg_lock_dep_map(lg), 0, 0, _RET_IP_);
 	for_each_possible_cpu(i) {
 		arch_spinlock_t *lock;
-		lock = per_cpu_ptr(lg->lock, i);
+		lock = per_cpu_ptr(&lg->lock, i);
 		arch_spin_lock(lock);
 	}
 }
 EXPORT_SYMBOL(lg_global_lock);
 
-void lg_global_unlock(struct lglock *lg)
+void lg_global_unlock(struct lglock __percpu *lg)
 {
 	int i;
 
-	rwlock_release(&lg->lock_dep_map, 1, _RET_IP_);
+	rwlock_release(lg_lock_dep_map(lg), 1, _RET_IP_);
 	for_each_possible_cpu(i) {
 		arch_spinlock_t *lock;
-		lock = per_cpu_ptr(lg->lock, i);
+		lock = per_cpu_ptr(&lg->lock, i);
 		arch_spin_unlock(lock);
 	}
 	preempt_enable();

^ permalink raw reply related	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03 21:05                                                               ` Linus Torvalds
@ 2013-09-03 21:13                                                                 ` Linus Torvalds
  2013-09-03 21:34                                                                   ` Linus Torvalds
  0 siblings, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-09-03 21:13 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Al Viro, Sedat Dilek, Waiman Long, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J, Peter Zijlstra, Arnaldo Carvalho de Melo

[-- Attachment #1: Type: text/plain, Size: 394 bytes --]

On Tue, Sep 3, 2013 at 2:05 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> TOTALLY UNTESTED PATCH ATTACHED.

Actually, that was the previous (broken) version of that patch - I
hadn't regenerated it after fixing some stupid compile errors, and it
had the DECLARE parts wrong.

This is the one that actually compiles.  Whether it *works* is still a
total mystery.

          Linus

[-- Attachment #2: patch.diff --]
[-- Type: application/octet-stream, Size: 6419 bytes --]

 fs/file_table.c        |  2 +-
 fs/internal.h          |  2 +-
 fs/locks.c             |  2 +-
 include/linux/lglock.h | 29 ++++++++++++-----------------
 kernel/lglock.c        | 46 ++++++++++++++++++++++++++--------------------
 5 files changed, 41 insertions(+), 40 deletions(-)

diff --git a/fs/file_table.c b/fs/file_table.c
index b44e4c559786..e0bee9e05db9 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -36,7 +36,7 @@ struct files_stat_struct files_stat = {
 	.max_files = NR_FILE
 };
 
-DEFINE_STATIC_LGLOCK(files_lglock);
+static DEFINE_LGLOCK(files_lglock);
 
 /* SLAB cache for file structures */
 static struct kmem_cache *filp_cachep __read_mostly;
diff --git a/fs/internal.h b/fs/internal.h
index 7c5f01cf619d..2db5882d77b2 100644
--- a/fs/internal.h
+++ b/fs/internal.h
@@ -59,7 +59,7 @@ extern int sb_prepare_remount_readonly(struct super_block *);
 
 extern void __init mnt_init(void);
 
-extern struct lglock vfsmount_lock;
+DECLARE_LGLOCK(vfsmount_lock);
 
 extern int __mnt_want_write(struct vfsmount *);
 extern int __mnt_want_write_file(struct file *);
diff --git a/fs/locks.c b/fs/locks.c
index b27a3005d78d..4b4704aee6c6 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -162,7 +162,7 @@ int lease_break_time = 45;
  * the file_lock_lglock. Note that alterations to the list also require that
  * the relevant i_lock is held.
  */
-DEFINE_STATIC_LGLOCK(file_lock_lglock);
+static DEFINE_LGLOCK(file_lock_lglock);
 static DEFINE_PER_CPU(struct hlist_head, file_lock_list);
 
 /*
diff --git a/include/linux/lglock.h b/include/linux/lglock.h
index 0d24e932db0b..232de2c46208 100644
--- a/include/linux/lglock.h
+++ b/include/linux/lglock.h
@@ -42,29 +42,24 @@
 #endif
 
 struct lglock {
-	arch_spinlock_t __percpu *lock;
+	arch_spinlock_t lock;
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 	struct lock_class_key lock_key;
 	struct lockdep_map    lock_dep_map;
 #endif
 };
 
-#define DEFINE_LGLOCK(name)						\
-	static DEFINE_PER_CPU(arch_spinlock_t, name ## _lock)		\
-	= __ARCH_SPIN_LOCK_UNLOCKED;					\
-	struct lglock name = { .lock = &name ## _lock }
+#define DECLARE_LGLOCK(name) \
+	DECLARE_PER_CPU(struct lglock, name)
+#define DEFINE_LGLOCK(name) \
+	DEFINE_PER_CPU(struct lglock, name) = { .lock = __ARCH_SPIN_LOCK_UNLOCKED }
 
-#define DEFINE_STATIC_LGLOCK(name)					\
-	static DEFINE_PER_CPU(arch_spinlock_t, name ## _lock)		\
-	= __ARCH_SPIN_LOCK_UNLOCKED;					\
-	static struct lglock name = { .lock = &name ## _lock }
-
-void lg_lock_init(struct lglock *lg, char *name);
-void lg_local_lock(struct lglock *lg);
-void lg_local_unlock(struct lglock *lg);
-void lg_local_lock_cpu(struct lglock *lg, int cpu);
-void lg_local_unlock_cpu(struct lglock *lg, int cpu);
-void lg_global_lock(struct lglock *lg);
-void lg_global_unlock(struct lglock *lg);
+void lg_lock_init(struct lglock __percpu *lg, char *name);
+void lg_local_lock(struct lglock __percpu *lg);
+void lg_local_unlock(struct lglock __percpu *lg);
+void lg_local_lock_cpu(struct lglock __percpu *lg, int cpu);
+void lg_local_unlock_cpu(struct lglock __percpu *lg, int cpu);
+void lg_global_lock(struct lglock __percpu *lg);
+void lg_global_unlock(struct lglock __percpu *lg);
 
 #endif
diff --git a/kernel/lglock.c b/kernel/lglock.c
index 6535a667a5a7..a9e327ba89e6 100644
--- a/kernel/lglock.c
+++ b/kernel/lglock.c
@@ -4,84 +4,90 @@
 #include <linux/cpu.h>
 #include <linux/string.h>
 
+/* We only fill in the name and lock_dep_map for the first CPU */
+#define lg_lock_dep_map(lg) \
+	per_cpu_ptr(&lg->lock_dep_map,0)
+#define lg_lock_key(lg) \
+	per_cpu_ptr(&lg->lock_key,0)
+
 /*
  * Note there is no uninit, so lglocks cannot be defined in
  * modules (but it's fine to use them from there)
  * Could be added though, just undo lg_lock_init
  */
 
-void lg_lock_init(struct lglock *lg, char *name)
+void lg_lock_init(struct lglock __percpu *lg, char *name)
 {
-	LOCKDEP_INIT_MAP(&lg->lock_dep_map, name, &lg->lock_key, 0);
+	LOCKDEP_INIT_MAP(lg_lock_dep_map(lg), name, lg_lock_key(lg), 0);
 }
 EXPORT_SYMBOL(lg_lock_init);
 
-void lg_local_lock(struct lglock *lg)
+void lg_local_lock(struct lglock __percpu *lg)
 {
 	arch_spinlock_t *lock;
 
 	preempt_disable();
-	rwlock_acquire_read(&lg->lock_dep_map, 0, 0, _RET_IP_);
-	lock = this_cpu_ptr(lg->lock);
+	rwlock_acquire_read(lg_lock_dep_map(lg), 0, 0, _RET_IP_);
+	lock = this_cpu_ptr(&lg->lock);
 	arch_spin_lock(lock);
 }
 EXPORT_SYMBOL(lg_local_lock);
 
-void lg_local_unlock(struct lglock *lg)
+void lg_local_unlock(struct lglock __percpu *lg)
 {
 	arch_spinlock_t *lock;
 
-	rwlock_release(&lg->lock_dep_map, 1, _RET_IP_);
-	lock = this_cpu_ptr(lg->lock);
+	rwlock_release(lg_lock_dep_map(lg), 1, _RET_IP_);
+	lock = this_cpu_ptr(&lg->lock);
 	arch_spin_unlock(lock);
 	preempt_enable();
 }
 EXPORT_SYMBOL(lg_local_unlock);
 
-void lg_local_lock_cpu(struct lglock *lg, int cpu)
+void lg_local_lock_cpu(struct lglock __percpu *lg, int cpu)
 {
 	arch_spinlock_t *lock;
 
 	preempt_disable();
-	rwlock_acquire_read(&lg->lock_dep_map, 0, 0, _RET_IP_);
-	lock = per_cpu_ptr(lg->lock, cpu);
+	rwlock_acquire_read(lg_lock_dep_map(lg), 0, 0, _RET_IP_);
+	lock = per_cpu_ptr(&lg->lock, cpu);
 	arch_spin_lock(lock);
 }
 EXPORT_SYMBOL(lg_local_lock_cpu);
 
-void lg_local_unlock_cpu(struct lglock *lg, int cpu)
+void lg_local_unlock_cpu(struct lglock __percpu *lg, int cpu)
 {
 	arch_spinlock_t *lock;
 
-	rwlock_release(&lg->lock_dep_map, 1, _RET_IP_);
-	lock = per_cpu_ptr(lg->lock, cpu);
+	rwlock_release(lg_lock_dep_map(lg), 1, _RET_IP_);
+	lock = per_cpu_ptr(&lg->lock, cpu);
 	arch_spin_unlock(lock);
 	preempt_enable();
 }
 EXPORT_SYMBOL(lg_local_unlock_cpu);
 
-void lg_global_lock(struct lglock *lg)
+void lg_global_lock(struct lglock __percpu *lg)
 {
 	int i;
 
 	preempt_disable();
-	rwlock_acquire(&lg->lock_dep_map, 0, 0, _RET_IP_);
+	rwlock_acquire(lg_lock_dep_map(lg), 0, 0, _RET_IP_);
 	for_each_possible_cpu(i) {
 		arch_spinlock_t *lock;
-		lock = per_cpu_ptr(lg->lock, i);
+		lock = per_cpu_ptr(&lg->lock, i);
 		arch_spin_lock(lock);
 	}
 }
 EXPORT_SYMBOL(lg_global_lock);
 
-void lg_global_unlock(struct lglock *lg)
+void lg_global_unlock(struct lglock __percpu *lg)
 {
 	int i;
 
-	rwlock_release(&lg->lock_dep_map, 1, _RET_IP_);
+	rwlock_release(lg_lock_dep_map(lg), 1, _RET_IP_);
 	for_each_possible_cpu(i) {
 		arch_spinlock_t *lock;
-		lock = per_cpu_ptr(lg->lock, i);
+		lock = per_cpu_ptr(&lg->lock, i);
 		arch_spin_unlock(lock);
 	}
 	preempt_enable();

^ permalink raw reply related	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03 21:13                                                                 ` Linus Torvalds
@ 2013-09-03 21:34                                                                   ` Linus Torvalds
  2013-09-03 21:39                                                                     ` Linus Torvalds
  0 siblings, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-09-03 21:34 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Al Viro, Sedat Dilek, Waiman Long, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J, Peter Zijlstra, Arnaldo Carvalho de Melo

On Tue, Sep 3, 2013 at 2:13 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> This is the one that actually compiles.  Whether it *works* is still a
> total mystery.

It generates ok code, and it booted, so it seems to work at least for my config.

However, it seems to make no performance-difference what-so-ever, and
lg_local_lock is still using about 7% cpu per the profiles.

The code generation is slightly better, but the profile looks the same:

       │    ffffffff81078e70 <lg_local_lock>:
  0.62 │      push   %rbp
  0.28 │      mov    %rsp,%rbp
  0.22 │      add    %gs:0xcd48,%rdi
  0.27 │      mov    $0x100,%eax
 97.22 │      lock   xadd   %ax,(%rdi)
  0.01 │      movzbl %ah,%edx
       │      cmp    %al,%dl
  0.56 │    ↓ je     29
       │      xchg   %ax,%ax
  0.00 │20:   pause
  0.00 │      movzbl (%rdi),%eax
       │      cmp    %dl,%al
       │    ↑ jne    20
       │29:   pop    %rbp
  0.81 │    ← retq

but it still obviously doesn't do the "lock xadd %ax,%gs:(%rdi)"
(without the preceding 'add') that would be the optimal code.

I'll try to hack that up too, but it's looking like it really is just
the "lock xadd", not the memory dependency chain..

            Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03 21:34                                                                   ` Linus Torvalds
@ 2013-09-03 21:39                                                                     ` Linus Torvalds
  0 siblings, 0 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-09-03 21:39 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Al Viro, Sedat Dilek, Waiman Long, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J, Peter Zijlstra, Arnaldo Carvalho de Melo

On Tue, Sep 3, 2013 at 2:34 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> I'll try to hack that up too, but it's looking like it really is just
> the "lock xadd", not the memory dependency chain..

Yeah, no difference: Better code generation with my quick hack for a
percpu spinlock:

       │    ffffffff81078e70 <lg_local_lock>:
  0.59 │      push   %rbp
  0.25 │      mov    %rsp,%rbp
  0.07 │      mov    $0x100,%eax
 97.55 │      lock   xadd   %ax,%gs:(%rdi)
  0.01 │      movzbl %ah,%edx
       │      cmp    %al,%dl
  0.68 │    ↓ je     29
       │      nop
       │20:   pause
       │      mov    %gs:(%rdi),%al
       │      cmp    %dl,%al
       │    ↑ jne    20
       │29:   pop    %rbp
  0.84 │    ← retq

but the actual cost is pretty much the same:

   6.81%   lg_local_lock

so it doesn't seem to be some odd weakness of the microarchitecture.

            Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01 15:32                                   ` Linus Torvalds
  2013-09-01 15:45                                     ` Sedat Dilek
  2013-09-01 20:59                                     ` Linus Torvalds
@ 2013-09-03 22:37                                     ` Sedat Dilek
  2013-09-03 22:55                                       ` Dave Jones
  2013-09-03 23:45                                       ` Sedat Dilek
  2 siblings, 2 replies; 151+ messages in thread
From: Sedat Dilek @ 2013-09-03 22:37 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Sun, Sep 1, 2013 at 5:32 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Sun, Sep 1, 2013 at 3:01 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>
>> Looks like this is now 10x faster: ~2.66Mloops (debug) VS.
>> ~26.60Mloops (no-debug).
>
> Ok, that's getting to be in the right ballpark.
>
> But your profile is still odd.
>
>> Samples: 159K of event 'cycles:pp', Event count (approx.): 76968896763
>>  12,79%  t_lockref_from-  [kernel.kallsyms]     [k] irq_return
>>   4,36%  t_lockref_from-  [kernel.kallsyms]     [k] __ticket_spin_lock
>
> If you do the profile with "-g", what are the top callers of this? You
> shouldn't see any spinlock load from the path lookup, but you have all
> these other things going on..
>
>>   4,36%  t_lockref_from-  [kernel.kallsyms]     [k] __acct_update_integrals
>>   4,07%  t_lockref_from-  [kernel.kallsyms]     [k] user_exit
>>   3,12%  t_lockref_from-  [kernel.kallsyms]     [k] local_clock
>>   2,83%  t_lockref_from-  [kernel.kallsyms]     [k] lockref_get_or_lock
>>   2,73%  t_lockref_from-  [kernel.kallsyms]     [k] kmem_cache_alloc
>>   2,62%  t_lockref_from-  [kernel.kallsyms]     [k] __d_lookup_rcu
>
> You're spending more time on the task stats than on the actual lookup.
> Maybe you should turn off CONFIG_TASKSTATS..But why that whole
> irq_return thing? Odd.
>

[ init/Kconfig ]
...
config TASKSTATS
        bool "Export task/process statistics through netlink"
        depends on NET <--- Difficult to disable it?!
        default n
        help
          Export selected statistics for tasks/processes through the
          generic netlink interface. Unlike BSD process accounting, the
          statistics are available during the lifetime of tasks/processes as
          responses to commands. Like BSD accounting, they are sent to user
          space on task exit.

          Say N if unsure.
...

- Sedat -

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03 15:14                                             ` Waiman Long
  2013-09-03 15:34                                               ` Linus Torvalds
@ 2013-09-03 22:41                                               ` Sedat Dilek
  2013-09-03 23:11                                                 ` Sedat Dilek
  1 sibling, 1 reply; 151+ messages in thread
From: Sedat Dilek @ 2013-09-03 22:41 UTC (permalink / raw)
  To: Waiman Long
  Cc: Ingo Molnar, Al Viro, Linus Torvalds, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

[-- Attachment #1: Type: text/plain, Size: 816 bytes --]

On Tue, Sep 3, 2013 at 5:14 PM, Waiman Long <waiman.long@hp.com> wrote:
> On 09/03/2013 02:01 AM, Ingo Molnar wrote:
>>
>> * Waiman Long<waiman.long@hp.com>  wrote:
>>
>>> Yes, that patch worked. It eliminated the lglock as a bottleneck in the
>>> AIM7 workload. The lg_global_lock did not show up in the perf profile,
>>> whereas the lg_local_lock was only 0.07%.
>>
>> Just curious: what's the worst bottleneck now in the optimized kernel? :-)
>>
>> Thanks,
>>
>>         Ingo
>
> With the following patches on v3.11:
> 1. Linus's version of lockref patch
> 2. Al's lglock patch
> 3. My preliminary patch to convert prepend_path under RCU
>

With no reference where to get those patches, it's a bit hard to follow.

I will try some perf benchmarking with the attached patch against
Linux "WfW" edition.

- Sedat -

[-- Attachment #2: 3.11.0-1-lockref-small.patch --]
[-- Type: application/octet-stream, Size: 15845 bytes --]

Linus Torvalds (4):
      lockref: add 'lockref_get_or_lock() helper
      vfs: reimplement d_rcu_to_refcount() using lockref_get_or_lock()
      lockref: uninline lockref helper functions
      lockref: implement lockless reference count updates using cmpxchg()

Sedat Dilek (6):
      kbuild: deb-pkg: Try to determine distribution
      kbuild: deb-pkg: Bump year in debian/copyright file
      kbuild: deb-pkg: Update git repository URL in debian/copyright file
      Merge branch 'deb-pkg-3.10-fixes' into 3.11.0-1-lockref-small
      Merge branch 'locked-reference-counts' into 3.11.0-1-lockref-small
      Merge branch 'lockref-3.12-fixes' into 3.11.0-1-lockref-small

Tony Luck (1):
      lockref: Relax in cmpxchg loop

Waiman Long (1):
      vfs: use lockref_get_not_zero() for optimistic lockless dget_parent()

 arch/x86/Kconfig                |   1 +
 arch/x86/include/asm/spinlock.h |   5 ++
 fs/dcache.c                     |  17 +++++-
 fs/namei.c                      |  90 ++++++++++++++++++++--------
 include/linux/dcache.h          |  22 -------
 include/linux/lockref.h         |  61 ++++---------------
 lib/Kconfig                     |  10 ++++
 lib/Makefile                    |   1 +
 lib/lockref.c                   | 128 ++++++++++++++++++++++++++++++++++++++++
 scripts/package/builddeb        |  19 +++++-
 10 files changed, 254 insertions(+), 100 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index b32ebf9..67e0074 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -16,6 +16,7 @@ config X86_64
 	def_bool y
 	depends on 64BIT
 	select X86_DEV_DMA_OPS
+	select ARCH_USE_CMPXCHG_LOCKREF
 
 ### Arch settings
 config X86
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h
index e3ddd7d..e0e6684 100644
--- a/arch/x86/include/asm/spinlock.h
+++ b/arch/x86/include/asm/spinlock.h
@@ -34,6 +34,11 @@
 # define UNLOCK_LOCK_PREFIX
 #endif
 
+static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock)
+{
+	return lock.tickets.head == lock.tickets.tail;
+}
+
 /*
  * Ticket locks are conceptually two parts, one indicating the current head of
  * the queue, and the other indicating the current tail. The lock is acquired
diff --git a/fs/dcache.c b/fs/dcache.c
index b949af8..96655f4 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -611,8 +611,23 @@ static inline void __dget(struct dentry *dentry)
 
 struct dentry *dget_parent(struct dentry *dentry)
 {
+	int gotref;
 	struct dentry *ret;
 
+	/*
+	 * Do optimistic parent lookup without any
+	 * locking.
+	 */
+	rcu_read_lock();
+	ret = ACCESS_ONCE(dentry->d_parent);
+	gotref = lockref_get_not_zero(&ret->d_lockref);
+	rcu_read_unlock();
+	if (likely(gotref)) {
+		if (likely(ret == ACCESS_ONCE(dentry->d_parent)))
+			return ret;
+		dput(ret);
+	}
+
 repeat:
 	/*
 	 * Don't need rcu_dereference because we re-check it was correct under
@@ -1771,7 +1786,7 @@ static noinline enum slow_d_compare slow_dentry_cmp(
  * without taking d_lock and checking d_seq sequence count against @seq
  * returned here.
  *
- * A refcount may be taken on the found dentry with the __d_rcu_to_refcount
+ * A refcount may be taken on the found dentry with the d_rcu_to_refcount
  * function.
  *
  * Alternatively, __d_lookup_rcu may be called again to look up the child of
diff --git a/fs/namei.c b/fs/namei.c
index 7720fbd..2c30c84 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -494,6 +494,50 @@ static inline void unlock_rcu_walk(void)
 	br_read_unlock(&vfsmount_lock);
 }
 
+/*
+ * When we move over from the RCU domain to properly refcounted
+ * long-lived dentries, we need to check the sequence numbers
+ * we got before lookup very carefully.
+ *
+ * We cannot blindly increment a dentry refcount - even if it
+ * is not locked - if it is zero, because it may have gone
+ * through the final d_kill() logic already.
+ *
+ * So for a zero refcount, we need to get the spinlock (which is
+ * safe even for a dead dentry because the de-allocation is
+ * RCU-delayed), and check the sequence count under the lock.
+ *
+ * Once we have checked the sequence count, we know it is live,
+ * and since we hold the spinlock it cannot die from under us.
+ *
+ * In contrast, if the reference count wasn't zero, we can just
+ * increment the lockref without having to take the spinlock.
+ * Even if the sequence number ends up being stale, we haven't
+ * gone through the final dput() and killed the dentry yet.
+ */
+static inline int d_rcu_to_refcount(struct dentry *dentry, seqcount_t *validate, unsigned seq)
+{
+	int gotref;
+
+	gotref = lockref_get_or_lock(&dentry->d_lockref);
+
+	/* Does the sequence number still match? */
+	if (read_seqcount_retry(validate, seq)) {
+		if (gotref)
+			dput(dentry);
+		else
+			spin_unlock(&dentry->d_lock);
+		return -ECHILD;
+	}
+
+	/* Get the ref now, if we couldn't get it originally */
+	if (!gotref) {
+		dentry->d_lockref.count++;
+		spin_unlock(&dentry->d_lock);
+	}
+	return 0;
+}
+
 /**
  * unlazy_walk - try to switch to ref-walk mode.
  * @nd: nameidata pathwalk data
@@ -518,29 +562,28 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry)
 				nd->root.dentry != fs->root.dentry)
 			goto err_root;
 	}
-	spin_lock(&parent->d_lock);
+
+	/*
+	 * For a negative lookup, the lookup sequence point is the parents
+	 * sequence point, and it only needs to revalidate the parent dentry.
+	 *
+	 * For a positive lookup, we need to move both the parent and the
+	 * dentry from the RCU domain to be properly refcounted. And the
+	 * sequence number in the dentry validates *both* dentry counters,
+	 * since we checked the sequence number of the parent after we got
+	 * the child sequence number. So we know the parent must still
+	 * be valid if the child sequence number is still valid.
+	 */
 	if (!dentry) {
-		if (!__d_rcu_to_refcount(parent, nd->seq))
-			goto err_parent;
+		if (d_rcu_to_refcount(parent, &parent->d_seq, nd->seq) < 0)
+			goto err_root;
 		BUG_ON(nd->inode != parent->d_inode);
 	} else {
-		if (dentry->d_parent != parent)
+		if (d_rcu_to_refcount(dentry, &dentry->d_seq, nd->seq) < 0)
+			goto err_root;
+		if (d_rcu_to_refcount(parent, &dentry->d_seq, nd->seq) < 0)
 			goto err_parent;
-		spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
-		if (!__d_rcu_to_refcount(dentry, nd->seq))
-			goto err_child;
-		/*
-		 * If the sequence check on the child dentry passed, then
-		 * the child has not been removed from its parent. This
-		 * means the parent dentry must be valid and able to take
-		 * a reference at this point.
-		 */
-		BUG_ON(!IS_ROOT(dentry) && dentry->d_parent != parent);
-		BUG_ON(!parent->d_lockref.count);
-		parent->d_lockref.count++;
-		spin_unlock(&dentry->d_lock);
 	}
-	spin_unlock(&parent->d_lock);
 	if (want_root) {
 		path_get(&nd->root);
 		spin_unlock(&fs->lock);
@@ -551,10 +594,8 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry)
 	nd->flags &= ~LOOKUP_RCU;
 	return 0;
 
-err_child:
-	spin_unlock(&dentry->d_lock);
 err_parent:
-	spin_unlock(&parent->d_lock);
+	dput(dentry);
 err_root:
 	if (want_root)
 		spin_unlock(&fs->lock);
@@ -585,14 +626,11 @@ static int complete_walk(struct nameidata *nd)
 		nd->flags &= ~LOOKUP_RCU;
 		if (!(nd->flags & LOOKUP_ROOT))
 			nd->root.mnt = NULL;
-		spin_lock(&dentry->d_lock);
-		if (unlikely(!__d_rcu_to_refcount(dentry, nd->seq))) {
-			spin_unlock(&dentry->d_lock);
+
+		if (d_rcu_to_refcount(dentry, &dentry->d_seq, nd->seq) < 0) {
 			unlock_rcu_walk();
 			return -ECHILD;
 		}
-		BUG_ON(nd->inode != dentry->d_inode);
-		spin_unlock(&dentry->d_lock);
 		mntget(nd->path.mnt);
 		unlock_rcu_walk();
 	}
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index efdc944..9169b91 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -304,28 +304,6 @@ extern struct dentry *__d_lookup(const struct dentry *, const struct qstr *);
 extern struct dentry *__d_lookup_rcu(const struct dentry *parent,
 				const struct qstr *name, unsigned *seq);
 
-/**
- * __d_rcu_to_refcount - take a refcount on dentry if sequence check is ok
- * @dentry: dentry to take a ref on
- * @seq: seqcount to verify against
- * Returns: 0 on failure, else 1.
- *
- * __d_rcu_to_refcount operates on a dentry,seq pair that was returned
- * by __d_lookup_rcu, to get a reference on an rcu-walk dentry.
- */
-static inline int __d_rcu_to_refcount(struct dentry *dentry, unsigned seq)
-{
-	int ret = 0;
-
-	assert_spin_locked(&dentry->d_lock);
-	if (!read_seqcount_retry(&dentry->d_seq, seq)) {
-		ret = 1;
-		dentry->d_lockref.count++;
-	}
-
-	return ret;
-}
-
 static inline unsigned d_count(const struct dentry *dentry)
 {
 	return dentry->d_lockref.count;
diff --git a/include/linux/lockref.h b/include/linux/lockref.h
index 01233e0..ca07b50 100644
--- a/include/linux/lockref.h
+++ b/include/linux/lockref.h
@@ -17,55 +17,20 @@
 #include <linux/spinlock.h>
 
 struct lockref {
-	spinlock_t lock;
-	unsigned int count;
+	union {
+#ifdef CONFIG_CMPXCHG_LOCKREF
+		aligned_u64 lock_count;
+#endif
+		struct {
+			spinlock_t lock;
+			unsigned int count;
+		};
+	};
 };
 
-/**
- * lockref_get - Increments reference count unconditionally
- * @lockcnt: pointer to lockref structure
- *
- * This operation is only valid if you already hold a reference
- * to the object, so you know the count cannot be zero.
- */
-static inline void lockref_get(struct lockref *lockref)
-{
-	spin_lock(&lockref->lock);
-	lockref->count++;
-	spin_unlock(&lockref->lock);
-}
-
-/**
- * lockref_get_not_zero - Increments count unless the count is 0
- * @lockcnt: pointer to lockref structure
- * Return: 1 if count updated successfully or 0 if count is 0
- */
-static inline int lockref_get_not_zero(struct lockref *lockref)
-{
-	int retval = 0;
-
-	spin_lock(&lockref->lock);
-	if (lockref->count) {
-		lockref->count++;
-		retval = 1;
-	}
-	spin_unlock(&lockref->lock);
-	return retval;
-}
-
-/**
- * lockref_put_or_lock - decrements count unless count <= 1 before decrement
- * @lockcnt: pointer to lockref structure
- * Return: 1 if count updated successfully or 0 if count <= 1 and lock taken
- */
-static inline int lockref_put_or_lock(struct lockref *lockref)
-{
-	spin_lock(&lockref->lock);
-	if (lockref->count <= 1)
-		return 0;
-	lockref->count--;
-	spin_unlock(&lockref->lock);
-	return 1;
-}
+extern void lockref_get(struct lockref *);
+extern int lockref_get_not_zero(struct lockref *);
+extern int lockref_get_or_lock(struct lockref *);
+extern int lockref_put_or_lock(struct lockref *);
 
 #endif /* __LINUX_LOCKREF_H */
diff --git a/lib/Kconfig b/lib/Kconfig
index 71d9f81..6556171 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -48,6 +48,16 @@ config STMP_DEVICE
 config PERCPU_RWSEM
 	boolean
 
+config ARCH_USE_CMPXCHG_LOCKREF
+	bool
+
+config CMPXCHG_LOCKREF
+	def_bool y if ARCH_USE_CMPXCHG_LOCKREF
+	depends on SMP
+	depends on !GENERIC_LOCKBREAK
+	depends on !DEBUG_SPINLOCK
+	depends on !DEBUG_LOCK_ALLOC
+
 config CRC_CCITT
 	tristate "CRC-CCITT functions"
 	help
diff --git a/lib/Makefile b/lib/Makefile
index 7baccfd..f2cb308 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -20,6 +20,7 @@ lib-$(CONFIG_MMU) += ioremap.o
 lib-$(CONFIG_SMP) += cpumask.o
 
 lib-y	+= kobject.o klist.o
+obj-y	+= lockref.o
 
 obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \
 	 bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \
diff --git a/lib/lockref.c b/lib/lockref.c
new file mode 100644
index 0000000..9d76f40
--- /dev/null
+++ b/lib/lockref.c
@@ -0,0 +1,128 @@
+#include <linux/export.h>
+#include <linux/lockref.h>
+
+#ifdef CONFIG_CMPXCHG_LOCKREF
+
+/*
+ * Note that the "cmpxchg()" reloads the "old" value for the
+ * failure case.
+ */
+#define CMPXCHG_LOOP(CODE, SUCCESS) do {					\
+	struct lockref old;							\
+	BUILD_BUG_ON(sizeof(old) != 8);						\
+	old.lock_count = ACCESS_ONCE(lockref->lock_count);			\
+	while (likely(arch_spin_value_unlocked(old.lock.rlock.raw_lock))) {  	\
+		struct lockref new = old, prev = old;				\
+		CODE								\
+		old.lock_count = cmpxchg(&lockref->lock_count,			\
+					 old.lock_count, new.lock_count);	\
+		if (likely(old.lock_count == prev.lock_count)) {		\
+			SUCCESS;						\
+		}								\
+		cpu_relax();							\
+	}									\
+} while (0)
+
+#else
+
+#define CMPXCHG_LOOP(CODE, SUCCESS) do { } while (0)
+
+#endif
+
+/**
+ * lockref_get - Increments reference count unconditionally
+ * @lockcnt: pointer to lockref structure
+ *
+ * This operation is only valid if you already hold a reference
+ * to the object, so you know the count cannot be zero.
+ */
+void lockref_get(struct lockref *lockref)
+{
+	CMPXCHG_LOOP(
+		new.count++;
+	,
+		return;
+	);
+
+	spin_lock(&lockref->lock);
+	lockref->count++;
+	spin_unlock(&lockref->lock);
+}
+EXPORT_SYMBOL(lockref_get);
+
+/**
+ * lockref_get_not_zero - Increments count unless the count is 0
+ * @lockcnt: pointer to lockref structure
+ * Return: 1 if count updated successfully or 0 if count was zero
+ */
+int lockref_get_not_zero(struct lockref *lockref)
+{
+	int retval;
+
+	CMPXCHG_LOOP(
+		new.count++;
+		if (!old.count)
+			return 0;
+	,
+		return 1;
+	);
+
+	spin_lock(&lockref->lock);
+	retval = 0;
+	if (lockref->count) {
+		lockref->count++;
+		retval = 1;
+	}
+	spin_unlock(&lockref->lock);
+	return retval;
+}
+EXPORT_SYMBOL(lockref_get_not_zero);
+
+/**
+ * lockref_get_or_lock - Increments count unless the count is 0
+ * @lockcnt: pointer to lockref structure
+ * Return: 1 if count updated successfully or 0 if count was zero
+ * and we got the lock instead.
+ */
+int lockref_get_or_lock(struct lockref *lockref)
+{
+	CMPXCHG_LOOP(
+		new.count++;
+		if (!old.count)
+			break;
+	,
+		return 1;
+	);
+
+	spin_lock(&lockref->lock);
+	if (!lockref->count)
+		return 0;
+	lockref->count++;
+	spin_unlock(&lockref->lock);
+	return 1;
+}
+EXPORT_SYMBOL(lockref_get_or_lock);
+
+/**
+ * lockref_put_or_lock - decrements count unless count <= 1 before decrement
+ * @lockcnt: pointer to lockref structure
+ * Return: 1 if count updated successfully or 0 if count <= 1 and lock taken
+ */
+int lockref_put_or_lock(struct lockref *lockref)
+{
+	CMPXCHG_LOOP(
+		new.count--;
+		if (old.count <= 1)
+			break;
+	,
+		return 1;
+	);
+
+	spin_lock(&lockref->lock);
+	if (lockref->count <= 1)
+		return 0;
+	lockref->count--;
+	spin_unlock(&lockref->lock);
+	return 1;
+}
+EXPORT_SYMBOL(lockref_put_or_lock);
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index acb8650..7d7c9d8 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -172,9 +172,22 @@ else
 fi
 maintainer="$name <$email>"
 
+# Try to determine distribution
+if [ -e $(which lsb_release) ]; then
+       codename=$(lsb_release --codename --short)
+       if [ "$codename" != "" ]; then
+		distribution=$codename
+       else
+		distribution="UNRELEASED"
+		echo "WARNING: The distribution could NOT be determined!"
+       fi
+else
+       echo "HINT: Install lsb_release binary, this helps to identify your distribution!"
+fi
+
 # Generate a simple changelog template
 cat <<EOF > debian/changelog
-linux-upstream ($packageversion) unstable; urgency=low
+linux-upstream ($packageversion) $distribution; urgency=low
 
   * Custom built Linux kernel.
 
@@ -188,10 +201,10 @@ This is a packacked upstream version of the Linux kernel.
 The sources may be found at most Linux ftp sites, including:
 ftp://ftp.kernel.org/pub/linux/kernel
 
-Copyright: 1991 - 2009 Linus Torvalds and others.
+Copyright: 1991 - 2013 Linus Torvalds and others.
 
 The git repository for mainline kernel development is at:
-git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
+git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by

^ permalink raw reply related	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03 22:37                                     ` Sedat Dilek
@ 2013-09-03 22:55                                       ` Dave Jones
  2013-09-03 23:05                                         ` Sedat Dilek
  2013-09-03 23:45                                       ` Sedat Dilek
  1 sibling, 1 reply; 151+ messages in thread
From: Dave Jones @ 2013-09-03 22:55 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Linus Torvalds, Waiman Long, Ingo Molnar, Benjamin Herrenschmidt,
	Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Peter Zijlstra, Steven Rostedt, Andi Kleen, Chandramouleeswaran,
	Aswin, Norton, Scott J

On Wed, Sep 04, 2013 at 12:37:25AM +0200, Sedat Dilek wrote:
 
 > > You're spending more time on the task stats than on the actual lookup.
 > > Maybe you should turn off CONFIG_TASKSTATS..But why that whole
 > > irq_return thing? Odd.
 > >
 > 
 > [ init/Kconfig ]
 > ...
 > config TASKSTATS
 >         bool "Export task/process statistics through netlink"
 >         depends on NET <--- Difficult to disable it?!

More likely you're getting bitten by the fact that CONFIG_KVM has
a 'select TASKSTATS'

	Dave

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03 22:55                                       ` Dave Jones
@ 2013-09-03 23:05                                         ` Sedat Dilek
  2013-09-03 23:15                                           ` Dave Jones
  0 siblings, 1 reply; 151+ messages in thread
From: Sedat Dilek @ 2013-09-03 23:05 UTC (permalink / raw)
  To: Dave Jones, Sedat Dilek, Linus Torvalds, Waiman Long,
	Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Wed, Sep 4, 2013 at 12:55 AM, Dave Jones <davej@redhat.com> wrote:
> On Wed, Sep 04, 2013 at 12:37:25AM +0200, Sedat Dilek wrote:
>
>  > > You're spending more time on the task stats than on the actual lookup.
>  > > Maybe you should turn off CONFIG_TASKSTATS..But why that whole
>  > > irq_return thing? Odd.
>  > >
>  >
>  > [ init/Kconfig ]
>  > ...
>  > config TASKSTATS
>  >         bool "Export task/process statistics through netlink"
>  >         depends on NET <--- Difficult to disable it?!
>
> More likely you're getting bitten by the fact that CONFIG_KVM has
> a 'select TASKSTATS'
>

With CONFIG_KVM=n ...

$ egrep 'CONFIG_NET=|CONFIG_KVM=|CONFIG_TASKSTATS' .config
CONFIG_TASKSTATS=y
CONFIG_NET=y

- Sedat -

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03 22:41                                               ` Sedat Dilek
@ 2013-09-03 23:11                                                 ` Sedat Dilek
  0 siblings, 0 replies; 151+ messages in thread
From: Sedat Dilek @ 2013-09-03 23:11 UTC (permalink / raw)
  To: Waiman Long
  Cc: Ingo Molnar, Al Viro, Linus Torvalds, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

On Wed, Sep 4, 2013 at 12:41 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> On Tue, Sep 3, 2013 at 5:14 PM, Waiman Long <waiman.long@hp.com> wrote:
>> On 09/03/2013 02:01 AM, Ingo Molnar wrote:
>>>
>>> * Waiman Long<waiman.long@hp.com>  wrote:
>>>
>>>> Yes, that patch worked. It eliminated the lglock as a bottleneck in the
>>>> AIM7 workload. The lg_global_lock did not show up in the perf profile,
>>>> whereas the lg_local_lock was only 0.07%.
>>>
>>> Just curious: what's the worst bottleneck now in the optimized kernel? :-)
>>>
>>> Thanks,
>>>
>>>         Ingo
>>
>> With the following patches on v3.11:
>> 1. Linus's version of lockref patch
>> 2. Al's lglock patch
>> 3. My preliminary patch to convert prepend_path under RCU
>>
>
> With no reference where to get those patches, it's a bit hard to follow.
>
> I will try some perf benchmarking with the attached patch against
> Linux "WfW" edition.
>

Eat thiz...

$ cat /proc/version
Linux version 3.11.0-1-lockref-small (sedat.dilek@gmail.com@fambox)
(gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #1 SMP Wed Sep 4
00:53:25 CEST 2013

$ ~/src/linux-kernel/linux/tools/perf/perf stat --null --repeat 5
../scripts/t_lockref_from-linus
Total loops: 26786226
Total loops: 26970142
Total loops: 26593312
Total loops: 26885806
Total loops: 26944076

 Performance counter stats for '../scripts/t_lockref_from-linus' (5 runs):

      10,011755076 seconds time elapsed
          ( +-  0,10% )

$ sudo ~/src/linux-kernel/linux/tools/perf/perf record -e cycles:pp
../scripts/t_lockref_from-linus
Total loops: 26267751
[ perf record: Woken up 25 times to write data ]
[ perf record: Captured and wrote 6.112 MB perf.data (~267015 samples) ]

$ sudo ~/src/linux-kernel/linux/tools/perf/perf report -tui

Samples: 159K of event 'cycles:pp', Event count (approx.): 77088218721
 12,52%uit_lockref_from-ui[kernel.kallsyms]   ui[k] irq_ret.rn
  4,37%uit_lockref_from-ui[kernel.kallsyms]   ui[k] __ticket_spin_lock
  4,18%uit_lockref_from-ui[kernel.kallsyms]   ui[k] __acct_.pdate_integrals
  3,90%uit_lockref_from-ui[kernel.kallsyms]   ui[k] .ser_exit
  3,17%uit_lockref_from-ui[kernel.kallsyms]   ui[k] __d_look.p_rc.
  3,14%uit_lockref_from-ui[kernel.kallsyms]   ui[k] lockref_get_or_lock
  3,01%uit_lockref_from-ui[kernel.kallsyms]   ui[k] local_clock
  2,72%uit_lockref_from-ui[kernel.kallsyms]   ui[k] kmem_cache_alloc
  2,54%uit_lockref_from-uilibc-2.15.so        ui[.] __xstat64
  2,45%uit_lockref_from-ui[kernel.kallsyms]   ui[k] link_path_walk
  2,23%uit_lockref_from-ui[kernel.kallsyms]   ui[k] kmem_cache_free
  1,90%uit_lockref_from-ui[kernel.kallsyms]   ui[k] rc._eqs_exit_common.isra.43
  1,88%uit_lockref_from-ui[kernel.kallsyms]   ui[k] tracesys
  1,82%uit_lockref_from-ui[kernel.kallsyms]   ui[k] rc._eqs_enter_common.isra.45
  1,77%uit_lockref_from-ui[kernel.kallsyms]   ui[k] sched_clock_cp.
  1,76%uit_lockref_from-ui[kernel.kallsyms]   ui[k] .ser_enter
  1,73%uit_lockref_from-ui[kernel.kallsyms]   ui[k] lockref_p.t_or_lock
  1,70%uit_lockref_from-ui[kernel.kallsyms]   ui[k] path_look.pat
  1,53%uit_lockref_from-ui[kernel.kallsyms]   ui[k] native_read_tsc
  1,52%uit_lockref_from-ui[kernel.kallsyms]   ui[k] native_sched_clock
  1,51%uit_lockref_from-ui[kernel.kallsyms]   ui[k] cp_new_stat
  1,51%uit_lockref_from-ui[kernel.kallsyms]   ui[k] syscall_trace_enter
  1,46%uit_lockref_from-ui[kernel.kallsyms]   ui[k] acco.nt_system_time
  1,42%uit_lockref_from-ui[kernel.kallsyms]   ui[k] path_init
  1,42%uit_lockref_from-ui[kernel.kallsyms]   ui[k] copy_.ser_generic_.nrolled
  1,39%uit_lockref_from-ui[kernel.kallsyms]   ui[k] jiffies_to_timeval
  1,39%uit_lockref_from-ui[kernel.kallsyms]   ui[k] getname_flags
  1,37%uit_lockref_from-ui[kernel.kallsyms]   ui[k] vfs_getattr
  1,25%uit_lockref_from-ui[kernel.kallsyms]   ui[k] common_perm
  1,14%uit_lockref_from-ui[kernel.kallsyms]   ui[k] get_vtime_delta
  1,13%uit_lockref_from-ui[kernel.kallsyms]   ui[k] look.p_fast
  1,12%uit_lockref_from-ui[kernel.kallsyms]   ui[k] syscall_trace_leave
  1,05%uit_lockref_from-ui[kernel.kallsyms]   ui[k] system_call
  0,99%uit_lockref_from-ui[kernel.kallsyms]   ui[k] generic_fillattr
  0,94%uit_lockref_from-ui[kernel.kallsyms]   ui[k] .ser_path_at_empty
  0,91%uit_lockref_from-ui[kernel.kallsyms]   ui[k] acco.nt_.ser_time
  0,90%uit_lockref_from-ui[kernel.kallsyms]   ui[k] __ticket_spin_.nlock
  0,87%uit_lockref_from-ui[kernel.kallsyms]   ui[k] strncpy_from_.ser
  0,83%uit_lockref_from-ui[kernel.kallsyms]   ui[k] filename_look.p
  0,82%uit_lockref_from-ui[kernel.kallsyms]   ui[k] generic_permission
  0,78%uit_lockref_from-ui[kernel.kallsyms]   ui[k] complete_walk
  0,75%uit_lockref_from-ui[kernel.kallsyms]   ui[k] vfs_fstatat
  0,74%uit_lockref_from-ui[kernel.kallsyms]   ui[k] lg_local_lock
  0,72%uit_lockref_from-ui[kernel.kallsyms]   ui[k] vtime_acco.nt_.ser
  0,67%uit_lockref_from-ui[kernel.kallsyms]   ui[k] dp.t
  0,66%uit_lockref_from-ui[kernel.kallsyms]   ui[k] __inode_permission
  0,62%uit_lockref_from-ui[kernel.kallsyms]   ui[k] rc._eqs_enter
  0,58%uit_lockref_from-ui[kernel.kallsyms]   ui[k] lg_local_.nlock
  0,56%uit_lockref_from-ui[kernel.kallsyms]   ui[k] vtime_.ser_enter
  0,50%uit_lockref_from-ui[kernel.kallsyms]   ui[k] cp.acct_acco.nt_field
  0,48%uit_lockref_from-ui[kernel.kallsyms]   ui[k] sec.rity_inode_permission
  0,48%uit_lockref_from-uit_lockref_from-lin.sui[.] start_ro.tine
  0,47%uit_lockref_from-ui[kernel.kallsyms]   ui[k] sec.rity_inode_getattr
  0,47%uit_lockref_from-ui[kernel.kallsyms]   ui[k] acct_acco.nt_cp.time
Press '?' for help on key bindings

Here the annotated entries for the first two entries:

irq_return
       │
       │
       │
       │    Disassembly of section .text:
       │
       │    ffffffff816d4f2c <irq_return>:
100,00 │    ↓ jmpq   120
       │      data32 data32 data32 data32 nopw %cs:0x0(%rax,%rax,1)


__ticket_spin_lock
       │
       │
       │
       │    Disassembly of section .text:
       │
       │    ffffffff8104ff10 <__ticket_spin_lock>:
  2,55 │      push   %rbp
  1,19 │      mov    $0x10000,%eax
  2,16 │      mov    %rsp,%rbp
 84,70 │      lock   xadd   %eax,(%rdi)
  0,14 │      mov    %eax,%edx
       │      shr    $0x10,%edx
  4,33 │      cmp    %ax,%dx
  0,03 │    ↓ je     2a
       │      nop
       │20:   pause
  0,03 │      movzwl (%rdi),%eax
       │      cmp    %dx,%ax
       │    ↑ jne    20
  0,03 │2a:   pop    %rbp
  4,84 │    ← retq

- Sedat -
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03 23:05                                         ` Sedat Dilek
@ 2013-09-03 23:15                                           ` Dave Jones
  2013-09-03 23:20                                             ` Sedat Dilek
  0 siblings, 1 reply; 151+ messages in thread
From: Dave Jones @ 2013-09-03 23:15 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Linus Torvalds, Waiman Long, Ingo Molnar, Benjamin Herrenschmidt,
	Alexander Viro, Jeff Layton, Miklos Szeredi, Ingo Molnar,
	Thomas Gleixner, linux-fsdevel, Linux Kernel Mailing List,
	Peter Zijlstra, Steven Rostedt, Andi Kleen, Chandramouleeswaran,
	Aswin, Norton, Scott J

On Wed, Sep 04, 2013 at 01:05:38AM +0200, Sedat Dilek wrote:
 > On Wed, Sep 4, 2013 at 12:55 AM, Dave Jones <davej@redhat.com> wrote:
 > > On Wed, Sep 04, 2013 at 12:37:25AM +0200, Sedat Dilek wrote:
 > >
 > >  > > You're spending more time on the task stats than on the actual lookup.
 > >  > > Maybe you should turn off CONFIG_TASKSTATS..But why that whole
 > >  > > irq_return thing? Odd.
 > >  > >
 > >  >
 > >  > [ init/Kconfig ]
 > >  > ...
 > >  > config TASKSTATS
 > >  >         bool "Export task/process statistics through netlink"
 > >  >         depends on NET <--- Difficult to disable it?!
 > >
 > > More likely you're getting bitten by the fact that CONFIG_KVM has
 > > a 'select TASKSTATS'
 > >
 > 
 > With CONFIG_KVM=n ...
 > 
 > $ egrep 'CONFIG_NET=|CONFIG_KVM=|CONFIG_TASKSTATS' .config
 > CONFIG_TASKSTATS=y
 > CONFIG_NET=y

Weird.

sed -i '/TASKSTATS/d' .config
sed -i '/KVM/d' .config
make oldconfig
...
egrep 'CONFIG_NET=|CONFIG_KVM=|CONFIG_TASKSTATS' .config
# CONFIG_TASKSTATS is not set
CONFIG_NET=y


The NET dependancy shouldn't matter at all.
I don't see any other 'select TASKSTATS' in the tree.

	Dave


^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03 23:15                                           ` Dave Jones
@ 2013-09-03 23:20                                             ` Sedat Dilek
  0 siblings, 0 replies; 151+ messages in thread
From: Sedat Dilek @ 2013-09-03 23:20 UTC (permalink / raw)
  To: Dave Jones, Sedat Dilek, Linus Torvalds, Waiman Long,
	Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Wed, Sep 4, 2013 at 1:15 AM, Dave Jones <davej@redhat.com> wrote:
> On Wed, Sep 04, 2013 at 01:05:38AM +0200, Sedat Dilek wrote:
>  > On Wed, Sep 4, 2013 at 12:55 AM, Dave Jones <davej@redhat.com> wrote:
>  > > On Wed, Sep 04, 2013 at 12:37:25AM +0200, Sedat Dilek wrote:
>  > >
>  > >  > > You're spending more time on the task stats than on the actual lookup.
>  > >  > > Maybe you should turn off CONFIG_TASKSTATS..But why that whole
>  > >  > > irq_return thing? Odd.
>  > >  > >
>  > >  >
>  > >  > [ init/Kconfig ]
>  > >  > ...
>  > >  > config TASKSTATS
>  > >  >         bool "Export task/process statistics through netlink"
>  > >  >         depends on NET <--- Difficult to disable it?!
>  > >
>  > > More likely you're getting bitten by the fact that CONFIG_KVM has
>  > > a 'select TASKSTATS'
>  > >
>  >
>  > With CONFIG_KVM=n ...
>  >
>  > $ egrep 'CONFIG_NET=|CONFIG_KVM=|CONFIG_TASKSTATS' .config
>  > CONFIG_TASKSTATS=y
>  > CONFIG_NET=y
>
> Weird.
>
> sed -i '/TASKSTATS/d' .config
> sed -i '/KVM/d' .config
> make oldconfig
> ...
> egrep 'CONFIG_NET=|CONFIG_KVM=|CONFIG_TASKSTATS' .config
> # CONFIG_TASKSTATS is not set
> CONFIG_NET=y
>
>
> The NET dependancy shouldn't matter at all.
> I don't see any other 'select TASKSTATS' in the tree.
>

Ah, cool.

With CONFIG_KVM=n and CONFIG_TASKSTATS=n plus...

$ yes "" | make oldconfig && make silentoldconfig </dev/null

...I get now:

$ egrep 'CONFIG_NET=|CONFIG_KVM=|CONFIG_TASKSTATS' .config
# CONFIG_TASKSTATS is not set
CONFIG_NET=y

Thanks, Dave!

- Sedat -

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03 22:37                                     ` Sedat Dilek
  2013-09-03 22:55                                       ` Dave Jones
@ 2013-09-03 23:45                                       ` Sedat Dilek
  1 sibling, 0 replies; 151+ messages in thread
From: Sedat Dilek @ 2013-09-03 23:45 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Waiman Long, Ingo Molnar, Benjamin Herrenschmidt, Alexander Viro,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

[-- Attachment #1: Type: text/plain, Size: 6045 bytes --]

On Wed, Sep 4, 2013 at 12:37 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> On Sun, Sep 1, 2013 at 5:32 PM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
>> On Sun, Sep 1, 2013 at 3:01 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>>>
>>> Looks like this is now 10x faster: ~2.66Mloops (debug) VS.
>>> ~26.60Mloops (no-debug).
>>
>> Ok, that's getting to be in the right ballpark.
>>
>> But your profile is still odd.
>>
>>> Samples: 159K of event 'cycles:pp', Event count (approx.): 76968896763
>>>  12,79%  t_lockref_from-  [kernel.kallsyms]     [k] irq_return
>>>   4,36%  t_lockref_from-  [kernel.kallsyms]     [k] __ticket_spin_lock
>>
>> If you do the profile with "-g", what are the top callers of this? You
>> shouldn't see any spinlock load from the path lookup, but you have all
>> these other things going on..
>>
>>>   4,36%  t_lockref_from-  [kernel.kallsyms]     [k] __acct_update_integrals
>>>   4,07%  t_lockref_from-  [kernel.kallsyms]     [k] user_exit
>>>   3,12%  t_lockref_from-  [kernel.kallsyms]     [k] local_clock
>>>   2,83%  t_lockref_from-  [kernel.kallsyms]     [k] lockref_get_or_lock
>>>   2,73%  t_lockref_from-  [kernel.kallsyms]     [k] kmem_cache_alloc
>>>   2,62%  t_lockref_from-  [kernel.kallsyms]     [k] __d_lookup_rcu
>>
>> You're spending more time on the task stats than on the actual lookup.
>> Maybe you should turn off CONFIG_TASKSTATS..But why that whole
>> irq_return thing? Odd.
>>
>
> [ init/Kconfig ]
> ...
> config TASKSTATS
>         bool "Export task/process statistics through netlink"
>         depends on NET <--- Difficult to disable it?!
>         default n
>         help
>           Export selected statistics for tasks/processes through the
>           generic netlink interface. Unlike BSD process accounting, the
>           statistics are available during the lifetime of tasks/processes as
>           responses to commands. Like BSD accounting, they are sent to user
>           space on task exit.
>
>           Say N if unsure.
> ...
>

So with Dave J.'s help I disabled CONFIG_TASKSTATS.

But I still see that odd irq_ret* thing.

My kernel-config and patch (on top of Linux v3.11) are attached.

- Sedat -

$ sudo ~/src/linux-kernel/linux/tools/perf/perf report -tui

Samples: 161K of event 'cycles:pp', Event count (approx.): 76595555357
 13,30%uit_lockref_from-ui[kernel.kallsyms]   ui[k] irq_ret.rn
  5,25%uit_lockref_from-ui[kernel.kallsyms]   ui[k] lockref_get_or_lock
  4,82%uit_lockref_from-ui[kernel.kallsyms]   ui[k] __ticket_spin_lock
  4,23%uit_lockref_from-ui[kernel.kallsyms]   ui[k] .ser_exit
  3,17%uit_lockref_from-ui[kernel.kallsyms]   ui[k] local_clock
  2,98%uit_lockref_from-ui[kernel.kallsyms]   ui[k] kmem_cache_alloc
  2,61%uit_lockref_from-uilibc-2.15.so        ui[.] __xstat64
  2,55%uit_lockref_from-ui[kernel.kallsyms]   ui[k] link_path_walk
  2,49%uit_lockref_from-ui[kernel.kallsyms]   ui[k] kmem_cache_free
  2,03%uit_lockref_from-ui[kernel.kallsyms]   ui[k] tracesys
  2,01%uit_lockref_from-ui[kernel.kallsyms]   ui[k] path_look.pat
  1,99%uit_lockref_from-ui[kernel.kallsyms]   ui[k] rc._eqs_exit_common.isra.43
  1,94%uit_lockref_from-ui[kernel.kallsyms]   ui[k] .ser_enter
  1,92%uit_lockref_from-ui[kernel.kallsyms]   ui[k] rc._eqs_enter_common.isra.45
  1,86%uit_lockref_from-ui[kernel.kallsyms]   ui[k] sched_clock_cp.
  1,72%uit_lockref_from-ui[kernel.kallsyms]   ui[k] __d_look.p_rc.
  1,71%uit_lockref_from-ui[kernel.kallsyms]   ui[k] native_read_tsc
  1,68%uit_lockref_from-ui[kernel.kallsyms]   ui[k] cp_new_stat
  1,65%uit_lockref_from-ui[kernel.kallsyms]   ui[k] lockref_p.t_or_lock
  1,64%uit_lockref_from-ui[kernel.kallsyms]   ui[k] look.p_fast
  1,59%uit_lockref_from-ui[kernel.kallsyms]   ui[k] path_init
  1,58%uit_lockref_from-ui[kernel.kallsyms]   ui[k] native_sched_clock
  1,57%uit_lockref_from-ui[kernel.kallsyms]   ui[k] copy_.ser_generic_.nrolled
  1,56%uit_lockref_from-ui[kernel.kallsyms]   ui[k] syscall_trace_enter
  1,53%uit_lockref_from-ui[kernel.kallsyms]   ui[k] acco.nt_system_time
  1,34%uit_lockref_from-ui[kernel.kallsyms]   ui[k] getname_flags
  1,28%uit_lockref_from-ui[kernel.kallsyms]   ui[k] get_vtime_delta
  1,26%uit_lockref_from-ui[kernel.kallsyms]   ui[k] vfs_getattr
  1,14%uit_lockref_from-ui[kernel.kallsyms]   ui[k] syscall_trace_leave
  1,11%uit_lockref_from-ui[kernel.kallsyms]   ui[k] system_call
  1,06%uit_lockref_from-ui[kernel.kallsyms]   ui[k] strncpy_from_.ser
  1,01%uit_lockref_from-ui[kernel.kallsyms]   ui[k] generic_fillattr
  0,97%uit_lockref_from-ui[kernel.kallsyms]   ui[k] acco.nt_.ser_time
  0,96%uit_lockref_from-ui[kernel.kallsyms]   ui[k] .ser_path_at_empty
  0,92%uit_lockref_from-ui[kernel.kallsyms]   ui[k] filename_look.p
  0,88%uit_lockref_from-ui[kernel.kallsyms]   ui[k] __ticket_spin_.nlock
  0,87%uit_lockref_from-ui[kernel.kallsyms]   ui[k] complete_walk
  0,86%uit_lockref_from-ui[kernel.kallsyms]   ui[k] generic_permission
  0,86%uit_lockref_from-ui[kernel.kallsyms]   ui[k] common_perm
  0,82%uit_lockref_from-ui[kernel.kallsyms]   ui[k] vfs_fstatat
  0,77%uit_lockref_from-ui[kernel.kallsyms]   ui[k] rc._eqs_enter
  0,75%uit_lockref_from-ui[kernel.kallsyms]   ui[k] vtime_acco.nt_.ser
  0,72%uit_lockref_from-ui[kernel.kallsyms]   ui[k] __inode_permission
  0,65%uit_lockref_from-ui[kernel.kallsyms]   ui[k] dp.t
  0,62%uit_lockref_from-ui[kernel.kallsyms]   ui[k] vtime_.ser_enter
  0,59%uit_lockref_from-ui[kernel.kallsyms]   ui[k] apparmor_inode_getattr
  0,55%uit_lockref_from-ui[kernel.kallsyms]   ui[k] lg_local_lock
  0,53%uit_lockref_from-ui[kernel.kallsyms]   ui[k] __vtime_acco.nt_system
  0,51%uit_lockref_from-ui[kernel.kallsyms]   ui[k] sec.rity_inode_permission
  0,51%uit_lockref_from-ui[kernel.kallsyms]   ui[k] mntp.t
  0,47%uit_lockref_from-uit_lockref_from-lin.sui[.] start_ro.tine
  0,45%uit_lockref_from-ui[kernel.kallsyms]   ui[k] cp.acct_acco.nt_field
  0,45%uit_lockref_from-ui[kernel.kallsyms]   ui[k] int_with_check
  0,44%uit_lockref_from-ui[kernel.kallsyms]   ui[k] rc._eqs_exit
Press '?' for help on key bindings

[-- Attachment #2: config-3.11.0-2-lockref-small --]
[-- Type: application/octet-stream, Size: 114160 bytes --]

#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 3.11.0 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_MMU=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_ARCH_HAS_CPU_AUTOPROBE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
CONFIG_ZONE_DMA32=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_HAVE_INTEL_TXT=y
CONFIG_X86_64_SMP=y
CONFIG_X86_HT=y
CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11"
CONFIG_ARCH_CPU_PROBE_RELEASE=y
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_EXTABLE_SORT=y

#
# General setup
#
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""
# CONFIG_COMPILE_TEST is not set
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_HAVE_KERNEL_LZ4=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
# CONFIG_KERNEL_LZ4 is not set
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_FHANDLE=y
CONFIG_AUDIT=y
CONFIG_AUDITSYSCALL=y
CONFIG_AUDIT_WATCH=y
CONFIG_AUDIT_TREE=y
# CONFIG_AUDIT_LOGINUID_IMMUTABLE is not set
CONFIG_HAVE_GENERIC_HARDIRQS=y

#
# IRQ subsystem
#
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_IRQ_DOMAIN=y
# CONFIG_IRQ_DOMAIN_DEBUG is not set
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_ARCH_CLOCKSOURCE_DATA=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
CONFIG_GENERIC_CMOS_UPDATE=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ_COMMON=y
# CONFIG_HZ_PERIODIC is not set
CONFIG_NO_HZ_IDLE=y
# CONFIG_NO_HZ_FULL is not set
# CONFIG_NO_HZ is not set
CONFIG_HIGH_RES_TIMERS=y

#
# CPU/Task time and stats accounting
#
CONFIG_VIRT_CPU_ACCOUNTING=y
# CONFIG_TICK_CPU_ACCOUNTING is not set
CONFIG_VIRT_CPU_ACCOUNTING_GEN=y
# CONFIG_IRQ_TIME_ACCOUNTING is not set
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
# CONFIG_TASKSTATS is not set

#
# RCU Subsystem
#
CONFIG_TREE_RCU=y
# CONFIG_PREEMPT_RCU is not set
CONFIG_RCU_STALL_COMMON=y
CONFIG_CONTEXT_TRACKING=y
CONFIG_RCU_USER_QS=y
CONFIG_CONTEXT_TRACKING_FORCE=y
CONFIG_RCU_FANOUT=64
CONFIG_RCU_FANOUT_LEAF=16
# CONFIG_RCU_FANOUT_EXACT is not set
# CONFIG_RCU_FAST_NO_HZ is not set
# CONFIG_TREE_RCU_TRACE is not set
CONFIG_RCU_NOCB_CPU=y
CONFIG_RCU_NOCB_CPU_NONE=y
# CONFIG_RCU_NOCB_CPU_ZERO is not set
# CONFIG_RCU_NOCB_CPU_ALL is not set
CONFIG_IKCONFIG=m
# CONFIG_IKCONFIG_PROC is not set
CONFIG_LOG_BUF_SHIFT=18
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y
CONFIG_ARCH_WANTS_PROT_NUMA_PROT_NONE=y
# CONFIG_NUMA_BALANCING is not set
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CPUSETS=y
CONFIG_PROC_PID_CPUSET=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_RESOURCE_COUNTERS=y
CONFIG_MEMCG=y
CONFIG_MEMCG_SWAP=y
# CONFIG_MEMCG_SWAP_ENABLED is not set
# CONFIG_MEMCG_KMEM is not set
CONFIG_CGROUP_HUGETLB=y
CONFIG_CGROUP_PERF=y
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_CFS_BANDWIDTH=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_BLK_CGROUP=y
# CONFIG_DEBUG_BLK_CGROUP is not set
CONFIG_CHECKPOINT_RESTORE=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_SCHED_AUTOGROUP=y
CONFIG_MM_OWNER=y
# CONFIG_SYSFS_DEPRECATED is not set
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
CONFIG_RD_LZO=y
# CONFIG_RD_LZ4 is not set
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_SYSCTL=y
CONFIG_ANON_INODES=y
CONFIG_HAVE_UID16=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_HAVE_PCSPKR_PLATFORM=y
CONFIG_EXPERT=y
CONFIG_UID16=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_PCSPKR_PLATFORM=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_PCI_QUIRKS=y
# CONFIG_EMBEDDED is not set
CONFIG_HAVE_PERF_EVENTS=y

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
CONFIG_VM_EVENT_COUNTERS=y
# CONFIG_COMPAT_BRK is not set
CONFIG_SLAB=y
# CONFIG_SLUB is not set
# CONFIG_SLOB is not set
CONFIG_PROFILING=y
CONFIG_TRACEPOINTS=y
# CONFIG_OPROFILE is not set
CONFIG_HAVE_OPROFILE=y
CONFIG_OPROFILE_NMI_TIMER=y
CONFIG_KPROBES=y
CONFIG_JUMP_LABEL=y
CONFIG_OPTPROBES=y
CONFIG_KPROBES_ON_FTRACE=y
CONFIG_UPROBES=y
# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_ARCH_USE_BUILTIN_BSWAP=y
CONFIG_KRETPROBES=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_OPTPROBES=y
CONFIG_HAVE_KPROBES_ON_FTRACE=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_DMA_ATTRS=y
CONFIG_USE_GENERIC_SMP_HELPERS=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_HW_BREAKPOINT=y
CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
CONFIG_HAVE_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_PERF_EVENTS_NMI=y
CONFIG_HAVE_PERF_REGS=y
CONFIG_HAVE_PERF_USER_STACK_DUMP=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y
CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
CONFIG_HAVE_CMPXCHG_LOCAL=y
CONFIG_HAVE_CMPXCHG_DOUBLE=y
CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
CONFIG_SECCOMP_FILTER=y
CONFIG_HAVE_CONTEXT_TRACKING=y
CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
CONFIG_HAVE_ARCH_SOFT_DIRTY=y
CONFIG_MODULES_USE_ELF_RELA=y
CONFIG_OLD_SIGSUSPEND3=y
CONFIG_COMPAT_OLD_SIGACTION=y

#
# GCOV-based kernel profiling
#
# CONFIG_GCOV_KERNEL is not set
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
# CONFIG_MODULE_FORCE_LOAD is not set
CONFIG_MODULE_UNLOAD=y
# CONFIG_MODULE_FORCE_UNLOAD is not set
CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y
CONFIG_MODULE_SIG=y
# CONFIG_MODULE_SIG_FORCE is not set
CONFIG_MODULE_SIG_ALL=y
# CONFIG_MODULE_SIG_SHA1 is not set
# CONFIG_MODULE_SIG_SHA224 is not set
# CONFIG_MODULE_SIG_SHA256 is not set
# CONFIG_MODULE_SIG_SHA384 is not set
CONFIG_MODULE_SIG_SHA512=y
CONFIG_MODULE_SIG_HASH="sha512"
CONFIG_STOP_MACHINE=y
CONFIG_BLOCK=y
CONFIG_BLK_DEV_BSG=y
CONFIG_BLK_DEV_BSGLIB=y
CONFIG_BLK_DEV_INTEGRITY=y
CONFIG_BLK_DEV_THROTTLING=y

#
# Partition Types
#
CONFIG_PARTITION_ADVANCED=y
CONFIG_ACORN_PARTITION=y
# CONFIG_ACORN_PARTITION_CUMANA is not set
# CONFIG_ACORN_PARTITION_EESOX is not set
CONFIG_ACORN_PARTITION_ICS=y
# CONFIG_ACORN_PARTITION_ADFS is not set
# CONFIG_ACORN_PARTITION_POWERTEC is not set
CONFIG_ACORN_PARTITION_RISCIX=y
# CONFIG_AIX_PARTITION is not set
CONFIG_OSF_PARTITION=y
CONFIG_AMIGA_PARTITION=y
CONFIG_ATARI_PARTITION=y
CONFIG_MAC_PARTITION=y
CONFIG_MSDOS_PARTITION=y
CONFIG_BSD_DISKLABEL=y
CONFIG_MINIX_SUBPARTITION=y
CONFIG_SOLARIS_X86_PARTITION=y
CONFIG_UNIXWARE_DISKLABEL=y
CONFIG_LDM_PARTITION=y
# CONFIG_LDM_DEBUG is not set
CONFIG_SGI_PARTITION=y
CONFIG_ULTRIX_PARTITION=y
CONFIG_SUN_PARTITION=y
CONFIG_KARMA_PARTITION=y
CONFIG_EFI_PARTITION=y
CONFIG_SYSV68_PARTITION=y
CONFIG_BLOCK_COMPAT=y

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
CONFIG_CFQ_GROUP_IOSCHED=y
CONFIG_DEFAULT_DEADLINE=y
# CONFIG_DEFAULT_CFQ is not set
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="deadline"
CONFIG_ASN1=y
CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
CONFIG_INLINE_READ_UNLOCK=y
CONFIG_INLINE_READ_UNLOCK_IRQ=y
CONFIG_INLINE_WRITE_UNLOCK=y
CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
CONFIG_MUTEX_SPIN_ON_OWNER=y
CONFIG_FREEZER=y

#
# Processor type and features
#
CONFIG_ZONE_DMA=y
CONFIG_SMP=y
CONFIG_X86_X2APIC=y
CONFIG_X86_MPPARSE=y
CONFIG_X86_EXTENDED_PLATFORM=y
CONFIG_X86_NUMACHIP=y
# CONFIG_X86_VSMP is not set
# CONFIG_X86_UV is not set
# CONFIG_X86_INTEL_LPSS is not set
CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
CONFIG_SCHED_OMIT_FRAME_POINTER=y
CONFIG_HYPERVISOR_GUEST=y
CONFIG_PARAVIRT=y
# CONFIG_PARAVIRT_DEBUG is not set
CONFIG_PARAVIRT_SPINLOCKS=y
CONFIG_XEN=y
CONFIG_XEN_DOM0=y
CONFIG_XEN_PRIVILEGED_GUEST=y
CONFIG_XEN_PVHVM=y
CONFIG_XEN_MAX_DOMAIN_MEMORY=500
CONFIG_XEN_SAVE_RESTORE=y
# CONFIG_XEN_DEBUG_FS is not set
CONFIG_KVM_GUEST=y
# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
CONFIG_PARAVIRT_CLOCK=y
CONFIG_NO_BOOTMEM=y
CONFIG_MEMTEST=y
# CONFIG_MK8 is not set
# CONFIG_MPSC is not set
# CONFIG_MCORE2 is not set
# CONFIG_MATOM is not set
CONFIG_GENERIC_CPU=y
CONFIG_X86_INTERNODE_CACHE_SHIFT=6
CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_TSC=y
CONFIG_X86_CMPXCHG64=y
CONFIG_X86_CMOV=y
CONFIG_X86_MINIMUM_CPU_FAMILY=64
CONFIG_X86_DEBUGCTLMSR=y
CONFIG_PROCESSOR_SELECT=y
CONFIG_CPU_SUP_INTEL=y
CONFIG_CPU_SUP_AMD=y
CONFIG_CPU_SUP_CENTAUR=y
CONFIG_HPET_TIMER=y
CONFIG_HPET_EMULATE_RTC=y
CONFIG_DMI=y
CONFIG_GART_IOMMU=y
CONFIG_CALGARY_IOMMU=y
CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y
CONFIG_SWIOTLB=y
CONFIG_IOMMU_HELPER=y
# CONFIG_MAXSMP is not set
CONFIG_NR_CPUS=256
CONFIG_SCHED_SMT=y
CONFIG_SCHED_MC=y
# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set
CONFIG_X86_LOCAL_APIC=y
CONFIG_X86_IO_APIC=y
CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
CONFIG_X86_MCE=y
CONFIG_X86_MCE_INTEL=y
CONFIG_X86_MCE_AMD=y
CONFIG_X86_MCE_THRESHOLD=y
# CONFIG_X86_MCE_INJECT is not set
CONFIG_X86_THERMAL_VECTOR=y
# CONFIG_I8K is not set
CONFIG_MICROCODE=y
CONFIG_MICROCODE_INTEL=y
CONFIG_MICROCODE_AMD=y
CONFIG_MICROCODE_OLD_INTERFACE=y
CONFIG_MICROCODE_INTEL_LIB=y
CONFIG_MICROCODE_INTEL_EARLY=y
CONFIG_MICROCODE_AMD_EARLY=y
CONFIG_MICROCODE_EARLY=y
# CONFIG_X86_MSR is not set
# CONFIG_X86_CPUID is not set
CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
CONFIG_DIRECT_GBPAGES=y
CONFIG_NUMA=y
CONFIG_AMD_NUMA=y
CONFIG_X86_64_ACPI_NUMA=y
CONFIG_NODES_SPAN_OTHER_NODES=y
# CONFIG_NUMA_EMU is not set
CONFIG_NODES_SHIFT=6
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ARCH_MEMORY_PROBE=y
CONFIG_ARCH_PROC_KCORE_TEXT=y
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_SPARSEMEM_MANUAL=y
CONFIG_SPARSEMEM=y
CONFIG_NEED_MULTIPLE_NODES=y
CONFIG_HAVE_MEMORY_PRESENT=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER=y
CONFIG_SPARSEMEM_VMEMMAP=y
CONFIG_HAVE_MEMBLOCK=y
CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
CONFIG_ARCH_DISCARD_MEMBLOCK=y
CONFIG_MEMORY_ISOLATION=y
# CONFIG_MOVABLE_NODE is not set
CONFIG_HAVE_BOOTMEM_INFO_NODE=y
CONFIG_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTPLUG_SPARSE=y
CONFIG_MEMORY_HOTREMOVE=y
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_COMPACTION=y
CONFIG_MIGRATION=y
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_ZONE_DMA_FLAG=1
CONFIG_BOUNCE=y
CONFIG_NEED_BOUNCE_POOL=y
CONFIG_VIRT_TO_BUS=y
CONFIG_KSM=y
CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
CONFIG_MEMORY_FAILURE=y
# CONFIG_HWPOISON_INJECT is not set
CONFIG_TRANSPARENT_HUGEPAGE=y
# CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS is not set
CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y
CONFIG_CROSS_MEMORY_ATTACH=y
CONFIG_CLEANCACHE=y
CONFIG_FRONTSWAP=y
# CONFIG_ZBUD is not set
# CONFIG_ZSWAP is not set
# CONFIG_MEM_SOFT_DIRTY is not set
CONFIG_X86_CHECK_BIOS_CORRUPTION=y
CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y
CONFIG_X86_RESERVE_LOW=64
CONFIG_MTRR=y
CONFIG_MTRR_SANITIZER=y
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=1
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
CONFIG_X86_PAT=y
CONFIG_ARCH_USES_PG_UNCACHED=y
CONFIG_ARCH_RANDOM=y
CONFIG_X86_SMAP=y
CONFIG_EFI=y
CONFIG_EFI_STUB=y
CONFIG_SECCOMP=y
CONFIG_CC_STACKPROTECTOR=y
# CONFIG_HZ_100 is not set
CONFIG_HZ_250=y
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=250
CONFIG_SCHED_HRTICK=y
CONFIG_KEXEC=y
CONFIG_CRASH_DUMP=y
CONFIG_KEXEC_JUMP=y
CONFIG_PHYSICAL_START=0x1000000
CONFIG_RELOCATABLE=y
CONFIG_PHYSICAL_ALIGN=0x1000000
CONFIG_HOTPLUG_CPU=y
# CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set
# CONFIG_DEBUG_HOTPLUG_CPU0 is not set
# CONFIG_COMPAT_VDSO is not set
# CONFIG_CMDLINE_BOOL is not set
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
CONFIG_USE_PERCPU_NUMA_NODE_ID=y

#
# Power management and ACPI options
#
CONFIG_ARCH_HIBERNATION_HEADER=y
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
CONFIG_HIBERNATE_CALLBACKS=y
CONFIG_HIBERNATION=y
CONFIG_PM_STD_PARTITION=""
CONFIG_PM_SLEEP=y
CONFIG_PM_SLEEP_SMP=y
# CONFIG_PM_AUTOSLEEP is not set
# CONFIG_PM_WAKELOCKS is not set
CONFIG_PM_RUNTIME=y
CONFIG_PM=y
# CONFIG_PM_DEBUG is not set
# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
CONFIG_ACPI=y
CONFIG_ACPI_SLEEP=y
# CONFIG_ACPI_PROCFS is not set
# CONFIG_ACPI_PROCFS_POWER is not set
CONFIG_ACPI_EC_DEBUGFS=m
CONFIG_ACPI_PROC_EVENT=y
CONFIG_ACPI_AC=y
CONFIG_ACPI_BATTERY=y
CONFIG_ACPI_BUTTON=y
CONFIG_ACPI_VIDEO=m
CONFIG_ACPI_FAN=y
CONFIG_ACPI_DOCK=y
CONFIG_ACPI_I2C=y
CONFIG_ACPI_PROCESSOR=y
CONFIG_ACPI_HOTPLUG_CPU=y
# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set
CONFIG_ACPI_THERMAL=y
CONFIG_ACPI_NUMA=y
CONFIG_ACPI_CUSTOM_DSDT_FILE=""
# CONFIG_ACPI_CUSTOM_DSDT is not set
# CONFIG_ACPI_INITRD_TABLE_OVERRIDE is not set
CONFIG_ACPI_BLACKLIST_YEAR=0
# CONFIG_ACPI_DEBUG is not set
# CONFIG_ACPI_PCI_SLOT is not set
CONFIG_X86_PM_TIMER=y
CONFIG_ACPI_CONTAINER=y
# CONFIG_ACPI_HOTPLUG_MEMORY is not set
# CONFIG_ACPI_SBS is not set
CONFIG_ACPI_HED=y
# CONFIG_ACPI_CUSTOM_METHOD is not set
CONFIG_ACPI_BGRT=y
CONFIG_ACPI_APEI=y
CONFIG_ACPI_APEI_GHES=y
CONFIG_ACPI_APEI_PCIEAER=y
CONFIG_ACPI_APEI_MEMORY_FAILURE=y
# CONFIG_ACPI_APEI_EINJ is not set
# CONFIG_ACPI_APEI_ERST_DEBUG is not set
CONFIG_SFI=y

#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
CONFIG_CPU_FREQ_GOV_COMMON=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_STAT_DETAILS=y
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y

#
# x86 CPU frequency scaling drivers
#
CONFIG_X86_INTEL_PSTATE=y
CONFIG_X86_PCC_CPUFREQ=y
CONFIG_X86_ACPI_CPUFREQ=y
CONFIG_X86_ACPI_CPUFREQ_CPB=y
CONFIG_X86_POWERNOW_K8=y
# CONFIG_X86_AMD_FREQ_SENSITIVITY is not set
CONFIG_X86_SPEEDSTEP_CENTRINO=y
# CONFIG_X86_P4_CLOCKMOD is not set

#
# shared options
#
# CONFIG_X86_SPEEDSTEP_LIB is not set
CONFIG_CPU_IDLE=y
# CONFIG_CPU_IDLE_MULTIPLE_DRIVERS is not set
CONFIG_CPU_IDLE_GOV_LADDER=y
CONFIG_CPU_IDLE_GOV_MENU=y
# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
CONFIG_INTEL_IDLE=y

#
# Memory power savings
#
# CONFIG_I7300_IDLE is not set

#
# Bus options (PCI etc.)
#
CONFIG_PCI=y
CONFIG_PCI_DIRECT=y
CONFIG_PCI_MMCONFIG=y
CONFIG_PCI_XEN=y
CONFIG_PCI_DOMAINS=y
# CONFIG_PCI_CNB20LE_QUIRK is not set
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI_PCIE=y
CONFIG_PCIEAER=y
# CONFIG_PCIE_ECRC is not set
# CONFIG_PCIEAER_INJECT is not set
CONFIG_PCIEASPM=y
# CONFIG_PCIEASPM_DEBUG is not set
CONFIG_PCIEASPM_DEFAULT=y
# CONFIG_PCIEASPM_POWERSAVE is not set
# CONFIG_PCIEASPM_PERFORMANCE is not set
CONFIG_PCIE_PME=y
CONFIG_ARCH_SUPPORTS_MSI=y
CONFIG_PCI_MSI=y
# CONFIG_PCI_DEBUG is not set
CONFIG_PCI_REALLOC_ENABLE_AUTO=y
# CONFIG_PCI_STUB is not set
# CONFIG_XEN_PCIDEV_FRONTEND is not set
CONFIG_HT_IRQ=y
CONFIG_PCI_ATS=y
CONFIG_PCI_IOV=y
CONFIG_PCI_PRI=y
CONFIG_PCI_PASID=y
CONFIG_PCI_IOAPIC=y
CONFIG_PCI_LABEL=y

#
# PCI host controller drivers
#
CONFIG_ISA_DMA_API=y
CONFIG_AMD_NB=y
# CONFIG_PCCARD is not set
CONFIG_HOTPLUG_PCI=y
# CONFIG_HOTPLUG_PCI_ACPI is not set
CONFIG_HOTPLUG_PCI_CPCI=y
# CONFIG_HOTPLUG_PCI_CPCI_ZT5550 is not set
# CONFIG_HOTPLUG_PCI_CPCI_GENERIC is not set
# CONFIG_HOTPLUG_PCI_SHPC is not set
CONFIG_RAPIDIO=y
CONFIG_RAPIDIO_TSI721=y
CONFIG_RAPIDIO_DISC_TIMEOUT=30
# CONFIG_RAPIDIO_ENABLE_RX_TX_PORTS is not set
CONFIG_RAPIDIO_DMA_ENGINE=y
# CONFIG_RAPIDIO_DEBUG is not set
# CONFIG_RAPIDIO_ENUM_BASIC is not set

#
# RapidIO Switch drivers
#
CONFIG_RAPIDIO_TSI57X=y
CONFIG_RAPIDIO_CPS_XX=y
CONFIG_RAPIDIO_TSI568=y
CONFIG_RAPIDIO_CPS_GEN2=y

#
# Executable file formats / Emulations
#
CONFIG_BINFMT_ELF=y
CONFIG_COMPAT_BINFMT_ELF=y
CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
CONFIG_BINFMT_SCRIPT=y
# CONFIG_HAVE_AOUT is not set
# CONFIG_BINFMT_MISC is not set
CONFIG_COREDUMP=y
CONFIG_IA32_EMULATION=y
# CONFIG_IA32_AOUT is not set
CONFIG_X86_X32=y
CONFIG_COMPAT=y
CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
CONFIG_SYSVIPC_COMPAT=y
CONFIG_KEYS_COMPAT=y
CONFIG_HAVE_TEXT_POKE_SMP=y
CONFIG_X86_DEV_DMA_OPS=y
CONFIG_NET=y
CONFIG_COMPAT_NETLINK_MESSAGES=y

#
# Networking options
#
CONFIG_PACKET=y
# CONFIG_PACKET_DIAG is not set
CONFIG_UNIX=y
# CONFIG_UNIX_DIAG is not set
# CONFIG_XFRM_USER is not set
# CONFIG_NET_KEY is not set
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_FIB_TRIE_STATS=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_ROUTE_VERBOSE=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
# CONFIG_IP_PNP_BOOTP is not set
# CONFIG_IP_PNP_RARP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE_DEMUX is not set
# CONFIG_NET_IP_TUNNEL is not set
CONFIG_IP_MROUTE=y
# CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
# CONFIG_ARPD is not set
CONFIG_SYN_COOKIES=y
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_XFRM_TUNNEL is not set
# CONFIG_INET_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_BEET is not set
CONFIG_INET_LRO=y
# CONFIG_INET_DIAG is not set
CONFIG_TCP_CONG_ADVANCED=y
# CONFIG_TCP_CONG_BIC is not set
CONFIG_TCP_CONG_CUBIC=y
# CONFIG_TCP_CONG_WESTWOOD is not set
# CONFIG_TCP_CONG_HTCP is not set
# CONFIG_TCP_CONG_HSTCP is not set
# CONFIG_TCP_CONG_HYBLA is not set
# CONFIG_TCP_CONG_VEGAS is not set
# CONFIG_TCP_CONG_SCALABLE is not set
# CONFIG_TCP_CONG_LP is not set
# CONFIG_TCP_CONG_VENO is not set
# CONFIG_TCP_CONG_YEAH is not set
# CONFIG_TCP_CONG_ILLINOIS is not set
CONFIG_DEFAULT_CUBIC=y
# CONFIG_DEFAULT_RENO is not set
CONFIG_DEFAULT_TCP_CONG="cubic"
CONFIG_TCP_MD5SIG=y
CONFIG_IPV6=y
CONFIG_IPV6_PRIVACY=y
CONFIG_IPV6_ROUTER_PREF=y
CONFIG_IPV6_ROUTE_INFO=y
# CONFIG_IPV6_OPTIMISTIC_DAD is not set
# CONFIG_INET6_AH is not set
# CONFIG_INET6_ESP is not set
# CONFIG_INET6_IPCOMP is not set
# CONFIG_IPV6_MIP6 is not set
# CONFIG_INET6_XFRM_TUNNEL is not set
# CONFIG_INET6_TUNNEL is not set
# CONFIG_INET6_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET6_XFRM_MODE_TUNNEL is not set
# CONFIG_INET6_XFRM_MODE_BEET is not set
# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
# CONFIG_IPV6_SIT is not set
# CONFIG_IPV6_TUNNEL is not set
# CONFIG_IPV6_GRE is not set
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_MROUTE=y
CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
CONFIG_IPV6_PIMSM_V2=y
CONFIG_NETLABEL=y
CONFIG_NETWORK_SECMARK=y
# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
CONFIG_NETFILTER=y
# CONFIG_NETFILTER_DEBUG is not set
CONFIG_NETFILTER_ADVANCED=y

#
# Core Netfilter Configuration
#
# CONFIG_NETFILTER_NETLINK_ACCT is not set
# CONFIG_NETFILTER_NETLINK_QUEUE is not set
# CONFIG_NETFILTER_NETLINK_LOG is not set
# CONFIG_NF_CONNTRACK is not set
# CONFIG_NETFILTER_XTABLES is not set
# CONFIG_IP_VS is not set

#
# IP: Netfilter Configuration
#
# CONFIG_NF_DEFRAG_IPV4 is not set
# CONFIG_IP_NF_IPTABLES is not set
# CONFIG_IP_NF_ARPTABLES is not set

#
# IPv6: Netfilter Configuration
#
# CONFIG_NF_DEFRAG_IPV6 is not set
# CONFIG_IP6_NF_IPTABLES is not set
# CONFIG_IP_DCCP is not set
# CONFIG_IP_SCTP is not set
# CONFIG_RDS is not set
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
# CONFIG_L2TP is not set
# CONFIG_BRIDGE is not set
CONFIG_HAVE_NET_DSA=y
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_PHONET is not set
# CONFIG_IEEE802154 is not set
CONFIG_NET_SCHED=y

#
# Queueing/Scheduling
#
# CONFIG_NET_SCH_CBQ is not set
CONFIG_NET_SCH_HTB=m
# CONFIG_NET_SCH_HFSC is not set
# CONFIG_NET_SCH_PRIO is not set
# CONFIG_NET_SCH_MULTIQ is not set
# CONFIG_NET_SCH_RED is not set
# CONFIG_NET_SCH_SFB is not set
# CONFIG_NET_SCH_SFQ is not set
# CONFIG_NET_SCH_TEQL is not set
# CONFIG_NET_SCH_TBF is not set
# CONFIG_NET_SCH_GRED is not set
# CONFIG_NET_SCH_DSMARK is not set
# CONFIG_NET_SCH_NETEM is not set
# CONFIG_NET_SCH_DRR is not set
# CONFIG_NET_SCH_MQPRIO is not set
# CONFIG_NET_SCH_CHOKE is not set
# CONFIG_NET_SCH_QFQ is not set
CONFIG_NET_SCH_CODEL=m
CONFIG_NET_SCH_FQ_CODEL=m
# CONFIG_NET_SCH_INGRESS is not set
# CONFIG_NET_SCH_PLUG is not set

#
# Classification
#
CONFIG_NET_CLS=y
# CONFIG_NET_CLS_BASIC is not set
# CONFIG_NET_CLS_TCINDEX is not set
# CONFIG_NET_CLS_ROUTE4 is not set
# CONFIG_NET_CLS_FW is not set
# CONFIG_NET_CLS_U32 is not set
# CONFIG_NET_CLS_RSVP is not set
# CONFIG_NET_CLS_RSVP6 is not set
# CONFIG_NET_CLS_FLOW is not set
# CONFIG_NET_CLS_CGROUP is not set
CONFIG_NET_EMATCH=y
CONFIG_NET_EMATCH_STACK=32
# CONFIG_NET_EMATCH_CMP is not set
# CONFIG_NET_EMATCH_NBYTE is not set
# CONFIG_NET_EMATCH_U32 is not set
# CONFIG_NET_EMATCH_META is not set
# CONFIG_NET_EMATCH_TEXT is not set
CONFIG_NET_CLS_ACT=y
# CONFIG_NET_ACT_POLICE is not set
# CONFIG_NET_ACT_GACT is not set
# CONFIG_NET_ACT_MIRRED is not set
# CONFIG_NET_ACT_NAT is not set
# CONFIG_NET_ACT_PEDIT is not set
# CONFIG_NET_ACT_SIMP is not set
# CONFIG_NET_ACT_SKBEDIT is not set
# CONFIG_NET_ACT_CSUM is not set
CONFIG_NET_SCH_FIFO=y
CONFIG_DCB=y
CONFIG_DNS_RESOLVER=y
# CONFIG_BATMAN_ADV is not set
# CONFIG_OPENVSWITCH is not set
# CONFIG_VSOCKETS is not set
# CONFIG_NETLINK_MMAP is not set
# CONFIG_NETLINK_DIAG is not set
# CONFIG_NET_MPLS_GSO is not set
CONFIG_RPS=y
CONFIG_RFS_ACCEL=y
CONFIG_XPS=y
# CONFIG_NETPRIO_CGROUP is not set
CONFIG_NET_RX_BUSY_POLL=y
CONFIG_BQL=y
CONFIG_BPF_JIT=y
CONFIG_NET_FLOW_LIMIT=y

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_NET_TCPPROBE is not set
# CONFIG_NET_DROP_MONITOR is not set
CONFIG_HAMRADIO=y

#
# Packet Radio protocols
#
# CONFIG_AX25 is not set
# CONFIG_CAN is not set
# CONFIG_IRDA is not set
CONFIG_BT=m
CONFIG_BT_RFCOMM=m
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=m
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
# CONFIG_BT_HIDP is not set

#
# Bluetooth device drivers
#
CONFIG_BT_HCIBTUSB=m
# CONFIG_BT_HCIBTSDIO is not set
# CONFIG_BT_HCIUART is not set
# CONFIG_BT_HCIBCM203X is not set
# CONFIG_BT_HCIBPA10X is not set
# CONFIG_BT_HCIBFUSB is not set
# CONFIG_BT_HCIVHCI is not set
# CONFIG_BT_MRVL is not set
# CONFIG_BT_ATH3K is not set
# CONFIG_AF_RXRPC is not set
CONFIG_FIB_RULES=y
CONFIG_WIRELESS=y
CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
CONFIG_CFG80211=m
CONFIG_NL80211_TESTMODE=y
# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
# CONFIG_CFG80211_REG_DEBUG is not set
# CONFIG_CFG80211_CERTIFICATION_ONUS is not set
CONFIG_CFG80211_DEFAULT_PS=y
CONFIG_CFG80211_DEBUGFS=y
# CONFIG_CFG80211_INTERNAL_REGDB is not set
CONFIG_CFG80211_WEXT=y
# CONFIG_LIB80211 is not set
CONFIG_MAC80211=m
CONFIG_MAC80211_HAS_RC=y
CONFIG_MAC80211_RC_PID=y
CONFIG_MAC80211_RC_MINSTREL=y
CONFIG_MAC80211_RC_MINSTREL_HT=y
# CONFIG_MAC80211_RC_DEFAULT_PID is not set
CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
CONFIG_MAC80211_MESH=y
CONFIG_MAC80211_LEDS=y
CONFIG_MAC80211_DEBUGFS=y
# CONFIG_MAC80211_MESSAGE_TRACING is not set
# CONFIG_MAC80211_DEBUG_MENU is not set
# CONFIG_WIMAX is not set
CONFIG_RFKILL=y
CONFIG_RFKILL_LEDS=y
CONFIG_RFKILL_INPUT=y
# CONFIG_RFKILL_REGULATOR is not set
# CONFIG_NET_9P is not set
# CONFIG_CAIF is not set
# CONFIG_CEPH_LIB is not set
# CONFIG_NFC is not set
CONFIG_HAVE_BPF_JIT=y

#
# Device Drivers
#

#
# Generic Driver Options
#
CONFIG_UEVENT_HELPER_PATH=""
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_STANDALONE is not set
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
CONFIG_FIRMWARE_IN_KERNEL=y
CONFIG_EXTRA_FIRMWARE=""
CONFIG_FW_LOADER_USER_HELPER=y
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
CONFIG_SYS_HYPERVISOR=y
# CONFIG_GENERIC_CPU_DEVICES is not set
CONFIG_REGMAP=y
CONFIG_REGMAP_I2C=y
CONFIG_REGMAP_SPI=y
CONFIG_REGMAP_IRQ=y
CONFIG_DMA_SHARED_BUFFER=y

#
# Bus devices
#
CONFIG_CONNECTOR=y
CONFIG_PROC_EVENTS=y
# CONFIG_MTD is not set
CONFIG_PARPORT=m
CONFIG_PARPORT_PC=m
# CONFIG_PARPORT_SERIAL is not set
CONFIG_PARPORT_PC_FIFO=y
# CONFIG_PARPORT_PC_SUPERIO is not set
# CONFIG_PARPORT_GSC is not set
# CONFIG_PARPORT_AX88796 is not set
CONFIG_PARPORT_1284=y
CONFIG_PNP=y
# CONFIG_PNP_DEBUG_MESSAGES is not set

#
# Protocols
#
CONFIG_PNPACPI=y
CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_FD is not set
# CONFIG_PARIDE is not set
# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_LOOP_MIN_COUNT=8
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
# CONFIG_BLK_DEV_DRBD is not set
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_NVME is not set
# CONFIG_BLK_DEV_SX8 is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=65536
# CONFIG_BLK_DEV_XIP is not set
# CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set
CONFIG_XEN_BLKDEV_FRONTEND=y
# CONFIG_XEN_BLKDEV_BACKEND is not set
CONFIG_VIRTIO_BLK=y
# CONFIG_BLK_DEV_HD is not set
# CONFIG_BLK_DEV_RBD is not set
# CONFIG_BLK_DEV_RSXX is not set

#
# Misc devices
#
# CONFIG_SENSORS_LIS3LV02D is not set
# CONFIG_AD525X_DPOT is not set
# CONFIG_DUMMY_IRQ is not set
# CONFIG_IBM_ASM is not set
# CONFIG_PHANTOM is not set
# CONFIG_SGI_IOC4 is not set
# CONFIG_TIFM_CORE is not set
# CONFIG_ICS932S401 is not set
# CONFIG_ATMEL_SSC is not set
# CONFIG_ENCLOSURE_SERVICES is not set
# CONFIG_HP_ILO is not set
# CONFIG_APDS9802ALS is not set
# CONFIG_ISL29003 is not set
# CONFIG_ISL29020 is not set
# CONFIG_SENSORS_TSL2550 is not set
# CONFIG_SENSORS_BH1780 is not set
# CONFIG_SENSORS_BH1770 is not set
# CONFIG_SENSORS_APDS990X is not set
# CONFIG_HMC6352 is not set
# CONFIG_DS1682 is not set
# CONFIG_TI_DAC7512 is not set
# CONFIG_VMWARE_BALLOON is not set
# CONFIG_BMP085_I2C is not set
# CONFIG_BMP085_SPI is not set
# CONFIG_PCH_PHUB is not set
# CONFIG_USB_SWITCH_FSA9480 is not set
# CONFIG_LATTICE_ECP3_CONFIG is not set
# CONFIG_SRAM is not set
# CONFIG_C2PORT is not set

#
# EEPROM support
#
# CONFIG_EEPROM_AT24 is not set
# CONFIG_EEPROM_AT25 is not set
# CONFIG_EEPROM_LEGACY is not set
# CONFIG_EEPROM_MAX6875 is not set
# CONFIG_EEPROM_93CX6 is not set
# CONFIG_EEPROM_93XX46 is not set
# CONFIG_CB710_CORE is not set

#
# Texas Instruments shared transport line discipline
#
# CONFIG_TI_ST is not set
# CONFIG_SENSORS_LIS3_I2C is not set

#
# Altera FPGA firmware download module
#
# CONFIG_ALTERA_STAPL is not set
CONFIG_INTEL_MEI=y
CONFIG_INTEL_MEI_ME=y
# CONFIG_VMWARE_VMCI is not set
CONFIG_HAVE_IDE=y
# CONFIG_IDE is not set

#
# SCSI device support
#
CONFIG_SCSI_MOD=y
# CONFIG_RAID_ATTRS is not set
CONFIG_SCSI=y
CONFIG_SCSI_DMA=y
# CONFIG_SCSI_TGT is not set
# CONFIG_SCSI_NETLINK is not set
CONFIG_SCSI_PROC_FS=y

#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=y
# CONFIG_CHR_DEV_ST is not set
# CONFIG_CHR_DEV_OSST is not set
CONFIG_BLK_DEV_SR=y
# CONFIG_BLK_DEV_SR_VENDOR is not set
CONFIG_CHR_DEV_SG=y
# CONFIG_CHR_DEV_SCH is not set
CONFIG_SCSI_MULTI_LUN=y
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_LOGGING=y
CONFIG_SCSI_SCAN_ASYNC=y

#
# SCSI Transports
#
CONFIG_SCSI_SPI_ATTRS=y
# CONFIG_SCSI_FC_ATTRS is not set
# CONFIG_SCSI_ISCSI_ATTRS is not set
# CONFIG_SCSI_SAS_ATTRS is not set
# CONFIG_SCSI_SAS_LIBSAS is not set
# CONFIG_SCSI_SRP_ATTRS is not set
CONFIG_SCSI_LOWLEVEL=y
# CONFIG_ISCSI_TCP is not set
# CONFIG_ISCSI_BOOT_SYSFS is not set
# CONFIG_SCSI_CXGB3_ISCSI is not set
# CONFIG_SCSI_CXGB4_ISCSI is not set
# CONFIG_SCSI_BNX2_ISCSI is not set
# CONFIG_SCSI_BNX2X_FCOE is not set
# CONFIG_BE2ISCSI is not set
# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
# CONFIG_SCSI_HPSA is not set
# CONFIG_SCSI_3W_9XXX is not set
# CONFIG_SCSI_3W_SAS is not set
# CONFIG_SCSI_ACARD is not set
# CONFIG_SCSI_AACRAID is not set
# CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC7XXX_OLD is not set
# CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_AIC94XX is not set
# CONFIG_SCSI_MVSAS is not set
# CONFIG_SCSI_MVUMI is not set
# CONFIG_SCSI_DPT_I2O is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_ARCMSR is not set
CONFIG_MEGARAID_NEWGEN=y
# CONFIG_MEGARAID_MM is not set
# CONFIG_MEGARAID_LEGACY is not set
# CONFIG_MEGARAID_SAS is not set
# CONFIG_SCSI_MPT2SAS is not set
# CONFIG_SCSI_MPT3SAS is not set
# CONFIG_SCSI_UFSHCD is not set
# CONFIG_SCSI_HPTIOP is not set
# CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_VMWARE_PVSCSI is not set
# CONFIG_LIBFC is not set
# CONFIG_LIBFCOE is not set
# CONFIG_FCOE is not set
# CONFIG_FCOE_FNIC is not set
# CONFIG_SCSI_DMX3191D is not set
# CONFIG_SCSI_EATA is not set
# CONFIG_SCSI_FUTURE_DOMAIN is not set
# CONFIG_SCSI_GDTH is not set
# CONFIG_SCSI_ISCI is not set
# CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_INITIO is not set
# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_PPA is not set
# CONFIG_SCSI_IMM is not set
# CONFIG_SCSI_STEX is not set
# CONFIG_SCSI_SYM53C8XX_2 is not set
# CONFIG_SCSI_IPR is not set
# CONFIG_SCSI_QLOGIC_1280 is not set
# CONFIG_SCSI_QLA_FC is not set
# CONFIG_SCSI_QLA_ISCSI is not set
# CONFIG_SCSI_LPFC is not set
# CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_DC390T is not set
# CONFIG_SCSI_DEBUG is not set
# CONFIG_SCSI_PMCRAID is not set
# CONFIG_SCSI_PM8001 is not set
# CONFIG_SCSI_SRP is not set
# CONFIG_SCSI_BFA_FC is not set
# CONFIG_SCSI_VIRTIO is not set
# CONFIG_SCSI_CHELSIO_FCOE is not set
# CONFIG_SCSI_DH is not set
# CONFIG_SCSI_OSD_INITIATOR is not set
CONFIG_ATA=y
# CONFIG_ATA_NONSTANDARD is not set
CONFIG_ATA_VERBOSE_ERROR=y
CONFIG_ATA_ACPI=y
# CONFIG_SATA_ZPODD is not set
CONFIG_SATA_PMP=y

#
# Controllers with non-SFF native interface
#
CONFIG_SATA_AHCI=y
# CONFIG_SATA_AHCI_PLATFORM is not set
# CONFIG_SATA_INIC162X is not set
# CONFIG_SATA_ACARD_AHCI is not set
# CONFIG_SATA_SIL24 is not set
CONFIG_ATA_SFF=y

#
# SFF controllers with custom DMA interface
#
# CONFIG_PDC_ADMA is not set
# CONFIG_SATA_QSTOR is not set
# CONFIG_SATA_SX4 is not set
CONFIG_ATA_BMDMA=y

#
# SATA SFF controllers with BMDMA
#
CONFIG_ATA_PIIX=y
# CONFIG_SATA_HIGHBANK is not set
# CONFIG_SATA_MV is not set
# CONFIG_SATA_NV is not set
# CONFIG_SATA_PROMISE is not set
# CONFIG_SATA_RCAR is not set
# CONFIG_SATA_SIL is not set
# CONFIG_SATA_SIS is not set
# CONFIG_SATA_SVW is not set
# CONFIG_SATA_ULI is not set
# CONFIG_SATA_VIA is not set
# CONFIG_SATA_VITESSE is not set

#
# PATA SFF controllers with BMDMA
#
# CONFIG_PATA_ALI is not set
# CONFIG_PATA_AMD is not set
# CONFIG_PATA_ARASAN_CF is not set
# CONFIG_PATA_ARTOP is not set
# CONFIG_PATA_ATIIXP is not set
# CONFIG_PATA_ATP867X is not set
# CONFIG_PATA_CMD64X is not set
# CONFIG_PATA_CS5520 is not set
# CONFIG_PATA_CS5530 is not set
# CONFIG_PATA_CS5536 is not set
# CONFIG_PATA_CYPRESS is not set
# CONFIG_PATA_EFAR is not set
# CONFIG_PATA_HPT366 is not set
# CONFIG_PATA_HPT37X is not set
# CONFIG_PATA_HPT3X2N is not set
# CONFIG_PATA_HPT3X3 is not set
# CONFIG_PATA_IT8213 is not set
# CONFIG_PATA_IT821X is not set
# CONFIG_PATA_JMICRON is not set
# CONFIG_PATA_MARVELL is not set
# CONFIG_PATA_NETCELL is not set
# CONFIG_PATA_NINJA32 is not set
# CONFIG_PATA_NS87415 is not set
# CONFIG_PATA_OLDPIIX is not set
# CONFIG_PATA_OPTIDMA is not set
# CONFIG_PATA_PDC2027X is not set
# CONFIG_PATA_PDC_OLD is not set
# CONFIG_PATA_RADISYS is not set
# CONFIG_PATA_RDC is not set
# CONFIG_PATA_SC1200 is not set
# CONFIG_PATA_SCH is not set
# CONFIG_PATA_SERVERWORKS is not set
# CONFIG_PATA_SIL680 is not set
CONFIG_PATA_SIS=y
# CONFIG_PATA_TOSHIBA is not set
# CONFIG_PATA_TRIFLEX is not set
# CONFIG_PATA_VIA is not set
# CONFIG_PATA_WINBOND is not set

#
# PIO-only SFF controllers
#
# CONFIG_PATA_CMD640_PCI is not set
# CONFIG_PATA_MPIIX is not set
# CONFIG_PATA_NS87410 is not set
# CONFIG_PATA_OPTI is not set
# CONFIG_PATA_PLATFORM is not set
# CONFIG_PATA_RZ1000 is not set

#
# Generic fallback / legacy drivers
#
CONFIG_PATA_ACPI=y
CONFIG_ATA_GENERIC=y
# CONFIG_PATA_LEGACY is not set
CONFIG_MD=y
CONFIG_BLK_DEV_MD=y
CONFIG_MD_AUTODETECT=y
# CONFIG_MD_LINEAR is not set
# CONFIG_MD_RAID0 is not set
# CONFIG_MD_RAID1 is not set
# CONFIG_MD_RAID10 is not set
# CONFIG_MD_RAID456 is not set
# CONFIG_MD_MULTIPATH is not set
# CONFIG_MD_FAULTY is not set
# CONFIG_BCACHE is not set
CONFIG_BLK_DEV_DM=y
# CONFIG_DM_DEBUG is not set
# CONFIG_DM_CRYPT is not set
# CONFIG_DM_SNAPSHOT is not set
# CONFIG_DM_THIN_PROVISIONING is not set
# CONFIG_DM_CACHE is not set
# CONFIG_DM_MIRROR is not set
# CONFIG_DM_RAID is not set
# CONFIG_DM_ZERO is not set
# CONFIG_DM_MULTIPATH is not set
# CONFIG_DM_DELAY is not set
CONFIG_DM_UEVENT=y
# CONFIG_DM_FLAKEY is not set
# CONFIG_DM_VERITY is not set
# CONFIG_DM_SWITCH is not set
# CONFIG_TARGET_CORE is not set
CONFIG_FUSION=y
# CONFIG_FUSION_SPI is not set
# CONFIG_FUSION_FC is not set
# CONFIG_FUSION_SAS is not set
CONFIG_FUSION_MAX_SGE=128
CONFIG_FUSION_LOGGING=y

#
# IEEE 1394 (FireWire) support
#
# CONFIG_FIREWIRE is not set
# CONFIG_FIREWIRE_NOSY is not set
# CONFIG_I2O is not set
CONFIG_MACINTOSH_DRIVERS=y
CONFIG_MAC_EMUMOUSEBTN=m
CONFIG_NETDEVICES=y
CONFIG_MII=m
CONFIG_NET_CORE=y
# CONFIG_BONDING is not set
# CONFIG_DUMMY is not set
# CONFIG_EQUALIZER is not set
CONFIG_NET_FC=y
# CONFIG_IFB is not set
# CONFIG_NET_TEAM is not set
# CONFIG_MACVLAN is not set
# CONFIG_VXLAN is not set
# CONFIG_NETCONSOLE is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_RIONET is not set
CONFIG_TUN=y
# CONFIG_VETH is not set
CONFIG_VIRTIO_NET=y
# CONFIG_NLMON is not set
# CONFIG_ARCNET is not set

#
# CAIF transport drivers
#
# CONFIG_VHOST_NET is not set

#
# Distributed Switch Architecture drivers
#
# CONFIG_NET_DSA_MV88E6XXX is not set
# CONFIG_NET_DSA_MV88E6060 is not set
# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set
# CONFIG_NET_DSA_MV88E6131 is not set
# CONFIG_NET_DSA_MV88E6123_61_65 is not set
CONFIG_ETHERNET=y
CONFIG_NET_VENDOR_3COM=y
# CONFIG_VORTEX is not set
# CONFIG_TYPHOON is not set
CONFIG_NET_VENDOR_ADAPTEC=y
# CONFIG_ADAPTEC_STARFIRE is not set
CONFIG_NET_VENDOR_ALTEON=y
# CONFIG_ACENIC is not set
CONFIG_NET_VENDOR_AMD=y
# CONFIG_AMD8111_ETH is not set
# CONFIG_PCNET32 is not set
CONFIG_NET_VENDOR_ARC=y
CONFIG_NET_VENDOR_ATHEROS=y
# CONFIG_ATL2 is not set
# CONFIG_ATL1 is not set
# CONFIG_ATL1E is not set
# CONFIG_ATL1C is not set
# CONFIG_ALX is not set
CONFIG_NET_CADENCE=y
# CONFIG_ARM_AT91_ETHER is not set
# CONFIG_MACB is not set
CONFIG_NET_VENDOR_BROADCOM=y
# CONFIG_B44 is not set
# CONFIG_BNX2 is not set
# CONFIG_CNIC is not set
# CONFIG_TIGON3 is not set
# CONFIG_BNX2X is not set
CONFIG_NET_VENDOR_BROCADE=y
# CONFIG_BNA is not set
# CONFIG_NET_CALXEDA_XGMAC is not set
CONFIG_NET_VENDOR_CHELSIO=y
# CONFIG_CHELSIO_T1 is not set
# CONFIG_CHELSIO_T3 is not set
# CONFIG_CHELSIO_T4 is not set
# CONFIG_CHELSIO_T4VF is not set
CONFIG_NET_VENDOR_CISCO=y
# CONFIG_ENIC is not set
# CONFIG_DNET is not set
CONFIG_NET_VENDOR_DEC=y
CONFIG_NET_TULIP=y
# CONFIG_DE2104X is not set
# CONFIG_TULIP is not set
# CONFIG_DE4X5 is not set
# CONFIG_WINBOND_840 is not set
# CONFIG_DM9102 is not set
# CONFIG_ULI526X is not set
CONFIG_NET_VENDOR_DLINK=y
# CONFIG_DL2K is not set
# CONFIG_SUNDANCE is not set
CONFIG_NET_VENDOR_EMULEX=y
# CONFIG_BE2NET is not set
CONFIG_NET_VENDOR_EXAR=y
# CONFIG_S2IO is not set
# CONFIG_VXGE is not set
CONFIG_NET_VENDOR_HP=y
# CONFIG_HP100 is not set
CONFIG_NET_VENDOR_INTEL=y
# CONFIG_E100 is not set
# CONFIG_E1000 is not set
# CONFIG_E1000E is not set
# CONFIG_IGB is not set
# CONFIG_IGBVF is not set
# CONFIG_IXGB is not set
# CONFIG_IXGBE is not set
# CONFIG_IXGBEVF is not set
CONFIG_NET_VENDOR_I825XX=y
# CONFIG_IP1000 is not set
# CONFIG_JME is not set
CONFIG_NET_VENDOR_MARVELL=y
# CONFIG_MVMDIO is not set
# CONFIG_SKGE is not set
# CONFIG_SKY2 is not set
CONFIG_NET_VENDOR_MELLANOX=y
# CONFIG_MLX4_EN is not set
# CONFIG_MLX4_CORE is not set
# CONFIG_MLX5_CORE is not set
CONFIG_NET_VENDOR_MICREL=y
# CONFIG_KS8842 is not set
# CONFIG_KS8851 is not set
# CONFIG_KS8851_MLL is not set
# CONFIG_KSZ884X_PCI is not set
CONFIG_NET_VENDOR_MICROCHIP=y
# CONFIG_ENC28J60 is not set
CONFIG_NET_VENDOR_MYRI=y
# CONFIG_MYRI10GE is not set
# CONFIG_FEALNX is not set
CONFIG_NET_VENDOR_NATSEMI=y
# CONFIG_NATSEMI is not set
# CONFIG_NS83820 is not set
CONFIG_NET_VENDOR_8390=y
# CONFIG_NE2K_PCI is not set
CONFIG_NET_VENDOR_NVIDIA=y
# CONFIG_FORCEDETH is not set
CONFIG_NET_VENDOR_OKI=y
# CONFIG_PCH_GBE is not set
# CONFIG_ETHOC is not set
CONFIG_NET_PACKET_ENGINE=y
# CONFIG_HAMACHI is not set
# CONFIG_YELLOWFIN is not set
CONFIG_NET_VENDOR_QLOGIC=y
# CONFIG_QLA3XXX is not set
# CONFIG_QLCNIC is not set
# CONFIG_QLGE is not set
# CONFIG_NETXEN_NIC is not set
CONFIG_NET_VENDOR_REALTEK=y
# CONFIG_ATP is not set
# CONFIG_8139CP is not set
# CONFIG_8139TOO is not set
CONFIG_R8169=m
# CONFIG_SH_ETH is not set
CONFIG_NET_VENDOR_RDC=y
# CONFIG_R6040 is not set
CONFIG_NET_VENDOR_SEEQ=y
CONFIG_NET_VENDOR_SILAN=y
# CONFIG_SC92031 is not set
CONFIG_NET_VENDOR_SIS=y
# CONFIG_SIS900 is not set
# CONFIG_SIS190 is not set
# CONFIG_SFC is not set
CONFIG_NET_VENDOR_SMSC=y
# CONFIG_EPIC100 is not set
# CONFIG_SMSC911X is not set
# CONFIG_SMSC9420 is not set
CONFIG_NET_VENDOR_STMICRO=y
# CONFIG_STMMAC_ETH is not set
CONFIG_NET_VENDOR_SUN=y
# CONFIG_HAPPYMEAL is not set
# CONFIG_SUNGEM is not set
# CONFIG_CASSINI is not set
# CONFIG_NIU is not set
CONFIG_NET_VENDOR_TEHUTI=y
# CONFIG_TEHUTI is not set
CONFIG_NET_VENDOR_TI=y
# CONFIG_TLAN is not set
CONFIG_NET_VENDOR_VIA=y
# CONFIG_VIA_RHINE is not set
# CONFIG_VIA_VELOCITY is not set
CONFIG_NET_VENDOR_WIZNET=y
# CONFIG_WIZNET_W5100 is not set
# CONFIG_WIZNET_W5300 is not set
CONFIG_FDDI=y
# CONFIG_DEFXX is not set
# CONFIG_SKFP is not set
# CONFIG_HIPPI is not set
# CONFIG_NET_SB1000 is not set
CONFIG_PHYLIB=y

#
# MII PHY device drivers
#
CONFIG_AT803X_PHY=y
CONFIG_AMD_PHY=y
CONFIG_MARVELL_PHY=y
CONFIG_DAVICOM_PHY=y
CONFIG_QSEMI_PHY=y
CONFIG_LXT_PHY=y
CONFIG_CICADA_PHY=y
CONFIG_VITESSE_PHY=y
CONFIG_SMSC_PHY=y
CONFIG_BROADCOM_PHY=y
CONFIG_BCM87XX_PHY=y
CONFIG_ICPLUS_PHY=y
CONFIG_REALTEK_PHY=y
CONFIG_NATIONAL_PHY=y
CONFIG_STE10XP=y
CONFIG_LSI_ET1011C_PHY=y
CONFIG_MICREL_PHY=y
CONFIG_FIXED_PHY=y
CONFIG_MDIO_BITBANG=y
CONFIG_MDIO_GPIO=y
# CONFIG_MICREL_KS8995MA is not set
# CONFIG_PLIP is not set
CONFIG_PPP=y
# CONFIG_PPP_BSDCOMP is not set
# CONFIG_PPP_DEFLATE is not set
CONFIG_PPP_FILTER=y
# CONFIG_PPP_MPPE is not set
CONFIG_PPP_MULTILINK=y
# CONFIG_PPPOE is not set
# CONFIG_PPP_ASYNC is not set
# CONFIG_PPP_SYNC_TTY is not set
# CONFIG_SLIP is not set
CONFIG_SLHC=y

#
# USB Network Adapters
#
# CONFIG_USB_CATC is not set
# CONFIG_USB_KAWETH is not set
# CONFIG_USB_PEGASUS is not set
# CONFIG_USB_RTL8150 is not set
# CONFIG_USB_RTL8152 is not set
# CONFIG_USB_USBNET is not set
# CONFIG_USB_HSO is not set
# CONFIG_USB_IPHETH is not set
CONFIG_WLAN=y
# CONFIG_LIBERTAS_THINFIRM is not set
# CONFIG_AIRO is not set
# CONFIG_ATMEL is not set
# CONFIG_AT76C50X_USB is not set
# CONFIG_PRISM54 is not set
# CONFIG_USB_ZD1201 is not set
# CONFIG_USB_NET_RNDIS_WLAN is not set
# CONFIG_RTL8180 is not set
# CONFIG_RTL8187 is not set
# CONFIG_ADM8211 is not set
# CONFIG_MAC80211_HWSIM is not set
# CONFIG_MWL8K is not set
# CONFIG_ATH_CARDS is not set
# CONFIG_B43 is not set
# CONFIG_B43LEGACY is not set
# CONFIG_BRCMFMAC is not set
# CONFIG_HOSTAP is not set
# CONFIG_IPW2100 is not set
# CONFIG_IPW2200 is not set
CONFIG_IWLWIFI=m
CONFIG_IWLDVM=m
# CONFIG_IWLMVM is not set
CONFIG_IWLWIFI_OPMODE_MODULAR=y

#
# Debugging Options
#
# CONFIG_IWLWIFI_DEBUG is not set
CONFIG_IWLWIFI_DEBUGFS=y
CONFIG_IWLWIFI_DEVICE_TRACING=y
CONFIG_IWLWIFI_P2P=y
# CONFIG_IWL4965 is not set
# CONFIG_IWL3945 is not set
# CONFIG_LIBERTAS is not set
# CONFIG_HERMES is not set
# CONFIG_P54_COMMON is not set
# CONFIG_RT2X00 is not set
CONFIG_RTL_CARDS=m
# CONFIG_RTL8192CE is not set
# CONFIG_RTL8192SE is not set
# CONFIG_RTL8192DE is not set
# CONFIG_RTL8723AE is not set
# CONFIG_RTL8188EE is not set
# CONFIG_RTL8192CU is not set
CONFIG_WL_TI=y
# CONFIG_WL1251 is not set
# CONFIG_WL12XX is not set
# CONFIG_WL18XX is not set
# CONFIG_WLCORE is not set
# CONFIG_ZD1211RW is not set
# CONFIG_MWIFIEX is not set
# CONFIG_CW1200 is not set

#
# Enable WiMAX (Networking options) to see the WiMAX drivers
#
CONFIG_WAN=y
# CONFIG_HDLC is not set
# CONFIG_DLCI is not set
# CONFIG_SBNI is not set
CONFIG_XEN_NETDEV_FRONTEND=y
# CONFIG_XEN_NETDEV_BACKEND is not set
# CONFIG_VMXNET3 is not set
CONFIG_ISDN=y
# CONFIG_ISDN_I4L is not set
# CONFIG_ISDN_CAPI is not set
# CONFIG_ISDN_DRV_GIGASET is not set
# CONFIG_HYSDN is not set
# CONFIG_MISDN is not set

#
# Input device support
#
CONFIG_INPUT=y
# CONFIG_INPUT_FF_MEMLESS is not set
# CONFIG_INPUT_POLLDEV is not set
# CONFIG_INPUT_SPARSEKMAP is not set
# CONFIG_INPUT_MATRIXKMAP is not set

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
CONFIG_INPUT_JOYDEV=m
CONFIG_INPUT_EVDEV=y
# CONFIG_INPUT_EVBUG is not set

#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
# CONFIG_KEYBOARD_ADP5520 is not set
# CONFIG_KEYBOARD_ADP5588 is not set
# CONFIG_KEYBOARD_ADP5589 is not set
CONFIG_KEYBOARD_ATKBD=y
# CONFIG_KEYBOARD_QT1070 is not set
# CONFIG_KEYBOARD_QT2160 is not set
# CONFIG_KEYBOARD_LKKBD is not set
# CONFIG_KEYBOARD_GPIO is not set
# CONFIG_KEYBOARD_GPIO_POLLED is not set
# CONFIG_KEYBOARD_TCA6416 is not set
# CONFIG_KEYBOARD_TCA8418 is not set
# CONFIG_KEYBOARD_MATRIX is not set
# CONFIG_KEYBOARD_LM8323 is not set
# CONFIG_KEYBOARD_LM8333 is not set
# CONFIG_KEYBOARD_MAX7359 is not set
# CONFIG_KEYBOARD_MCS is not set
# CONFIG_KEYBOARD_MPR121 is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_OPENCORES is not set
# CONFIG_KEYBOARD_STOWAWAY is not set
# CONFIG_KEYBOARD_SUNKBD is not set
# CONFIG_KEYBOARD_STMPE is not set
# CONFIG_KEYBOARD_TC3589X is not set
# CONFIG_KEYBOARD_XTKBD is not set
CONFIG_INPUT_MOUSE=y
CONFIG_MOUSE_PS2=m
CONFIG_MOUSE_PS2_ALPS=y
CONFIG_MOUSE_PS2_LOGIPS2PP=y
CONFIG_MOUSE_PS2_SYNAPTICS=y
CONFIG_MOUSE_PS2_CYPRESS=y
CONFIG_MOUSE_PS2_LIFEBOOK=y
CONFIG_MOUSE_PS2_TRACKPOINT=y
CONFIG_MOUSE_PS2_ELANTECH=y
CONFIG_MOUSE_PS2_SENTELIC=y
CONFIG_MOUSE_PS2_TOUCHKIT=y
# CONFIG_MOUSE_SERIAL is not set
# CONFIG_MOUSE_APPLETOUCH is not set
# CONFIG_MOUSE_BCM5974 is not set
# CONFIG_MOUSE_CYAPA is not set
# CONFIG_MOUSE_VSXXXAA is not set
# CONFIG_MOUSE_GPIO is not set
# CONFIG_MOUSE_SYNAPTICS_I2C is not set
# CONFIG_MOUSE_SYNAPTICS_USB is not set
CONFIG_INPUT_JOYSTICK=y
# CONFIG_JOYSTICK_ANALOG is not set
# CONFIG_JOYSTICK_A3D is not set
# CONFIG_JOYSTICK_ADI is not set
# CONFIG_JOYSTICK_COBRA is not set
# CONFIG_JOYSTICK_GF2K is not set
# CONFIG_JOYSTICK_GRIP is not set
# CONFIG_JOYSTICK_GRIP_MP is not set
# CONFIG_JOYSTICK_GUILLEMOT is not set
# CONFIG_JOYSTICK_INTERACT is not set
# CONFIG_JOYSTICK_SIDEWINDER is not set
# CONFIG_JOYSTICK_TMDC is not set
# CONFIG_JOYSTICK_IFORCE is not set
# CONFIG_JOYSTICK_WARRIOR is not set
# CONFIG_JOYSTICK_MAGELLAN is not set
# CONFIG_JOYSTICK_SPACEORB is not set
# CONFIG_JOYSTICK_SPACEBALL is not set
# CONFIG_JOYSTICK_STINGER is not set
# CONFIG_JOYSTICK_TWIDJOY is not set
# CONFIG_JOYSTICK_ZHENHUA is not set
# CONFIG_JOYSTICK_DB9 is not set
# CONFIG_JOYSTICK_GAMECON is not set
# CONFIG_JOYSTICK_TURBOGRAFX is not set
# CONFIG_JOYSTICK_AS5011 is not set
# CONFIG_JOYSTICK_JOYDUMP is not set
# CONFIG_JOYSTICK_XPAD is not set
# CONFIG_JOYSTICK_WALKERA0701 is not set
CONFIG_INPUT_TABLET=y
# CONFIG_TABLET_USB_ACECAD is not set
# CONFIG_TABLET_USB_AIPTEK is not set
# CONFIG_TABLET_USB_GTCO is not set
# CONFIG_TABLET_USB_HANWANG is not set
# CONFIG_TABLET_USB_KBTAB is not set
# CONFIG_TABLET_USB_WACOM is not set
CONFIG_INPUT_TOUCHSCREEN=y
# CONFIG_TOUCHSCREEN_88PM860X is not set
# CONFIG_TOUCHSCREEN_ADS7846 is not set
# CONFIG_TOUCHSCREEN_AD7877 is not set
# CONFIG_TOUCHSCREEN_AD7879 is not set
# CONFIG_TOUCHSCREEN_ATMEL_MXT is not set
# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set
# CONFIG_TOUCHSCREEN_BU21013 is not set
# CONFIG_TOUCHSCREEN_CY8CTMG110 is not set
# CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set
# CONFIG_TOUCHSCREEN_CYTTSP4_CORE is not set
# CONFIG_TOUCHSCREEN_DA9034 is not set
# CONFIG_TOUCHSCREEN_DA9052 is not set
# CONFIG_TOUCHSCREEN_DYNAPRO is not set
# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set
# CONFIG_TOUCHSCREEN_EETI is not set
# CONFIG_TOUCHSCREEN_FUJITSU is not set
# CONFIG_TOUCHSCREEN_ILI210X is not set
# CONFIG_TOUCHSCREEN_GUNZE is not set
# CONFIG_TOUCHSCREEN_ELO is not set
# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
# CONFIG_TOUCHSCREEN_WACOM_I2C is not set
# CONFIG_TOUCHSCREEN_MAX11801 is not set
# CONFIG_TOUCHSCREEN_MCS5000 is not set
# CONFIG_TOUCHSCREEN_MMS114 is not set
# CONFIG_TOUCHSCREEN_MTOUCH is not set
# CONFIG_TOUCHSCREEN_INEXIO is not set
# CONFIG_TOUCHSCREEN_MK712 is not set
# CONFIG_TOUCHSCREEN_PENMOUNT is not set
# CONFIG_TOUCHSCREEN_EDT_FT5X06 is not set
# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
# CONFIG_TOUCHSCREEN_PIXCIR is not set
# CONFIG_TOUCHSCREEN_WM831X is not set
# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
# CONFIG_TOUCHSCREEN_TSC_SERIO is not set
# CONFIG_TOUCHSCREEN_TSC2005 is not set
# CONFIG_TOUCHSCREEN_TSC2007 is not set
# CONFIG_TOUCHSCREEN_PCAP is not set
# CONFIG_TOUCHSCREEN_ST1232 is not set
# CONFIG_TOUCHSCREEN_STMPE is not set
# CONFIG_TOUCHSCREEN_TPS6507X is not set
CONFIG_INPUT_MISC=y
# CONFIG_INPUT_88PM860X_ONKEY is not set
# CONFIG_INPUT_AD714X is not set
# CONFIG_INPUT_BMA150 is not set
# CONFIG_INPUT_PCSPKR is not set
# CONFIG_INPUT_MAX8925_ONKEY is not set
# CONFIG_INPUT_MMA8450 is not set
# CONFIG_INPUT_MPU3050 is not set
# CONFIG_INPUT_APANEL is not set
# CONFIG_INPUT_GP2A is not set
# CONFIG_INPUT_GPIO_TILT_POLLED is not set
# CONFIG_INPUT_ATLAS_BTNS is not set
# CONFIG_INPUT_ATI_REMOTE2 is not set
# CONFIG_INPUT_KEYSPAN_REMOTE is not set
# CONFIG_INPUT_KXTJ9 is not set
# CONFIG_INPUT_POWERMATE is not set
# CONFIG_INPUT_YEALINK is not set
# CONFIG_INPUT_CM109 is not set
# CONFIG_INPUT_TWL6040_VIBRA is not set
CONFIG_INPUT_UINPUT=y
# CONFIG_INPUT_PCF8574 is not set
# CONFIG_INPUT_PWM_BEEPER is not set
# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
# CONFIG_INPUT_DA9052_ONKEY is not set
# CONFIG_INPUT_DA9055_ONKEY is not set
# CONFIG_INPUT_WM831X_ON is not set
# CONFIG_INPUT_PCAP is not set
# CONFIG_INPUT_ADXL34X is not set
# CONFIG_INPUT_IMS_PCU is not set
# CONFIG_INPUT_CMA3000 is not set
# CONFIG_INPUT_XEN_KBDDEV_FRONTEND is not set

#
# Hardware I/O ports
#
CONFIG_SERIO=y
CONFIG_SERIO_I8042=y
# CONFIG_SERIO_SERPORT is not set
# CONFIG_SERIO_CT82C710 is not set
# CONFIG_SERIO_PARKBD is not set
# CONFIG_SERIO_PCIPS2 is not set
CONFIG_SERIO_LIBPS2=y
CONFIG_SERIO_RAW=m
# CONFIG_SERIO_ALTERA_PS2 is not set
# CONFIG_SERIO_PS2MULT is not set
# CONFIG_SERIO_ARC_PS2 is not set
# CONFIG_GAMEPORT is not set

#
# Character devices
#
CONFIG_TTY=y
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_VT_CONSOLE_SLEEP=y
CONFIG_HW_CONSOLE=y
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_UNIX98_PTYS=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=0
CONFIG_SERIAL_NONSTANDARD=y
# CONFIG_ROCKETPORT is not set
# CONFIG_CYCLADES is not set
# CONFIG_MOXA_INTELLIO is not set
# CONFIG_MOXA_SMARTIO is not set
# CONFIG_SYNCLINK is not set
# CONFIG_SYNCLINKMP is not set
# CONFIG_SYNCLINK_GT is not set
# CONFIG_NOZOMI is not set
# CONFIG_ISI is not set
# CONFIG_N_HDLC is not set
# CONFIG_N_GSM is not set
# CONFIG_TRACE_SINK is not set
# CONFIG_DEVKMEM is not set

#
# Serial drivers
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
CONFIG_SERIAL_8250_PNP=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_SERIAL_8250_DMA=y
CONFIG_SERIAL_8250_PCI=y
CONFIG_SERIAL_8250_NR_UARTS=48
CONFIG_SERIAL_8250_RUNTIME_UARTS=32
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_MANY_PORTS=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
# CONFIG_SERIAL_8250_DETECT_IRQ is not set
CONFIG_SERIAL_8250_RSA=y
# CONFIG_SERIAL_8250_DW is not set

#
# Non-8250 serial port support
#
CONFIG_SERIAL_KGDB_NMI=y
# CONFIG_SERIAL_MAX3100 is not set
CONFIG_SERIAL_MAX310X=y
# CONFIG_SERIAL_MFD_HSU is not set
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_CONSOLE_POLL=y
# CONFIG_SERIAL_JSM is not set
CONFIG_SERIAL_SCCNXP=y
CONFIG_SERIAL_SCCNXP_CONSOLE=y
# CONFIG_SERIAL_TIMBERDALE is not set
# CONFIG_SERIAL_ALTERA_JTAGUART is not set
# CONFIG_SERIAL_ALTERA_UART is not set
# CONFIG_SERIAL_IFX6X60 is not set
# CONFIG_SERIAL_PCH_UART is not set
# CONFIG_SERIAL_ARC is not set
# CONFIG_SERIAL_RP2 is not set
# CONFIG_SERIAL_FSL_LPUART is not set
CONFIG_TTY_PRINTK=y
CONFIG_PRINTER=m
# CONFIG_LP_CONSOLE is not set
CONFIG_PPDEV=m
CONFIG_HVC_DRIVER=y
CONFIG_HVC_IRQ=y
CONFIG_HVC_XEN=y
CONFIG_HVC_XEN_FRONTEND=y
# CONFIG_VIRTIO_CONSOLE is not set
# CONFIG_IPMI_HANDLER is not set
CONFIG_HW_RANDOM=y
# CONFIG_HW_RANDOM_TIMERIOMEM is not set
# CONFIG_HW_RANDOM_INTEL is not set
# CONFIG_HW_RANDOM_AMD is not set
# CONFIG_HW_RANDOM_VIA is not set
# CONFIG_HW_RANDOM_VIRTIO is not set
# CONFIG_HW_RANDOM_TPM is not set
# CONFIG_NVRAM is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
# CONFIG_MWAVE is not set
# CONFIG_RAW_DRIVER is not set
CONFIG_HPET=y
CONFIG_HPET_MMAP=y
# CONFIG_HANGCHECK_TIMER is not set
CONFIG_TCG_TPM=y
# CONFIG_TCG_TIS is not set
# CONFIG_TCG_TIS_I2C_INFINEON is not set
# CONFIG_TCG_NSC is not set
# CONFIG_TCG_ATMEL is not set
# CONFIG_TCG_INFINEON is not set
# CONFIG_TCG_ST33_I2C is not set
# CONFIG_TELCLOCK is not set
CONFIG_DEVPORT=y
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
# CONFIG_I2C_CHARDEV is not set
# CONFIG_I2C_MUX is not set
CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_ALGOBIT=m

#
# I2C Hardware Bus support
#

#
# PC SMBus host controller drivers
#
# CONFIG_I2C_ALI1535 is not set
# CONFIG_I2C_ALI1563 is not set
# CONFIG_I2C_ALI15X3 is not set
# CONFIG_I2C_AMD756 is not set
# CONFIG_I2C_AMD8111 is not set
# CONFIG_I2C_I801 is not set
# CONFIG_I2C_ISCH is not set
# CONFIG_I2C_ISMT is not set
# CONFIG_I2C_PIIX4 is not set
# CONFIG_I2C_NFORCE2 is not set
# CONFIG_I2C_SIS5595 is not set
# CONFIG_I2C_SIS630 is not set
# CONFIG_I2C_SIS96X is not set
# CONFIG_I2C_VIA is not set
# CONFIG_I2C_VIAPRO is not set

#
# ACPI drivers
#
# CONFIG_I2C_SCMI is not set

#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
# CONFIG_I2C_CBUS_GPIO is not set
# CONFIG_I2C_DESIGNWARE_PCI is not set
# CONFIG_I2C_EG20T is not set
# CONFIG_I2C_GPIO is not set
# CONFIG_I2C_OCORES is not set
# CONFIG_I2C_PCA_PLATFORM is not set
# CONFIG_I2C_PXA_PCI is not set
# CONFIG_I2C_SIMTEC is not set
# CONFIG_I2C_XILINX is not set

#
# External I2C/SMBus adapter drivers
#
# CONFIG_I2C_DIOLAN_U2C is not set
# CONFIG_I2C_PARPORT is not set
# CONFIG_I2C_PARPORT_LIGHT is not set
# CONFIG_I2C_TAOS_EVM is not set
# CONFIG_I2C_TINY_USB is not set

#
# Other I2C/SMBus bus drivers
#
# CONFIG_I2C_STUB is not set
# CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
CONFIG_SPI=y
# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y

#
# SPI Master Controller Drivers
#
# CONFIG_SPI_ALTERA is not set
# CONFIG_SPI_BITBANG is not set
# CONFIG_SPI_BUTTERFLY is not set
# CONFIG_SPI_GPIO is not set
# CONFIG_SPI_LM70_LLP is not set
# CONFIG_SPI_OC_TINY is not set
# CONFIG_SPI_PXA2XX is not set
# CONFIG_SPI_PXA2XX_PCI is not set
# CONFIG_SPI_SC18IS602 is not set
# CONFIG_SPI_TOPCLIFF_PCH is not set
# CONFIG_SPI_XCOMM is not set
# CONFIG_SPI_XILINX is not set
# CONFIG_SPI_DESIGNWARE is not set

#
# SPI Protocol Masters
#
# CONFIG_SPI_SPIDEV is not set
# CONFIG_SPI_TLE62X0 is not set
# CONFIG_HSI is not set

#
# PPS support
#
# CONFIG_PPS is not set

#
# PPS generators support
#

#
# PTP clock support
#
# CONFIG_PTP_1588_CLOCK is not set

#
# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
#
# CONFIG_PTP_1588_CLOCK_PCH is not set
CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
CONFIG_GPIO_DEVRES=y
CONFIG_GPIOLIB=y
CONFIG_GPIO_ACPI=y
# CONFIG_DEBUG_GPIO is not set
# CONFIG_GPIO_SYSFS is not set
# CONFIG_GPIO_DA9052 is not set
# CONFIG_GPIO_DA9055 is not set

#
# Memory mapped GPIO drivers:
#
# CONFIG_GPIO_GENERIC_PLATFORM is not set
# CONFIG_GPIO_IT8761E is not set
# CONFIG_GPIO_TS5500 is not set
# CONFIG_GPIO_SCH is not set
# CONFIG_GPIO_ICH is not set
# CONFIG_GPIO_VX855 is not set
# CONFIG_GPIO_LYNXPOINT is not set

#
# I2C GPIO expanders:
#
# CONFIG_GPIO_MAX7300 is not set
# CONFIG_GPIO_MAX732X is not set
# CONFIG_GPIO_PCA953X is not set
# CONFIG_GPIO_PCF857X is not set
CONFIG_GPIO_RC5T583=y
CONFIG_GPIO_SX150X=y
CONFIG_GPIO_STMPE=y
CONFIG_GPIO_TC3589X=y
# CONFIG_GPIO_TPS65912 is not set
# CONFIG_GPIO_TWL6040 is not set
# CONFIG_GPIO_WM831X is not set
# CONFIG_GPIO_WM8350 is not set
# CONFIG_GPIO_WM8994 is not set
# CONFIG_GPIO_ADP5520 is not set
# CONFIG_GPIO_ADP5588 is not set

#
# PCI GPIO expanders:
#
# CONFIG_GPIO_BT8XX is not set
# CONFIG_GPIO_AMD8111 is not set
CONFIG_GPIO_LANGWELL=y
# CONFIG_GPIO_PCH is not set
# CONFIG_GPIO_ML_IOH is not set
# CONFIG_GPIO_RDC321X is not set

#
# SPI GPIO expanders:
#
# CONFIG_GPIO_MAX7301 is not set
# CONFIG_GPIO_MCP23S08 is not set
# CONFIG_GPIO_MC33880 is not set
# CONFIG_GPIO_74X164 is not set

#
# AC97 GPIO expanders:
#

#
# MODULbus GPIO expanders:
#
# CONFIG_GPIO_PALMAS is not set
CONFIG_GPIO_TPS6586X=y
CONFIG_GPIO_TPS65910=y

#
# USB GPIO expanders:
#
# CONFIG_W1 is not set
CONFIG_POWER_SUPPLY=y
# CONFIG_POWER_SUPPLY_DEBUG is not set
# CONFIG_PDA_POWER is not set
# CONFIG_MAX8925_POWER is not set
# CONFIG_WM831X_BACKUP is not set
# CONFIG_WM831X_POWER is not set
# CONFIG_WM8350_POWER is not set
# CONFIG_TEST_POWER is not set
# CONFIG_BATTERY_88PM860X is not set
# CONFIG_BATTERY_DS2780 is not set
# CONFIG_BATTERY_DS2781 is not set
# CONFIG_BATTERY_DS2782 is not set
# CONFIG_BATTERY_SBS is not set
# CONFIG_BATTERY_BQ27x00 is not set
# CONFIG_BATTERY_DA9030 is not set
# CONFIG_BATTERY_DA9052 is not set
# CONFIG_BATTERY_MAX17040 is not set
# CONFIG_BATTERY_MAX17042 is not set
# CONFIG_CHARGER_MAX8903 is not set
# CONFIG_CHARGER_LP8727 is not set
# CONFIG_CHARGER_GPIO is not set
CONFIG_CHARGER_MANAGER=y
# CONFIG_CHARGER_BQ2415X is not set
# CONFIG_CHARGER_SMB347 is not set
# CONFIG_CHARGER_TPS65090 is not set
# CONFIG_BATTERY_GOLDFISH is not set
# CONFIG_POWER_RESET is not set
CONFIG_POWER_AVS=y
CONFIG_HWMON=y
# CONFIG_HWMON_VID is not set
# CONFIG_HWMON_DEBUG_CHIP is not set

#
# Native drivers
#
# CONFIG_SENSORS_ABITUGURU is not set
# CONFIG_SENSORS_ABITUGURU3 is not set
# CONFIG_SENSORS_AD7314 is not set
# CONFIG_SENSORS_AD7414 is not set
# CONFIG_SENSORS_AD7418 is not set
# CONFIG_SENSORS_ADCXX is not set
# CONFIG_SENSORS_ADM1021 is not set
# CONFIG_SENSORS_ADM1025 is not set
# CONFIG_SENSORS_ADM1026 is not set
# CONFIG_SENSORS_ADM1029 is not set
# CONFIG_SENSORS_ADM1031 is not set
# CONFIG_SENSORS_ADM9240 is not set
# CONFIG_SENSORS_ADT7310 is not set
# CONFIG_SENSORS_ADT7410 is not set
# CONFIG_SENSORS_ADT7411 is not set
# CONFIG_SENSORS_ADT7462 is not set
# CONFIG_SENSORS_ADT7470 is not set
# CONFIG_SENSORS_ADT7475 is not set
# CONFIG_SENSORS_ASC7621 is not set
# CONFIG_SENSORS_K8TEMP is not set
# CONFIG_SENSORS_K10TEMP is not set
# CONFIG_SENSORS_FAM15H_POWER is not set
# CONFIG_SENSORS_ASB100 is not set
# CONFIG_SENSORS_ATXP1 is not set
# CONFIG_SENSORS_DS620 is not set
# CONFIG_SENSORS_DS1621 is not set
# CONFIG_SENSORS_DA9052_ADC is not set
# CONFIG_SENSORS_DA9055 is not set
# CONFIG_SENSORS_I5K_AMB is not set
# CONFIG_SENSORS_F71805F is not set
# CONFIG_SENSORS_F71882FG is not set
# CONFIG_SENSORS_F75375S is not set
# CONFIG_SENSORS_FSCHMD is not set
# CONFIG_SENSORS_G760A is not set
# CONFIG_SENSORS_G762 is not set
# CONFIG_SENSORS_GL518SM is not set
# CONFIG_SENSORS_GL520SM is not set
# CONFIG_SENSORS_GPIO_FAN is not set
# CONFIG_SENSORS_HIH6130 is not set
CONFIG_SENSORS_CORETEMP=m
# CONFIG_SENSORS_IT87 is not set
# CONFIG_SENSORS_JC42 is not set
# CONFIG_SENSORS_LINEAGE is not set
# CONFIG_SENSORS_LM63 is not set
# CONFIG_SENSORS_LM70 is not set
# CONFIG_SENSORS_LM73 is not set
# CONFIG_SENSORS_LM75 is not set
# CONFIG_SENSORS_LM77 is not set
# CONFIG_SENSORS_LM78 is not set
# CONFIG_SENSORS_LM80 is not set
# CONFIG_SENSORS_LM83 is not set
# CONFIG_SENSORS_LM85 is not set
# CONFIG_SENSORS_LM87 is not set
# CONFIG_SENSORS_LM90 is not set
# CONFIG_SENSORS_LM92 is not set
# CONFIG_SENSORS_LM93 is not set
# CONFIG_SENSORS_LTC4151 is not set
# CONFIG_SENSORS_LTC4215 is not set
# CONFIG_SENSORS_LTC4245 is not set
# CONFIG_SENSORS_LTC4261 is not set
# CONFIG_SENSORS_LM95234 is not set
# CONFIG_SENSORS_LM95241 is not set
# CONFIG_SENSORS_LM95245 is not set
# CONFIG_SENSORS_MAX1111 is not set
# CONFIG_SENSORS_MAX16065 is not set
# CONFIG_SENSORS_MAX1619 is not set
# CONFIG_SENSORS_MAX1668 is not set
# CONFIG_SENSORS_MAX197 is not set
# CONFIG_SENSORS_MAX6639 is not set
# CONFIG_SENSORS_MAX6642 is not set
# CONFIG_SENSORS_MAX6650 is not set
# CONFIG_SENSORS_MAX6697 is not set
# CONFIG_SENSORS_MCP3021 is not set
# CONFIG_SENSORS_NCT6775 is not set
# CONFIG_SENSORS_NTC_THERMISTOR is not set
# CONFIG_SENSORS_PC87360 is not set
# CONFIG_SENSORS_PC87427 is not set
# CONFIG_SENSORS_PCF8591 is not set
# CONFIG_PMBUS is not set
# CONFIG_SENSORS_SHT15 is not set
# CONFIG_SENSORS_SHT21 is not set
# CONFIG_SENSORS_SIS5595 is not set
# CONFIG_SENSORS_SMM665 is not set
# CONFIG_SENSORS_DME1737 is not set
# CONFIG_SENSORS_EMC1403 is not set
# CONFIG_SENSORS_EMC2103 is not set
# CONFIG_SENSORS_EMC6W201 is not set
# CONFIG_SENSORS_SMSC47M1 is not set
# CONFIG_SENSORS_SMSC47M192 is not set
# CONFIG_SENSORS_SMSC47B397 is not set
# CONFIG_SENSORS_SCH56XX_COMMON is not set
# CONFIG_SENSORS_SCH5627 is not set
# CONFIG_SENSORS_SCH5636 is not set
# CONFIG_SENSORS_ADS1015 is not set
# CONFIG_SENSORS_ADS7828 is not set
# CONFIG_SENSORS_ADS7871 is not set
# CONFIG_SENSORS_AMC6821 is not set
# CONFIG_SENSORS_INA209 is not set
# CONFIG_SENSORS_INA2XX is not set
# CONFIG_SENSORS_THMC50 is not set
# CONFIG_SENSORS_TMP102 is not set
# CONFIG_SENSORS_TMP401 is not set
# CONFIG_SENSORS_TMP421 is not set
# CONFIG_SENSORS_VIA_CPUTEMP is not set
# CONFIG_SENSORS_VIA686A is not set
# CONFIG_SENSORS_VT1211 is not set
# CONFIG_SENSORS_VT8231 is not set
# CONFIG_SENSORS_W83781D is not set
# CONFIG_SENSORS_W83791D is not set
# CONFIG_SENSORS_W83792D is not set
# CONFIG_SENSORS_W83793 is not set
# CONFIG_SENSORS_W83795 is not set
# CONFIG_SENSORS_W83L785TS is not set
# CONFIG_SENSORS_W83L786NG is not set
# CONFIG_SENSORS_W83627HF is not set
# CONFIG_SENSORS_W83627EHF is not set
# CONFIG_SENSORS_WM831X is not set
# CONFIG_SENSORS_WM8350 is not set
# CONFIG_SENSORS_APPLESMC is not set

#
# ACPI drivers
#
# CONFIG_SENSORS_ACPI_POWER is not set
# CONFIG_SENSORS_ATK0110 is not set
CONFIG_THERMAL=y
CONFIG_THERMAL_HWMON=y
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set
# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set
# CONFIG_THERMAL_GOV_FAIR_SHARE is not set
CONFIG_THERMAL_GOV_STEP_WISE=y
CONFIG_THERMAL_GOV_USER_SPACE=y
CONFIG_CPU_THERMAL=y
# CONFIG_THERMAL_EMULATION is not set
# CONFIG_INTEL_POWERCLAMP is not set
CONFIG_X86_PKG_TEMP_THERMAL=m

#
# Texas Instruments thermal drivers
#
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_CORE=y
# CONFIG_WATCHDOG_NOWAYOUT is not set

#
# Watchdog Device Drivers
#
# CONFIG_SOFT_WATCHDOG is not set
# CONFIG_DA9052_WATCHDOG is not set
# CONFIG_DA9055_WATCHDOG is not set
# CONFIG_WM831X_WATCHDOG is not set
# CONFIG_WM8350_WATCHDOG is not set
# CONFIG_ACQUIRE_WDT is not set
# CONFIG_ADVANTECH_WDT is not set
# CONFIG_ALIM1535_WDT is not set
# CONFIG_ALIM7101_WDT is not set
# CONFIG_F71808E_WDT is not set
# CONFIG_SP5100_TCO is not set
# CONFIG_SC520_WDT is not set
# CONFIG_SBC_FITPC2_WATCHDOG is not set
# CONFIG_EUROTECH_WDT is not set
# CONFIG_IB700_WDT is not set
# CONFIG_IBMASR is not set
# CONFIG_WAFER_WDT is not set
# CONFIG_I6300ESB_WDT is not set
# CONFIG_IE6XX_WDT is not set
# CONFIG_ITCO_WDT is not set
# CONFIG_IT8712F_WDT is not set
# CONFIG_IT87_WDT is not set
# CONFIG_HP_WATCHDOG is not set
# CONFIG_SC1200_WDT is not set
# CONFIG_PC87413_WDT is not set
# CONFIG_NV_TCO is not set
# CONFIG_60XX_WDT is not set
# CONFIG_SBC8360_WDT is not set
# CONFIG_CPU5_WDT is not set
# CONFIG_SMSC_SCH311X_WDT is not set
# CONFIG_SMSC37B787_WDT is not set
# CONFIG_VIA_WDT is not set
# CONFIG_W83627HF_WDT is not set
# CONFIG_W83697HF_WDT is not set
# CONFIG_W83697UG_WDT is not set
# CONFIG_W83877F_WDT is not set
# CONFIG_W83977F_WDT is not set
# CONFIG_MACHZ_WDT is not set
# CONFIG_SBC_EPX_C3_WATCHDOG is not set
# CONFIG_MEN_A21_WDT is not set
# CONFIG_XEN_WDT is not set

#
# PCI-based Watchdog Cards
#
# CONFIG_PCIPCWATCHDOG is not set
# CONFIG_WDTPCI is not set

#
# USB-based Watchdog Cards
#
# CONFIG_USBPCWATCHDOG is not set
CONFIG_SSB_POSSIBLE=y

#
# Sonics Silicon Backplane
#
# CONFIG_SSB is not set
CONFIG_BCMA_POSSIBLE=y

#
# Broadcom specific AMBA
#
# CONFIG_BCMA is not set

#
# Multifunction device drivers
#
CONFIG_MFD_CORE=y
# CONFIG_MFD_CS5535 is not set
# CONFIG_MFD_AS3711 is not set
CONFIG_PMIC_ADP5520=y
CONFIG_MFD_AAT2870_CORE=y
# CONFIG_MFD_CROS_EC is not set
CONFIG_PMIC_DA903X=y
CONFIG_PMIC_DA9052=y
CONFIG_MFD_DA9052_SPI=y
CONFIG_MFD_DA9052_I2C=y
CONFIG_MFD_DA9055=y
# CONFIG_MFD_MC13XXX_SPI is not set
# CONFIG_MFD_MC13XXX_I2C is not set
# CONFIG_HTC_PASIC3 is not set
CONFIG_HTC_I2CPLD=y
CONFIG_LPC_ICH=m
# CONFIG_LPC_SCH is not set
# CONFIG_MFD_JANZ_CMODIO is not set
# CONFIG_MFD_KEMPLD is not set
# CONFIG_MFD_88PM800 is not set
# CONFIG_MFD_88PM805 is not set
CONFIG_MFD_88PM860X=y
CONFIG_MFD_MAX77686=y
CONFIG_MFD_MAX77693=y
# CONFIG_MFD_MAX8907 is not set
CONFIG_MFD_MAX8925=y
CONFIG_MFD_MAX8997=y
CONFIG_MFD_MAX8998=y
CONFIG_EZX_PCAP=y
# CONFIG_MFD_VIPERBOARD is not set
# CONFIG_MFD_RETU is not set
# CONFIG_MFD_PCF50633 is not set
# CONFIG_MFD_RDC321X is not set
# CONFIG_MFD_RTSX_PCI is not set
CONFIG_MFD_RC5T583=y
CONFIG_MFD_SEC_CORE=y
# CONFIG_MFD_SI476X_CORE is not set
# CONFIG_MFD_SM501 is not set
CONFIG_MFD_SMSC=y
CONFIG_ABX500_CORE=y
CONFIG_AB3100_CORE=y
# CONFIG_AB3100_OTP is not set
CONFIG_MFD_STMPE=y

#
# STMicroelectronics STMPE Interface Drivers
#
CONFIG_STMPE_I2C=y
CONFIG_STMPE_SPI=y
# CONFIG_MFD_SYSCON is not set
# CONFIG_MFD_TI_AM335X_TSCADC is not set
CONFIG_MFD_LP8788=y
CONFIG_MFD_PALMAS=y
# CONFIG_TPS6105X is not set
# CONFIG_TPS65010 is not set
# CONFIG_TPS6507X is not set
CONFIG_MFD_TPS65090=y
# CONFIG_MFD_TPS65217 is not set
CONFIG_MFD_TPS6586X=y
CONFIG_MFD_TPS65910=y
CONFIG_MFD_TPS65912=y
CONFIG_MFD_TPS65912_I2C=y
CONFIG_MFD_TPS65912_SPI=y
# CONFIG_MFD_TPS80031 is not set
# CONFIG_TWL4030_CORE is not set
CONFIG_TWL6040_CORE=y
# CONFIG_MFD_WL1273_CORE is not set
# CONFIG_MFD_LM3533 is not set
# CONFIG_MFD_TIMBERDALE is not set
CONFIG_MFD_TC3589X=y
# CONFIG_MFD_TMIO is not set
# CONFIG_MFD_VX855 is not set
# CONFIG_MFD_ARIZONA_I2C is not set
# CONFIG_MFD_ARIZONA_SPI is not set
CONFIG_MFD_WM8400=y
CONFIG_MFD_WM831X=y
CONFIG_MFD_WM831X_I2C=y
CONFIG_MFD_WM831X_SPI=y
CONFIG_MFD_WM8350=y
CONFIG_MFD_WM8350_I2C=y
CONFIG_MFD_WM8994=y
CONFIG_REGULATOR=y
# CONFIG_REGULATOR_DEBUG is not set
# CONFIG_REGULATOR_DUMMY is not set
# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
# CONFIG_REGULATOR_GPIO is not set
# CONFIG_REGULATOR_AD5398 is not set
# CONFIG_REGULATOR_AAT2870 is not set
# CONFIG_REGULATOR_DA903X is not set
# CONFIG_REGULATOR_DA9052 is not set
# CONFIG_REGULATOR_DA9055 is not set
# CONFIG_REGULATOR_FAN53555 is not set
# CONFIG_REGULATOR_ISL6271A is not set
CONFIG_REGULATOR_88PM8607=y
# CONFIG_REGULATOR_MAX1586 is not set
# CONFIG_REGULATOR_MAX8649 is not set
# CONFIG_REGULATOR_MAX8660 is not set
# CONFIG_REGULATOR_MAX8925 is not set
# CONFIG_REGULATOR_MAX8952 is not set
# CONFIG_REGULATOR_MAX8973 is not set
# CONFIG_REGULATOR_MAX8997 is not set
# CONFIG_REGULATOR_MAX8998 is not set
# CONFIG_REGULATOR_MAX77686 is not set
# CONFIG_REGULATOR_MAX77693 is not set
# CONFIG_REGULATOR_PCAP is not set
# CONFIG_REGULATOR_LP3971 is not set
# CONFIG_REGULATOR_LP3972 is not set
CONFIG_REGULATOR_LP872X=y
# CONFIG_REGULATOR_LP8755 is not set
CONFIG_REGULATOR_LP8788=y
# CONFIG_REGULATOR_RC5T583 is not set
# CONFIG_REGULATOR_S2MPS11 is not set
# CONFIG_REGULATOR_S5M8767 is not set
# CONFIG_REGULATOR_AB3100 is not set
# CONFIG_REGULATOR_PALMAS is not set
# CONFIG_REGULATOR_TPS51632 is not set
# CONFIG_REGULATOR_TPS62360 is not set
# CONFIG_REGULATOR_TPS65023 is not set
# CONFIG_REGULATOR_TPS6507X is not set
# CONFIG_REGULATOR_TPS65090 is not set
# CONFIG_REGULATOR_TPS6524X is not set
# CONFIG_REGULATOR_TPS6586X is not set
# CONFIG_REGULATOR_TPS65910 is not set
# CONFIG_REGULATOR_TPS65912 is not set
# CONFIG_REGULATOR_WM831X is not set
# CONFIG_REGULATOR_WM8350 is not set
# CONFIG_REGULATOR_WM8400 is not set
# CONFIG_REGULATOR_WM8994 is not set
CONFIG_MEDIA_SUPPORT=m

#
# Multimedia core support
#
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_MEDIA_ANALOG_TV_SUPPORT=y
CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
CONFIG_MEDIA_RADIO_SUPPORT=y
CONFIG_MEDIA_RC_SUPPORT=y
# CONFIG_MEDIA_CONTROLLER is not set
CONFIG_VIDEO_DEV=m
CONFIG_VIDEO_V4L2=m
# CONFIG_VIDEO_ADV_DEBUG is not set
# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
CONFIG_VIDEOBUF2_CORE=m
CONFIG_VIDEOBUF2_MEMOPS=m
CONFIG_VIDEOBUF2_VMALLOC=m
# CONFIG_VIDEO_V4L2_INT_DEVICE is not set
CONFIG_DVB_CORE=m
CONFIG_DVB_NET=y
# CONFIG_TTPCI_EEPROM is not set
CONFIG_DVB_MAX_ADAPTERS=8
CONFIG_DVB_DYNAMIC_MINORS=y

#
# Media drivers
#
CONFIG_RC_CORE=m
# CONFIG_RC_MAP is not set
CONFIG_RC_DECODERS=y
# CONFIG_LIRC is not set
# CONFIG_IR_NEC_DECODER is not set
# CONFIG_IR_RC5_DECODER is not set
# CONFIG_IR_RC6_DECODER is not set
# CONFIG_IR_JVC_DECODER is not set
# CONFIG_IR_SONY_DECODER is not set
# CONFIG_IR_RC5_SZ_DECODER is not set
# CONFIG_IR_SANYO_DECODER is not set
# CONFIG_IR_MCE_KBD_DECODER is not set
CONFIG_RC_DEVICES=y
# CONFIG_RC_ATI_REMOTE is not set
# CONFIG_IR_ENE is not set
# CONFIG_IR_IMON is not set
# CONFIG_IR_MCEUSB is not set
# CONFIG_IR_ITE_CIR is not set
# CONFIG_IR_FINTEK is not set
# CONFIG_IR_NUVOTON is not set
# CONFIG_IR_REDRAT3 is not set
# CONFIG_IR_STREAMZAP is not set
# CONFIG_IR_WINBOND_CIR is not set
# CONFIG_IR_IGUANA is not set
# CONFIG_IR_TTUSBIR is not set
# CONFIG_RC_LOOPBACK is not set
# CONFIG_IR_GPIO_CIR is not set
CONFIG_MEDIA_USB_SUPPORT=y

#
# Webcam devices
#
CONFIG_USB_VIDEO_CLASS=m
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
# CONFIG_USB_GSPCA is not set
# CONFIG_USB_PWC is not set
# CONFIG_VIDEO_CPIA2 is not set
# CONFIG_USB_ZR364XX is not set
# CONFIG_USB_STKWEBCAM is not set
# CONFIG_USB_S2255 is not set
# CONFIG_USB_SN9C102 is not set
# CONFIG_VIDEO_USBTV is not set

#
# Analog TV USB devices
#
# CONFIG_VIDEO_PVRUSB2 is not set
# CONFIG_VIDEO_HDPVR is not set
# CONFIG_VIDEO_TLG2300 is not set
# CONFIG_VIDEO_USBVISION is not set
# CONFIG_VIDEO_STK1160 is not set

#
# Analog/digital TV USB devices
#
# CONFIG_VIDEO_AU0828 is not set
# CONFIG_VIDEO_CX231XX is not set
# CONFIG_VIDEO_TM6000 is not set

#
# Digital TV USB devices
#
# CONFIG_DVB_USB is not set
# CONFIG_DVB_USB_V2 is not set
# CONFIG_DVB_TTUSB_BUDGET is not set
# CONFIG_DVB_TTUSB_DEC is not set
# CONFIG_SMS_USB_DRV is not set
# CONFIG_DVB_B2C2_FLEXCOP_USB is not set

#
# Webcam, TV (analog/digital) USB devices
#
# CONFIG_VIDEO_EM28XX is not set
CONFIG_MEDIA_PCI_SUPPORT=y

#
# Media capture support
#

#
# Media capture/analog TV support
#
# CONFIG_VIDEO_IVTV is not set
# CONFIG_VIDEO_ZORAN is not set
# CONFIG_VIDEO_HEXIUM_GEMINI is not set
# CONFIG_VIDEO_HEXIUM_ORION is not set
# CONFIG_VIDEO_MXB is not set

#
# Media capture/analog/hybrid TV support
#
# CONFIG_VIDEO_CX18 is not set
# CONFIG_VIDEO_CX23885 is not set
# CONFIG_VIDEO_CX25821 is not set
# CONFIG_VIDEO_CX88 is not set
# CONFIG_VIDEO_BT848 is not set
# CONFIG_VIDEO_SAA7134 is not set
# CONFIG_VIDEO_SAA7164 is not set

#
# Media digital TV PCI Adapters
#
# CONFIG_DVB_AV7110 is not set
# CONFIG_DVB_BUDGET_CORE is not set
# CONFIG_DVB_B2C2_FLEXCOP_PCI is not set
# CONFIG_DVB_PLUTO2 is not set
# CONFIG_DVB_DM1105 is not set
# CONFIG_DVB_PT1 is not set
# CONFIG_MANTIS_CORE is not set
# CONFIG_DVB_NGENE is not set
# CONFIG_DVB_DDBRIDGE is not set
CONFIG_V4L_PLATFORM_DRIVERS=y
# CONFIG_VIDEO_CAFE_CCIC is not set
# CONFIG_VIDEO_TIMBERDALE is not set
# CONFIG_SOC_CAMERA is not set
CONFIG_V4L_MEM2MEM_DRIVERS=y
# CONFIG_VIDEO_MEM2MEM_DEINTERLACE is not set
# CONFIG_VIDEO_SH_VEU is not set
CONFIG_V4L_TEST_DRIVERS=y
# CONFIG_VIDEO_VIVI is not set
# CONFIG_VIDEO_MEM2MEM_TESTDEV is not set

#
# Supported MMC/SDIO adapters
#
# CONFIG_SMS_SDIO_DRV is not set
CONFIG_MEDIA_PARPORT_SUPPORT=y
# CONFIG_VIDEO_BWQCAM is not set
# CONFIG_VIDEO_CQCAM is not set
# CONFIG_VIDEO_W9966 is not set
CONFIG_RADIO_ADAPTERS=y
CONFIG_RADIO_SI470X=y
# CONFIG_USB_SI470X is not set
# CONFIG_I2C_SI470X is not set
# CONFIG_USB_MR800 is not set
# CONFIG_USB_DSBR is not set
# CONFIG_RADIO_MAXIRADIO is not set
# CONFIG_RADIO_SHARK is not set
# CONFIG_RADIO_SHARK2 is not set
# CONFIG_I2C_SI4713 is not set
# CONFIG_RADIO_SI4713 is not set
# CONFIG_USB_KEENE is not set
# CONFIG_USB_MA901 is not set
# CONFIG_RADIO_TEA5764 is not set
# CONFIG_RADIO_SAA7706H is not set
# CONFIG_RADIO_TEF6862 is not set
# CONFIG_RADIO_WL1273 is not set

#
# Texas Instruments WL128x FM driver (ST based)
#
# CONFIG_RADIO_WL128X is not set
# CONFIG_CYPRESS_FIRMWARE is not set

#
# Media ancillary drivers (tuners, sensors, i2c, frontends)
#
CONFIG_MEDIA_SUBDRV_AUTOSELECT=y
CONFIG_MEDIA_ATTACH=y
CONFIG_VIDEO_IR_I2C=m

#
# Audio decoders, processors and mixers
#

#
# RDS decoders
#

#
# Video decoders
#

#
# Video and audio decoders
#

#
# Video encoders
#

#
# Camera sensor devices
#

#
# Flash devices
#

#
# Video improvement chips
#

#
# Miscelaneous helper chips
#

#
# Sensors used on soc_camera driver
#
CONFIG_MEDIA_TUNER=m
CONFIG_MEDIA_TUNER_SIMPLE=m
CONFIG_MEDIA_TUNER_TDA8290=m
CONFIG_MEDIA_TUNER_TDA827X=m
CONFIG_MEDIA_TUNER_TDA18271=m
CONFIG_MEDIA_TUNER_TDA9887=m
CONFIG_MEDIA_TUNER_TEA5761=m
CONFIG_MEDIA_TUNER_TEA5767=m
CONFIG_MEDIA_TUNER_MT20XX=m
CONFIG_MEDIA_TUNER_XC2028=m
CONFIG_MEDIA_TUNER_XC5000=m
CONFIG_MEDIA_TUNER_XC4000=m
CONFIG_MEDIA_TUNER_MC44S803=m

#
# Multistandard (satellite) frontends
#

#
# Multistandard (cable + terrestrial) frontends
#

#
# DVB-S (satellite) frontends
#

#
# DVB-T (terrestrial) frontends
#

#
# DVB-C (cable) frontends
#

#
# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
#

#
# ISDB-T (terrestrial) frontends
#

#
# Digital terrestrial only tuners/PLL
#

#
# SEC control devices for DVB-S
#

#
# Tools to develop new frontends
#
# CONFIG_DVB_DUMMY_FE is not set

#
# Graphics support
#
CONFIG_AGP=y
CONFIG_AGP_AMD64=y
CONFIG_AGP_INTEL=y
# CONFIG_AGP_SIS is not set
CONFIG_AGP_VIA=y
CONFIG_VGA_ARB=y
CONFIG_VGA_ARB_MAX_GPUS=16
CONFIG_VGA_SWITCHEROO=y
CONFIG_DRM=m
CONFIG_DRM_KMS_HELPER=m
CONFIG_DRM_LOAD_EDID_FIRMWARE=y

#
# I2C encoder or helper chips
#
# CONFIG_DRM_I2C_CH7006 is not set
# CONFIG_DRM_I2C_SIL164 is not set
# CONFIG_DRM_I2C_NXP_TDA998X is not set
# CONFIG_DRM_TDFX is not set
# CONFIG_DRM_R128 is not set
# CONFIG_DRM_RADEON is not set
# CONFIG_DRM_NOUVEAU is not set
# CONFIG_DRM_I810 is not set
CONFIG_DRM_I915=m
CONFIG_DRM_I915_KMS=y
# CONFIG_DRM_MGA is not set
# CONFIG_DRM_SIS is not set
# CONFIG_DRM_VIA is not set
# CONFIG_DRM_SAVAGE is not set
# CONFIG_DRM_VMWGFX is not set
# CONFIG_DRM_GMA500 is not set
# CONFIG_DRM_UDL is not set
# CONFIG_DRM_AST is not set
# CONFIG_DRM_MGAG200 is not set
# CONFIG_DRM_CIRRUS_QEMU is not set
# CONFIG_DRM_QXL is not set
# CONFIG_VGASTATE is not set
CONFIG_VIDEO_OUTPUT_CONTROL=m
CONFIG_HDMI=y
CONFIG_FB=y
CONFIG_FIRMWARE_EDID=y
# CONFIG_FB_DDC is not set
# CONFIG_FB_BOOT_VESA_SUPPORT is not set
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
# CONFIG_FB_SYS_FILLRECT is not set
# CONFIG_FB_SYS_COPYAREA is not set
# CONFIG_FB_SYS_IMAGEBLIT is not set
# CONFIG_FB_FOREIGN_ENDIAN is not set
# CONFIG_FB_SYS_FOPS is not set
# CONFIG_FB_SVGALIB is not set
# CONFIG_FB_MACMODES is not set
# CONFIG_FB_BACKLIGHT is not set
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_TILEBLITTING=y

#
# Frame buffer hardware drivers
#
# CONFIG_FB_CIRRUS is not set
# CONFIG_FB_PM2 is not set
# CONFIG_FB_CYBER2000 is not set
# CONFIG_FB_ARC is not set
CONFIG_FB_ASILIANT=y
CONFIG_FB_IMSTT=y
# CONFIG_FB_VGA16 is not set
# CONFIG_FB_UVESA is not set
# CONFIG_FB_VESA is not set
CONFIG_FB_EFI=y
# CONFIG_FB_N411 is not set
# CONFIG_FB_HGA is not set
# CONFIG_FB_S1D13XXX is not set
# CONFIG_FB_NVIDIA is not set
# CONFIG_FB_RIVA is not set
# CONFIG_FB_I740 is not set
# CONFIG_FB_LE80578 is not set
# CONFIG_FB_INTEL is not set
# CONFIG_FB_MATROX is not set
# CONFIG_FB_RADEON is not set
# CONFIG_FB_ATY128 is not set
# CONFIG_FB_ATY is not set
# CONFIG_FB_S3 is not set
# CONFIG_FB_SAVAGE is not set
# CONFIG_FB_SIS is not set
# CONFIG_FB_VIA is not set
# CONFIG_FB_NEOMAGIC is not set
# CONFIG_FB_KYRO is not set
# CONFIG_FB_3DFX is not set
# CONFIG_FB_VOODOO1 is not set
# CONFIG_FB_VT8623 is not set
# CONFIG_FB_TRIDENT is not set
# CONFIG_FB_ARK is not set
# CONFIG_FB_PM3 is not set
# CONFIG_FB_CARMINE is not set
# CONFIG_FB_TMIO is not set
# CONFIG_FB_SMSCUFX is not set
# CONFIG_FB_UDL is not set
# CONFIG_FB_GOLDFISH is not set
# CONFIG_FB_VIRTUAL is not set
# CONFIG_XEN_FBDEV_FRONTEND is not set
# CONFIG_FB_METRONOME is not set
# CONFIG_FB_MB862XX is not set
# CONFIG_FB_BROADSHEET is not set
# CONFIG_FB_AUO_K190X is not set
CONFIG_EXYNOS_VIDEO=y
CONFIG_BACKLIGHT_LCD_SUPPORT=y
# CONFIG_LCD_CLASS_DEVICE is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=y
# CONFIG_BACKLIGHT_GENERIC is not set
# CONFIG_BACKLIGHT_PWM is not set
# CONFIG_BACKLIGHT_DA903X is not set
# CONFIG_BACKLIGHT_DA9052 is not set
# CONFIG_BACKLIGHT_MAX8925 is not set
# CONFIG_BACKLIGHT_APPLE is not set
# CONFIG_BACKLIGHT_SAHARA is not set
# CONFIG_BACKLIGHT_WM831X is not set
# CONFIG_BACKLIGHT_ADP5520 is not set
# CONFIG_BACKLIGHT_ADP8860 is not set
# CONFIG_BACKLIGHT_ADP8870 is not set
# CONFIG_BACKLIGHT_88PM860X is not set
# CONFIG_BACKLIGHT_AAT2870 is not set
# CONFIG_BACKLIGHT_LM3630 is not set
# CONFIG_BACKLIGHT_LM3639 is not set
# CONFIG_BACKLIGHT_LP855X is not set
# CONFIG_BACKLIGHT_LP8788 is not set

#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
# CONFIG_VGACON_SOFT_SCROLLBACK is not set
CONFIG_DUMMY_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
# CONFIG_LOGO is not set
CONFIG_SOUND=m
# CONFIG_SOUND_OSS_CORE is not set
CONFIG_SND=m
CONFIG_SND_TIMER=m
CONFIG_SND_PCM=m
CONFIG_SND_HWDEP=m
CONFIG_SND_RAWMIDI=m
CONFIG_SND_JACK=y
CONFIG_SND_SEQUENCER=m
# CONFIG_SND_SEQ_DUMMY is not set
# CONFIG_SND_MIXER_OSS is not set
# CONFIG_SND_PCM_OSS is not set
# CONFIG_SND_SEQUENCER_OSS is not set
# CONFIG_SND_HRTIMER is not set
CONFIG_SND_DYNAMIC_MINORS=y
CONFIG_SND_MAX_CARDS=32
CONFIG_SND_SUPPORT_OLD_API=y
CONFIG_SND_VERBOSE_PROCFS=y
# CONFIG_SND_VERBOSE_PRINTK is not set
# CONFIG_SND_DEBUG is not set
CONFIG_SND_VMASTER=y
CONFIG_SND_KCTL_JACK=y
CONFIG_SND_DMA_SGBUF=y
CONFIG_SND_RAWMIDI_SEQ=m
# CONFIG_SND_OPL3_LIB_SEQ is not set
# CONFIG_SND_OPL4_LIB_SEQ is not set
# CONFIG_SND_SBAWE_SEQ is not set
# CONFIG_SND_EMU10K1_SEQ is not set
CONFIG_SND_DRIVERS=y
# CONFIG_SND_PCSP is not set
# CONFIG_SND_DUMMY is not set
# CONFIG_SND_ALOOP is not set
CONFIG_SND_VIRMIDI=m
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_MTS64 is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_MPU401 is not set
# CONFIG_SND_PORTMAN2X4 is not set
CONFIG_SND_PCI=y
# CONFIG_SND_AD1889 is not set
# CONFIG_SND_ALS300 is not set
# CONFIG_SND_ALS4000 is not set
# CONFIG_SND_ALI5451 is not set
# CONFIG_SND_ASIHPI is not set
# CONFIG_SND_ATIIXP is not set
# CONFIG_SND_ATIIXP_MODEM is not set
# CONFIG_SND_AU8810 is not set
# CONFIG_SND_AU8820 is not set
# CONFIG_SND_AU8830 is not set
# CONFIG_SND_AW2 is not set
# CONFIG_SND_AZT3328 is not set
# CONFIG_SND_BT87X is not set
# CONFIG_SND_CA0106 is not set
# CONFIG_SND_CMIPCI is not set
# CONFIG_SND_OXYGEN is not set
# CONFIG_SND_CS4281 is not set
# CONFIG_SND_CS46XX is not set
# CONFIG_SND_CS5530 is not set
# CONFIG_SND_CS5535AUDIO is not set
# CONFIG_SND_CTXFI is not set
# CONFIG_SND_DARLA20 is not set
# CONFIG_SND_GINA20 is not set
# CONFIG_SND_LAYLA20 is not set
# CONFIG_SND_DARLA24 is not set
# CONFIG_SND_GINA24 is not set
# CONFIG_SND_LAYLA24 is not set
# CONFIG_SND_MONA is not set
# CONFIG_SND_MIA is not set
# CONFIG_SND_ECHO3G is not set
# CONFIG_SND_INDIGO is not set
# CONFIG_SND_INDIGOIO is not set
# CONFIG_SND_INDIGODJ is not set
# CONFIG_SND_INDIGOIOX is not set
# CONFIG_SND_INDIGODJX is not set
# CONFIG_SND_EMU10K1 is not set
# CONFIG_SND_EMU10K1X is not set
# CONFIG_SND_ENS1370 is not set
# CONFIG_SND_ENS1371 is not set
# CONFIG_SND_ES1938 is not set
# CONFIG_SND_ES1968 is not set
# CONFIG_SND_FM801 is not set
CONFIG_SND_HDA_INTEL=m
CONFIG_SND_HDA_PREALLOC_SIZE=64
CONFIG_SND_HDA_HWDEP=y
CONFIG_SND_HDA_RECONFIG=y
CONFIG_SND_HDA_INPUT_BEEP=y
CONFIG_SND_HDA_INPUT_BEEP_MODE=0
CONFIG_SND_HDA_INPUT_JACK=y
CONFIG_SND_HDA_PATCH_LOADER=y
CONFIG_SND_HDA_CODEC_REALTEK=y
CONFIG_SND_HDA_CODEC_ANALOG=y
CONFIG_SND_HDA_CODEC_SIGMATEL=y
CONFIG_SND_HDA_CODEC_VIA=y
CONFIG_SND_HDA_CODEC_HDMI=y
# CONFIG_SND_HDA_I915 is not set
CONFIG_SND_HDA_CODEC_CIRRUS=y
CONFIG_SND_HDA_CODEC_CONEXANT=y
CONFIG_SND_HDA_CODEC_CA0110=y
CONFIG_SND_HDA_CODEC_CA0132=y
# CONFIG_SND_HDA_CODEC_CA0132_DSP is not set
CONFIG_SND_HDA_CODEC_CMEDIA=y
CONFIG_SND_HDA_CODEC_SI3054=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0
# CONFIG_SND_HDSP is not set
# CONFIG_SND_HDSPM is not set
# CONFIG_SND_ICE1712 is not set
# CONFIG_SND_ICE1724 is not set
# CONFIG_SND_INTEL8X0 is not set
# CONFIG_SND_INTEL8X0M is not set
# CONFIG_SND_KORG1212 is not set
# CONFIG_SND_LOLA is not set
# CONFIG_SND_LX6464ES is not set
# CONFIG_SND_MAESTRO3 is not set
# CONFIG_SND_MIXART is not set
# CONFIG_SND_NM256 is not set
# CONFIG_SND_PCXHR is not set
# CONFIG_SND_RIPTIDE is not set
# CONFIG_SND_RME32 is not set
# CONFIG_SND_RME96 is not set
# CONFIG_SND_RME9652 is not set
# CONFIG_SND_SONICVIBES is not set
# CONFIG_SND_TRIDENT is not set
# CONFIG_SND_VIA82XX is not set
# CONFIG_SND_VIA82XX_MODEM is not set
# CONFIG_SND_VIRTUOSO is not set
# CONFIG_SND_VX222 is not set
# CONFIG_SND_YMFPCI is not set
CONFIG_SND_SPI=y
CONFIG_SND_USB=y
# CONFIG_SND_USB_AUDIO is not set
# CONFIG_SND_USB_UA101 is not set
# CONFIG_SND_USB_USX2Y is not set
# CONFIG_SND_USB_CAIAQ is not set
# CONFIG_SND_USB_US122L is not set
# CONFIG_SND_USB_6FIRE is not set
# CONFIG_SND_USB_HIFACE is not set
# CONFIG_SND_SOC is not set
# CONFIG_SOUND_PRIME is not set

#
# HID support
#
CONFIG_HID=m
CONFIG_HIDRAW=y
# CONFIG_UHID is not set
CONFIG_HID_GENERIC=m

#
# Special HID drivers
#
# CONFIG_HID_A4TECH is not set
# CONFIG_HID_ACRUX is not set
# CONFIG_HID_APPLE is not set
# CONFIG_HID_APPLEIR is not set
# CONFIG_HID_AUREAL is not set
# CONFIG_HID_BELKIN is not set
# CONFIG_HID_CHERRY is not set
# CONFIG_HID_CHICONY is not set
# CONFIG_HID_PRODIKEYS is not set
# CONFIG_HID_CYPRESS is not set
# CONFIG_HID_DRAGONRISE is not set
# CONFIG_HID_EMS_FF is not set
# CONFIG_HID_ELECOM is not set
# CONFIG_HID_ELO is not set
# CONFIG_HID_EZKEY is not set
# CONFIG_HID_HOLTEK is not set
# CONFIG_HID_HUION is not set
# CONFIG_HID_KEYTOUCH is not set
# CONFIG_HID_KYE is not set
# CONFIG_HID_UCLOGIC is not set
# CONFIG_HID_WALTOP is not set
# CONFIG_HID_GYRATION is not set
# CONFIG_HID_ICADE is not set
# CONFIG_HID_TWINHAN is not set
# CONFIG_HID_KENSINGTON is not set
# CONFIG_HID_LCPOWER is not set
# CONFIG_HID_LENOVO_TPKBD is not set
# CONFIG_HID_LOGITECH is not set
# CONFIG_HID_MAGICMOUSE is not set
# CONFIG_HID_MICROSOFT is not set
# CONFIG_HID_MONTEREY is not set
# CONFIG_HID_MULTITOUCH is not set
# CONFIG_HID_NTRIG is not set
# CONFIG_HID_ORTEK is not set
# CONFIG_HID_PANTHERLORD is not set
# CONFIG_HID_PETALYNX is not set
# CONFIG_HID_PICOLCD is not set
# CONFIG_HID_PRIMAX is not set
# CONFIG_HID_ROCCAT is not set
# CONFIG_HID_SAITEK is not set
# CONFIG_HID_SAMSUNG is not set
# CONFIG_HID_SONY is not set
# CONFIG_HID_SPEEDLINK is not set
# CONFIG_HID_STEELSERIES is not set
# CONFIG_HID_SUNPLUS is not set
# CONFIG_HID_GREENASIA is not set
# CONFIG_HID_SMARTJOYPLUS is not set
# CONFIG_HID_TIVO is not set
# CONFIG_HID_TOPSEED is not set
# CONFIG_HID_THINGM is not set
# CONFIG_HID_THRUSTMASTER is not set
# CONFIG_HID_WACOM is not set
# CONFIG_HID_WIIMOTE is not set
# CONFIG_HID_ZEROPLUS is not set
# CONFIG_HID_ZYDACRON is not set
# CONFIG_HID_SENSOR_HUB is not set

#
# USB HID support
#
CONFIG_USB_HID=m
CONFIG_HID_PID=y
CONFIG_USB_HIDDEV=y

#
# USB HID Boot Protocol drivers
#
# CONFIG_USB_KBD is not set
# CONFIG_USB_MOUSE is not set

#
# I2C HID support
#
# CONFIG_I2C_HID is not set
CONFIG_USB_SUPPORT=y
CONFIG_USB_COMMON=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB=y
# CONFIG_USB_DEBUG is not set
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y

#
# Miscellaneous USB options
#
CONFIG_USB_DEFAULT_PERSIST=y
CONFIG_USB_DYNAMIC_MINORS=y
# CONFIG_USB_OTG is not set
# CONFIG_USB_OTG_WHITELIST is not set
# CONFIG_USB_OTG_BLACKLIST_HUB is not set
CONFIG_USB_MON=m
# CONFIG_USB_WUSB_CBAF is not set

#
# USB Host Controller Drivers
#
# CONFIG_USB_C67X00_HCD is not set
CONFIG_USB_XHCI_HCD=y
# CONFIG_USB_XHCI_HCD_DEBUGGING is not set
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_TT_NEWSCHED=y
CONFIG_USB_EHCI_PCI=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
# CONFIG_USB_OXU210HP_HCD is not set
# CONFIG_USB_ISP116X_HCD is not set
# CONFIG_USB_ISP1760_HCD is not set
# CONFIG_USB_ISP1362_HCD is not set
# CONFIG_USB_FUSBH200_HCD is not set
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PCI=y
CONFIG_USB_OHCI_HCD_PLATFORM=y
# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_UHCI_HCD=y
# CONFIG_USB_SL811_HCD is not set
# CONFIG_USB_R8A66597_HCD is not set

#
# USB Device Class drivers
#
# CONFIG_USB_ACM is not set
CONFIG_USB_PRINTER=m
# CONFIG_USB_WDM is not set
# CONFIG_USB_TMC is not set

#
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
#

#
# also be needed; see USB_STORAGE Help for more info
#
CONFIG_USB_STORAGE=m
# CONFIG_USB_STORAGE_DEBUG is not set
# CONFIG_USB_STORAGE_REALTEK is not set
# CONFIG_USB_STORAGE_DATAFAB is not set
# CONFIG_USB_STORAGE_FREECOM is not set
# CONFIG_USB_STORAGE_ISD200 is not set
# CONFIG_USB_STORAGE_USBAT is not set
# CONFIG_USB_STORAGE_SDDR09 is not set
# CONFIG_USB_STORAGE_SDDR55 is not set
# CONFIG_USB_STORAGE_JUMPSHOT is not set
# CONFIG_USB_STORAGE_ALAUDA is not set
# CONFIG_USB_STORAGE_ONETOUCH is not set
# CONFIG_USB_STORAGE_KARMA is not set
# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
# CONFIG_USB_STORAGE_ENE_UB6250 is not set

#
# USB Imaging devices
#
# CONFIG_USB_MDC800 is not set
# CONFIG_USB_MICROTEK is not set
# CONFIG_USB_DWC3 is not set
# CONFIG_USB_CHIPIDEA is not set

#
# USB port drivers
#
# CONFIG_USB_USS720 is not set
# CONFIG_USB_SERIAL is not set

#
# USB Miscellaneous drivers
#
# CONFIG_USB_EMI62 is not set
# CONFIG_USB_EMI26 is not set
# CONFIG_USB_ADUTUX is not set
# CONFIG_USB_SEVSEG is not set
# CONFIG_USB_RIO500 is not set
# CONFIG_USB_LEGOTOWER is not set
# CONFIG_USB_LCD is not set
# CONFIG_USB_LED is not set
# CONFIG_USB_CYPRESS_CY7C63 is not set
# CONFIG_USB_CYTHERM is not set
# CONFIG_USB_IDMOUSE is not set
# CONFIG_USB_FTDI_ELAN is not set
# CONFIG_USB_APPLEDISPLAY is not set
# CONFIG_USB_SISUSBVGA is not set
# CONFIG_USB_LD is not set
# CONFIG_USB_TRANCEVIBRATOR is not set
# CONFIG_USB_IOWARRIOR is not set
# CONFIG_USB_TEST is not set
# CONFIG_USB_ISIGHTFW is not set
# CONFIG_USB_YUREX is not set
# CONFIG_USB_EZUSB_FX2 is not set
# CONFIG_USB_HSIC_USB3503 is not set
# CONFIG_USB_PHY is not set
# CONFIG_USB_GADGET is not set
# CONFIG_UWB is not set
CONFIG_MMC=y
# CONFIG_MMC_DEBUG is not set
# CONFIG_MMC_UNSAFE_RESUME is not set
# CONFIG_MMC_CLKGATE is not set

#
# MMC/SD/SDIO Card Drivers
#
CONFIG_MMC_BLOCK=m
CONFIG_MMC_BLOCK_MINORS=8
CONFIG_MMC_BLOCK_BOUNCE=y
# CONFIG_SDIO_UART is not set
# CONFIG_MMC_TEST is not set

#
# MMC/SD/SDIO Host Controller Drivers
#
CONFIG_MMC_SDHCI=m
CONFIG_MMC_SDHCI_PCI=m
# CONFIG_MMC_RICOH_MMC is not set
# CONFIG_MMC_SDHCI_ACPI is not set
# CONFIG_MMC_SDHCI_PLTFM is not set
# CONFIG_MMC_WBSD is not set
# CONFIG_MMC_TIFM_SD is not set
# CONFIG_MMC_SPI is not set
# CONFIG_MMC_CB710 is not set
# CONFIG_MMC_VIA_SDMMC is not set
# CONFIG_MMC_VUB300 is not set
# CONFIG_MMC_USHC is not set
# CONFIG_MEMSTICK is not set
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y

#
# LED drivers
#
# CONFIG_LEDS_88PM860X is not set
# CONFIG_LEDS_LM3530 is not set
# CONFIG_LEDS_LM3642 is not set
# CONFIG_LEDS_PCA9532 is not set
# CONFIG_LEDS_GPIO is not set
# CONFIG_LEDS_LP3944 is not set
# CONFIG_LEDS_LP5521 is not set
# CONFIG_LEDS_LP5523 is not set
# CONFIG_LEDS_LP5562 is not set
# CONFIG_LEDS_LP8788 is not set
# CONFIG_LEDS_CLEVO_MAIL is not set
# CONFIG_LEDS_PCA955X is not set
# CONFIG_LEDS_PCA9633 is not set
# CONFIG_LEDS_WM831X_STATUS is not set
# CONFIG_LEDS_WM8350 is not set
# CONFIG_LEDS_DA903X is not set
# CONFIG_LEDS_DA9052 is not set
# CONFIG_LEDS_DAC124S085 is not set
# CONFIG_LEDS_PWM is not set
# CONFIG_LEDS_REGULATOR is not set
# CONFIG_LEDS_BD2802 is not set
# CONFIG_LEDS_INTEL_SS4200 is not set
# CONFIG_LEDS_LT3593 is not set
# CONFIG_LEDS_ADP5520 is not set
# CONFIG_LEDS_DELL_NETBOOKS is not set
# CONFIG_LEDS_TCA6507 is not set
# CONFIG_LEDS_MAX8997 is not set
# CONFIG_LEDS_LM355x is not set
# CONFIG_LEDS_OT200 is not set
# CONFIG_LEDS_BLINKM is not set

#
# LED Triggers
#
CONFIG_LEDS_TRIGGERS=y
# CONFIG_LEDS_TRIGGER_TIMER is not set
# CONFIG_LEDS_TRIGGER_ONESHOT is not set
# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
CONFIG_LEDS_TRIGGER_CPU=y
# CONFIG_LEDS_TRIGGER_GPIO is not set
# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set

#
# iptables trigger is under Netfilter config (LED target)
#
# CONFIG_LEDS_TRIGGER_TRANSIENT is not set
# CONFIG_LEDS_TRIGGER_CAMERA is not set
# CONFIG_ACCESSIBILITY is not set
# CONFIG_INFINIBAND is not set
CONFIG_EDAC=y
CONFIG_EDAC_LEGACY_SYSFS=y
# CONFIG_EDAC_DEBUG is not set
# CONFIG_EDAC_DECODE_MCE is not set
# CONFIG_EDAC_MM_EDAC is not set
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_SYSTOHC=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
# CONFIG_RTC_DEBUG is not set

#
# RTC interfaces
#
CONFIG_RTC_INTF_SYSFS=y
CONFIG_RTC_INTF_PROC=y
CONFIG_RTC_INTF_DEV=y
# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
# CONFIG_RTC_DRV_TEST is not set

#
# I2C RTC drivers
#
# CONFIG_RTC_DRV_88PM860X is not set
# CONFIG_RTC_DRV_DS1307 is not set
# CONFIG_RTC_DRV_DS1374 is not set
# CONFIG_RTC_DRV_DS1672 is not set
# CONFIG_RTC_DRV_DS3232 is not set
# CONFIG_RTC_DRV_LP8788 is not set
# CONFIG_RTC_DRV_MAX6900 is not set
# CONFIG_RTC_DRV_MAX8925 is not set
# CONFIG_RTC_DRV_MAX8998 is not set
# CONFIG_RTC_DRV_MAX8997 is not set
# CONFIG_RTC_DRV_MAX77686 is not set
# CONFIG_RTC_DRV_RS5C372 is not set
# CONFIG_RTC_DRV_ISL1208 is not set
# CONFIG_RTC_DRV_ISL12022 is not set
# CONFIG_RTC_DRV_X1205 is not set
# CONFIG_RTC_DRV_PALMAS is not set
# CONFIG_RTC_DRV_PCF2127 is not set
# CONFIG_RTC_DRV_PCF8523 is not set
# CONFIG_RTC_DRV_PCF8563 is not set
# CONFIG_RTC_DRV_PCF8583 is not set
# CONFIG_RTC_DRV_M41T80 is not set
# CONFIG_RTC_DRV_BQ32K is not set
# CONFIG_RTC_DRV_TPS6586X is not set
# CONFIG_RTC_DRV_TPS65910 is not set
# CONFIG_RTC_DRV_RC5T583 is not set
# CONFIG_RTC_DRV_S35390A is not set
# CONFIG_RTC_DRV_FM3130 is not set
# CONFIG_RTC_DRV_RX8581 is not set
# CONFIG_RTC_DRV_RX8025 is not set
# CONFIG_RTC_DRV_EM3027 is not set
# CONFIG_RTC_DRV_RV3029C2 is not set

#
# SPI RTC drivers
#
# CONFIG_RTC_DRV_M41T93 is not set
# CONFIG_RTC_DRV_M41T94 is not set
# CONFIG_RTC_DRV_DS1305 is not set
# CONFIG_RTC_DRV_DS1390 is not set
# CONFIG_RTC_DRV_MAX6902 is not set
# CONFIG_RTC_DRV_R9701 is not set
# CONFIG_RTC_DRV_RS5C348 is not set
# CONFIG_RTC_DRV_DS3234 is not set
# CONFIG_RTC_DRV_PCF2123 is not set
# CONFIG_RTC_DRV_RX4581 is not set

#
# Platform RTC drivers
#
CONFIG_RTC_DRV_CMOS=y
# CONFIG_RTC_DRV_DS1286 is not set
# CONFIG_RTC_DRV_DS1511 is not set
# CONFIG_RTC_DRV_DS1553 is not set
# CONFIG_RTC_DRV_DS1742 is not set
# CONFIG_RTC_DRV_DA9052 is not set
# CONFIG_RTC_DRV_DA9055 is not set
# CONFIG_RTC_DRV_STK17TA8 is not set
# CONFIG_RTC_DRV_M48T86 is not set
# CONFIG_RTC_DRV_M48T35 is not set
# CONFIG_RTC_DRV_M48T59 is not set
# CONFIG_RTC_DRV_MSM6242 is not set
# CONFIG_RTC_DRV_BQ4802 is not set
# CONFIG_RTC_DRV_RP5C01 is not set
# CONFIG_RTC_DRV_V3020 is not set
# CONFIG_RTC_DRV_DS2404 is not set
# CONFIG_RTC_DRV_WM831X is not set
# CONFIG_RTC_DRV_WM8350 is not set
# CONFIG_RTC_DRV_AB3100 is not set

#
# on-CPU RTC drivers
#
# CONFIG_RTC_DRV_PCAP is not set

#
# HID Sensor RTC drivers
#
# CONFIG_RTC_DRV_HID_SENSOR_TIME is not set
CONFIG_DMADEVICES=y
# CONFIG_DMADEVICES_DEBUG is not set

#
# DMA Devices
#
# CONFIG_INTEL_MID_DMAC is not set
# CONFIG_INTEL_IOATDMA is not set
# CONFIG_DW_DMAC_CORE is not set
# CONFIG_DW_DMAC is not set
# CONFIG_DW_DMAC_PCI is not set
# CONFIG_TIMB_DMA is not set
# CONFIG_PCH_DMA is not set
CONFIG_DMA_ENGINE=y
CONFIG_DMA_ACPI=y

#
# DMA Clients
#
CONFIG_NET_DMA=y
# CONFIG_ASYNC_TX_DMA is not set
# CONFIG_DMATEST is not set
CONFIG_AUXDISPLAY=y
# CONFIG_KS0108 is not set
# CONFIG_UIO is not set
# CONFIG_VFIO is not set
CONFIG_VIRT_DRIVERS=y
CONFIG_VIRTIO=y

#
# Virtio drivers
#
CONFIG_VIRTIO_PCI=y
# CONFIG_VIRTIO_BALLOON is not set
# CONFIG_VIRTIO_MMIO is not set

#
# Microsoft Hyper-V guest support
#
# CONFIG_HYPERV is not set

#
# Xen driver support
#
CONFIG_XEN_BALLOON=y
CONFIG_XEN_SELFBALLOONING=y
CONFIG_XEN_BALLOON_MEMORY_HOTPLUG=y
CONFIG_XEN_SCRUB_PAGES=y
# CONFIG_XEN_DEV_EVTCHN is not set
CONFIG_XEN_BACKEND=y
# CONFIG_XENFS is not set
CONFIG_XEN_SYS_HYPERVISOR=y
CONFIG_XEN_XENBUS_FRONTEND=y
# CONFIG_XEN_GNTDEV is not set
# CONFIG_XEN_GRANT_DEV_ALLOC is not set
CONFIG_SWIOTLB_XEN=y
CONFIG_XEN_TMEM=m
# CONFIG_XEN_PCIDEV_BACKEND is not set
CONFIG_XEN_PRIVCMD=m
CONFIG_XEN_ACPI_PROCESSOR=y
CONFIG_XEN_MCE_LOG=y
CONFIG_XEN_HAVE_PVMMU=y
CONFIG_STAGING=y
# CONFIG_ET131X is not set
# CONFIG_SLICOSS is not set
# CONFIG_USBIP_CORE is not set
# CONFIG_W35UND is not set
# CONFIG_PRISM2_USB is not set
# CONFIG_ECHO is not set
# CONFIG_COMEDI is not set
# CONFIG_ASUS_OLED is not set
# CONFIG_PANEL is not set
# CONFIG_R8187SE is not set
# CONFIG_RTL8192U is not set
# CONFIG_RTLLIB is not set
# CONFIG_R8712U is not set
# CONFIG_RTS5139 is not set
# CONFIG_TRANZPORT is not set
# CONFIG_IDE_PHISON is not set
# CONFIG_LINE6_USB is not set
# CONFIG_VT6655 is not set
# CONFIG_VT6656 is not set
# CONFIG_DX_SEP is not set
CONFIG_ZSMALLOC=y
# CONFIG_ZRAM is not set
# CONFIG_FB_SM7XX is not set
# CONFIG_CRYSTALHD is not set
# CONFIG_FB_XGI is not set
# CONFIG_ACPI_QUICKSTART is not set
# CONFIG_USB_ENESTORAGE is not set
# CONFIG_BCM_WIMAX is not set
# CONFIG_FT1000 is not set

#
# Speakup console speech
#
# CONFIG_SPEAKUP is not set
# CONFIG_TOUCHSCREEN_CLEARPAD_TM1217 is not set
# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set
CONFIG_STAGING_MEDIA=y
# CONFIG_DVB_AS102 is not set
# CONFIG_DVB_CXD2099 is not set
# CONFIG_VIDEO_DT3155 is not set
# CONFIG_VIDEO_GO7007 is not set
# CONFIG_SOLO6X10 is not set

#
# Android
#
CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ASHMEM=y
# CONFIG_ANDROID_LOGGER is not set
CONFIG_ANDROID_TIMED_OUTPUT=y
# CONFIG_ANDROID_TIMED_GPIO is not set
CONFIG_ANDROID_LOW_MEMORY_KILLER=y
CONFIG_ANDROID_INTF_ALARM_DEV=y
# CONFIG_SYNC is not set
# CONFIG_USB_WPAN_HCD is not set
# CONFIG_WIMAX_GDM72XX is not set
CONFIG_NET_VENDOR_SILICOM=y
# CONFIG_SBYPASS is not set
# CONFIG_BPCTL is not set
# CONFIG_CED1401 is not set
# CONFIG_DGRP is not set
# CONFIG_ZCACHE is not set
# CONFIG_USB_DWC2 is not set
# CONFIG_USB_BTMTK is not set
CONFIG_X86_PLATFORM_DEVICES=y
# CONFIG_ACER_WMI is not set
# CONFIG_ACERHDF is not set
# CONFIG_ASUS_LAPTOP is not set
# CONFIG_CHROMEOS_LAPTOP is not set
# CONFIG_DELL_WMI is not set
# CONFIG_DELL_WMI_AIO is not set
# CONFIG_FUJITSU_LAPTOP is not set
# CONFIG_FUJITSU_TABLET is not set
# CONFIG_AMILO_RFKILL is not set
# CONFIG_HP_ACCEL is not set
# CONFIG_HP_WMI is not set
# CONFIG_MSI_LAPTOP is not set
# CONFIG_PANASONIC_LAPTOP is not set
# CONFIG_COMPAL_LAPTOP is not set
# CONFIG_SONY_LAPTOP is not set
# CONFIG_IDEAPAD_LAPTOP is not set
# CONFIG_THINKPAD_ACPI is not set
# CONFIG_SENSORS_HDAPS is not set
# CONFIG_INTEL_MENLOW is not set
# CONFIG_EEEPC_LAPTOP is not set
# CONFIG_ASUS_WMI is not set
CONFIG_ACPI_WMI=m
# CONFIG_MSI_WMI is not set
# CONFIG_TOPSTAR_LAPTOP is not set
# CONFIG_ACPI_TOSHIBA is not set
# CONFIG_TOSHIBA_BT_RFKILL is not set
# CONFIG_ACPI_CMPC is not set
# CONFIG_INTEL_IPS is not set
# CONFIG_IBM_RTL is not set
# CONFIG_XO15_EBOOK is not set
CONFIG_SAMSUNG_LAPTOP=m
# CONFIG_MXM_WMI is not set
# CONFIG_INTEL_OAKTRAIL is not set
# CONFIG_SAMSUNG_Q10 is not set
# CONFIG_APPLE_GMUX is not set
# CONFIG_INTEL_RST is not set
# CONFIG_INTEL_SMARTCONNECT is not set
# CONFIG_PVPANIC is not set

#
# Hardware Spinlock drivers
#
CONFIG_CLKEVT_I8253=y
CONFIG_I8253_LOCK=y
CONFIG_CLKBLD_I8253=y
# CONFIG_MAILBOX is not set
CONFIG_IOMMU_API=y
CONFIG_IOMMU_SUPPORT=y
CONFIG_AMD_IOMMU=y
CONFIG_AMD_IOMMU_STATS=y
# CONFIG_AMD_IOMMU_V2 is not set
CONFIG_DMAR_TABLE=y
CONFIG_INTEL_IOMMU=y
# CONFIG_INTEL_IOMMU_DEFAULT_ON is not set
CONFIG_INTEL_IOMMU_FLOPPY_WA=y
CONFIG_IRQ_REMAP=y

#
# Remoteproc drivers
#
# CONFIG_STE_MODEM_RPROC is not set

#
# Rpmsg drivers
#
CONFIG_PM_DEVFREQ=y

#
# DEVFREQ Governors
#
CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y
CONFIG_DEVFREQ_GOV_PERFORMANCE=y
CONFIG_DEVFREQ_GOV_POWERSAVE=y
CONFIG_DEVFREQ_GOV_USERSPACE=y

#
# DEVFREQ Drivers
#
CONFIG_EXTCON=y

#
# Extcon Device Drivers
#
# CONFIG_EXTCON_GPIO is not set
# CONFIG_EXTCON_MAX77693 is not set
# CONFIG_EXTCON_MAX8997 is not set
# CONFIG_EXTCON_PALMAS is not set
CONFIG_MEMORY=y
# CONFIG_IIO is not set
# CONFIG_NTB is not set
# CONFIG_VME_BUS is not set
CONFIG_PWM=y
CONFIG_PWM_SYSFS=y
# CONFIG_IPACK_BUS is not set
# CONFIG_RESET_CONTROLLER is not set
# CONFIG_FMC is not set

#
# Firmware Drivers
#
CONFIG_EDD=y
CONFIG_EDD_OFF=y
CONFIG_FIRMWARE_MEMMAP=y
# CONFIG_DELL_RBU is not set
# CONFIG_DCDBAS is not set
CONFIG_DMIID=y
# CONFIG_DMI_SYSFS is not set
CONFIG_ISCSI_IBFT_FIND=y
# CONFIG_ISCSI_IBFT is not set
# CONFIG_GOOGLE_FIRMWARE is not set

#
# EFI (Extensible Firmware Interface) Support
#
CONFIG_EFI_VARS=y
CONFIG_EFI_VARS_PSTORE=y
# CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE is not set

#
# File systems
#
CONFIG_DCACHE_WORD_ACCESS=y
# CONFIG_EXT2_FS is not set
CONFIG_EXT3_FS=y
CONFIG_EXT3_DEFAULTS_TO_ORDERED=y
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT23=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
# CONFIG_EXT4_DEBUG is not set
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
CONFIG_JBD2=y
# CONFIG_JBD2_DEBUG is not set
CONFIG_FS_MBCACHE=y
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
CONFIG_XFS_FS=m
CONFIG_XFS_QUOTA=y
CONFIG_XFS_POSIX_ACL=y
CONFIG_XFS_RT=y
# CONFIG_XFS_WARN is not set
# CONFIG_XFS_DEBUG is not set
# CONFIG_GFS2_FS is not set
CONFIG_BTRFS_FS=m
CONFIG_BTRFS_FS_POSIX_ACL=y
# CONFIG_BTRFS_FS_CHECK_INTEGRITY is not set
# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set
# CONFIG_BTRFS_DEBUG is not set
# CONFIG_NILFS2_FS is not set
CONFIG_FS_POSIX_ACL=y
CONFIG_EXPORTFS=y
CONFIG_FILE_LOCKING=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY_USER=y
CONFIG_FANOTIFY=y
CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
# CONFIG_PRINT_QUOTA_WARNING is not set
# CONFIG_QUOTA_DEBUG is not set
# CONFIG_QFMT_V1 is not set
# CONFIG_QFMT_V2 is not set
CONFIG_QUOTACTL=y
CONFIG_QUOTACTL_COMPAT=y
# CONFIG_AUTOFS4_FS is not set
CONFIG_FUSE_FS=y
# CONFIG_CUSE is not set
CONFIG_GENERIC_ACL=y

#
# Caches
#
# CONFIG_FSCACHE is not set

#
# CD-ROM/DVD Filesystems
#
CONFIG_ISO9660_FS=m
CONFIG_JOLIET=y
# CONFIG_ZISOFS is not set
CONFIG_UDF_FS=m
CONFIG_UDF_NLS=y

#
# DOS/FAT/NT Filesystems
#
CONFIG_FAT_FS=y
# CONFIG_MSDOS_FS is not set
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
# CONFIG_NTFS_FS is not set

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_VMCORE=y
CONFIG_PROC_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_TMPFS_XATTR=y
CONFIG_HUGETLBFS=y
CONFIG_HUGETLB_PAGE=y
# CONFIG_CONFIGFS_FS is not set
CONFIG_MISC_FILESYSTEMS=y
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
CONFIG_ECRYPT_FS=y
# CONFIG_ECRYPT_FS_MESSAGING is not set
# CONFIG_HFS_FS is not set
# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_LOGFS is not set
# CONFIG_CRAMFS is not set
CONFIG_SQUASHFS=m
CONFIG_SQUASHFS_XATTR=y
CONFIG_SQUASHFS_ZLIB=y
CONFIG_SQUASHFS_LZO=y
CONFIG_SQUASHFS_XZ=y
# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set
# CONFIG_SQUASHFS_EMBEDDED is not set
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
# CONFIG_VXFS_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_OMFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_QNX6FS_FS is not set
# CONFIG_ROMFS_FS is not set
CONFIG_PSTORE=y
# CONFIG_PSTORE_CONSOLE is not set
# CONFIG_PSTORE_FTRACE is not set
# CONFIG_PSTORE_RAM is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set
# CONFIG_F2FS_FS is not set
# CONFIG_EFIVAR_FS is not set
CONFIG_NETWORK_FILESYSTEMS=y
# CONFIG_NFS_FS is not set
# CONFIG_NFSD is not set
# CONFIG_CEPH_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=y
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
# CONFIG_NLS_CODEPAGE_850 is not set
# CONFIG_NLS_CODEPAGE_852 is not set
# CONFIG_NLS_CODEPAGE_855 is not set
# CONFIG_NLS_CODEPAGE_857 is not set
# CONFIG_NLS_CODEPAGE_860 is not set
# CONFIG_NLS_CODEPAGE_861 is not set
# CONFIG_NLS_CODEPAGE_862 is not set
# CONFIG_NLS_CODEPAGE_863 is not set
# CONFIG_NLS_CODEPAGE_864 is not set
# CONFIG_NLS_CODEPAGE_865 is not set
# CONFIG_NLS_CODEPAGE_866 is not set
# CONFIG_NLS_CODEPAGE_869 is not set
# CONFIG_NLS_CODEPAGE_936 is not set
# CONFIG_NLS_CODEPAGE_950 is not set
# CONFIG_NLS_CODEPAGE_932 is not set
# CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
# CONFIG_NLS_ASCII is not set
CONFIG_NLS_ISO8859_1=m
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
# CONFIG_NLS_ISO8859_4 is not set
# CONFIG_NLS_ISO8859_5 is not set
# CONFIG_NLS_ISO8859_6 is not set
# CONFIG_NLS_ISO8859_7 is not set
# CONFIG_NLS_ISO8859_9 is not set
# CONFIG_NLS_ISO8859_13 is not set
# CONFIG_NLS_ISO8859_14 is not set
# CONFIG_NLS_ISO8859_15 is not set
# CONFIG_NLS_KOI8_R is not set
# CONFIG_NLS_KOI8_U is not set
# CONFIG_NLS_MAC_ROMAN is not set
# CONFIG_NLS_MAC_CELTIC is not set
# CONFIG_NLS_MAC_CENTEURO is not set
# CONFIG_NLS_MAC_CROATIAN is not set
# CONFIG_NLS_MAC_CYRILLIC is not set
# CONFIG_NLS_MAC_GAELIC is not set
# CONFIG_NLS_MAC_GREEK is not set
# CONFIG_NLS_MAC_ICELAND is not set
# CONFIG_NLS_MAC_INUIT is not set
# CONFIG_NLS_MAC_ROMANIAN is not set
# CONFIG_NLS_MAC_TURKISH is not set
# CONFIG_NLS_UTF8 is not set

#
# Kernel hacking
#
CONFIG_TRACE_IRQFLAGS_SUPPORT=y

#
# printk and dmesg options
#
CONFIG_PRINTK_TIME=y
CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
CONFIG_BOOT_PRINTK_DELAY=y
# CONFIG_DYNAMIC_DEBUG is not set

#
# Compile-time checks and compiler options
#
# CONFIG_DEBUG_INFO is not set
# CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_FRAME_WARN=1024
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_READABLE_ASM is not set
CONFIG_UNUSED_SYMBOLS=y
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
# CONFIG_DEBUG_SECTION_MISMATCH is not set
CONFIG_ARCH_WANT_FRAME_POINTERS=y
CONFIG_FRAME_POINTER=y
# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_KERNEL=y

#
# Memory Debugging
#
# CONFIG_DEBUG_PAGEALLOC is not set
# CONFIG_DEBUG_OBJECTS is not set
# CONFIG_DEBUG_SLAB is not set
CONFIG_HAVE_DEBUG_KMEMLEAK=y
# CONFIG_DEBUG_KMEMLEAK is not set
# CONFIG_DEBUG_STACK_USAGE is not set
# CONFIG_DEBUG_VM is not set
# CONFIG_DEBUG_VIRTUAL is not set
# CONFIG_DEBUG_MEMORY_INIT is not set
# CONFIG_DEBUG_PER_CPU_MAPS is not set
CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
# CONFIG_DEBUG_STACKOVERFLOW is not set
CONFIG_HAVE_ARCH_KMEMCHECK=y
# CONFIG_DEBUG_SHIRQ is not set

#
# Debug Lockups and Hangs
#
CONFIG_LOCKUP_DETECTOR=y
CONFIG_HARDLOCKUP_DETECTOR=y
# CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set
CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=0
# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
CONFIG_DETECT_HUNG_TASK=y
CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120
# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
# CONFIG_PANIC_ON_OOPS is not set
CONFIG_PANIC_ON_OOPS_VALUE=0
CONFIG_SCHED_DEBUG=y
CONFIG_SCHEDSTATS=y
CONFIG_TIMER_STATS=y

#
# Lock Debugging (spinlocks, mutexes, etc...)
#
# CONFIG_DEBUG_RT_MUTEXES is not set
# CONFIG_RT_MUTEX_TESTER is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_MUTEXES is not set
# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set
# CONFIG_DEBUG_LOCK_ALLOC is not set
# CONFIG_PROVE_LOCKING is not set
# CONFIG_LOCK_STAT is not set
# CONFIG_DEBUG_ATOMIC_SLEEP is not set
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
CONFIG_STACKTRACE=y
# CONFIG_DEBUG_KOBJECT is not set
CONFIG_DEBUG_BUGVERBOSE=y
# CONFIG_DEBUG_WRITECOUNT is not set
# CONFIG_DEBUG_LIST is not set
# CONFIG_DEBUG_SG is not set
# CONFIG_DEBUG_NOTIFIERS is not set
# CONFIG_DEBUG_CREDENTIALS is not set

#
# RCU Debugging
#
# CONFIG_SPARSE_RCU_POINTER is not set
# CONFIG_RCU_TORTURE_TEST is not set
CONFIG_RCU_CPU_STALL_TIMEOUT=60
# CONFIG_RCU_CPU_STALL_INFO is not set
# CONFIG_RCU_TRACE is not set
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
# CONFIG_NOTIFIER_ERROR_INJECTION is not set
# CONFIG_FAULT_INJECTION is not set
CONFIG_LATENCYTOP=y
CONFIG_ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS=y
# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set
CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_NOP_TRACER=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_FENTRY=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_TRACER_MAX_TRACE=y
CONFIG_TRACE_CLOCK=y
CONFIG_RING_BUFFER=y
CONFIG_EVENT_TRACING=y
CONFIG_CONTEXT_SWITCH_TRACER=y
CONFIG_TRACING=y
CONFIG_GENERIC_TRACER=y
CONFIG_TRACING_SUPPORT=y
CONFIG_FTRACE=y
CONFIG_FUNCTION_TRACER=y
CONFIG_FUNCTION_GRAPH_TRACER=y
# CONFIG_IRQSOFF_TRACER is not set
CONFIG_SCHED_TRACER=y
CONFIG_FTRACE_SYSCALLS=y
CONFIG_TRACER_SNAPSHOT=y
# CONFIG_TRACER_SNAPSHOT_PER_CPU_SWAP is not set
CONFIG_BRANCH_PROFILE_NONE=y
# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
# CONFIG_PROFILE_ALL_BRANCHES is not set
CONFIG_STACK_TRACER=y
CONFIG_BLK_DEV_IO_TRACE=y
CONFIG_KPROBE_EVENT=y
CONFIG_UPROBE_EVENT=y
CONFIG_PROBE_EVENTS=y
CONFIG_DYNAMIC_FTRACE=y
CONFIG_DYNAMIC_FTRACE_WITH_REGS=y
CONFIG_FUNCTION_PROFILER=y
CONFIG_FTRACE_MCOUNT_RECORD=y
# CONFIG_FTRACE_STARTUP_TEST is not set
CONFIG_MMIOTRACE=y
# CONFIG_MMIOTRACE_TEST is not set
# CONFIG_RING_BUFFER_BENCHMARK is not set
# CONFIG_RING_BUFFER_STARTUP_TEST is not set

#
# Runtime Testing
#
# CONFIG_LKDTM is not set
# CONFIG_TEST_LIST_SORT is not set
# CONFIG_KPROBES_SANITY_TEST is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_RBTREE_TEST is not set
# CONFIG_INTERVAL_TREE_TEST is not set
# CONFIG_ATOMIC64_SELFTEST is not set
# CONFIG_TEST_STRING_HELPERS is not set
# CONFIG_TEST_KSTRTOX is not set
# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_KGDB=y
CONFIG_KGDB_SERIAL_CONSOLE=y
# CONFIG_KGDB_TESTS is not set
CONFIG_KGDB_LOW_LEVEL_TRAP=y
CONFIG_KGDB_KDB=y
CONFIG_KDB_KEYBOARD=y
CONFIG_KDB_CONTINUE_CATASTROPHIC=0
CONFIG_STRICT_DEVMEM=y
# CONFIG_X86_VERBOSE_BOOTUP is not set
CONFIG_EARLY_PRINTK=y
CONFIG_EARLY_PRINTK_DBGP=y
# CONFIG_X86_PTDUMP is not set
CONFIG_DEBUG_RODATA=y
# CONFIG_DEBUG_RODATA_TEST is not set
CONFIG_DEBUG_SET_MODULE_RONX=y
# CONFIG_DEBUG_NX_TEST is not set
CONFIG_DOUBLEFAULT=y
# CONFIG_DEBUG_TLBFLUSH is not set
# CONFIG_IOMMU_DEBUG is not set
# CONFIG_IOMMU_STRESS is not set
CONFIG_HAVE_MMIOTRACE_SUPPORT=y
# CONFIG_X86_DECODER_SELFTEST is not set
CONFIG_IO_DELAY_TYPE_0X80=0
CONFIG_IO_DELAY_TYPE_0XED=1
CONFIG_IO_DELAY_TYPE_UDELAY=2
CONFIG_IO_DELAY_TYPE_NONE=3
# CONFIG_IO_DELAY_0X80 is not set
CONFIG_IO_DELAY_0XED=y
# CONFIG_IO_DELAY_UDELAY is not set
# CONFIG_IO_DELAY_NONE is not set
CONFIG_DEFAULT_IO_DELAY_TYPE=1
# CONFIG_DEBUG_BOOT_PARAMS is not set
# CONFIG_CPA_DEBUG is not set
CONFIG_OPTIMIZE_INLINING=y
# CONFIG_DEBUG_NMI_SELFTEST is not set
# CONFIG_X86_DEBUG_STATIC_CPU_HAS is not set

#
# Security options
#
CONFIG_KEYS=y
CONFIG_TRUSTED_KEYS=y
CONFIG_ENCRYPTED_KEYS=y
# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
# CONFIG_SECURITY_DMESG_RESTRICT is not set
CONFIG_SECURITY=y
CONFIG_SECURITYFS=y
CONFIG_SECURITY_NETWORK=y
CONFIG_SECURITY_PATH=y
CONFIG_INTEL_TXT=y
CONFIG_LSM_MMAP_MIN_ADDR=0
CONFIG_SECURITY_SELINUX=y
CONFIG_SECURITY_SELINUX_BOOTPARAM=y
CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
CONFIG_SECURITY_SELINUX_DISABLE=y
CONFIG_SECURITY_SELINUX_DEVELOP=y
CONFIG_SECURITY_SELINUX_AVC_STATS=y
CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set
CONFIG_SECURITY_SMACK=y
CONFIG_SECURITY_TOMOYO=y
CONFIG_SECURITY_TOMOYO_MAX_ACCEPT_ENTRY=2048
CONFIG_SECURITY_TOMOYO_MAX_AUDIT_LOG=1024
# CONFIG_SECURITY_TOMOYO_OMIT_USERSPACE_LOADER is not set
CONFIG_SECURITY_TOMOYO_POLICY_LOADER="/sbin/tomoyo-init"
CONFIG_SECURITY_TOMOYO_ACTIVATION_TRIGGER="/sbin/init"
CONFIG_SECURITY_APPARMOR=y
CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1
CONFIG_SECURITY_YAMA=y
CONFIG_SECURITY_YAMA_STACKED=y
CONFIG_INTEGRITY=y
CONFIG_INTEGRITY_SIGNATURE=y
CONFIG_INTEGRITY_AUDIT=y
# CONFIG_INTEGRITY_ASYMMETRIC_KEYS is not set
# CONFIG_IMA is not set
CONFIG_EVM=y
CONFIG_EVM_HMAC_VERSION=2
# CONFIG_DEFAULT_SECURITY_SELINUX is not set
# CONFIG_DEFAULT_SECURITY_SMACK is not set
# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
CONFIG_DEFAULT_SECURITY_APPARMOR=y
# CONFIG_DEFAULT_SECURITY_YAMA is not set
# CONFIG_DEFAULT_SECURITY_DAC is not set
CONFIG_DEFAULT_SECURITY="apparmor"
CONFIG_XOR_BLOCKS=m
CONFIG_CRYPTO=y

#
# Crypto core or helper
#
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_BLKCIPHER=y
CONFIG_CRYPTO_BLKCIPHER2=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_RNG=y
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_PCOMP2=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
# CONFIG_CRYPTO_USER is not set
CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
CONFIG_CRYPTO_GF128MUL=m
# CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_PCRYPT is not set
CONFIG_CRYPTO_WORKQUEUE=y
CONFIG_CRYPTO_CRYPTD=m
# CONFIG_CRYPTO_AUTHENC is not set
# CONFIG_CRYPTO_TEST is not set
CONFIG_CRYPTO_ABLK_HELPER_X86=m
CONFIG_CRYPTO_GLUE_HELPER_X86=m

#
# Authenticated Encryption with Associated Data
#
# CONFIG_CRYPTO_CCM is not set
# CONFIG_CRYPTO_GCM is not set
# CONFIG_CRYPTO_SEQIV is not set

#
# Block modes
#
CONFIG_CRYPTO_CBC=y
# CONFIG_CRYPTO_CTR is not set
# CONFIG_CRYPTO_CTS is not set
CONFIG_CRYPTO_ECB=y
CONFIG_CRYPTO_LRW=m
# CONFIG_CRYPTO_PCBC is not set
CONFIG_CRYPTO_XTS=m

#
# Hash modes
#
# CONFIG_CRYPTO_CMAC is not set
CONFIG_CRYPTO_HMAC=y
# CONFIG_CRYPTO_XCBC is not set
# CONFIG_CRYPTO_VMAC is not set

#
# Digest
#
CONFIG_CRYPTO_CRC32C=y
CONFIG_CRYPTO_CRC32C_INTEL=y
# CONFIG_CRYPTO_CRC32 is not set
# CONFIG_CRYPTO_CRC32_PCLMUL is not set
# CONFIG_CRYPTO_GHASH is not set
# CONFIG_CRYPTO_MD4 is not set
CONFIG_CRYPTO_MD5=y
# CONFIG_CRYPTO_MICHAEL_MIC is not set
# CONFIG_CRYPTO_RMD128 is not set
# CONFIG_CRYPTO_RMD160 is not set
# CONFIG_CRYPTO_RMD256 is not set
# CONFIG_CRYPTO_RMD320 is not set
CONFIG_CRYPTO_SHA1=y
# CONFIG_CRYPTO_SHA1_SSSE3 is not set
# CONFIG_CRYPTO_SHA256_SSSE3 is not set
# CONFIG_CRYPTO_SHA512_SSSE3 is not set
CONFIG_CRYPTO_SHA256=y
CONFIG_CRYPTO_SHA512=y
# CONFIG_CRYPTO_TGR192 is not set
# CONFIG_CRYPTO_WP512 is not set
CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=m

#
# Ciphers
#
CONFIG_CRYPTO_AES=y
CONFIG_CRYPTO_AES_X86_64=m
CONFIG_CRYPTO_AES_NI_INTEL=m
# CONFIG_CRYPTO_ANUBIS is not set
CONFIG_CRYPTO_ARC4=m
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_BLOWFISH_X86_64 is not set
# CONFIG_CRYPTO_CAMELLIA is not set
# CONFIG_CRYPTO_CAMELLIA_X86_64 is not set
# CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64 is not set
# CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64 is not set
# CONFIG_CRYPTO_CAST5 is not set
# CONFIG_CRYPTO_CAST5_AVX_X86_64 is not set
# CONFIG_CRYPTO_CAST6 is not set
# CONFIG_CRYPTO_CAST6_AVX_X86_64 is not set
# CONFIG_CRYPTO_DES is not set
# CONFIG_CRYPTO_FCRYPT is not set
# CONFIG_CRYPTO_KHAZAD is not set
# CONFIG_CRYPTO_SALSA20 is not set
# CONFIG_CRYPTO_SALSA20_X86_64 is not set
# CONFIG_CRYPTO_SEED is not set
# CONFIG_CRYPTO_SERPENT is not set
# CONFIG_CRYPTO_SERPENT_SSE2_X86_64 is not set
# CONFIG_CRYPTO_SERPENT_AVX_X86_64 is not set
# CONFIG_CRYPTO_SERPENT_AVX2_X86_64 is not set
# CONFIG_CRYPTO_TEA is not set
# CONFIG_CRYPTO_TWOFISH is not set
# CONFIG_CRYPTO_TWOFISH_X86_64 is not set
# CONFIG_CRYPTO_TWOFISH_X86_64_3WAY is not set
# CONFIG_CRYPTO_TWOFISH_AVX_X86_64 is not set

#
# Compression
#
# CONFIG_CRYPTO_DEFLATE is not set
# CONFIG_CRYPTO_ZLIB is not set
CONFIG_CRYPTO_LZO=y
# CONFIG_CRYPTO_LZ4 is not set
# CONFIG_CRYPTO_LZ4HC is not set

#
# Random Number Generation
#
# CONFIG_CRYPTO_ANSI_CPRNG is not set
# CONFIG_CRYPTO_USER_API_HASH is not set
# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
CONFIG_CRYPTO_HW=y
CONFIG_CRYPTO_DEV_PADLOCK=y
# CONFIG_CRYPTO_DEV_PADLOCK_AES is not set
# CONFIG_CRYPTO_DEV_PADLOCK_SHA is not set
CONFIG_ASYMMETRIC_KEY_TYPE=y
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
CONFIG_PUBLIC_KEY_ALGO_RSA=y
CONFIG_X509_CERTIFICATE_PARSER=y
CONFIG_HAVE_KVM=y
CONFIG_VIRTUALIZATION=y
# CONFIG_KVM is not set
CONFIG_BINARY_PRINTF=y

#
# Library routines
#
CONFIG_RAID6_PQ=m
CONFIG_BITREVERSE=y
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GENERIC_NET_UTILS=y
CONFIG_GENERIC_FIND_FIRST_BIT=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_IO=y
CONFIG_PERCPU_RWSEM=y
CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
CONFIG_CMPXCHG_LOCKREF=y
# CONFIG_CRC_CCITT is not set
CONFIG_CRC16=y
CONFIG_CRC_T10DIF=y
CONFIG_CRC_ITU_T=m
CONFIG_CRC32=y
# CONFIG_CRC32_SELFTEST is not set
CONFIG_CRC32_SLICEBY8=y
# CONFIG_CRC32_SLICEBY4 is not set
# CONFIG_CRC32_SARWATE is not set
# CONFIG_CRC32_BIT is not set
# CONFIG_CRC7 is not set
CONFIG_LIBCRC32C=m
# CONFIG_CRC8 is not set
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=m
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_XZ_DEC=y
CONFIG_XZ_DEC_X86=y
CONFIG_XZ_DEC_POWERPC=y
CONFIG_XZ_DEC_IA64=y
CONFIG_XZ_DEC_ARM=y
CONFIG_XZ_DEC_ARMTHUMB=y
CONFIG_XZ_DEC_SPARC=y
CONFIG_XZ_DEC_BCJ=y
# CONFIG_XZ_DEC_TEST is not set
CONFIG_DECOMPRESS_GZIP=y
CONFIG_DECOMPRESS_BZIP2=y
CONFIG_DECOMPRESS_LZMA=y
CONFIG_DECOMPRESS_XZ=y
CONFIG_DECOMPRESS_LZO=y
CONFIG_GENERIC_ALLOCATOR=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_CPU_RMAP=y
CONFIG_DQL=y
CONFIG_NLATTR=y
CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
CONFIG_AVERAGE=y
CONFIG_CLZ_TAB=y
# CONFIG_CORDIC is not set
CONFIG_DDR=y
CONFIG_MPILIB=y
CONFIG_SIGNATURE=y
CONFIG_OID_REGISTRY=y
CONFIG_UCS2_STRING=y
CONFIG_FONT_SUPPORT=y
# CONFIG_FONTS is not set
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y

[-- Attachment #3: 3.11.0-2-lockref-small.patch --]
[-- Type: application/octet-stream, Size: 17163 bytes --]

Linus Torvalds (4):
      lockref: add 'lockref_get_or_lock() helper
      vfs: reimplement d_rcu_to_refcount() using lockref_get_or_lock()
      lockref: uninline lockref helper functions
      lockref: implement lockless reference count updates using cmpxchg()

Manfred Spraul (1):
      ipc/msg.c: Fix lost wakeup in msgsnd().

Sedat Dilek (7):
      kbuild: deb-pkg: Try to determine distribution
      kbuild: deb-pkg: Bump year in debian/copyright file
      kbuild: deb-pkg: Update git repository URL in debian/copyright file
      Merge branch 'deb-pkg-3.10-fixes' into 3.11.0-1-lockref-small
      Merge branch 'locked-reference-counts' into 3.11.0-1-lockref-small
      Merge branch 'lockref-3.12-fixes' into 3.11.0-1-lockref-small
      Merge branch 'ipc-msg-3.11-fixes' into 3.11.0-2-lockref-small

Tony Luck (1):
      lockref: Relax in cmpxchg loop

Waiman Long (1):
      vfs: use lockref_get_not_zero() for optimistic lockless dget_parent()

 arch/x86/Kconfig                |   1 +
 arch/x86/include/asm/spinlock.h |   5 ++
 fs/dcache.c                     |  17 +++++-
 fs/namei.c                      |  90 ++++++++++++++++++++--------
 include/linux/dcache.h          |  22 -------
 include/linux/lockref.h         |  61 ++++---------------
 ipc/msg.c                       |  12 ++--
 lib/Kconfig                     |  10 ++++
 lib/Makefile                    |   1 +
 lib/lockref.c                   | 128 ++++++++++++++++++++++++++++++++++++++++
 scripts/package/builddeb        |  19 +++++-
 11 files changed, 259 insertions(+), 107 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index b32ebf9..67e0074 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -16,6 +16,7 @@ config X86_64
 	def_bool y
 	depends on 64BIT
 	select X86_DEV_DMA_OPS
+	select ARCH_USE_CMPXCHG_LOCKREF
 
 ### Arch settings
 config X86
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h
index e3ddd7d..e0e6684 100644
--- a/arch/x86/include/asm/spinlock.h
+++ b/arch/x86/include/asm/spinlock.h
@@ -34,6 +34,11 @@
 # define UNLOCK_LOCK_PREFIX
 #endif
 
+static __always_inline int arch_spin_value_unlocked(arch_spinlock_t lock)
+{
+	return lock.tickets.head == lock.tickets.tail;
+}
+
 /*
  * Ticket locks are conceptually two parts, one indicating the current head of
  * the queue, and the other indicating the current tail. The lock is acquired
diff --git a/fs/dcache.c b/fs/dcache.c
index b949af8..96655f4 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -611,8 +611,23 @@ static inline void __dget(struct dentry *dentry)
 
 struct dentry *dget_parent(struct dentry *dentry)
 {
+	int gotref;
 	struct dentry *ret;
 
+	/*
+	 * Do optimistic parent lookup without any
+	 * locking.
+	 */
+	rcu_read_lock();
+	ret = ACCESS_ONCE(dentry->d_parent);
+	gotref = lockref_get_not_zero(&ret->d_lockref);
+	rcu_read_unlock();
+	if (likely(gotref)) {
+		if (likely(ret == ACCESS_ONCE(dentry->d_parent)))
+			return ret;
+		dput(ret);
+	}
+
 repeat:
 	/*
 	 * Don't need rcu_dereference because we re-check it was correct under
@@ -1771,7 +1786,7 @@ static noinline enum slow_d_compare slow_dentry_cmp(
  * without taking d_lock and checking d_seq sequence count against @seq
  * returned here.
  *
- * A refcount may be taken on the found dentry with the __d_rcu_to_refcount
+ * A refcount may be taken on the found dentry with the d_rcu_to_refcount
  * function.
  *
  * Alternatively, __d_lookup_rcu may be called again to look up the child of
diff --git a/fs/namei.c b/fs/namei.c
index 7720fbd..2c30c84 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -494,6 +494,50 @@ static inline void unlock_rcu_walk(void)
 	br_read_unlock(&vfsmount_lock);
 }
 
+/*
+ * When we move over from the RCU domain to properly refcounted
+ * long-lived dentries, we need to check the sequence numbers
+ * we got before lookup very carefully.
+ *
+ * We cannot blindly increment a dentry refcount - even if it
+ * is not locked - if it is zero, because it may have gone
+ * through the final d_kill() logic already.
+ *
+ * So for a zero refcount, we need to get the spinlock (which is
+ * safe even for a dead dentry because the de-allocation is
+ * RCU-delayed), and check the sequence count under the lock.
+ *
+ * Once we have checked the sequence count, we know it is live,
+ * and since we hold the spinlock it cannot die from under us.
+ *
+ * In contrast, if the reference count wasn't zero, we can just
+ * increment the lockref without having to take the spinlock.
+ * Even if the sequence number ends up being stale, we haven't
+ * gone through the final dput() and killed the dentry yet.
+ */
+static inline int d_rcu_to_refcount(struct dentry *dentry, seqcount_t *validate, unsigned seq)
+{
+	int gotref;
+
+	gotref = lockref_get_or_lock(&dentry->d_lockref);
+
+	/* Does the sequence number still match? */
+	if (read_seqcount_retry(validate, seq)) {
+		if (gotref)
+			dput(dentry);
+		else
+			spin_unlock(&dentry->d_lock);
+		return -ECHILD;
+	}
+
+	/* Get the ref now, if we couldn't get it originally */
+	if (!gotref) {
+		dentry->d_lockref.count++;
+		spin_unlock(&dentry->d_lock);
+	}
+	return 0;
+}
+
 /**
  * unlazy_walk - try to switch to ref-walk mode.
  * @nd: nameidata pathwalk data
@@ -518,29 +562,28 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry)
 				nd->root.dentry != fs->root.dentry)
 			goto err_root;
 	}
-	spin_lock(&parent->d_lock);
+
+	/*
+	 * For a negative lookup, the lookup sequence point is the parents
+	 * sequence point, and it only needs to revalidate the parent dentry.
+	 *
+	 * For a positive lookup, we need to move both the parent and the
+	 * dentry from the RCU domain to be properly refcounted. And the
+	 * sequence number in the dentry validates *both* dentry counters,
+	 * since we checked the sequence number of the parent after we got
+	 * the child sequence number. So we know the parent must still
+	 * be valid if the child sequence number is still valid.
+	 */
 	if (!dentry) {
-		if (!__d_rcu_to_refcount(parent, nd->seq))
-			goto err_parent;
+		if (d_rcu_to_refcount(parent, &parent->d_seq, nd->seq) < 0)
+			goto err_root;
 		BUG_ON(nd->inode != parent->d_inode);
 	} else {
-		if (dentry->d_parent != parent)
+		if (d_rcu_to_refcount(dentry, &dentry->d_seq, nd->seq) < 0)
+			goto err_root;
+		if (d_rcu_to_refcount(parent, &dentry->d_seq, nd->seq) < 0)
 			goto err_parent;
-		spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
-		if (!__d_rcu_to_refcount(dentry, nd->seq))
-			goto err_child;
-		/*
-		 * If the sequence check on the child dentry passed, then
-		 * the child has not been removed from its parent. This
-		 * means the parent dentry must be valid and able to take
-		 * a reference at this point.
-		 */
-		BUG_ON(!IS_ROOT(dentry) && dentry->d_parent != parent);
-		BUG_ON(!parent->d_lockref.count);
-		parent->d_lockref.count++;
-		spin_unlock(&dentry->d_lock);
 	}
-	spin_unlock(&parent->d_lock);
 	if (want_root) {
 		path_get(&nd->root);
 		spin_unlock(&fs->lock);
@@ -551,10 +594,8 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry)
 	nd->flags &= ~LOOKUP_RCU;
 	return 0;
 
-err_child:
-	spin_unlock(&dentry->d_lock);
 err_parent:
-	spin_unlock(&parent->d_lock);
+	dput(dentry);
 err_root:
 	if (want_root)
 		spin_unlock(&fs->lock);
@@ -585,14 +626,11 @@ static int complete_walk(struct nameidata *nd)
 		nd->flags &= ~LOOKUP_RCU;
 		if (!(nd->flags & LOOKUP_ROOT))
 			nd->root.mnt = NULL;
-		spin_lock(&dentry->d_lock);
-		if (unlikely(!__d_rcu_to_refcount(dentry, nd->seq))) {
-			spin_unlock(&dentry->d_lock);
+
+		if (d_rcu_to_refcount(dentry, &dentry->d_seq, nd->seq) < 0) {
 			unlock_rcu_walk();
 			return -ECHILD;
 		}
-		BUG_ON(nd->inode != dentry->d_inode);
-		spin_unlock(&dentry->d_lock);
 		mntget(nd->path.mnt);
 		unlock_rcu_walk();
 	}
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index efdc944..9169b91 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -304,28 +304,6 @@ extern struct dentry *__d_lookup(const struct dentry *, const struct qstr *);
 extern struct dentry *__d_lookup_rcu(const struct dentry *parent,
 				const struct qstr *name, unsigned *seq);
 
-/**
- * __d_rcu_to_refcount - take a refcount on dentry if sequence check is ok
- * @dentry: dentry to take a ref on
- * @seq: seqcount to verify against
- * Returns: 0 on failure, else 1.
- *
- * __d_rcu_to_refcount operates on a dentry,seq pair that was returned
- * by __d_lookup_rcu, to get a reference on an rcu-walk dentry.
- */
-static inline int __d_rcu_to_refcount(struct dentry *dentry, unsigned seq)
-{
-	int ret = 0;
-
-	assert_spin_locked(&dentry->d_lock);
-	if (!read_seqcount_retry(&dentry->d_seq, seq)) {
-		ret = 1;
-		dentry->d_lockref.count++;
-	}
-
-	return ret;
-}
-
 static inline unsigned d_count(const struct dentry *dentry)
 {
 	return dentry->d_lockref.count;
diff --git a/include/linux/lockref.h b/include/linux/lockref.h
index 01233e0..ca07b50 100644
--- a/include/linux/lockref.h
+++ b/include/linux/lockref.h
@@ -17,55 +17,20 @@
 #include <linux/spinlock.h>
 
 struct lockref {
-	spinlock_t lock;
-	unsigned int count;
+	union {
+#ifdef CONFIG_CMPXCHG_LOCKREF
+		aligned_u64 lock_count;
+#endif
+		struct {
+			spinlock_t lock;
+			unsigned int count;
+		};
+	};
 };
 
-/**
- * lockref_get - Increments reference count unconditionally
- * @lockcnt: pointer to lockref structure
- *
- * This operation is only valid if you already hold a reference
- * to the object, so you know the count cannot be zero.
- */
-static inline void lockref_get(struct lockref *lockref)
-{
-	spin_lock(&lockref->lock);
-	lockref->count++;
-	spin_unlock(&lockref->lock);
-}
-
-/**
- * lockref_get_not_zero - Increments count unless the count is 0
- * @lockcnt: pointer to lockref structure
- * Return: 1 if count updated successfully or 0 if count is 0
- */
-static inline int lockref_get_not_zero(struct lockref *lockref)
-{
-	int retval = 0;
-
-	spin_lock(&lockref->lock);
-	if (lockref->count) {
-		lockref->count++;
-		retval = 1;
-	}
-	spin_unlock(&lockref->lock);
-	return retval;
-}
-
-/**
- * lockref_put_or_lock - decrements count unless count <= 1 before decrement
- * @lockcnt: pointer to lockref structure
- * Return: 1 if count updated successfully or 0 if count <= 1 and lock taken
- */
-static inline int lockref_put_or_lock(struct lockref *lockref)
-{
-	spin_lock(&lockref->lock);
-	if (lockref->count <= 1)
-		return 0;
-	lockref->count--;
-	spin_unlock(&lockref->lock);
-	return 1;
-}
+extern void lockref_get(struct lockref *);
+extern int lockref_get_not_zero(struct lockref *);
+extern int lockref_get_or_lock(struct lockref *);
+extern int lockref_put_or_lock(struct lockref *);
 
 #endif /* __LINUX_LOCKREF_H */
diff --git a/ipc/msg.c b/ipc/msg.c
index 9f29d9e..b65fdf1 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -680,16 +680,18 @@ long do_msgsnd(int msqid, long mtype, void __user *mtext,
 		goto out_unlock1;
 	}
 
+	ipc_lock_object(&msq->q_perm);
+
 	for (;;) {
 		struct msg_sender s;
 
 		err = -EACCES;
 		if (ipcperms(ns, &msq->q_perm, S_IWUGO))
-			goto out_unlock1;
+			goto out_unlock0;
 
 		err = security_msg_queue_msgsnd(msq, msg, msgflg);
 		if (err)
-			goto out_unlock1;
+			goto out_unlock0;
 
 		if (msgsz + msq->q_cbytes <= msq->q_qbytes &&
 				1 + msq->q_qnum <= msq->q_qbytes) {
@@ -699,10 +701,9 @@ long do_msgsnd(int msqid, long mtype, void __user *mtext,
 		/* queue full, wait: */
 		if (msgflg & IPC_NOWAIT) {
 			err = -EAGAIN;
-			goto out_unlock1;
+			goto out_unlock0;
 		}
 
-		ipc_lock_object(&msq->q_perm);
 		ss_add(msq, &s);
 
 		if (!ipc_rcu_getref(msq)) {
@@ -730,10 +731,7 @@ long do_msgsnd(int msqid, long mtype, void __user *mtext,
 			goto out_unlock0;
 		}
 
-		ipc_unlock_object(&msq->q_perm);
 	}
-
-	ipc_lock_object(&msq->q_perm);
 	msq->q_lspid = task_tgid_vnr(current);
 	msq->q_stime = get_seconds();
 
diff --git a/lib/Kconfig b/lib/Kconfig
index 71d9f81..6556171 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -48,6 +48,16 @@ config STMP_DEVICE
 config PERCPU_RWSEM
 	boolean
 
+config ARCH_USE_CMPXCHG_LOCKREF
+	bool
+
+config CMPXCHG_LOCKREF
+	def_bool y if ARCH_USE_CMPXCHG_LOCKREF
+	depends on SMP
+	depends on !GENERIC_LOCKBREAK
+	depends on !DEBUG_SPINLOCK
+	depends on !DEBUG_LOCK_ALLOC
+
 config CRC_CCITT
 	tristate "CRC-CCITT functions"
 	help
diff --git a/lib/Makefile b/lib/Makefile
index 7baccfd..f2cb308 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -20,6 +20,7 @@ lib-$(CONFIG_MMU) += ioremap.o
 lib-$(CONFIG_SMP) += cpumask.o
 
 lib-y	+= kobject.o klist.o
+obj-y	+= lockref.o
 
 obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \
 	 bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \
diff --git a/lib/lockref.c b/lib/lockref.c
new file mode 100644
index 0000000..9d76f40
--- /dev/null
+++ b/lib/lockref.c
@@ -0,0 +1,128 @@
+#include <linux/export.h>
+#include <linux/lockref.h>
+
+#ifdef CONFIG_CMPXCHG_LOCKREF
+
+/*
+ * Note that the "cmpxchg()" reloads the "old" value for the
+ * failure case.
+ */
+#define CMPXCHG_LOOP(CODE, SUCCESS) do {					\
+	struct lockref old;							\
+	BUILD_BUG_ON(sizeof(old) != 8);						\
+	old.lock_count = ACCESS_ONCE(lockref->lock_count);			\
+	while (likely(arch_spin_value_unlocked(old.lock.rlock.raw_lock))) {  	\
+		struct lockref new = old, prev = old;				\
+		CODE								\
+		old.lock_count = cmpxchg(&lockref->lock_count,			\
+					 old.lock_count, new.lock_count);	\
+		if (likely(old.lock_count == prev.lock_count)) {		\
+			SUCCESS;						\
+		}								\
+		cpu_relax();							\
+	}									\
+} while (0)
+
+#else
+
+#define CMPXCHG_LOOP(CODE, SUCCESS) do { } while (0)
+
+#endif
+
+/**
+ * lockref_get - Increments reference count unconditionally
+ * @lockcnt: pointer to lockref structure
+ *
+ * This operation is only valid if you already hold a reference
+ * to the object, so you know the count cannot be zero.
+ */
+void lockref_get(struct lockref *lockref)
+{
+	CMPXCHG_LOOP(
+		new.count++;
+	,
+		return;
+	);
+
+	spin_lock(&lockref->lock);
+	lockref->count++;
+	spin_unlock(&lockref->lock);
+}
+EXPORT_SYMBOL(lockref_get);
+
+/**
+ * lockref_get_not_zero - Increments count unless the count is 0
+ * @lockcnt: pointer to lockref structure
+ * Return: 1 if count updated successfully or 0 if count was zero
+ */
+int lockref_get_not_zero(struct lockref *lockref)
+{
+	int retval;
+
+	CMPXCHG_LOOP(
+		new.count++;
+		if (!old.count)
+			return 0;
+	,
+		return 1;
+	);
+
+	spin_lock(&lockref->lock);
+	retval = 0;
+	if (lockref->count) {
+		lockref->count++;
+		retval = 1;
+	}
+	spin_unlock(&lockref->lock);
+	return retval;
+}
+EXPORT_SYMBOL(lockref_get_not_zero);
+
+/**
+ * lockref_get_or_lock - Increments count unless the count is 0
+ * @lockcnt: pointer to lockref structure
+ * Return: 1 if count updated successfully or 0 if count was zero
+ * and we got the lock instead.
+ */
+int lockref_get_or_lock(struct lockref *lockref)
+{
+	CMPXCHG_LOOP(
+		new.count++;
+		if (!old.count)
+			break;
+	,
+		return 1;
+	);
+
+	spin_lock(&lockref->lock);
+	if (!lockref->count)
+		return 0;
+	lockref->count++;
+	spin_unlock(&lockref->lock);
+	return 1;
+}
+EXPORT_SYMBOL(lockref_get_or_lock);
+
+/**
+ * lockref_put_or_lock - decrements count unless count <= 1 before decrement
+ * @lockcnt: pointer to lockref structure
+ * Return: 1 if count updated successfully or 0 if count <= 1 and lock taken
+ */
+int lockref_put_or_lock(struct lockref *lockref)
+{
+	CMPXCHG_LOOP(
+		new.count--;
+		if (old.count <= 1)
+			break;
+	,
+		return 1;
+	);
+
+	spin_lock(&lockref->lock);
+	if (lockref->count <= 1)
+		return 0;
+	lockref->count--;
+	spin_unlock(&lockref->lock);
+	return 1;
+}
+EXPORT_SYMBOL(lockref_put_or_lock);
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index acb8650..7d7c9d8 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -172,9 +172,22 @@ else
 fi
 maintainer="$name <$email>"
 
+# Try to determine distribution
+if [ -e $(which lsb_release) ]; then
+       codename=$(lsb_release --codename --short)
+       if [ "$codename" != "" ]; then
+		distribution=$codename
+       else
+		distribution="UNRELEASED"
+		echo "WARNING: The distribution could NOT be determined!"
+       fi
+else
+       echo "HINT: Install lsb_release binary, this helps to identify your distribution!"
+fi
+
 # Generate a simple changelog template
 cat <<EOF > debian/changelog
-linux-upstream ($packageversion) unstable; urgency=low
+linux-upstream ($packageversion) $distribution; urgency=low
 
   * Custom built Linux kernel.
 
@@ -188,10 +201,10 @@ This is a packacked upstream version of the Linux kernel.
 The sources may be found at most Linux ftp sites, including:
 ftp://ftp.kernel.org/pub/linux/kernel
 
-Copyright: 1991 - 2009 Linus Torvalds and others.
+Copyright: 1991 - 2013 Linus Torvalds and others.
 
 The git repository for mainline kernel development is at:
-git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
+git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by

^ permalink raw reply related	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-03 19:09                                                 ` Linus Torvalds
  2013-09-03 21:01                                                   ` Waiman Long
@ 2013-09-04 14:52                                                   ` Waiman Long
  2013-09-04 15:14                                                     ` Linus Torvalds
  2013-09-05 13:31                                                     ` Ingo Molnar
  1 sibling, 2 replies; 151+ messages in thread
From: Waiman Long @ 2013-09-04 14:52 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ingo Molnar, Al Viro, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On 09/03/2013 03:09 PM, Linus Torvalds wrote:
> On Tue, Sep 3, 2013 at 8:34 AM, Linus Torvalds
> <torvalds@linux-foundation.org>  wrote:
>> I suspect the tty_ldisc_lock() could be made to go away if we care.
> Heh. I just pulled the tty patches from Greg, and the locking has
> changed completely.
>
> It may actually fix your AIM7 test-case, because while the global
> spinlock remains (it got renamed to "tty_ldiscs_lock" - there's an
> added "s"), the common operations now take the per-tty lock to get the
> ldisc for that tty, rather than that global spinlock (which just
> protects the actual ldisk array now).
>
> That said, I don't know what AIM7 really ends up doing, but your
> profile seems to have every access through tty_ldisc_[de]ref() that
> now uses only the per-tty lock. Of course, how much that helps ends up
> depending on whether AIM7 uses lots of tty's or just one shared one.
>
> Anyway, it might be worth testing my current -git tree.
>
>                    Linus

The latest tty patches did work. The tty related spinlock contention is 
now completely gone. The short workload can now reach over 8M JPM which 
is the highest I have ever seen.

The perf profile was:

5.85%     reaim  reaim                 [.] mul_short
4.87%     reaim  [kernel.kallsyms]     [k] ebitmap_get_bit
4.72%     reaim  reaim                 [.] mul_int
4.71%     reaim  reaim                 [.] mul_long
2.67%     reaim  libc-2.12.so          [.] __random_r
2.64%     reaim  [kernel.kallsyms]     [k] lockref_get_not_zero
1.58%     reaim  [kernel.kallsyms]     [k] copy_user_generic_string
1.48%     reaim  [kernel.kallsyms]     [k] mls_level_isvalid
1.35%     reaim  [kernel.kallsyms]     [k] find_next_bit
1.23%     reaim  [kernel.kallsyms]     [k] system_call
1.21%     reaim  libc-2.12.so          [.] memcpy
1.19%     reaim  [kernel.kallsyms]     [k] _raw_spin_lock
1.06%     reaim  [kernel.kallsyms]     [k] avc_has_perm_flags
1.04%     reaim  libc-2.12.so          [.] __srandom_r
1.02%     reaim  reaim                 [.] newton_raphson
1.01%     reaim  [kernel.kallsyms]     [k] update_cfs_rq_blocked_load
0.98%     reaim  [kernel.kallsyms]     [k] fsnotify
0.94%     reaim  [kernel.kallsyms]     [k] avtab_search_node
0.91%     reaim  libm-2.12.so          [.] __sincos

I have a patch in linux-next that should eliminate ebitmap_get_bit, 
mls_leve_isvalid and find_next_bit from the list top once it is merged.

Regards,
Longman

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-04 14:52                                                   ` Waiman Long
@ 2013-09-04 15:14                                                     ` Linus Torvalds
  2013-09-04 19:25                                                       ` Waiman Long
  2013-09-05 13:31                                                     ` Ingo Molnar
  1 sibling, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-09-04 15:14 UTC (permalink / raw)
  To: Waiman Long
  Cc: Ingo Molnar, Al Viro, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Wed, Sep 4, 2013 at 7:52 AM, Waiman Long <waiman.long@hp.com> wrote:
>
> The latest tty patches did work. The tty related spinlock contention is now
> completely gone. The short workload can now reach over 8M JPM which is the
> highest I have ever seen.

Good. And this was with the 80-core machine, so there aren't any
scalability issues hiding?

             Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-04 15:14                                                     ` Linus Torvalds
@ 2013-09-04 19:25                                                       ` Waiman Long
  2013-09-04 21:34                                                         ` Linus Torvalds
  0 siblings, 1 reply; 151+ messages in thread
From: Waiman Long @ 2013-09-04 19:25 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ingo Molnar, Al Viro, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On 09/04/2013 11:14 AM, Linus Torvalds wrote:
> On Wed, Sep 4, 2013 at 7:52 AM, Waiman Long<waiman.long@hp.com>  wrote:
>> The latest tty patches did work. The tty related spinlock contention is now
>> completely gone. The short workload can now reach over 8M JPM which is the
>> highest I have ever seen.
> Good. And this was with the 80-core machine, so there aren't any
> scalability issues hiding?
>
>               Linus

Yes, the perf profile was taking from an 80-core machine. There isn't 
any scalability issue hiding for the short workload on an 80-core machine.

However, I am certain that more may pop up when running in an even 
larger machine like the prototype 240-core machine that our team has 
been testing on.

-Longman

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-04 19:25                                                       ` Waiman Long
@ 2013-09-04 21:34                                                         ` Linus Torvalds
  2013-09-05  2:35                                                           ` Waiman Long
  0 siblings, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-09-04 21:34 UTC (permalink / raw)
  To: Waiman Long
  Cc: Ingo Molnar, Al Viro, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Wed, Sep 4, 2013 at 12:25 PM, Waiman Long <waiman.long@hp.com> wrote:
>
> Yes, the perf profile was taking from an 80-core machine. There isn't any
> scalability issue hiding for the short workload on an 80-core machine.
>
> However, I am certain that more may pop up when running in an even larger
> machine like the prototype 240-core machine that our team has been testing
> on.

Sure. Please let us know, I think it's going to be interesting to see
what that shows.

SGI certainly did much larger machines, but their primary target
tended to be all user space, so they had things like "tons of
concurrent page faults in the same process" rather than filename
lookup or the tty layer.

                Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-04 21:34                                                         ` Linus Torvalds
@ 2013-09-05  2:35                                                           ` Waiman Long
  0 siblings, 0 replies; 151+ messages in thread
From: Waiman Long @ 2013-09-05  2:35 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ingo Molnar, Al Viro, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On 09/04/2013 05:34 PM, Linus Torvalds wrote:
> On Wed, Sep 4, 2013 at 12:25 PM, Waiman Long<waiman.long@hp.com>  wrote:
>> Yes, the perf profile was taking from an 80-core machine. There isn't any
>> scalability issue hiding for the short workload on an 80-core machine.
>>
>> However, I am certain that more may pop up when running in an even larger
>> machine like the prototype 240-core machine that our team has been testing
>> on.
> Sure. Please let us know, I think it's going to be interesting to see
> what that shows.
>
> SGI certainly did much larger machines, but their primary target
> tended to be all user space, so they had things like "tons of
> concurrent page faults in the same process" rather than filename
> lookup or the tty layer.
>
>                  Linus

I think SGI is more focus on compute-intensive workload. HP is more 
focus on high-end commercial workload like SAP HANA. Below was a sample 
perf profile of the high-systime workload on a 240-core prototype 
machine (HT off) with 3.10-rc1 kernel with my lockref and seqlock patches:

      9.61%    3382925          swapper  [kernel.kallsyms]         [k] 
_raw_spin_lock
                        |--59.90%-- rcu_process_callbacks
                        |--19.41%-- load_balance
                        |--9.58%-- rcu_accelerate_cbs
                        |--6.70%-- tick_do_update_jiffies64
                        |--1.46%-- scheduler_tick
                        |--1.17%-- sched_rt_period_timer
                        |--0.56%-- perf_adjust_freq_unthr_context
                         --1.21%-- [...]

      6.34%         99            reaim  [kernel.kallsyms]         [k] 
_raw_spin_lock
                          |--73.96%-- load_balance
                          |--11.98%-- rcu_process_callbacks
                          |--2.21%-- __mutex_lock_slowpath
                          |--2.02%-- rcu_accelerate_cbs
                          |--1.95%-- wake_up_new_task
                          |--1.70%-- scheduler_tick
                          |--1.67%-- xfs_alloc_log_agf
                          |--1.24%-- task_rq_lock
                          |--1.15%-- try_to_wake_up
                           --2.12%-- [...]

      5.39%          2            reaim  [kernel.kallsyms]         [k] 
_raw_spin_lock_irqsave
                          |--95.08%-- rwsem_wake
                          |--1.80%-- rcu_process_callbacks
                          |--1.03%-- prepare_to_wait
                          |--0.59%-- __wake_up
                           --1.50%-- [...]

      2.28%          1            reaim  [kernel.kallsyms]         [k] 
_raw_spin_lock_irq
                          |--90.56%-- rwsem_down_write_failed
                          |--9.25%-- __schedule
                           --0.19%-- [...]

Longman

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-04 14:52                                                   ` Waiman Long
  2013-09-04 15:14                                                     ` Linus Torvalds
@ 2013-09-05 13:31                                                     ` Ingo Molnar
  2013-09-05 17:33                                                       ` Waiman Long
  1 sibling, 1 reply; 151+ messages in thread
From: Ingo Molnar @ 2013-09-05 13:31 UTC (permalink / raw)
  To: Waiman Long
  Cc: Linus Torvalds, Al Viro, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J


* Waiman Long <waiman.long@hp.com> wrote:

> On 09/03/2013 03:09 PM, Linus Torvalds wrote:
> >On Tue, Sep 3, 2013 at 8:34 AM, Linus Torvalds
> ><torvalds@linux-foundation.org>  wrote:
> >>I suspect the tty_ldisc_lock() could be made to go away if we care.
> >Heh. I just pulled the tty patches from Greg, and the locking has
> >changed completely.
> >
> >It may actually fix your AIM7 test-case, because while the global
> >spinlock remains (it got renamed to "tty_ldiscs_lock" - there's an
> >added "s"), the common operations now take the per-tty lock to get the
> >ldisc for that tty, rather than that global spinlock (which just
> >protects the actual ldisk array now).
> >
> >That said, I don't know what AIM7 really ends up doing, but your
> >profile seems to have every access through tty_ldisc_[de]ref() that
> >now uses only the per-tty lock. Of course, how much that helps ends up
> >depending on whether AIM7 uses lots of tty's or just one shared one.
> >
> >Anyway, it might be worth testing my current -git tree.
> >
> >                   Linus
> 
> The latest tty patches did work. The tty related spinlock contention
> is now completely gone. The short workload can now reach over 8M JPM
> which is the highest I have ever seen.
> 
> The perf profile was:
> 
> 5.85%     reaim  reaim                 [.] mul_short
> 4.87%     reaim  [kernel.kallsyms]     [k] ebitmap_get_bit
> 4.72%     reaim  reaim                 [.] mul_int
> 4.71%     reaim  reaim                 [.] mul_long
> 2.67%     reaim  libc-2.12.so          [.] __random_r
> 2.64%     reaim  [kernel.kallsyms]     [k] lockref_get_not_zero
> 1.58%     reaim  [kernel.kallsyms]     [k] copy_user_generic_string
> 1.48%     reaim  [kernel.kallsyms]     [k] mls_level_isvalid
> 1.35%     reaim  [kernel.kallsyms]     [k] find_next_bit

6%+ spent in ebitmap_get_bit() and mls_level_isvalid() looks like 
something worth optimizing.

Is that called very often, or is it perhaps cache-bouncing for some 
reason?

Btw., you ought to be able to see instructions where the CPU is in some 
sort of stall (either it ran out of work, or it is cache-missing, or it is 
executing something complex), via:

  perf top -e stalled-cycles-frontend -e stalled-cycles-backend

run it for a while and pick the one which has more entries and have a 
look. Both profiles will keep updating in the background.

(Note: on Haswell CPUs stalled-cycles events are not yet available.)

Another performance analysis trick is to run this while your workload is 
executing:

  perf stat -a -ddd sleep 60

and have a look at the output - it will color-code suspicious looking 
counts.

For example, this is on a 32-way box running a kernel build:

vega:~> perf stat -addd sleep 10

 Performance counter stats for 'sleep 10':

     320753.639566 task-clock                #   32.068 CPUs utilized           [100.00%]
           187,962 context-switches          #    0.586 K/sec                   [100.00%]
            22,989 cpu-migrations            #    0.072 K/sec                   [100.00%]
         6,622,424 page-faults               #    0.021 M/sec                  
   817,576,186,285 cycles                    #    2.549 GHz                     [27.82%]
   214,366,744,930 stalled-cycles-frontend   #   26.22% frontend cycles idle    [16.75%]
    45,454,323,703 stalled-cycles-backend    #    5.56% backend  cycles idle    [16.72%]
   474,770,833,376 instructions              #    0.58  insns per cycle        
                                             #    0.45  stalled cycles per insn [22.27%]
   105,860,676,229 branches                  #  330.037 M/sec                   [33.37%]
     5,964,088,457 branch-misses             #    5.63% of all branches         [33.36%]
   244,982,563,232 L1-dcache-loads           #  763.772 M/sec                   [33.35%]
     7,503,377,286 L1-dcache-load-misses     #    3.06% of all L1-dcache hits   [33.36%]
    19,606,194,180 LLC-loads                 #   61.125 M/sec                   [22.26%]
     1,232,340,603 LLC-load-misses           #    6.29% of all LL-cache hits    [16.69%]
   261,749,251,526 L1-icache-loads           #  816.045 M/sec                   [16.69%]
    11,821,747,974 L1-icache-load-misses     #    4.52% of all L1-icache hits   [16.67%]
   244,253,746,431 dTLB-loads                #  761.500 M/sec                   [27.78%]
       126,546,407 dTLB-load-misses          #    0.05% of all dTLB cache hits  [33.30%]
   260,909,042,891 iTLB-loads                #  813.425 M/sec                   [33.31%]
        73,911,000 iTLB-load-misses          #    0.03% of all iTLB cache hits  [33.31%]
     7,989,072,388 L1-dcache-prefetches      #   24.907 M/sec                   [27.76%]
                 0 L1-dcache-prefetch-misses #    0.000 K/sec                   [33.32%]

      10.002245831 seconds time elapsed

the system is nicely saturated, caches are more or less normally utilized, 
but about a quarter of all frontend cycles are idle.

So then I ran:

  perf top -e stalled-cycles-frontend

which gave me this profile:

     2.21%            cc1  cc1                                [.] ht_lookup_with_hash                                  
     1.86%            cc1  libc-2.15.so                       [.] _int_malloc                                          
     1.66%            cc1  [kernel.kallsyms]                  [k] page_fault                                           
     1.48%            cc1  cc1                                [.] _cpp_lex_direct                                      
     1.33%            cc1  cc1                                [.] grokdeclarator                                       
     1.26%            cc1  cc1                                [.] ggc_internal_alloc_stat                              
     1.19%            cc1  cc1                                [.] ggc_internal_cleared_alloc_stat                      
     1.12%            cc1  libc-2.15.so                       [.] _int_free                                            
     1.10%            cc1  libc-2.15.so                       [.] malloc                                               
     0.95%            cc1  cc1                                [.] c_lex_with_flags                                     
     0.95%            cc1  cc1                                [.] cpp_get_token_1                                      
     0.92%            cc1  cc1                                [.] c_parser_declspecs                                   

where gcc's ht_lookup_with_hash() is having trouble:

which function is visibly getting stalls from a hash walk:

    0.79 :        a0f303:       addl   $0x1,0x80(%rdi)
    0.01 :        a0f30a:       mov    %rdi,%rbx
    0.18 :        a0f30d:       mov    %rsi,%r15
    0.00 :        a0f310:       lea    -0x1(%r14),%r13d
    0.13 :        a0f314:       and    %r13d,%r10d
    0.05 :        a0f317:       mov    %r10d,%eax
    0.34 :        a0f31a:       mov    (%rcx,%rax,8),%r9
   24.87 :        a0f31e:       lea    0x0(,%rax,8),%rdx
    0.02 :        a0f326:       test   %r9,%r9
    0.00 :        a0f329:       je     a0f5bd <ht_lookup_with_hash+0x2ed>
    0.31 :        a0f32f:       cmp    $0xffffffffffffffff,%r9
    0.18 :        a0f333:       je     a0f6e1 <ht_lookup_with_hash+0x411>
    0.37 :        a0f339:       cmp    %r12d,0xc(%r9)
   24.41 :        a0f33d:       jne    a0f3a0 <ht_lookup_with_hash+0xd0>

So giving that function some attention would probably give the most bang 
for bucks on this particular workload.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-05 13:31                                                     ` Ingo Molnar
@ 2013-09-05 17:33                                                       ` Waiman Long
  2013-09-05 17:40                                                         ` Ingo Molnar
  0 siblings, 1 reply; 151+ messages in thread
From: Waiman Long @ 2013-09-05 17:33 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Linus Torvalds, Al Viro, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

[-- Attachment #1: Type: text/plain, Size: 1287 bytes --]

On 09/05/2013 09:31 AM, Ingo Molnar wrote:
> * Waiman Long<waiman.long@hp.com>  wrote:
>
>
>> The latest tty patches did work. The tty related spinlock contention
>> is now completely gone. The short workload can now reach over 8M JPM
>> which is the highest I have ever seen.
>>
>> The perf profile was:
>>
>> 5.85%     reaim  reaim                 [.] mul_short
>> 4.87%     reaim  [kernel.kallsyms]     [k] ebitmap_get_bit
>> 4.72%     reaim  reaim                 [.] mul_int
>> 4.71%     reaim  reaim                 [.] mul_long
>> 2.67%     reaim  libc-2.12.so          [.] __random_r
>> 2.64%     reaim  [kernel.kallsyms]     [k] lockref_get_not_zero
>> 1.58%     reaim  [kernel.kallsyms]     [k] copy_user_generic_string
>> 1.48%     reaim  [kernel.kallsyms]     [k] mls_level_isvalid
>> 1.35%     reaim  [kernel.kallsyms]     [k] find_next_bit
> 6%+ spent in ebitmap_get_bit() and mls_level_isvalid() looks like
> something worth optimizing.
>
> Is that called very often, or is it perhaps cache-bouncing for some
> reason?

The high cycle count is due more to inefficient algorithm in the 
mls_level_isvalid() function than cacheline contention in the code. The 
attached patch should address this problem. It is in linux-next and 
hopefully will be merged in 3.12.

-Longman

[-- Attachment #2: 0001-SELinux-Reduce-overhead-of-mls_level_isvalid-functio.patch --]
[-- Type: text/plain, Size: 7857 bytes --]

>From 232a29fd04d5345d6af3330f48710cd48a345c10 Mon Sep 17 00:00:00 2001
From: Waiman Long <Waiman.Long@hp.com>
Date: Mon, 10 Jun 2013 13:52:36 -0400
Subject: [PATCH 1/2 v5] SELinux: Reduce overhead of mls_level_isvalid() function call
To: Stephen Smalley <sds@tycho.nsa.gov>,
    James Morris <james.l.morris@oracle.com>,
    Eric Paris <eparis@parisplace.org>
Cc: linux-security-module@vger.kernel.org,
    linux-kernel@vger.kernel.org,
    "Chandramouleeswaran, Aswin" <aswin@hp.com>,
    "Norton, Scott J" <scott.norton@hp.com>

v4->v5:
  - Fix scripts/checkpatch.pl warning.

v3->v4:
  - Merge the 2 separate while loops in ebitmap_contains() into
    a single one.

v2->v3:
  - Remove unused local variables i, node from mls_level_isvalid().

v1->v2:
 - Move the new ebitmap comparison logic from mls_level_isvalid()
   into the ebitmap_contains() helper function.
 - Rerun perf and performance tests on the latest v3.10-rc4 kernel.

While running the high_systime workload of the AIM7 benchmark on
a 2-socket 12-core Westmere x86-64 machine running 3.10-rc4 kernel
(with HT on), it was found that a pretty sizable amount of time was
spent in the SELinux code. Below was the perf trace of the "perf
record -a -s" of a test run at 1500 users:

  5.04%            ls  [kernel.kallsyms]     [k] ebitmap_get_bit
  1.96%            ls  [kernel.kallsyms]     [k] mls_level_isvalid
  1.95%            ls  [kernel.kallsyms]     [k] find_next_bit

The ebitmap_get_bit() was the hottest function in the perf-report
output.  Both the ebitmap_get_bit() and find_next_bit() functions
were, in fact, called by mls_level_isvalid(). As a result, the
mls_level_isvalid() call consumed 8.95% of the total CPU time of
all the 24 virtual CPUs which is quite a lot. The majority of the
mls_level_isvalid() function invocations come from the socket creation
system call.

Looking at the mls_level_isvalid() function, it is checking to see
if all the bits set in one of the ebitmap structure are also set in
another one as well as the highest set bit is no bigger than the one
specified by the given policydb data structure. It is doing it in
a bit-by-bit manner. So if the ebitmap structure has many bits set,
the iteration loop will be done many times.

The current code can be rewritten to use a similar algorithm as the
ebitmap_contains() function with an additional check for the
highest set bit. The ebitmap_contains() function was extended to
cover an optional additional check for the highest set bit, and the
mls_level_isvalid() function was modified to call ebitmap_contains().

With that change, the perf trace showed that the used CPU time drop
down to just 0.08% (ebitmap_contains + mls_level_isvalid) of the
total which is about 100X less than before.

  0.07%            ls  [kernel.kallsyms]     [k] ebitmap_contains
  0.05%            ls  [kernel.kallsyms]     [k] ebitmap_get_bit
  0.01%            ls  [kernel.kallsyms]     [k] mls_level_isvalid
  0.01%            ls  [kernel.kallsyms]     [k] find_next_bit

The remaining ebitmap_get_bit() and find_next_bit() functions calls
are made by other kernel routines as the new mls_level_isvalid()
function will not call them anymore.

This patch also improves the high_systime AIM7 benchmark result,
though the improvement is not as impressive as is suggested by the
reduction in CPU time spent in the ebitmap functions. The table below
shows the performance change on the 2-socket x86-64 system (with HT
on) mentioned above.

+--------------+---------------+----------------+-----------------+
|   Workload   | mean % change | mean % change  | mean % change   |
|              | 10-100 users  | 200-1000 users | 1100-2000 users |
+--------------+---------------+----------------+-----------------+
| high_systime |     +0.1%     |     +0.9%      |     +2.6%       |
+--------------+---------------+----------------+-----------------+

Signed-off-by: Waiman Long <Waiman.Long@hp.com>
---
 security/selinux/ss/ebitmap.c   |   20 ++++++++++++++++++--
 security/selinux/ss/ebitmap.h   |    2 +-
 security/selinux/ss/mls.c       |   22 +++++++---------------
 security/selinux/ss/mls_types.h |    2 +-
 4 files changed, 27 insertions(+), 19 deletions(-)

diff --git a/security/selinux/ss/ebitmap.c b/security/selinux/ss/ebitmap.c
index 30f119b..820313a 100644
--- a/security/selinux/ss/ebitmap.c
+++ b/security/selinux/ss/ebitmap.c
@@ -213,7 +213,12 @@ netlbl_import_failure:
 }
 #endif /* CONFIG_NETLABEL */
 
-int ebitmap_contains(struct ebitmap *e1, struct ebitmap *e2)
+/*
+ * Check to see if all the bits set in e2 are also set in e1. Optionally,
+ * if last_e2bit is non-zero, the highest set bit in e2 cannot exceed
+ * last_e2bit.
+ */
+int ebitmap_contains(struct ebitmap *e1, struct ebitmap *e2, u32 last_e2bit)
 {
 	struct ebitmap_node *n1, *n2;
 	int i;
@@ -223,14 +228,25 @@ int ebitmap_contains(struct ebitmap *e1, struct ebitmap *e2)
 
 	n1 = e1->node;
 	n2 = e2->node;
+
 	while (n1 && n2 && (n1->startbit <= n2->startbit)) {
 		if (n1->startbit < n2->startbit) {
 			n1 = n1->next;
 			continue;
 		}
-		for (i = 0; i < EBITMAP_UNIT_NUMS; i++) {
+		for (i = EBITMAP_UNIT_NUMS - 1; (i >= 0) && !n2->maps[i]; )
+			i--;	/* Skip trailing NULL map entries */
+		if (last_e2bit && (i >= 0)) {
+			u32 lastsetbit = n2->startbit + i * EBITMAP_UNIT_SIZE +
+					 __fls(n2->maps[i]);
+			if (lastsetbit > last_e2bit)
+				return 0;
+		}
+
+		while (i >= 0) {
 			if ((n1->maps[i] & n2->maps[i]) != n2->maps[i])
 				return 0;
+			i--;
 		}
 
 		n1 = n1->next;
diff --git a/security/selinux/ss/ebitmap.h b/security/selinux/ss/ebitmap.h
index 922f8af..e7eb3a9 100644
--- a/security/selinux/ss/ebitmap.h
+++ b/security/selinux/ss/ebitmap.h
@@ -117,7 +117,7 @@ static inline void ebitmap_node_clr_bit(struct ebitmap_node *n,
 
 int ebitmap_cmp(struct ebitmap *e1, struct ebitmap *e2);
 int ebitmap_cpy(struct ebitmap *dst, struct ebitmap *src);
-int ebitmap_contains(struct ebitmap *e1, struct ebitmap *e2);
+int ebitmap_contains(struct ebitmap *e1, struct ebitmap *e2, u32 last_e2bit);
 int ebitmap_get_bit(struct ebitmap *e, unsigned long bit);
 int ebitmap_set_bit(struct ebitmap *e, unsigned long bit, int value);
 void ebitmap_destroy(struct ebitmap *e);
diff --git a/security/selinux/ss/mls.c b/security/selinux/ss/mls.c
index 40de8d3..c85bc1e 100644
--- a/security/selinux/ss/mls.c
+++ b/security/selinux/ss/mls.c
@@ -160,8 +160,6 @@ void mls_sid_to_context(struct context *context,
 int mls_level_isvalid(struct policydb *p, struct mls_level *l)
 {
 	struct level_datum *levdatum;
-	struct ebitmap_node *node;
-	int i;
 
 	if (!l->sens || l->sens > p->p_levels.nprim)
 		return 0;
@@ -170,19 +168,13 @@ int mls_level_isvalid(struct policydb *p, struct mls_level *l)
 	if (!levdatum)
 		return 0;
 
-	ebitmap_for_each_positive_bit(&l->cat, node, i) {
-		if (i > p->p_cats.nprim)
-			return 0;
-		if (!ebitmap_get_bit(&levdatum->level->cat, i)) {
-			/*
-			 * Category may not be associated with
-			 * sensitivity.
-			 */
-			return 0;
-		}
-	}
-
-	return 1;
+	/*
+	 * Return 1 iff all the bits set in l->cat are also be set in
+	 * levdatum->level->cat and no bit in l->cat is larger than
+	 * p->p_cats.nprim.
+	 */
+	return ebitmap_contains(&levdatum->level->cat, &l->cat,
+				p->p_cats.nprim);
 }
 
 int mls_range_isvalid(struct policydb *p, struct mls_range *r)
diff --git a/security/selinux/ss/mls_types.h b/security/selinux/ss/mls_types.h
index 03bed52..e936487 100644
--- a/security/selinux/ss/mls_types.h
+++ b/security/selinux/ss/mls_types.h
@@ -35,7 +35,7 @@ static inline int mls_level_eq(struct mls_level *l1, struct mls_level *l2)
 static inline int mls_level_dom(struct mls_level *l1, struct mls_level *l2)
 {
 	return ((l1->sens >= l2->sens) &&
-		ebitmap_contains(&l1->cat, &l2->cat));
+		ebitmap_contains(&l1->cat, &l2->cat, 0));
 }
 
 #define mls_level_incomp(l1, l2) \
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-05 17:33                                                       ` Waiman Long
@ 2013-09-05 17:40                                                         ` Ingo Molnar
  0 siblings, 0 replies; 151+ messages in thread
From: Ingo Molnar @ 2013-09-05 17:40 UTC (permalink / raw)
  To: Waiman Long
  Cc: Linus Torvalds, Al Viro, Benjamin Herrenschmidt, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J


* Waiman Long <waiman.long@hp.com> wrote:

> On 09/05/2013 09:31 AM, Ingo Molnar wrote:
> >* Waiman Long<waiman.long@hp.com>  wrote:
> >
> >
> >>The latest tty patches did work. The tty related spinlock contention
> >>is now completely gone. The short workload can now reach over 8M JPM
> >>which is the highest I have ever seen.
> >>
> >>The perf profile was:
> >>
> >>5.85%     reaim  reaim                 [.] mul_short
> >>4.87%     reaim  [kernel.kallsyms]     [k] ebitmap_get_bit
> >>4.72%     reaim  reaim                 [.] mul_int
> >>4.71%     reaim  reaim                 [.] mul_long
> >>2.67%     reaim  libc-2.12.so          [.] __random_r
> >>2.64%     reaim  [kernel.kallsyms]     [k] lockref_get_not_zero
> >>1.58%     reaim  [kernel.kallsyms]     [k] copy_user_generic_string
> >>1.48%     reaim  [kernel.kallsyms]     [k] mls_level_isvalid
> >>1.35%     reaim  [kernel.kallsyms]     [k] find_next_bit
> >6%+ spent in ebitmap_get_bit() and mls_level_isvalid() looks like
> >something worth optimizing.
> >
> >Is that called very often, or is it perhaps cache-bouncing for some
> >reason?
> 
> The high cycle count is due more to inefficient algorithm in the 
> mls_level_isvalid() function than cacheline contention in the code. The 
> attached patch should address this problem. It is in linux-next and 
> hopefully will be merged in 3.12.

Great!

If/when you happen to boot the latest & greatest kernel that has all these 
scalability patches applied it would be nice if you could send an updated 
profile into this thread.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-29 23:42             ` Linus Torvalds
  2013-08-30  0:26               ` Benjamin Herrenschmidt
  2013-08-30  3:12               ` Waiman Long
@ 2013-09-08 21:45               ` Linus Torvalds
  2013-09-09  0:03                 ` Al Viro
  2 siblings, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-09-08 21:45 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Benjamin Herrenschmidt, Waiman Long, Alexander Viro, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

Al, this is mainly a rambling question for you, but others left on the
Cc just FYI..

On Thu, Aug 29, 2013 at 4:42 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> So I fixed the VFS layer instead. With dput() and friends using
> lockrefs, the only thing remaining in the hot RCU dentry lookup path
> was the nasty __d_rcu_to_refcount() thing in complete_walk(). I
> rewrote that to locklessly increment the refcount when it was nonzero,
> and get the lock if it was zero, and that all seems to work fine.

Today I realized that my new simplified d_rcu_to_refcount() was
fundamentally buggy in a really annoying way.

I had worried mainly about the races with the dentry being
invalidated, and how we must not touch the dentry reference count if
it might be dead, because once the dentry has been killed, it cannot
be killed again.

My lockref_get_or_lock() avoided all that by making sure that it
always got the reference on a dentry that was still live, and this
everything was fine. If it turns out that the sequence count says that
the lookup wasn't valid, we could just dput() that dentry, and
everything was fine.

And you know what? That's even true. It's true from a dentry standpoint.

But today I was - for totally unrelated reasons, just as a result of
looking at performance profiles - looking at dput(), and realized that
dput() really *can* sleep. Not for any actual dentry reasons, but
because the inode associated with the dentry is being released. And
the reason I noticed this from the performance profile was that the
dput code did

      if (dentry->d_lockref.count == 1)
            might_sleep();

where reading that lockref count showed up in the profile.

But that test never triggered any of my thinking, and it's racy
anyway, and the condition we care about is another race, which means
that it not only didn't trigger my thinking, it doesn't trigger in any
normal testing either. The fact is, dput() can always sleep,
regardless of count, because of the race (ok, the exception being that
you actually have multiple references to the same dentry _yourself_,
but who does that? Nobody).

Anyway, the reason the new d_rcu_to_refcount() is buggy isn't because
it does bad things to dentries - the dentry reference counts and
lifetimes are perfectly fine. No, the reason it does bad things is
that it does an otherwise perfectly fine dput() in a context where it
definitely is _not_ fine to sleep. We are in RCU lookup, so we are in
a RCU-locked region, we hold the percpu vfsmount_lock spinlock, and in
fact in unlazy_walk() we also potentially hold the "fs->lock"
spinlock.

Ugh, ugh, ugh.

I really like the much simplified d_rcu_to_refcount() conceptually,
though. So my current plan is to keep it, but to just delay the
"dput()" it does until after we've done the "unlock_rcu_walk()".

"complete_walk()" is actually quite simple to fix, because it does the
unlock_rcu_walk() itself - so it's fairly trivial to just move the
dput() to be after it. In preparation for this, I already ended up
committing my "dead lockref" dentry code, because that simplifies
d_rcu_to_refcount() to the degree that splitting the code up into the
callers and then moving the dput() looks like the right thing to do.

The problem I see right now is unlazy_walk(). It does *not* do the
unlock_rcu_walk() itself for the error case (and it's the error case
that needs this), but instead just returns -ECHILD and expects the
caller to do it. Even then it happens fairly obscurely in
"terminate_walk()".

So Al, any ideas? I currently have two:

 - always do that unlock_rcu_walk() in unlazy_walk(), and exit RCU
mode even for the error case (similar to how complete_walk() does it).

   That makes solving this for unlazy_walk() as straightforward as it
is for complete_walk(), and this is, I think, the right thing to do.

 - add a couple of "to be freed" dentry pointers to the 'nd' and let
terminate_walk() do the dput(). This leaves the unlazy_walk()
semantics alone.

The second one is hacky, but it doesn't change the semantics of
unlzay_walk(). I think the current semantics (drop out of RCU mode on
success, but not on failure) are nasty, but I wonder if there is some
really subtle reason for it. So the hacky second solution has got that
whole "no change to odd/subtle semantics" thing going for it..

Comments?

                 Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-08 21:45               ` Linus Torvalds
@ 2013-09-09  0:03                 ` Al Viro
  2013-09-09  0:25                   ` Linus Torvalds
                                     ` (2 more replies)
  0 siblings, 3 replies; 151+ messages in thread
From: Al Viro @ 2013-09-09  0:03 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ingo Molnar, Benjamin Herrenschmidt, Waiman Long, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Sun, Sep 08, 2013 at 02:45:32PM -0700, Linus Torvalds wrote:

> But that test never triggered any of my thinking, and it's racy
> anyway, and the condition we care about is another race, which means
> that it not only didn't trigger my thinking, it doesn't trigger in any
> normal testing either. The fact is, dput() can always sleep,
> regardless of count, because of the race (ok, the exception being that
> you actually have multiple references to the same dentry _yourself_,
> but who does that? Nobody).

There's one exception - basically, we decide to put duplicates of
reference(s) we hold into (a bunch of) structures being created.  If
we decide that we'd failed and need to roll back, the structures
need to be taken out of whatever lists, etc. they'd been already
put on and references held in them - dropped.  That removal gets done
under a spinlock.  Sure, we can string those structures on some kind
of temp list, drop the spinlock and do dput() on everything in there,
but it's much more convenient to just free them as we are evicting
them, doing dput() as we go.  Which is safe, since we are still have
the references used to create these buggers pinned down.

> Anyway, the reason the new d_rcu_to_refcount() is buggy isn't because
> it does bad things to dentries - the dentry reference counts and
> lifetimes are perfectly fine. No, the reason it does bad things is
> that it does an otherwise perfectly fine dput() in a context where it
> definitely is _not_ fine to sleep. We are in RCU lookup, so we are in
> a RCU-locked region, we hold the percpu vfsmount_lock spinlock, and in
> fact in unlazy_walk() we also potentially hold the "fs->lock"
> spinlock.
> 
> Ugh, ugh, ugh.
> 
> I really like the much simplified d_rcu_to_refcount() conceptually,
> though. So my current plan is to keep it, but to just delay the
> "dput()" it does until after we've done the "unlock_rcu_walk()".

> "complete_walk()" is actually quite simple to fix, because it does the
> unlock_rcu_walk() itself - so it's fairly trivial to just move the
> dput() to be after it. In preparation for this, I already ended up
> committing my "dead lockref" dentry code, because that simplifies
> d_rcu_to_refcount() to the degree that splitting the code up into the
> callers and then moving the dput() looks like the right thing to do.
> 
> The problem I see right now is unlazy_walk(). It does *not* do the
> unlock_rcu_walk() itself for the error case (and it's the error case
> that needs this), but instead just returns -ECHILD and expects the
> caller to do it. Even then it happens fairly obscurely in
> "terminate_walk()".
> 
> So Al, any ideas? I currently have two:
> 
>  - always do that unlock_rcu_walk() in unlazy_walk(), and exit RCU
> mode even for the error case (similar to how complete_walk() does it).
> 
>    That makes solving this for unlazy_walk() as straightforward as it
> is for complete_walk(), and this is, I think, the right thing to do.
> 
>  - add a couple of "to be freed" dentry pointers to the 'nd' and let
> terminate_walk() do the dput(). This leaves the unlazy_walk()
> semantics alone.
> 
> The second one is hacky, but it doesn't change the semantics of
> unlzay_walk(). I think the current semantics (drop out of RCU mode on
> success, but not on failure) are nasty, but I wonder if there is some
> really subtle reason for it. So the hacky second solution has got that
> whole "no change to odd/subtle semantics" thing going for it..

Well...  unlazy_walk() is always followed by terminate_walk() very shortly,
but there's a minor problem - terminate_walk() uses "are we in RCU
mode?" for two things:
	a) do we need to do path_put() here?
	b) do we need to unlock?
If you introduce the third case ("no need to do unlock and no need to
do path_put()"), we'd better decide how to check for that case...

I suspect that minimal variant would be along the lines of
	* have unlazy_walk() slap NULL into ->path.mnt on error, clear
LOOKUP_RCU and unlock
	* have terminate_walk() check ->path.mnt before doing path_put()
in !RCU case
	* in do_last() replace bool got_write with struct vfsmount *got_write,
storing the reference to vfsmount we'd fed to mnt_want_write().
And use its value when we call mnt_put_write() in there...

I'll put together a commit like that on top of what I was going to push
into public queues tonight; give me about half an hour, OK?

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-09  0:03                 ` Al Viro
@ 2013-09-09  0:25                   ` Linus Torvalds
  2013-09-09  0:35                     ` Al Viro
  2013-09-09  2:09                     ` Ramkumar Ramachandra
  2013-09-09  0:30                   ` Al Viro
  2013-09-09  3:32                   ` Linus Torvalds
  2 siblings, 2 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-09-09  0:25 UTC (permalink / raw)
  To: Al Viro
  Cc: Ingo Molnar, Benjamin Herrenschmidt, Waiman Long, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

[-- Attachment #1: Type: text/plain, Size: 1565 bytes --]

On Sun, Sep 8, 2013 at 5:03 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> Well...  unlazy_walk() is always followed by terminate_walk() very shortly,
> but there's a minor problem - terminate_walk() uses "are we in RCU
> mode?" for two things:
>         a) do we need to do path_put() here?
>         b) do we need to unlock?
> If you introduce the third case ("no need to do unlock and no need to
> do path_put()"), we'd better decide how to check for that case...

Actually, I decided to take advantage of those two cases instead, and
I have a patch that I think does the right thing. Basically, I start
off unlazy_walk() with just doing that lockref_get_not_dead() on the
parent dentry, and if that fails I just return an error in RCU mode
(so terminate_walk() does what it always used to do, and we haven't
done anything else to any refcounts).

Now, if the lockref_get_not_dead() succeeded, that means that we have
a reference on the nd->path.dentry, and we can now just do
"mntget(nd->path.mnt);". Ta-Daa! We now have everything done for the
non-RCU case for terminate_walk().

So after that point, we clear LOOKUP_RCU, and make the rule be that
any return (error or success) has to do unlock_rcu_walk(). And then
all the other refcounts are easy, we can just "dput(dentry);" after
that.

I haven't tested it yet, I was going to reboot into it just now. But
I'm attaching the patch here. Maybe I missed some detail, but it all
seems simpler.

Note that this patch requires the "lockref_get_not_dead()" cleanup at
the top of my current -git.

        Linus

[-- Attachment #2: patch.diff --]
[-- Type: application/octet-stream, Size: 4618 bytes --]

 fs/namei.c | 102 +++++++++++++++++++++++++++++--------------------------------
 1 file changed, 49 insertions(+), 53 deletions(-)

diff --git a/fs/namei.c b/fs/namei.c
index cc4bcfaa8624..56e4f4d537d0 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -494,37 +494,6 @@ static inline void unlock_rcu_walk(void)
 	br_read_unlock(&vfsmount_lock);
 }
 
-/*
- * When we move over from the RCU domain to properly refcounted
- * long-lived dentries, we need to check the sequence numbers
- * we got before lookup very carefully.
- *
- * We cannot blindly increment a dentry refcount - even if it
- * is not locked - if it is zero, because it may have gone
- * through the final d_kill() logic already.
- *
- * So for a zero refcount, we need to get the spinlock (which is
- * safe even for a dead dentry because the de-allocation is
- * RCU-delayed), and check the sequence count under the lock.
- *
- * Once we have checked the sequence count, we know it is live,
- * and since we hold the spinlock it cannot die from under us.
- *
- * In contrast, if the reference count wasn't zero, we can just
- * increment the lockref without having to take the spinlock.
- * Even if the sequence number ends up being stale, we haven't
- * gone through the final dput() and killed the dentry yet.
- */
-static inline int d_rcu_to_refcount(struct dentry *dentry, seqcount_t *validate, unsigned seq)
-{
-	if (likely(lockref_get_not_dead(&dentry->d_lockref))) {
-		if (!read_seqcount_retry(validate, seq))
-				return 0;
-		dput(dentry);
-	}
-	return -ECHILD;
-}
-
 /**
  * unlazy_walk - try to switch to ref-walk mode.
  * @nd: nameidata pathwalk data
@@ -539,16 +508,29 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry)
 {
 	struct fs_struct *fs = current->fs;
 	struct dentry *parent = nd->path.dentry;
-	int want_root = 0;
 
 	BUG_ON(!(nd->flags & LOOKUP_RCU));
-	if (nd->root.mnt && !(nd->flags & LOOKUP_ROOT)) {
-		want_root = 1;
-		spin_lock(&fs->lock);
-		if (nd->root.mnt != fs->root.mnt ||
-				nd->root.dentry != fs->root.dentry)
-			goto err_root;
-	}
+
+	/*
+	 * Get a reference to the parent first: we're
+	 * going to make "path_put(nd->path)" valid in
+	 * non-RCU context for "terminate_walk()".
+	 *
+	 * If this doesn't work, return immediately with
+	 * RCU walking still active (and then we will do
+	 * the RCU walk cleanup in terminate_walk()).
+	 */
+	if (!lockref_get_not_dead(&parent->d_lockref))
+		return -ECHILD;
+
+	/*
+	 * After the mntget(), we terminate_walk() will do
+	 * the right thing for non-RCU mode, and all our
+	 * subsequent exit cases should unlock_rcu_walk()
+	 * before returning.
+	 */
+	mntget(nd->path.mnt);
+	nd->flags &= ~LOOKUP_RCU;
 
 	/*
 	 * For a negative lookup, the lookup sequence point is the parents
@@ -562,30 +544,39 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry)
 	 * be valid if the child sequence number is still valid.
 	 */
 	if (!dentry) {
-		if (d_rcu_to_refcount(parent, &parent->d_seq, nd->seq) < 0)
-			goto err_root;
+		if (read_seqcount_retry(&parent->d_seq, nd->seq))
+			goto out;
 		BUG_ON(nd->inode != parent->d_inode);
 	} else {
-		if (d_rcu_to_refcount(dentry, &dentry->d_seq, nd->seq) < 0)
-			goto err_root;
-		if (d_rcu_to_refcount(parent, &dentry->d_seq, nd->seq) < 0)
-			goto err_parent;
+		if (!lockref_get_not_dead(&dentry->d_lockref))
+			goto out;
+		if (read_seqcount_retry(&dentry->d_seq, nd->seq))
+			goto drop_dentry;
 	}
-	if (want_root) {
+
+	/*
+	 * Sequence counts matched. Now make sure that the root is
+	 * still valid and get it if required.
+	 */
+	if (nd->root.mnt && !(nd->flags & LOOKUP_ROOT)) {
+		spin_lock(&fs->lock);
+		if (nd->root.mnt != fs->root.mnt || nd->root.dentry != fs->root.dentry)
+			goto unlock_and_drop_dentry;
 		path_get(&nd->root);
 		spin_unlock(&fs->lock);
 	}
-	mntget(nd->path.mnt);
 
 	unlock_rcu_walk();
-	nd->flags &= ~LOOKUP_RCU;
 	return 0;
 
-err_parent:
+unlock_and_drop_dentry:
+	spin_unlock(&fs->lock);
+drop_dentry:
+	unlock_rcu_walk();
 	dput(dentry);
-err_root:
-	if (want_root)
-		spin_unlock(&fs->lock);
+	return -ECHILD;
+out:
+	unlock_rcu_walk();
 	return -ECHILD;
 }
 
@@ -614,10 +605,15 @@ static int complete_walk(struct nameidata *nd)
 		if (!(nd->flags & LOOKUP_ROOT))
 			nd->root.mnt = NULL;
 
-		if (d_rcu_to_refcount(dentry, &dentry->d_seq, nd->seq) < 0) {
+		if (unlikely(!lockref_get_not_dead(&dentry->d_lockref))) {
 			unlock_rcu_walk();
 			return -ECHILD;
 		}
+		if (read_seqcount_retry(&dentry->d_seq, nd->seq)) {
+			unlock_rcu_walk();
+			dput(dentry);
+			return -ECHILD;
+		}
 		mntget(nd->path.mnt);
 		unlock_rcu_walk();
 	}

^ permalink raw reply related	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-09  0:03                 ` Al Viro
  2013-09-09  0:25                   ` Linus Torvalds
@ 2013-09-09  0:30                   ` Al Viro
  2013-09-09  3:32                   ` Linus Torvalds
  2 siblings, 0 replies; 151+ messages in thread
From: Al Viro @ 2013-09-09  0:30 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ingo Molnar, Benjamin Herrenschmidt, Waiman Long, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Mon, Sep 09, 2013 at 01:03:00AM +0100, Al Viro wrote:

> Well...  unlazy_walk() is always followed by terminate_walk() very shortly,
> but there's a minor problem - terminate_walk() uses "are we in RCU
> mode?" for two things:
> 	a) do we need to do path_put() here?
> 	b) do we need to unlock?
> If you introduce the third case ("no need to do unlock and no need to
> do path_put()"), we'd better decide how to check for that case...
> 
> I suspect that minimal variant would be along the lines of
> 	* have unlazy_walk() slap NULL into ->path.mnt on error, clear
> LOOKUP_RCU and unlock
> 	* have terminate_walk() check ->path.mnt before doing path_put()
> in !RCU case
> 	* in do_last() replace bool got_write with struct vfsmount *got_write,
> storing the reference to vfsmount we'd fed to mnt_want_write().
> And use its value when we call mnt_put_write() in there...
> 
> I'll put together a commit like that on top of what I was going to push
> into public queues tonight; give me about half an hour, OK?

See the last commit in vfs.git#for-next (38373e1).

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-09  0:25                   ` Linus Torvalds
@ 2013-09-09  0:35                     ` Al Viro
  2013-09-09  0:38                       ` Linus Torvalds
  2013-09-09  2:09                     ` Ramkumar Ramachandra
  1 sibling, 1 reply; 151+ messages in thread
From: Al Viro @ 2013-09-09  0:35 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ingo Molnar, Benjamin Herrenschmidt, Waiman Long, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Sun, Sep 08, 2013 at 05:25:40PM -0700, Linus Torvalds wrote:
> On Sun, Sep 8, 2013 at 5:03 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> >
> > Well...  unlazy_walk() is always followed by terminate_walk() very shortly,
> > but there's a minor problem - terminate_walk() uses "are we in RCU
> > mode?" for two things:
> >         a) do we need to do path_put() here?
> >         b) do we need to unlock?
> > If you introduce the third case ("no need to do unlock and no need to
> > do path_put()"), we'd better decide how to check for that case...
> 
> Actually, I decided to take advantage of those two cases instead, and
> I have a patch that I think does the right thing. Basically, I start
> off unlazy_walk() with just doing that lockref_get_not_dead() on the
> parent dentry, and if that fails I just return an error in RCU mode
> (so terminate_walk() does what it always used to do, and we haven't
> done anything else to any refcounts).
> 
> Now, if the lockref_get_not_dead() succeeded, that means that we have
> a reference on the nd->path.dentry, and we can now just do
> "mntget(nd->path.mnt);". Ta-Daa! We now have everything done for the
> non-RCU case for terminate_walk().
> 
> So after that point, we clear LOOKUP_RCU, and make the rule be that
> any return (error or success) has to do unlock_rcu_walk(). And then
> all the other refcounts are easy, we can just "dput(dentry);" after
> that.
> 
> I haven't tested it yet, I was going to reboot into it just now. But
> I'm attaching the patch here. Maybe I missed some detail, but it all
> seems simpler.
> 
> Note that this patch requires the "lockref_get_not_dead()" cleanup at
> the top of my current -git.

That should also work, replacing the current tip of #for-next.  Do you
prefer to merge those two diffs of yours into a single commit?

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-09  0:35                     ` Al Viro
@ 2013-09-09  0:38                       ` Linus Torvalds
  2013-09-09  0:57                         ` Al Viro
  0 siblings, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-09-09  0:38 UTC (permalink / raw)
  To: Al Viro
  Cc: Ingo Molnar, Benjamin Herrenschmidt, Waiman Long, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Sun, Sep 8, 2013 at 5:35 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> That should also work, replacing the current tip of #for-next.  Do you
> prefer to merge those two diffs of yours into a single commit?

If you're ok with my patch (it's now also tested, I'm running with it
and it looks fine), I'll commit that one as-is.

When you say "those two diffs of yours", which two are you talking
about? I already committed the "dead lockref" part separately - it may
be "preparatory", but it was preparatory cleanup that didn't change
semantics, so it's better to be separate anyway. The last patch I sent
out a few moments ago is the one that actually fixes things so that
"dput()" isn't done under the RCU lock etc.

           Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-09  0:38                       ` Linus Torvalds
@ 2013-09-09  0:57                         ` Al Viro
  0 siblings, 0 replies; 151+ messages in thread
From: Al Viro @ 2013-09-09  0:57 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ingo Molnar, Benjamin Herrenschmidt, Waiman Long, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Sun, Sep 08, 2013 at 05:38:46PM -0700, Linus Torvalds wrote:
> On Sun, Sep 8, 2013 at 5:35 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> >
> > That should also work, replacing the current tip of #for-next.  Do you
> > prefer to merge those two diffs of yours into a single commit?
> 
> If you're ok with my patch (it's now also tested, I'm running with it
> and it looks fine), I'll commit that one as-is.

OK...  I'm dropping 38373e1ee72bf57b6f9b1ab0979a60887352c7e6, then...

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-09  0:25                   ` Linus Torvalds
  2013-09-09  0:35                     ` Al Viro
@ 2013-09-09  2:09                     ` Ramkumar Ramachandra
  1 sibling, 0 replies; 151+ messages in thread
From: Ramkumar Ramachandra @ 2013-09-09  2:09 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Al Viro, Ingo Molnar, Benjamin Herrenschmidt, Waiman Long,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

Linus Torvalds wrote:
> On Sun, Sep 8, 2013 at 5:03 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>>
>> Well...  unlazy_walk() is always followed by terminate_walk() very shortly,
>> but there's a minor problem - terminate_walk() uses "are we in RCU
>> mode?" for two things:
>>         a) do we need to do path_put() here?
>>         b) do we need to unlock?
>> If you introduce the third case ("no need to do unlock and no need to
>> do path_put()"), we'd better decide how to check for that case...

Yeah, I think b is a crucial step: it depends on how you unlock. Does
the unlocking result in data corruption and chaos, or does it result
in ordered data being unlocked? If it's the former case, people are
sure to take advantage of you; otherwise, you can use people.

> Actually, I decided to take advantage of those two cases instead, and
> I have a patch that I think does the right thing. Basically, I start
> off unlazy_walk() with just doing that lockref_get_not_dead() on the
> parent dentry, and if that fails I just return an error in RCU mode
> (so terminate_walk() does what it always used to do, and we haven't
> done anything else to any refcounts).

LRU cache requires that a single processor is accessing memory at a
time: if there are multiple processors, L1/ L2 cache concurrent access
is a problem.

> Now, if the lockref_get_not_dead() succeeded, that means that we have
> a reference on the nd->path.dentry, and we can now just do
> "mntget(nd->path.mnt);". Ta-Daa! We now have everything done for the
> non-RCU case for terminate_walk().

How efficient is the mounting? Has data been corrupted while taking
the portable filesystem around?

> So after that point, we clear LOOKUP_RCU, and make the rule be that
> any return (error or success) has to do unlock_rcu_walk(). And then
> all the other refcounts are easy, we can just "dput(dentry);" after
> that.

Drag ropes.

> I haven't tested it yet, I was going to reboot into it just now. But
> I'm attaching the patch here. Maybe I missed some detail, but it all
> seems simpler.

Some amount of garbage collection is healthy every once in a while,
but the project requires more yak shavers than anything else at this
point.

> Note that this patch requires the "lockref_get_not_dead()" cleanup at
> the top of my current -git.

Why is the current gitster not up to date? We should discuss automated
version control.

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-09  0:03                 ` Al Viro
  2013-09-09  0:25                   ` Linus Torvalds
  2013-09-09  0:30                   ` Al Viro
@ 2013-09-09  3:32                   ` Linus Torvalds
  2013-09-09  4:06                     ` Ramkumar Ramachandra
  2013-09-09  5:44                     ` Al Viro
  2 siblings, 2 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-09-09  3:32 UTC (permalink / raw)
  To: Al Viro
  Cc: Ingo Molnar, Benjamin Herrenschmidt, Waiman Long, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Sun, Sep 8, 2013 at 5:03 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> There's one exception - basically, we decide to put duplicates of
> reference(s) we hold into (a bunch of) structures being created.  If
> we decide that we'd failed and need to roll back, the structures
> need to be taken out of whatever lists, etc. they'd been already
> put on and references held in them - dropped.  That removal gets done
> under a spinlock.  Sure, we can string those structures on some kind
> of temp list, drop the spinlock and do dput() on everything in there,
> but it's much more convenient to just free them as we are evicting
> them, doing dput() as we go.  Which is safe, since we are still have
> the references used to create these buggers pinned down.

Hmm. Which codepath does this? Because I got curious and added back
the __might_sleep() unconditionally to dput() just to see (now that I
think that the dput() bugs are gone), and at least under normal load
it doesn't trigger. I even wrote a thing that just constantly creates
and renames the target file concurrently with looking it up, so that
I've stress-tested the RCU sequence number failure path (and verified
with a profile that yes, it does trigger the "oops, need to retry"
case). I didn't test anything odd at all (just my dentry stress tests
and a regular graphical desktop), though.

And I have too much memory to sanely stress any out-of-memory situations.

#firstworldkerneldeveloperproblems

            Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-09  3:32                   ` Linus Torvalds
@ 2013-09-09  4:06                     ` Ramkumar Ramachandra
  2013-09-09  5:44                     ` Al Viro
  1 sibling, 0 replies; 151+ messages in thread
From: Ramkumar Ramachandra @ 2013-09-09  4:06 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Al Viro, Ingo Molnar, Benjamin Herrenschmidt, Waiman Long,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Peter Zijlstra,
	Steven Rostedt, Andi Kleen, Chandramouleeswaran, Aswin, Norton,
	Scott J

Linus Torvalds wrote:
> On Sun, Sep 8, 2013 at 5:03 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>>
>> There's one exception - basically, we decide to put duplicates of
>> reference(s) we hold into (a bunch of) structures being created.  If
>> we decide that we'd failed and need to roll back, the structures
>> need to be taken out of whatever lists, etc. they'd been already
>> put on and references held in them - dropped.  That removal gets done
>> under a spinlock.  Sure, we can string those structures on some kind
>> of temp list, drop the spinlock and do dput() on everything in there,
>> but it's much more convenient to just free them as we are evicting
>> them, doing dput() as we go.  Which is safe, since we are still have
>> the references used to create these buggers pinned down.

Dropping the spinlocks means more cores; unfortunately, a quad-core
seems to be the limit. Users must divide their time between reading
history and contributing to the present: some amount of persistent
data is a must on every user's machine. Pixel seems to be heading in
the wrong direction: that's what is stressing us out.

Ram

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-09  3:32                   ` Linus Torvalds
  2013-09-09  4:06                     ` Ramkumar Ramachandra
@ 2013-09-09  5:44                     ` Al Viro
  1 sibling, 0 replies; 151+ messages in thread
From: Al Viro @ 2013-09-09  5:44 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ingo Molnar, Benjamin Herrenschmidt, Waiman Long, Jeff Layton,
	Miklos Szeredi, Ingo Molnar, Thomas Gleixner, linux-fsdevel,
	Linux Kernel Mailing List, Peter Zijlstra, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Sun, Sep 08, 2013 at 08:32:03PM -0700, Linus Torvalds wrote:
> On Sun, Sep 8, 2013 at 5:03 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> >
> > There's one exception - basically, we decide to put duplicates of
> > reference(s) we hold into (a bunch of) structures being created.  If
> > we decide that we'd failed and need to roll back, the structures
> > need to be taken out of whatever lists, etc. they'd been already
> > put on and references held in them - dropped.  That removal gets done
> > under a spinlock.  Sure, we can string those structures on some kind
> > of temp list, drop the spinlock and do dput() on everything in there,
> > but it's much more convenient to just free them as we are evicting
> > them, doing dput() as we go.  Which is safe, since we are still have
> > the references used to create these buggers pinned down.
> 
> Hmm. Which codepath does this? Because I got curious and added back
> the __might_sleep() unconditionally to dput() just to see (now that I
> think that the dput() bugs are gone), and at least under normal load
> it doesn't trigger. I even wrote a thing that just constantly creates
> and renames the target file concurrently with looking it up, so that
> I've stress-tested the RCU sequence number failure path (and verified
> with a profile that yes, it does trigger the "oops, need to retry"
> case). I didn't test anything odd at all (just my dentry stress tests
> and a regular graphical desktop), though.

Not sure if we have anything of that sort in the current tree; I remember
that kind of stuff in shared subtree code (basically, if we decided that
operation should fail halfway through the process, we could just evict
all created vfsmounts from the lists and mntput them, spinlocks or no
spinlocks - they all had been copied from existing ones protected by
the system-wide serialization on namespace modifications, so resulting
dput() calls wouldn't have d_count on anything reach zero).  But I'm not
sure if it had been about vfsmount_lock or namespace_sem (we really don't
want any IO under the latter, since one stuck fs can make _any_ umount
impossible afterwards) and all remnants of that got killed off by
reorganizations of locking in there - all pending dput()/mntput() calls are
delayed until namespace_unlock() now.

Anyway, that wouldn't break even now - I'm not saying that it's a good
pattern to use, but it's legitimate.  If you are holding a reference
already, something like
	p = alloc_foo();
	spin_lock(&lock);
	...
	p->dentry = dget(dentry);
	...
	if (error) {
		...
		free_foo(p);
		...
		spin_unlock(&lock);
	}
with free_foo(p) including dput(p->dentry) is safe.  The whole thing was just
a comment on your "who does that? Nobody" - that kind of stuff has uses and
it did happen at least once.  And yes, it is safe *and* anybody writing
anything of that sort needs to look hard if it can be reorganized into
something less subtle...

> And I have too much memory to sanely stress any out-of-memory situations.

KVM image with -m <size> or mem=<size> in kernel command line ;-)

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01  0:13                                             ` Al Viro
  2013-09-01 17:48                                               ` Al Viro
@ 2013-09-09  8:30                                               ` Peter Zijlstra
  1 sibling, 0 replies; 151+ messages in thread
From: Peter Zijlstra @ 2013-09-09  8:30 UTC (permalink / raw)
  To: Al Viro
  Cc: Linus Torvalds, Waiman Long, Ingo Molnar, Benjamin Herrenschmidt,
	Jeff Layton, Miklos Szeredi, Ingo Molnar, Thomas Gleixner,
	linux-fsdevel, Linux Kernel Mailing List, Steven Rostedt,
	Andi Kleen, Chandramouleeswaran, Aswin, Norton, Scott J

On Sun, Sep 01, 2013 at 01:13:06AM +0100, Al Viro wrote:

> +static noinline_for_stack
> +char *dentry_name(char *buf, char *end, const struct dentry *d, struct printf_spec spec,
> +		  int depth)
> +{
> +	int i, n = 0;
> +	const char *s;
> +	char *p = buf;
> +	const struct dentry *array[4];
> +	char c;
> +
> +	if (depth < 0) {
> +		depth = 1;
> +		WARN_ON(1);
> +	}
> +	if (depth > 4) {
> +		depth = 4;
> +		WARN_ON(1);
> +	}
> +
> +	rcu_read_lock();
> +	for (i = 0; i < depth; i++) {
> +		struct dentry *p = ACCESS_ONCE(d->d_parent);
> +		array[i] = d;
> +		if (d == p)
> +			break;
> +		d = p;
> +	}
> +	if (!i) {	/* root dentry has a bloody inconvenient name */
> +		i++;
> +		goto do_name;
> +	}
> +	if (i == depth)
> +		goto do_name;
> +	while (i && n != spec.precision) {
> +		if (buf < end)
> +			*buf = '/';
> +		buf++;
> +		n++;
> +do_name:
> +		s = ACCESS_ONCE(array[--i]->d_name.name);
> +		while (n != spec.precision && (c = *s++) != '\0') {
> +			if (buf < end)
> +				*buf = c;
> +			buf++;
> +			n++;
> +		}
> +	}
> +	rcu_read_unlock();

Should one or both of those ACCESS_ONCE()s be an rcu_dereference()?

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01 18:11         ` Steven Rostedt
@ 2013-09-01 20:03           ` Linus Torvalds
  0 siblings, 0 replies; 151+ messages in thread
From: Linus Torvalds @ 2013-09-01 20:03 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Theodore Ts'o, George Spelvin, linux-fsdevel,
	Linux Kernel Mailing List, Al Viro, Waiman Long,
	Frederic Weisbecker

On Sun, Sep 1, 2013 at 11:11 AM, Steven Rostedt <rostedt@goodmis.org> wrote:
>
> I've been told that gcc works better with 'bool' than with an int.
> Should I replace those bools with bit fields in the structure?

I think bitfields are a better idea in a struct, yes. They take less
space, and there's a possibility to generate better code with a
bitfield test than with a bool, especially if you have multiple values
and you test them together.

If it's a single bool in a structure, it really doesn't matter. It's
going to take up at least a char (and usually more due to padding of
other fields) regardless of bool-vs-bitfield issues. But I'd much
rather see bitfields in structs because they *can* work better, and
they are more flexible than "bool" anyway.

Bools generally should generate the same code as "char", and yes, that
can be better than "int". On x86, for example, the "setcc" instruction
always sets a char, so if you use an "int" for boolean values, the
compiler usually generates something like "xor %eax,%eax; test ..;
setne %al" or similar. A bool or a char will skip the "xor", because
the "setne" will set the low bits that are sufficient. That said, it's
not actually noticeable in practice, and most routines that return
true/false will just do plain "return 0" or whatever, so there's no
use for "setcc" to begin with.

         Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01 15:49       ` Linus Torvalds
@ 2013-09-01 18:11         ` Steven Rostedt
  2013-09-01 20:03           ` Linus Torvalds
  0 siblings, 1 reply; 151+ messages in thread
From: Steven Rostedt @ 2013-09-01 18:11 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Theodore Ts'o, George Spelvin, linux-fsdevel,
	Linux Kernel Mailing List, Al Viro, Waiman Long,
	Frederic Weisbecker

On Sun, 1 Sep 2013 08:49:48 -0700
Linus Torvalds <torvalds@linux-foundation.org> wrote:


> Nobody used to care, because we used to not use that broken type in the kernel.

I've been told that gcc works better with 'bool' than with an int.
Should I replace those bools with bit fields in the structure?

-- Steve

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01 11:10     ` Theodore Ts'o
@ 2013-09-01 15:49       ` Linus Torvalds
  2013-09-01 18:11         ` Steven Rostedt
  0 siblings, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-09-01 15:49 UTC (permalink / raw)
  To: Theodore Ts'o, George Spelvin, linux-fsdevel,
	Linux Kernel Mailing List, Al Viro, Waiman Long, Steven Rostedt,
	Frederic Weisbecker

On Sun, Sep 1, 2013 at 4:10 AM, Theodore Ts'o <tytso@mit.edu> wrote:
> Speaking of bool (and I'm not a fan of it either), is this warning
> just noise (which is bad enough since it masks real warnings), or is
> this going to cause serious problems?
>
>   CHECK   /usr/projects/linux/ext4/kernel/trace/trace.c
> /usr/projects/linux/ext4/kernel/trace/trace.c:559:6: warning: symbol 'free_snapshot' was not declared. Should it be static?
> /usr/projects/linux/ext4/kernel/trace/trace.c:1489:14: warning: expression using sizeof bool

It's just because sparse is being a bit odd. Internally, sparse thinks
that "bool" has a size of one bit. So it then the sizeof code has a
special case to make it one byte, and when that special case was
added, people added the warning too.

I suspect we sparse should just make the size of "bool" be 8 bits
internally, and we should drop the warning. As it is, sparse will
actually do odd and wrong things due to the "bool is one bit" if you
put "bool" types in structures or unions, I think.

Nobody used to care, because we used to not use that broken type in the kernel.

            Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-09-01  8:50   ` George Spelvin
@ 2013-09-01 11:10     ` Theodore Ts'o
  2013-09-01 15:49       ` Linus Torvalds
  0 siblings, 1 reply; 151+ messages in thread
From: Theodore Ts'o @ 2013-09-01 11:10 UTC (permalink / raw)
  To: George Spelvin
  Cc: torvalds, linux-fsdevel, linux-kernel, viro, waiman.long,
	Steven Rostedt, Frederic Weisbecker

Speaking of bool (and I'm not a fan of it either), is this warning
just noise (which is bad enough since it masks real warnings), or is
this going to cause serious problems?

  CHECK   /usr/projects/linux/ext4/kernel/trace/trace.c
/usr/projects/linux/ext4/kernel/trace/trace.c:559:6: warning: symbol 'free_snapshot' was not declared. Should it be static?
/usr/projects/linux/ext4/kernel/trace/trace.c:1489:14: warning: expression using sizeof bool
/usr/projects/linux/ext4/kernel/trace/trace.c:1489:14: warning: expression using sizeof bool
/usr/projects/linux/ext4/kernel/trace/trace.c:1489:14: warning: expression using sizeof bool
/usr/projects/linux/ext4/kernel/trace/trace.c:1489:14: warning: expression using sizeof bool
/usr/projects/linux/ext4/kernel/trace/trace.c:1492:9: warning: expression using sizeof bool
/usr/projects/linux/ext4/kernel/trace/trace.c:1492:9: warning: expression using sizeof bool
/usr/projects/linux/ext4/kernel/trace/trace.c:1492:9: warning: expression using sizeof bool
/usr/projects/linux/ext4/kernel/trace/trace.c:1492:9: warning: expression using sizeof bool
/usr/projects/linux/ext4/kernel/trace/trace.c:1539:9: warning: expression using sizeof bool
/usr/projects/linux/ext4/kernel/trace/trace.c:1539:9: warning: expression using sizeof bool
/usr/projects/linux/ext4/kernel/trace/trace.c:1539:9: warning: expression using sizeof bool
/usr/projects/linux/ext4/kernel/trace/trace.c:1539:9: warning: expression using sizeof bool

(i.e., is a C compiler allowed to pack multiple bools stored in a data
structure into a single byte, with potentially hilarious results for C
code trying to do magic utilizing sizeof and offsetof (which some of
our kernel macros do use, IIRC)?

				- Ted

P.S.  BTW, this is not the only set of sparse warnings that are
emitted by files in kernel/trace/*; maybe it would be good if the
ftrace maintianers worked on nuking them all?  There are also a bunch
of warnings like which I've only recently learned indicated potential
RCU bugs:

/usr/projects/linux/ext4/kernel/trace/trace.c:1885:17: warning: incorrect type in assignment (different address spaces)
/usr/projects/linux/ext4/kernel/trace/trace.c:1885:17:    expected struct trace_buffer_struct *buffers
/usr/projects/linux/ext4/kernel/trace/trace.c:1885:17:    got struct trace_buffer_struct [noderef] <asn:3>*<noident>

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-31 17:16 ` Linus Torvalds
@ 2013-09-01  8:50   ` George Spelvin
  2013-09-01 11:10     ` Theodore Ts'o
  0 siblings, 1 reply; 151+ messages in thread
From: George Spelvin @ 2013-09-01  8:50 UTC (permalink / raw)
  To: linux, torvalds; +Cc: linux-fsdevel, linux-kernel, viro, waiman.long

> If "bool" had real advantages (like having a dense array
> representation, for example), that would be one thing. It doesn't.
> Sure, now you can take an address of a bool (which you couldn't
> generally do efficiently if it really was a bit array), but it also
> means that in practice, "bool" is normally nothing but "char" with
> some really odd and special implicit type casting rules.

Huh.  For me, the big advantage is, to paraphrase Michael Palin, that
the number of possible values is two, no more, and no less.  Two is
the number of possibilities, and the number of possibilities is two.
Three is Right Out.

I agree that as a *storage* type (in a data structure), it's of limited
usefulness.  But as a *parameter* type, to pass to and return from
functions, it's wonderful.

There are lots of naming conventions (like the word "flag", or a function
name starting with "is") to indicate that the return value is a simple
true/false, but declaring it that way provides compile-time checking.

> I doubt most people really even understand how "bool" casting works.

There's a reason for that; you rarely need to cast to bool, and you
could forbid it outright with very little impact on bool's usefulness.
What fraction of C programmers remember off the top of their heads that
casting from float to integer rounds toward zero?

Heck, if you asked me which conversions were defined and which were
undefined, I'd have to look it up.  (I'd guess it's the same as the
different overflow rules for signed and unsigned types, but I'd have
to check.)

The place bool is most useful is control flow flags and other things
where all you're doing is assigning literal values and testing it.  And,
if you want to get fancy, assigning to bool variables from boolean-valued
expressions like "flag = value >= limit;"


That said, I agree that the fact that 2 != (bool)2 is a bit subtle, but
doesn't that basic problem apply to *any* narrowing cast?  (And thus,
is not really an *additional* subtlety that a progammer needs to learn
about.)  And in this case, I can't really think of a *better* choice
that could have been made.

I can only see three plausible alternatives:

1) Use the lsbit, (bool)x == x & 1
2) Use zero/nonzero, and make (bool)x == !!x
3) Forbid casting to bool entirely.

Option 1 matches all other narrowing casts in C, and would be how I'd
expect a "bit" type to work.

Option 2 is how C conditional statements already work, so for any value x,
"if (x)" is the same as "if ((bool)x)".  It's a rule that C programmers
already need to know; they only need to know to *apply* it in this one
extra case.

In fact, it arguably makes things *simpler* to explain, since it at least
gives a name to the magic that C condition expressions are subject to.

Option 3 is attractive, but ends up breaking the analogy to conditional
expressions.  I'd recommend it as a coding style, however.

> And bool is actually really *dangerous* to use if you don't understand
> it. There are people who use "bool", but then because they want to be
> portable, they have a compatibility #ifdef or other configuration
> thing that does something like
>
>   typedef int bool;
>   #define true 1
>   #define false 0
>
> and it will actually work. Most of the time. And then the semantic
> differences from a _real_ C compiler that supports the C99 _Bool/bool
> type are really really subtle.

But *all* of the subtleties arise when casting other types to bool.
If you just avoid that one thing (which it's hopefully obvious won't be
faithfully emulated by a compatibility kludge anyway), it all goes away.

And this rule is itself just a special case of "be very careful with
narrowing casts", which is already common wisdom.

For that kludge, I think a better equivalent would be

typedef enum { false, true } bool;

which at least communicates the idea (again, this is an annoying sutlety
that C programmers *already* have to deal with, so no additional cognitive
effort) that "the compiler might not catch you assigning out-of-range
values, but if you do, demons might fly out of your nose."


Anyway, thanks for sharing your opition.  To me, it just looked like exactly
the sort of code where the bool type was a natural fit.

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
  2013-08-31  3:06 [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount George Spelvin
@ 2013-08-31 17:16 ` Linus Torvalds
  2013-09-01  8:50   ` George Spelvin
  0 siblings, 1 reply; 151+ messages in thread
From: Linus Torvalds @ 2013-08-31 17:16 UTC (permalink / raw)
  To: George Spelvin
  Cc: linux-fsdevel, Linux Kernel Mailing List, Al Viro, Waiman Long

On Fri, Aug 30, 2013 at 8:06 PM, George Spelvin <linux@horizon.com> wrote:
> Just noticing that you are adding several functions that return a boolean
> value as an int.  And a "gotref" local variable.
>
> Is that just not wanting to bother with thse newfangled C99 innovations,
> or do you dislike the "bool" type for some reason?

I don't use "bool" in code I write. I don't think it adds any actual
value, and I think the data type is badly designed and of dubious
value in C. It has very few actual advantages.

That said, it's not like I *hate* the type, and I won't remove bool
from code other people write. I just think it's superfluous and
stupid, and another case of C++ people thinking too much "this is a
cool feature" without then actually doing it well. The C people then
picked it up because it was less onerous than some other C++ features,
and all the compilers had the logic anyway.

If "bool" had real advantages (like having a dense array
representation, for example), that would be one thing. It doesn't.
Sure, now you can take an address of a bool (which you couldn't
generally do efficiently if it really was a bit array), but it also
means that in practice, "bool" is normally nothing but "char" with
some really odd and special implicit type casting rules.

I doubt most people really even understand how "bool" casting works.

And bool is actually really *dangerous* to use if you don't understand
it. There are people who use "bool", but then because they want to be
portable, they have a compatibility #ifdef or other configuration
thing that does something like

   typedef int bool;
   #define true 1
   #define false 0

and it will actually work. Most of the time. And then the semantic
differences from a _real_ C compiler that supports the C99 _Bool/bool
type are really really subtle.

IOW, bool has very few real upsides, and it has a real downside: it's
subtle, and people really never even seem to _realize_ just how subtle
it is.  I suspect that if you ask ten random average C programmers if
the above is equivalent to stdbool.h, nine of them will say "sure".

And they'd be *COMPLETELY* wrong.

So no. I'm definitely not a fan of bool. I think there are better
types, and I think there are better ways to document things.

                     Linus

^ permalink raw reply	[flat|nested] 151+ messages in thread

* Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount
@ 2013-08-31  3:06 George Spelvin
  2013-08-31 17:16 ` Linus Torvalds
  0 siblings, 1 reply; 151+ messages in thread
From: George Spelvin @ 2013-08-31  3:06 UTC (permalink / raw)
  To: torvalds; +Cc: linux, linux-fsdevel, linux-kernel, viro, waiman.long

Just noticing that you are adding several functions that return a boolean
value as an int.  And a "gotref" local variable.

Is that just not wanting to bother with thse newfangled C99 innovations,
or do you dislike the "bool" type for some reason?

Even if it doesn't change the code in the slightest, I like to declare
things with the bool type for documentation.  I can see avoiding code
churn, but this is all new code, so I thought I'd ask.

(FWIW, stdbool.h was in gcc 3.2, which README says is the minimum
supported version, although that's probably outdated information.)

^ permalink raw reply	[flat|nested] 151+ messages in thread

end of thread, other threads:[~2013-09-09  8:30 UTC | newest]

Thread overview: 151+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-06  3:12 [PATCH v7 0/4] Lockless update of reference count protected by spinlock Waiman Long
2013-08-06  3:12 ` [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount Waiman Long
2013-08-29  1:40   ` Linus Torvalds
2013-08-29  4:44     ` Benjamin Herrenschmidt
2013-08-29  7:00       ` Ingo Molnar
2013-08-29 16:43         ` Linus Torvalds
2013-08-29 19:25           ` Linus Torvalds
2013-08-29 23:42             ` Linus Torvalds
2013-08-30  0:26               ` Benjamin Herrenschmidt
2013-08-30  0:49                 ` Linus Torvalds
2013-08-30  2:06                   ` Michael Neuling
2013-08-30  2:30                     ` Benjamin Herrenschmidt
2013-08-30  2:35                       ` Linus Torvalds
2013-08-30  2:45                         ` Benjamin Herrenschmidt
2013-08-30  2:31                     ` Linus Torvalds
2013-08-30  2:43                       ` Benjamin Herrenschmidt
2013-08-30  7:16                   ` Ingo Molnar
2013-08-30 15:28                     ` Linus Torvalds
2013-08-30  3:12               ` Waiman Long
2013-08-30  3:54                 ` Linus Torvalds
2013-08-30  7:55                   ` Sedat Dilek
2013-08-30  8:10                     ` Sedat Dilek
2013-08-30  9:27                     ` Sedat Dilek
2013-08-30  9:48                       ` Ingo Molnar
2013-08-30  9:56                         ` Sedat Dilek
2013-08-30  9:58                           ` Sedat Dilek
2013-08-30 10:29                             ` Sedat Dilek
2013-08-30 10:36                               ` Peter Zijlstra
2013-08-30 10:44                                 ` Sedat Dilek
2013-08-30 10:46                                   ` Sedat Dilek
2013-08-30 10:52                                   ` Peter Zijlstra
2013-08-30 10:57                                     ` Sedat Dilek
2013-08-30 14:05                                       ` Sedat Dilek
2013-08-30 11:19                                 ` Sedat Dilek
2013-08-30 10:38                               ` Sedat Dilek
2013-08-30 15:34                       ` Linus Torvalds
2013-08-30 15:38                         ` Sedat Dilek
2013-08-30 16:12                           ` Steven Rostedt
2013-08-30 16:16                             ` Sedat Dilek
2013-08-30 18:42                             ` Linus Torvalds
2013-08-30 16:32                           ` Linus Torvalds
2013-08-30 16:37                             ` Sedat Dilek
2013-08-30 16:52                               ` Linus Torvalds
2013-08-30 17:11                                 ` Sedat Dilek
2013-08-30 17:26                                   ` Linus Torvalds
2013-09-01 10:01                                 ` Sedat Dilek
2013-09-01 10:33                                   ` Sedat Dilek
2013-09-01 15:32                                   ` Linus Torvalds
2013-09-01 15:45                                     ` Sedat Dilek
2013-09-01 15:55                                       ` Linus Torvalds
2013-09-02 10:30                                         ` Sedat Dilek
2013-09-02 16:09                                           ` David Ahern
2013-09-01 20:59                                     ` Linus Torvalds
2013-09-01 21:23                                       ` Al Viro
2013-09-01 22:16                                         ` Linus Torvalds
2013-09-01 22:35                                           ` Al Viro
2013-09-01 22:44                                             ` Al Viro
2013-09-01 22:58                                               ` Linus Torvalds
2013-09-01 22:48                                           ` Linus Torvalds
2013-09-01 23:30                                             ` Al Viro
2013-09-02  0:12                                               ` Linus Torvalds
2013-09-02  0:50                                                 ` Linus Torvalds
2013-09-02  7:05                                                   ` Ingo Molnar
2013-09-02 16:44                                                     ` Linus Torvalds
2013-09-03 10:15                                                       ` Ingo Molnar
2013-09-03 15:41                                                         ` Linus Torvalds
2013-09-03 18:34                                                           ` Linus Torvalds
2013-09-03 19:19                                                             ` Ingo Molnar
2013-09-03 21:05                                                               ` Linus Torvalds
2013-09-03 21:13                                                                 ` Linus Torvalds
2013-09-03 21:34                                                                   ` Linus Torvalds
2013-09-03 21:39                                                                     ` Linus Torvalds
2013-09-03 14:08                                                       ` Pavel Machek
2013-09-03 22:37                                     ` Sedat Dilek
2013-09-03 22:55                                       ` Dave Jones
2013-09-03 23:05                                         ` Sedat Dilek
2013-09-03 23:15                                           ` Dave Jones
2013-09-03 23:20                                             ` Sedat Dilek
2013-09-03 23:45                                       ` Sedat Dilek
2013-08-30 18:33                   ` Waiman Long
2013-08-30 18:53                     ` Linus Torvalds
2013-08-30 19:20                       ` Waiman Long
2013-08-30 19:33                         ` Linus Torvalds
2013-08-30 20:15                           ` Waiman Long
2013-08-30 20:43                             ` Linus Torvalds
2013-08-30 20:54                               ` Al Viro
2013-08-30 21:03                                 ` Linus Torvalds
2013-08-30 21:44                                   ` Al Viro
2013-08-30 22:30                                     ` Linus Torvalds
2013-08-31 21:23                                       ` Al Viro
2013-08-31 22:49                                         ` Linus Torvalds
2013-08-31 23:27                                           ` Al Viro
2013-09-01  0:13                                             ` Al Viro
2013-09-01 17:48                                               ` Al Viro
2013-09-09  8:30                                               ` Peter Zijlstra
2013-08-30 21:10                                 ` Waiman Long
2013-08-30 21:22                                   ` Linus Torvalds
2013-08-30 21:30                                   ` Al Viro
2013-08-30 21:42                                     ` Waiman Long
2013-08-30 19:40                         ` Al Viro
2013-08-30 19:52                           ` Waiman Long
2013-08-30 20:26                             ` Al Viro
2013-08-30 20:35                               ` Waiman Long
2013-08-30 20:48                                 ` Al Viro
2013-08-31  2:02                                   ` Waiman Long
2013-08-31  2:35                                     ` Al Viro
2013-08-31  2:42                                       ` Al Viro
2013-09-02 19:25                                         ` Waiman Long
2013-09-03  6:01                                           ` Ingo Molnar
2013-09-03  7:24                                             ` Sedat Dilek
2013-09-03 15:38                                               ` Linus Torvalds
2013-09-03 15:14                                             ` Waiman Long
2013-09-03 15:34                                               ` Linus Torvalds
2013-09-03 19:09                                                 ` Linus Torvalds
2013-09-03 21:01                                                   ` Waiman Long
2013-09-04 14:52                                                   ` Waiman Long
2013-09-04 15:14                                                     ` Linus Torvalds
2013-09-04 19:25                                                       ` Waiman Long
2013-09-04 21:34                                                         ` Linus Torvalds
2013-09-05  2:35                                                           ` Waiman Long
2013-09-05 13:31                                                     ` Ingo Molnar
2013-09-05 17:33                                                       ` Waiman Long
2013-09-05 17:40                                                         ` Ingo Molnar
2013-09-03 22:41                                               ` Sedat Dilek
2013-09-03 23:11                                                 ` Sedat Dilek
2013-09-08 21:45               ` Linus Torvalds
2013-09-09  0:03                 ` Al Viro
2013-09-09  0:25                   ` Linus Torvalds
2013-09-09  0:35                     ` Al Viro
2013-09-09  0:38                       ` Linus Torvalds
2013-09-09  0:57                         ` Al Viro
2013-09-09  2:09                     ` Ramkumar Ramachandra
2013-09-09  0:30                   ` Al Viro
2013-09-09  3:32                   ` Linus Torvalds
2013-09-09  4:06                     ` Ramkumar Ramachandra
2013-09-09  5:44                     ` Al Viro
2013-08-30 17:17           ` Peter Zijlstra
2013-08-30 17:28             ` Linus Torvalds
2013-08-30 17:33               ` Linus Torvalds
2013-08-29 15:20     ` Waiman Long
2013-08-06  3:12 ` [PATCH v7 2/4] spinlock: Enable x86 architecture to do lockless refcount update Waiman Long
2013-08-06  3:12 ` [PATCH v7 3/4] dcache: replace d_lock/d_count by d_lockcnt Waiman Long
2013-08-06  3:12 ` [PATCH v7 4/4] dcache: Enable lockless update of dentry's refcount Waiman Long
2013-08-13 18:03 ` [PATCH v7 0/4] Lockless update of reference count protected by spinlock Waiman Long
2013-08-31  3:06 [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount George Spelvin
2013-08-31 17:16 ` Linus Torvalds
2013-09-01  8:50   ` George Spelvin
2013-09-01 11:10     ` Theodore Ts'o
2013-09-01 15:49       ` Linus Torvalds
2013-09-01 18:11         ` Steven Rostedt
2013-09-01 20:03           ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).