Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp715762imu; Fri, 9 Nov 2018 05:04:07 -0800 (PST) X-Google-Smtp-Source: AJdET5cvyRneTOM08o1ePjG8iRIwK+6VC45w3PqG3lAL3N+W4qS7nME2A9ooE8PS4i2FrFsLLPlW X-Received: by 2002:a62:848e:: with SMTP id k136-v6mr8922739pfd.115.1541768646941; Fri, 09 Nov 2018 05:04:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541768646; cv=none; d=google.com; s=arc-20160816; b=S1q9B2Uf/GcJi0cNzB58obk9eGJs0jxhTVf93MQXIRKwx7f1jknYptQrgWwfV/HkuX 1QUztseYcG1geelAazonGmqJkAWYiLJEYj4RG9DX37F6H5YOC9otIvAY9m3k/n4Rcrcl UrjecLyUOowbrFfB2HJhniIbLz98jSPuXGOe2Beo2uIRzTNoGpI2MEjOl10UQ7ugk05G cPv1CLUN5v3RZc107nCANFpkqxo0HUQ2c53Dr7HMnRN5id0ViNcCxMxpzSG9LC1Ktpjz XvudHi7tuplNfzVXt/18tU7Nyc+A2DAV0c4tcN5ZF+JzqDK++aEy/IgEsvpRzE110Abz mC1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=l1QyOZiLeNHyGSqV8c/SS36D9FMGVFHn7qMqB1TdzBM=; b=e55uBWqyICJVY5HgMXS7NGNqKIZ6XN8NXdeCo7bcLPKRZ8H27dBye/70h+VR4smyQy t4bA/Tj7eoJV17TTd5kdhdAM8Hp/7eWCwoSuHITdESHfC3+ZyKNnKR4r13F59kOvfvrj yPPaKCVXCIALK7/ognXb+LN8M+JisJvjMx7f0zuE9h7cvw9qPXphIXBEW+QShhtEPPoL 6sbIF9XIcrcRqVfWVSYUxCiBBMYucfQojrK19FoJD4s0tqutmhHr7hbifT4I8uApb6Uh 6g6UisuyK8beyXBHJFOZT4jMFHQ6QNAp647Wo9fQlRRRZeqICzINfnDfKbGKfmZLpTR0 ZFAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=NTcZ+5U5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3-v6si7693886plo.97.2018.11.09.05.03.46; Fri, 09 Nov 2018 05:04:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=NTcZ+5U5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728316AbeKIWlo (ORCPT + 99 others); Fri, 9 Nov 2018 17:41:44 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:43040 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727806AbeKIWlo (ORCPT ); Fri, 9 Nov 2018 17:41:44 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wA9CwwTD068530; Fri, 9 Nov 2018 13:00:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=l1QyOZiLeNHyGSqV8c/SS36D9FMGVFHn7qMqB1TdzBM=; b=NTcZ+5U5Kn5i2nKVLjvDXdI9OQ2U0LQgcBp7PERaT66loqnNP4Tq2XpFEHtKMEr12+Us hWU+xQkpvrJ8uIwjdgigcUK5AIB3jvDbjH/Gha0z0QdLcPYT+aityu36hZz/YhNke55h 1UzmL5szqus9C1UIgOSs3/asy8n0i/Owqym+y2sqobvlEB8CzhcDXEsSoB/qJBlqkmaf oRKq2MiJuFY0qr4ATb3nQvpxJ5NVDyEMFUbk5TouufIu7s9U1UMzmzsgaBEoTi7BBi/0 s4lTOALA3pC+KlreoJVRJzE14ZCOl5whWGjSLlOjAnH22HRXUwJ1zBrOX4Ursa05flcM 8g== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2nh4ar6txm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Nov 2018 13:00:47 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wA9D0ktV018294 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 9 Nov 2018 13:00:46 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wA9D0Apw020529; Fri, 9 Nov 2018 13:00:44 GMT Received: from ca-dev63.us.oracle.com (/10.211.8.221) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 09 Nov 2018 05:00:10 -0800 From: Steve Sistare To: mingo@redhat.com, peterz@infradead.org Cc: subhra.mazumdar@oracle.com, dhaval.giani@oracle.com, daniel.m.jordan@oracle.com, pavel.tatashin@microsoft.com, matt@codeblueprint.co.uk, umgwanakikbuti@gmail.com, riel@redhat.com, jbacik@fb.com, juri.lelli@redhat.com, valentin.schneider@arm.com, vincent.guittot@linaro.org, quentin.perret@arm.com, steven.sistare@oracle.com, linux-kernel@vger.kernel.org Subject: [PATCH v3 06/10] sched/fair: Generalize the detach_task interface Date: Fri, 9 Nov 2018 04:50:36 -0800 Message-Id: <1541767840-93588-7-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1541767840-93588-1-git-send-email-steven.sistare@oracle.com> References: <1541767840-93588-1-git-send-email-steven.sistare@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9071 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1811090121 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The detach_task function takes a struct lb_env argument, but only needs a few of its members. Pass the rq and cpu arguments explicitly so the function may be called from code that is not based on lb_env. No functional change. Signed-off-by: Steve Sistare --- kernel/sched/fair.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index da368ed..453d280 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7199,15 +7199,15 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) } /* - * detach_task() -- detach the task for the migration specified in env + * detach_task() -- detach the task for the migration from @src_rq to @dst_cpu. */ -static void detach_task(struct task_struct *p, struct lb_env *env) +static void detach_task(struct task_struct *p, struct rq *src_rq, int dst_cpu) { - lockdep_assert_held(&env->src_rq->lock); + lockdep_assert_held(&src_rq->lock); p->on_rq = TASK_ON_RQ_MIGRATING; - deactivate_task(env->src_rq, p, DEQUEUE_NOCLOCK); - set_task_cpu(p, env->dst_cpu); + deactivate_task(src_rq, p, DEQUEUE_NOCLOCK); + set_task_cpu(p, dst_cpu); } /* @@ -7227,7 +7227,7 @@ static struct task_struct *detach_one_task(struct lb_env *env) if (!can_migrate_task(p, env)) continue; - detach_task(p, env); + detach_task(p, env->src_rq, env->dst_cpu); /* * Right now, this is only the second place where @@ -7294,7 +7294,7 @@ static int detach_tasks(struct lb_env *env) if ((load / 2) > env->imbalance) goto next; - detach_task(p, env); + detach_task(p, env->src_rq, env->dst_cpu); list_add(&p->se.group_node, &env->tasks); detached++; -- 1.8.3.1