From: Kirill Tkhai <ktkhai@virtuozzo.com>
To: akpm@linux-foundation.org, gregkh@linuxfoundation.org,
rafael@kernel.org, viro@zeniv.linux.org.uk,
darrick.wong@oracle.com, paulmck@linux.vnet.ibm.com,
josh@joshtriplett.org, rostedt@goodmis.org,
mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com,
hughd@google.com, shuah@kernel.org, robh@kernel.org,
ulf.hansson@linaro.org, aspriel@gmail.com,
vivek.gautam@codeaurora.org, robin.murphy@arm.com,
joe@perches.com, heikki.krogerus@linux.intel.com,
ktkhai@virtuozzo.com, sfr@canb.auug.org.au,
vdavydov.dev@gmail.com, mhocko@suse.com,
chris@chris-wilson.co.uk, penguin-kernel@I-love.SAKURA.ne.jp,
aryabinin@virtuozzo.com, willy@infradead.org,
ying.huang@intel.com, shakeelb@google.com, jbacik@fb.com,
mingo@kernel.org, mhiramat@kernel.org,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-mm@kvack.org
Subject: [PATCH RFC 01/10] rcu: Make CONFIG_SRCU unconditionally enabled
Date: Tue, 07 Aug 2018 18:37:36 +0300 [thread overview]
Message-ID: <153365625652.19074.8434946780002619802.stgit@localhost.localdomain> (raw)
In-Reply-To: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain>
This patch kills all CONFIG_SRCU defines and
the code under !CONFIG_SRCU.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
drivers/base/core.c | 42 --------------------
include/linux/device.h | 2 -
include/linux/rcutiny.h | 4 --
include/linux/srcu.h | 5 --
kernel/notifier.c | 3 -
kernel/rcu/Kconfig | 12 +-----
kernel/rcu/tree.h | 5 --
kernel/rcu/update.c | 4 --
.../selftests/rcutorture/doc/TREE_RCU-kconfig.txt | 5 --
9 files changed, 3 insertions(+), 79 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 04bbcd779e11..8483da53c88f 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -44,7 +44,6 @@ early_param("sysfs.deprecated", sysfs_deprecated_setup);
/* Device links support. */
-#ifdef CONFIG_SRCU
static DEFINE_MUTEX(device_links_lock);
DEFINE_STATIC_SRCU(device_links_srcu);
@@ -67,30 +66,6 @@ void device_links_read_unlock(int idx)
{
srcu_read_unlock(&device_links_srcu, idx);
}
-#else /* !CONFIG_SRCU */
-static DECLARE_RWSEM(device_links_lock);
-
-static inline void device_links_write_lock(void)
-{
- down_write(&device_links_lock);
-}
-
-static inline void device_links_write_unlock(void)
-{
- up_write(&device_links_lock);
-}
-
-int device_links_read_lock(void)
-{
- down_read(&device_links_lock);
- return 0;
-}
-
-void device_links_read_unlock(int not_used)
-{
- up_read(&device_links_lock);
-}
-#endif /* !CONFIG_SRCU */
/**
* device_is_dependent - Check if one device depends on another one
@@ -317,7 +292,6 @@ static void device_link_free(struct device_link *link)
kfree(link);
}
-#ifdef CONFIG_SRCU
static void __device_link_free_srcu(struct rcu_head *rhead)
{
device_link_free(container_of(rhead, struct device_link, rcu_head));
@@ -337,22 +311,6 @@ static void __device_link_del(struct kref *kref)
list_del_rcu(&link->c_node);
call_srcu(&device_links_srcu, &link->rcu_head, __device_link_free_srcu);
}
-#else /* !CONFIG_SRCU */
-static void __device_link_del(struct kref *kref)
-{
- struct device_link *link = container_of(kref, struct device_link, kref);
-
- dev_info(link->consumer, "Dropping the link to %s\n",
- dev_name(link->supplier));
-
- if (link->flags & DL_FLAG_PM_RUNTIME)
- pm_runtime_drop_link(link->consumer);
-
- list_del(&link->s_node);
- list_del(&link->c_node);
- device_link_free(link);
-}
-#endif /* !CONFIG_SRCU */
/**
* device_link_del - Delete a link between two devices.
diff --git a/include/linux/device.h b/include/linux/device.h
index 8f882549edee..524dc17d67be 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -827,9 +827,7 @@ struct device_link {
u32 flags;
bool rpm_active;
struct kref kref;
-#ifdef CONFIG_SRCU
struct rcu_head rcu_head;
-#endif
};
/**
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index 8d9a0ea8f0b5..63e2b6f2e94a 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -115,11 +115,7 @@ static inline void rcu_irq_exit_irqson(void) { }
static inline void rcu_irq_enter_irqson(void) { }
static inline void rcu_irq_exit(void) { }
static inline void exit_rcu(void) { }
-#ifdef CONFIG_SRCU
void rcu_scheduler_starting(void);
-#else /* #ifndef CONFIG_SRCU */
-static inline void rcu_scheduler_starting(void) { }
-#endif /* #else #ifndef CONFIG_SRCU */
static inline void rcu_end_inkernel_boot(void) { }
static inline bool rcu_is_watching(void) { return true; }
diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index 3e72a291c401..27238223a78e 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -60,11 +60,8 @@ int init_srcu_struct(struct srcu_struct *sp);
#include <linux/srcutiny.h>
#elif defined(CONFIG_TREE_SRCU)
#include <linux/srcutree.h>
-#elif defined(CONFIG_SRCU)
-#error "Unknown SRCU implementation specified to kernel configuration"
#else
-/* Dummy definition for things like notifiers. Actual use gets link error. */
-struct srcu_struct { };
+#error "Unknown SRCU implementation specified to kernel configuration"
#endif
void call_srcu(struct srcu_struct *sp, struct rcu_head *head,
diff --git a/kernel/notifier.c b/kernel/notifier.c
index 6196af8a8223..6e4b55e74736 100644
--- a/kernel/notifier.c
+++ b/kernel/notifier.c
@@ -402,7 +402,6 @@ int raw_notifier_call_chain(struct raw_notifier_head *nh,
}
EXPORT_SYMBOL_GPL(raw_notifier_call_chain);
-#ifdef CONFIG_SRCU
/*
* SRCU notifier chain routines. Registration and unregistration
* use a mutex, and call_chain is synchronized by SRCU (no locks).
@@ -529,8 +528,6 @@ void srcu_init_notifier_head(struct srcu_notifier_head *nh)
}
EXPORT_SYMBOL_GPL(srcu_init_notifier_head);
-#endif /* CONFIG_SRCU */
-
static ATOMIC_NOTIFIER_HEAD(die_chain);
int notrace notify_die(enum die_val val, const char *str,
diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig
index 9210379c0353..f52e55e33f0a 100644
--- a/kernel/rcu/Kconfig
+++ b/kernel/rcu/Kconfig
@@ -49,28 +49,20 @@ config RCU_EXPERT
Say N if you are unsure.
-config SRCU
- bool
- help
- This option selects the sleepable version of RCU. This version
- permits arbitrary sleeping or blocking within RCU read-side critical
- sections.
-
config TINY_SRCU
bool
- default y if SRCU && TINY_RCU
+ default y if TINY_RCU
help
This option selects the single-CPU non-preemptible version of SRCU.
config TREE_SRCU
bool
- default y if SRCU && !TINY_RCU
+ default y if !TINY_RCU
help
This option selects the full-fledged version of SRCU.
config TASKS_RCU
def_bool PREEMPT
- select SRCU
help
This option enables a task-based RCU implementation that uses
only voluntary context switch (not preemption!), idle, and
diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h
index 4e74df768c57..b7f76400a45e 100644
--- a/kernel/rcu/tree.h
+++ b/kernel/rcu/tree.h
@@ -489,12 +489,7 @@ static bool rcu_nohz_full_cpu(struct rcu_state *rsp);
static void rcu_dynticks_task_enter(void);
static void rcu_dynticks_task_exit(void);
-#ifdef CONFIG_SRCU
void srcu_online_cpu(unsigned int cpu);
void srcu_offline_cpu(unsigned int cpu);
-#else /* #ifdef CONFIG_SRCU */
-void srcu_online_cpu(unsigned int cpu) { }
-void srcu_offline_cpu(unsigned int cpu) { }
-#endif /* #else #ifdef CONFIG_SRCU */
#endif /* #ifndef RCU_TREE_NONCORE */
diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c
index 39cb23d22109..90de81c98524 100644
--- a/kernel/rcu/update.c
+++ b/kernel/rcu/update.c
@@ -210,8 +210,6 @@ void rcu_test_sync_prims(void)
synchronize_sched_expedited();
}
-#if !defined(CONFIG_TINY_RCU) || defined(CONFIG_SRCU)
-
/*
* Switch to run-time mode once RCU has fully initialized.
*/
@@ -224,8 +222,6 @@ static int __init rcu_set_runtime_mode(void)
}
core_initcall(rcu_set_runtime_mode);
-#endif /* #if !defined(CONFIG_TINY_RCU) || defined(CONFIG_SRCU) */
-
#ifdef CONFIG_DEBUG_LOCK_ALLOC
static struct lock_class_key rcu_lock_key;
struct lockdep_map rcu_lock_map =
diff --git a/tools/testing/selftests/rcutorture/doc/TREE_RCU-kconfig.txt b/tools/testing/selftests/rcutorture/doc/TREE_RCU-kconfig.txt
index af6fca03602f..b4f015c3244a 100644
--- a/tools/testing/selftests/rcutorture/doc/TREE_RCU-kconfig.txt
+++ b/tools/testing/selftests/rcutorture/doc/TREE_RCU-kconfig.txt
@@ -73,9 +73,4 @@ CONFIG_TASKS_RCU
These are controlled by CONFIG_PREEMPT and/or CONFIG_SMP.
-CONFIG_SRCU
-
- Selected by CONFIG_RCU_TORTURE_TEST, so cannot disable.
-
-
boot parameters ignored: TBD
next prev parent reply other threads:[~2018-08-07 15:37 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-07 15:37 [PATCH RFC 00/10] Introduce lockless shrink_slab() Kirill Tkhai
2018-08-07 15:37 ` Kirill Tkhai [this message]
2018-08-08 0:55 ` [PATCH RFC 01/10] rcu: Make CONFIG_SRCU unconditionally enabled Steven Rostedt
2018-08-08 1:05 ` Stephen Rothwell
2018-08-08 9:46 ` Kirill Tkhai
2018-08-08 1:08 ` Stephen Rothwell
2018-08-08 9:59 ` Kirill Tkhai
2018-08-08 11:04 ` Stephen Rothwell
2018-08-08 7:20 ` Michal Hocko
2018-08-08 10:17 ` Kirill Tkhai
2018-08-08 10:27 ` Michal Hocko
2018-08-08 21:31 ` Dave Chinner
2018-08-09 0:07 ` Matthew Wilcox
2018-08-09 7:45 ` Greg KH
2018-08-09 10:22 ` Kirill Tkhai
2018-08-08 16:13 ` Josh Triplett
2018-08-08 16:23 ` Kirill Tkhai
2018-08-08 16:30 ` Kirill Tkhai
2018-08-08 18:01 ` Josh Triplett
2018-08-08 23:02 ` Shakeel Butt
2018-08-08 23:09 ` Josh Triplett
2018-08-07 15:37 ` [PATCH RFC 02/10] mm: Make shrink_slab() lockless Kirill Tkhai
2018-08-08 11:51 ` Kirill Tkhai
2018-08-08 12:36 ` Tetsuo Handa
2018-08-08 12:51 ` Kirill Tkhai
2018-08-08 13:20 ` [PATCH RFC v2 " Kirill Tkhai
2018-08-09 7:14 ` Michal Hocko
2018-08-09 9:21 ` Kirill Tkhai
2018-08-09 10:37 ` Tetsuo Handa
2018-08-09 10:58 ` Kirill Tkhai
2018-08-09 11:23 ` Kirill Tkhai
2018-08-07 15:38 ` [PATCH RFC 03/10] mm: Convert shrinker_rwsem to mutex Kirill Tkhai
2018-08-07 15:38 ` [PATCH RFC 04/10] mm: Split unregister_shrinker() Kirill Tkhai
2018-08-07 15:38 ` [PATCH RFC 05/10] fs: Move list_lru_destroy() to destroy_super_work() Kirill Tkhai
2018-08-07 15:38 ` [PATCH RFC 06/10] fs: Shrink only (SB_ACTIVE|SB_BORN) superblocks in super_cache_scan() Kirill Tkhai
2018-08-07 15:38 ` [PATCH RFC 07/10] fs: Introduce struct super_operations::destroy_super() callback Kirill Tkhai
2018-08-07 15:39 ` [PATCH RFC 08/10] xfs: Introduce xfs_fs_destroy_super() Kirill Tkhai
2018-08-07 15:39 ` [PATCH RFC 09/10] shmem: Implement shmem_destroy_super() Kirill Tkhai
2018-08-07 15:39 ` [PATCH RFC 10/10] fs: Use unregister_shrinker_delayed_{initiate, finalize} for super_block shrinker Kirill Tkhai
2018-08-08 1:12 ` [PATCH RFC 00/10] Introduce lockless shrink_slab() Stephen Rothwell
2018-08-08 5:39 ` Shakeel Butt
2018-08-08 10:18 ` Kirill Tkhai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=153365625652.19074.8434946780002619802.stgit@localhost.localdomain \
--to=ktkhai@virtuozzo.com \
--cc=akpm@linux-foundation.org \
--cc=aryabinin@virtuozzo.com \
--cc=aspriel@gmail.com \
--cc=chris@chris-wilson.co.uk \
--cc=darrick.wong@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=hughd@google.com \
--cc=jbacik@fb.com \
--cc=jiangshanlai@gmail.com \
--cc=joe@perches.com \
--cc=josh@joshtriplett.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=mhocko@suse.com \
--cc=mingo@kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=robin.murphy@arm.com \
--cc=rostedt@goodmis.org \
--cc=sfr@canb.auug.org.au \
--cc=shakeelb@google.com \
--cc=shuah@kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=vdavydov.dev@gmail.com \
--cc=viro@zeniv.linux.org.uk \
--cc=vivek.gautam@codeaurora.org \
--cc=willy@infradead.org \
--cc=ying.huang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).