- de_thread-use-tsk-not-current.patch removed from -mm tree

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

 



The patch titled

     de_thread: Use tsk not current

has been removed from the -mm tree.  Its filename is

     de_thread-use-tsk-not-current.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
Subject: de_thread: Use tsk not current
From: Eric W. Biederman <ebiederm@xxxxxxxxxxxx>

Ingo Oeser pointed out that because current expands to an inline function
it is more space efficient and somewhat faster to simply keep a cached copy
of current in another variable.  This patch implements that for the
de_thread function.

(akpm: saves nearly 100 bytes of text on x86)

Signed-off-by: Eric W. Biederman <ebiederm@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/exec.c |   46 +++++++++++++++++++++++-----------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff -puN fs/exec.c~de_thread-use-tsk-not-current fs/exec.c
--- a/fs/exec.c~de_thread-use-tsk-not-current
+++ a/fs/exec.c
@@ -595,7 +595,7 @@ static int de_thread(struct task_struct 
 	if (!newsighand)
 		return -ENOMEM;
 
-	if (thread_group_empty(current))
+	if (thread_group_empty(tsk))
 		goto no_thread_group;
 
 	/*
@@ -620,17 +620,17 @@ static int de_thread(struct task_struct 
 	 * Reparenting needs write_lock on tasklist_lock,
 	 * so it is safe to do it under read_lock.
 	 */
-	if (unlikely(current->group_leader == child_reaper))
-		child_reaper = current;
+	if (unlikely(tsk->group_leader == child_reaper))
+		child_reaper = tsk;
 
-	zap_other_threads(current);
+	zap_other_threads(tsk);
 	read_unlock(&tasklist_lock);
 
 	/*
 	 * Account for the thread group leader hanging around:
 	 */
 	count = 1;
-	if (!thread_group_leader(current)) {
+	if (!thread_group_leader(tsk)) {
 		count = 2;
 		/*
 		 * The SIGALRM timer survives the exec, but needs to point
@@ -639,14 +639,14 @@ static int de_thread(struct task_struct 
 		 * synchronize with any firing (by calling del_timer_sync)
 		 * before we can safely let the old group leader die.
 		 */
-		sig->tsk = current;
+		sig->tsk = tsk;
 		spin_unlock_irq(lock);
 		if (hrtimer_cancel(&sig->real_timer))
 			hrtimer_restart(&sig->real_timer);
 		spin_lock_irq(lock);
 	}
 	while (atomic_read(&sig->count) > count) {
-		sig->group_exit_task = current;
+		sig->group_exit_task = tsk;
 		sig->notify_count = count;
 		__set_current_state(TASK_UNINTERRUPTIBLE);
 		spin_unlock_irq(lock);
@@ -662,13 +662,13 @@ static int de_thread(struct task_struct 
 	 * do is to wait for the thread group leader to become inactive,
 	 * and to assume its PID:
 	 */
-	if (!thread_group_leader(current)) {
+	if (!thread_group_leader(tsk)) {
 		/*
 		 * Wait for the thread group leader to be a zombie.
 		 * It should already be zombie at this point, most
 		 * of the time.
 		 */
-		leader = current->group_leader;
+		leader = tsk->group_leader;
 		while (leader->exit_state != EXIT_ZOMBIE)
 			yield();
 
@@ -682,12 +682,12 @@ static int de_thread(struct task_struct 
 		 * When we take on its identity by switching to its PID, we
 		 * also take its birthdate (always earlier than our own).
 		 */
-		current->start_time = leader->start_time;
+		tsk->start_time = leader->start_time;
 
 		write_lock_irq(&tasklist_lock);
 
-		BUG_ON(leader->tgid != current->tgid);
-		BUG_ON(current->pid == current->tgid);
+		BUG_ON(leader->tgid != tsk->tgid);
+		BUG_ON(tsk->pid == tsk->tgid);
 		/*
 		 * An exec() starts a new thread group with the
 		 * TGID of the previous thread group. Rehash the
@@ -700,17 +700,17 @@ static int de_thread(struct task_struct 
 		 * Note: The old leader also uses this pid until release_task
 		 *       is called.  Odd but simple and correct.
 		 */
-		detach_pid(current, PIDTYPE_PID);
-		current->pid = leader->pid;
-		attach_pid(current, PIDTYPE_PID,  current->pid);
-		transfer_pid(leader, current, PIDTYPE_PGID);
-		transfer_pid(leader, current, PIDTYPE_SID);
-		list_replace_rcu(&leader->tasks, &current->tasks);
+		detach_pid(tsk, PIDTYPE_PID);
+		tsk->pid = leader->pid;
+		attach_pid(tsk, PIDTYPE_PID,  tsk->pid);
+		transfer_pid(leader, tsk, PIDTYPE_PGID);
+		transfer_pid(leader, tsk, PIDTYPE_SID);
+		list_replace_rcu(&leader->tasks, &tsk->tasks);
 
-		current->group_leader = current;
-		leader->group_leader = current;
+		tsk->group_leader = tsk;
+		leader->group_leader = tsk;
 
-		current->exit_signal = SIGCHLD;
+		tsk->exit_signal = SIGCHLD;
 
 		BUG_ON(leader->exit_state != EXIT_ZOMBIE);
 		leader->exit_state = EXIT_DEAD;
@@ -750,7 +750,7 @@ no_thread_group:
 		spin_lock(&oldsighand->siglock);
 		spin_lock_nested(&newsighand->siglock, SINGLE_DEPTH_NESTING);
 
-		rcu_assign_pointer(current->sighand, newsighand);
+		rcu_assign_pointer(tsk->sighand, newsighand);
 		recalc_sigpending();
 
 		spin_unlock(&newsighand->siglock);
@@ -761,7 +761,7 @@ no_thread_group:
 			kmem_cache_free(sighand_cachep, oldsighand);
 	}
 
-	BUG_ON(!thread_group_leader(current));
+	BUG_ON(!thread_group_leader(tsk));
 	return 0;
 }
 	
_

Patches currently in -mm which might be from ebiederm@xxxxxxxxxxxx are

origin.patch
git-scsi-misc.patch
fix-conflict-with-the-is_init-identifier-on-parisc.patch
pidspace-is_init.patch
simplify-update_times-avoid-jiffies-jiffies_64-aliasing-problem-2.patch
kexec-warning-fix.patch
kill-extraneous-printk-in-kernel_restart.patch
fix-mem_write-return-value.patch
kcore-elf-note-namesz-field-fix.patch
stack-overflow-safe-kdump-safe_smp_processor_id.patch
stack-overflow-safe-kdump-safe_smp_processor_id_voyager.patch
stack-overflow-safe-kdump-crash_use_safe_smp_processor_id.patch
stack-overflow-safe-kdump-crash_use_safe_smp_processor_id-fix.patch
stack-overflow-safe-kdump-safe_smp_send_nmi_allbutself.patch
proc-readdir-race-fix-take-3.patch
proc-readdir-race-fix-take-3-race-fix.patch
proc-reorder-the-functions-in-basec.patch
proc-modify-proc_pident_lookup-to-be-completely-table-driven.patch
proc-give-the-root-directory-a-task.patch
pid-implement-access-helpers-for-a-tacks-various-process-groups.patch
pid-add-do_each_pid_task.patch
pid-implement-signal-functions-that-take-a-struct-pid.patch
pid-export-the-symbols-needed-to-use-struct-pid.patch
pid-implement-pid_nr.patch
vt-rework-the-console-spawning-variables.patch
vt-make-vt_pid-a-struct-pid-making-it-pid-wrap-around-safe.patch
file-modify-struct-fown_struct-to-use-a-struct-pid.patch
file-modify-struct-fown_struct-to-use-a-struct-pid-fix.patch
pids-coding-style-use-struct-pidmap.patch
proc-readdir-race-fix-take-3-fix-1.patch
simplify-pid-iterators.patch
move-pidmap-to-pspaceh.patch
move-pidmap-to-pspaceh-fix.patch
define-struct-pspace.patch
proc-readdir-race-fix-take-3-fix-2.patch
update-mq_notify-to-use-a-struct-pid.patch
file-add-locking-to-f_getown.patch
usb-fixup-usb-so-it-uses-struct-pid.patch
s390-update-fs3270-to-use-a-struct-pid.patch
proc-sysctl-add-_proc_do_string-helper.patch
namespaces-add-nsproxy.patch
namespaces-add-nsproxy-move-init_nsproxy-into-kernel-nsproxyc.patch
namespaces-incorporate-fs-namespace-into-nsproxy.patch
namespaces-incorporate-fs-namespace-into-nsproxy-whitespace.patch
namespaces-exit_task_namespaces-invalidates-nsproxy.patch
namespaces-utsname-introduce-temporary-helpers.patch
namespaces-utsname-switch-to-using-uts-namespaces.patch
namespaces-utsname-switch-to-using-uts-namespaces-klibc-bit.patch
namespaces-utsname-use-init_utsname-when-appropriate-klibc-bit.patch
namespaces-utsname-switch-to-using-uts-namespaces-klibc-bit-2.patch
namespaces-utsname-use-init_utsname-when-appropriate.patch
namespaces-utsname-implement-utsname-namespaces.patch
namespaces-utsname-sysctl-hack.patch
namespaces-utsname-remove-system_utsname.patch
namespaces-utsname-implement-clone_newuts-flag.patch
namespaces-utsname-implement-clone_newuts-flag-fix.patch
uts-copy-nsproxy-only-when-needed.patch
ipc-namespace-core.patch
ipc-namespace-utils.patch
proc-make-the-generation-of-the-self-symlink-table-driven.patch
proc-factor-out-an-instantiate-method-from-every-lookup-method.patch
proc-remove-the-hard-coded-inode-numbers.patch
proc-merge-proc_tid_attr-and-proc_tgid_attr.patch
proc-use-pid_task-instead-of-open-coding-it.patch
proc-convert-task_sig-to-use-lock_task_sighand.patch
proc-convert-do_task_stat-to-use-lock_task_sighand.patch
proc-drop-tasklist-lock-in-task_state.patch
proc-properly-compute-tgid_offset.patch
proc-remove-trailing-blank-entry-from-pid_entry-arrays.patch
proc-remove-the-useless-smp-safe-comments-from-proc.patch
proc-comment-what-proc_fill_cache-does.patch
introduce-get_task_pid-to-fix-unsafe-get_pid.patch
replace-cad_pid-by-a-struct-pid.patch
replace-cad_pid-by-a-struct-pid-fixes.patch
genirq-msi-restore-__do_irq-compat-logic-temporarily.patch
genirq-irq-convert-the-move_irq-flag-from-a-32bit-word-to-a-single-bit.patch
genirq-irq-add-moved_masked_irq.patch
genirq-x86_64-irq-reenable-migrating-irqs-to-other-cpus.patch
genirq-msi-simplify-msi-enable-and-disable.patch
genirq-msi-make-the-msi-boolean-tests-return-either-0-or-1.patch
genirq-msi-implement-helper-functions-read_msi_msg-and-write_msi_msg.patch
genirq-msi-refactor-the-msi_ops.patch
genirq-msi-simplify-the-msi-irq-limit-policy.patch
genirq-irq-add-a-dynamic-irq-creation-api.patch
genirq-ia64-irq-dynamic-irq-support.patch
genirq-i386-irq-dynamic-irq-support.patch
genirq-x86_64-irq-dynamic-irq-support.patch
genirq-msi-make-the-msi-code-irq-based-and-not-vector-based.patch
genirq-x86_64-irq-move-msi-message-composition-into-io_apicc.patch
genirq-i386-irq-move-msi-message-composition-into-io_apicc.patch
genirq-msi-only-build-msi-apicc-on-ia64.patch
genirq-msi-only-build-msi-apicc-on-ia64-fix.patch
genirq-x86_64-irq-remove-the-msi-assumption-that-irq-==-vector.patch
genirq-i386-irq-remove-the-msi-assumption-that-irq-==-vector.patch
genirq-irq-remove-msi-hacks.patch
genirq-irq-generalize-the-check-for-hardirq_bits.patch
genirq-x86_64-irq-make-the-external-irq-handlers-report-their-vector-not-the-irq-number.patch
genirq-x86_64-irq-make-vector_irq-per-cpu.patch
genirq-x86_64-irq-make-vector_irq-per-cpu-fix.patch
genirq-x86_64-irq-make-vector_irq-per-cpu-warning-fix.patch
genirq-x86_64-irq-kill-gsi_irq_sharing.patch
genirq-x86_64-irq-kill-irq-compression.patch
add-hypertransport-capability-defines.patch
add-hypertransport-capability-defines-fix.patch
initial-generic-hypertransport-interrupt-support.patch
initial-generic-hypertransport-interrupt-support-Kconfig-fix.patch
pidhash-temporary-debug-checks.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux