* [PATCH] sched: Drop try_get_task_struct()
@ 2017-06-15 2:37 Davidlohr Bueso
2017-06-20 13:27 ` [tip:sched/core] sched/core: Drop the unused try_get_task_struct() helper function tip-bot for Davidlohr Bueso
0 siblings, 1 reply; 2+ messages in thread
From: Davidlohr Bueso @ 2017-06-15 2:37 UTC (permalink / raw)
To: mingo, peterz; +Cc: oleg, linux-kernel, dave, Davidlohr Bueso
This function was introduced by 150593b (sched/api: Introduce
task_rcu_dereference() and try_get_task_struct()), to allow
easier usage of task_rcu_dereference(), however no users
were ever added. Drop the helper.
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
---
include/linux/sched/task.h | 2 --
kernel/exit.c | 13 -------------
2 files changed, 15 deletions(-)
diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h
index a978d7189cfd..f0f065c5afcf 100644
--- a/include/linux/sched/task.h
+++ b/include/linux/sched/task.h
@@ -95,8 +95,6 @@ static inline void put_task_struct(struct task_struct *t)
}
struct task_struct *task_rcu_dereference(struct task_struct **ptask);
-struct task_struct *try_get_task_struct(struct task_struct **ptask);
-
#ifdef CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT
extern int arch_task_struct_size __read_mostly;
diff --git a/kernel/exit.c b/kernel/exit.c
index d0a34e1e4ec1..0479eb8b4985 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -317,19 +317,6 @@ void rcuwait_wake_up(struct rcuwait *w)
rcu_read_unlock();
}
-struct task_struct *try_get_task_struct(struct task_struct **ptask)
-{
- struct task_struct *task;
-
- rcu_read_lock();
- task = task_rcu_dereference(ptask);
- if (task)
- get_task_struct(task);
- rcu_read_unlock();
-
- return task;
-}
-
/*
* Determine if a process group is "orphaned", according to the POSIX
* definition in 2.2.2.52. Orphaned process groups are not to be affected
--
2.12.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [tip:sched/core] sched/core: Drop the unused try_get_task_struct() helper function
2017-06-15 2:37 [PATCH] sched: Drop try_get_task_struct() Davidlohr Bueso
@ 2017-06-20 13:27 ` tip-bot for Davidlohr Bueso
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Davidlohr Bueso @ 2017-06-20 13:27 UTC (permalink / raw)
To: linux-tip-commits
Cc: torvalds, dave, oleg, linux-kernel, tglx, dbueso, mingo, peterz, hpa
Commit-ID: f11cc0760b8397e0d230122606421b6a96e9f869
Gitweb: http://git.kernel.org/tip/f11cc0760b8397e0d230122606421b6a96e9f869
Author: Davidlohr Bueso <dave@stgolabs.net>
AuthorDate: Wed, 14 Jun 2017 19:37:30 -0700
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 20 Jun 2017 12:48:37 +0200
sched/core: Drop the unused try_get_task_struct() helper function
This function was introduced by:
150593bf8693 ("sched/api: Introduce task_rcu_dereference() and try_get_task_struct()")
... to allow easier usage of task_rcu_dereference(), however no users
were ever added. Drop the helper.
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: dave@stgolabs.net
Link: http://lkml.kernel.org/r/20170615023730.22827-1-dave@stgolabs.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
include/linux/sched/task.h | 2 --
kernel/exit.c | 13 -------------
2 files changed, 15 deletions(-)
diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h
index a978d71..f0f065c 100644
--- a/include/linux/sched/task.h
+++ b/include/linux/sched/task.h
@@ -95,8 +95,6 @@ static inline void put_task_struct(struct task_struct *t)
}
struct task_struct *task_rcu_dereference(struct task_struct **ptask);
-struct task_struct *try_get_task_struct(struct task_struct **ptask);
-
#ifdef CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT
extern int arch_task_struct_size __read_mostly;
diff --git a/kernel/exit.c b/kernel/exit.c
index 7d69443..c632262 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -318,19 +318,6 @@ void rcuwait_wake_up(struct rcuwait *w)
rcu_read_unlock();
}
-struct task_struct *try_get_task_struct(struct task_struct **ptask)
-{
- struct task_struct *task;
-
- rcu_read_lock();
- task = task_rcu_dereference(ptask);
- if (task)
- get_task_struct(task);
- rcu_read_unlock();
-
- return task;
-}
-
/*
* Determine if a process group is "orphaned", according to the POSIX
* definition in 2.2.2.52. Orphaned process groups are not to be affected
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-20 13:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-15 2:37 [PATCH] sched: Drop try_get_task_struct() Davidlohr Bueso
2017-06-20 13:27 ` [tip:sched/core] sched/core: Drop the unused try_get_task_struct() helper function tip-bot for Davidlohr Bueso
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).