[Devel] [PATCH RHEL7 COMMIT] fairsched: Port diff-fairsched-optimize-sys_fairsched_mvpr

Konstantin Khorenko khorenko at virtuozzo.com
Fri May 29 04:49:38 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.7
------>
commit 901bf5dd708537e483a90ebcf62af57239e63702
Author: Vladimir Davydov <vdavydov at parallels.com>
Date:   Fri May 29 15:49:38 2015 +0400

    fairsched: Port diff-fairsched-optimize-sys_fairsched_mvpr
    
    Author: Konstantin Khlebnikov
    Email: khlebnikov at openvz.org
    Subject: fairsched: optimize sys_fairsched_mvpr()
    Date: Wed, 08 May 2013 13:59:04 +0400
    
    Remove task_list_lock and optimize for current.
    
    https://jira.sw.ru/browse/PCLIN-26766
    
    Signed-off-by: Konstantin Khlebnikov <khlebnikov at openvz.org>
    
    =============================================================================
    
    Related to https://jira.sw.ru/browse/PSBM-33642
    
    Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 kernel/fairsched.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/kernel/fairsched.c b/kernel/fairsched.c
index 3879f8e..40d3eff 100644
--- a/kernel/fairsched.c
+++ b/kernel/fairsched.c
@@ -243,16 +243,17 @@ SYSCALL_DEFINE2(fairsched_mvpr, pid_t, pid, unsigned int, id)
 	if (retval)
 		return retval;
 
-	write_lock_irq(&tasklist_lock);
-	tsk = find_task_by_vpid(pid);
+	rcu_read_lock();
+	tsk = current;
+	if (pid != task_pid_vnr(tsk))
+		tsk = find_task_by_vpid(pid);
 	if (tsk == NULL) {
-		write_unlock_irq(&tasklist_lock);
+		rcu_read_unlock();
 		retval = -ESRCH;
 		goto out;
 	}
 	get_task_struct(tsk);
-	write_unlock_irq(&tasklist_lock);
-
+	rcu_read_unlock();
 
 	retval = fairsched_move(&node, tsk);
 



More information about the Devel mailing list