Received: by 10.192.165.156 with SMTP id m28csp1883967imm; Thu, 12 Apr 2018 05:18:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+sv3eUdYBzi2f+izIbpeK81LQGlgSjIPtnc4attAFO0g8X0EEwrfim6G8hsWhOp5LWDEg1 X-Received: by 10.101.65.75 with SMTP id x11mr531918pgp.203.1523535496035; Thu, 12 Apr 2018 05:18:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523535496; cv=none; d=google.com; s=arc-20160816; b=X8REHg+q7YPw2VyIYDqgaFUd9a1PlX6w/HPraYwB/GMk3etOSbnCcXzbrIiwzW6sig Qh/yRocZwEH7sNH02lodwupdzLxY54W9JEVz/z7q0875akSlz7qQTkudxU4L81ugkIeB J1fV2AMq1jFWQMz0GT/ZqulqyUjdb3TQNvXw51gVdXSbLYK3yD7WHBfUjERDqZxrctp7 4dF+8khLwgzX7TM0mmB9qOZyFuLzbx5ysKR1bL+rDm2gBnK+txDyQE/vxPDyjOVV+KGu R6KvcfIk9sgURbv8qrglXsO6r7Lc46CGSincHLPDj9qESGthIgFh5GKX6ctVKyJ7QGHP VpFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=fPmDxa0GTtSk4n9o3BVnci9f6m4goIxpR9ybIhG/MGI=; b=trbCR5BFrXMWMjdK01gUT3907cyYFv+n22VsAwr2ESHUfr3fHckOGyR/VGGJj5TODU VJUczxksFU6P/i0hFUq86DixooBZ5QjLZCyrfWkkTOAwihRlB9FhqG+YXLFLho6Pnj7p 4oe9PGY9AOy9uGeu6ZPlvfvcYsl//JpLbquPUMRgZbatK8y+5R1bcM5sZe1hm0N76Vdu uLVS14moaAyRhDSO5vroL+dUquFuXp3siDComOTfS7b4z85SLxLncBaB5Xytj61oMqDp GCThogXOPMWB+KlQ7Nue7BmhimPjHBgNIWcRjcT2NN7C30ul2DPkOb/7Zv/Y6gPj1wnb XeZw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z60-v6si1196406plh.15.2018.04.12.05.17.38; Thu, 12 Apr 2018 05:18:16 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752796AbeDLMKo (ORCPT + 99 others); Thu, 12 Apr 2018 08:10:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:58802 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751953AbeDLMKn (ORCPT ); Thu, 12 Apr 2018 08:10:43 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EAA8521785; Thu, 12 Apr 2018 12:10:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EAA8521785 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Thu, 12 Apr 2018 08:10:39 -0400 From: Steven Rostedt To: Li Bin Cc: , , , Subject: Re: [PATCH 1/2] sched/rt.c: pick and check task if double_lock_balance() unlock the rq Message-ID: <20180412081039.17fcc09c@gandalf.local.home> In-Reply-To: <1523530735-20011-2-git-send-email-huawei.libin@huawei.com> References: <1523530735-20011-1-git-send-email-huawei.libin@huawei.com> <1523530735-20011-2-git-send-email-huawei.libin@huawei.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 12 Apr 2018 18:58:54 +0800 Li Bin wrote: > @@ -1726,13 +1746,10 @@ static struct rq *find_lock_lowest_rq(struct task_struct *task, struct rq *rq) > * We had to unlock the run queue. In > * the mean time, task could have > * migrated already or had its affinity changed. > - * Also make sure that it wasn't scheduled on its rq. > */ > - if (unlikely(task_rq(task) != rq || > - !cpumask_test_cpu(lowest_rq->cpu, &task->cpus_allowed) || > - task_running(rq, task) || > - !rt_task(task) || > - !task_on_rq_queued(task))) { > + struct task_struct *next_task = pick_next_pushable_task(rq); Could you declare next_task above the comment. It's better styling. struct task_struct *next_task; /* * Comment */ next_task = pick_next_pushable_task(rq); -- Steve > + if (unlikely(next_task != task || > + !cpumask_test_cpu(lowest_rq->cpu, &task->cpus_allowed))) { > > double_unlock_balance(rq, lowest_rq); > lowest_rq = NULL; > @@ -1752,26 +1769,6 @@ static struct rq *find_lock_lowest_rq(struct task_struct *task, struct rq *rq)