LKML Archive on
 help / color / Atom feed
From: Davidlohr Bueso <>
	Davidlohr Bueso <>
Subject: [PATCH] sched: Drop try_get_task_struct()
Date: Wed, 14 Jun 2017 19:37:30 -0700
Message-ID: <> (raw)

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 <>
Signed-off-by: Davidlohr Bueso <>
 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);
 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)
-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  Orphaned process groups are not to be affected

             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-15  2:37 Davidlohr Bueso [this message]
2017-06-20 13:27 ` [tip:sched/core] sched/core: Drop the unused try_get_task_struct() helper function tip-bot for Davidlohr Bueso

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git
	git clone --mirror lkml/git/8.git
	git clone --mirror lkml/git/9.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone