From patchwork Mon Feb 24 10:47:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juri Lelli X-Patchwork-Id: 25186 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A6514203C4 for ; Mon, 24 Feb 2014 10:47:28 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id c41sf9374718yho.9 for ; Mon, 24 Feb 2014 02:47:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=Sz/8mzoMsDZuWlDGdQHhVGM5s3h53qztktNqdIsgHAo=; b=XpULGxt9WPctJS2IiQH7S9ddDn4DRqWqh/ZufLGtV/pf5rv6A7P+rsap2Hl4q58gOo HcQwnFRe5ydOY9zKfzNGNAcFB5EKplYKvKckGE8JPMBg/9+rFuX9syaTiZDpLZdZhyXy jLzq28RVHm4/NZ78WTjk94YfGmJNEy9vBxaXAud00U4b8AVdMdtZHR+3QggdINga7ro4 e56qUqUYnyNz7spZ5q8EAHIxQKeRbzz7jdz+6If/FRHuDUPhzmtWEKKRKl4zofX0/6Bk EW+sgJwJ8GcGt52ZKWo0TY5Ikj7YzdKEoEIFj4XODx81gG208S+TDnXyxAQKOCK/m5sE elGw== X-Gm-Message-State: ALoCoQl7cs2PJCR0bJ8Iocpur5kkZqo0PsLxRWFKvAOd2D8wuIP+cfwHVBN3DPFth3dR6QwpEjZH X-Received: by 10.236.69.35 with SMTP id m23mr9522085yhd.6.1393238848421; Mon, 24 Feb 2014 02:47:28 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.25.33 with SMTP id 30ls1969093qgs.22.gmail; Mon, 24 Feb 2014 02:47:28 -0800 (PST) X-Received: by 10.220.147.16 with SMTP id j16mr12064909vcv.28.1393238848265; Mon, 24 Feb 2014 02:47:28 -0800 (PST) Received: from mail-ve0-x235.google.com (mail-ve0-x235.google.com [2607:f8b0:400c:c01::235]) by mx.google.com with ESMTPS id xn5si5709524vdc.68.2014.02.24.02.47.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Feb 2014 02:47:28 -0800 (PST) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::235 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::235; Received: by mail-ve0-f181.google.com with SMTP id jw12so5642187veb.12 for ; Mon, 24 Feb 2014 02:47:27 -0800 (PST) X-Received: by 10.52.101.135 with SMTP id fg7mr9986909vdb.17.1393238847917; Mon, 24 Feb 2014 02:47:27 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp52187vcz; Mon, 24 Feb 2014 02:47:27 -0800 (PST) X-Received: by 10.66.192.162 with SMTP id hh2mr23966198pac.150.1393238847020; Mon, 24 Feb 2014 02:47:27 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id nd12si16573170pab.40.2014.02.24.02.47.26; Mon, 24 Feb 2014 02:47:26 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751994AbaBXKrR (ORCPT + 26 others); Mon, 24 Feb 2014 05:47:17 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]:41960 "EHLO mail-ee0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750899AbaBXKrQ (ORCPT ); Mon, 24 Feb 2014 05:47:16 -0500 Received: by mail-ee0-f44.google.com with SMTP id d49so659578eek.17 for ; Mon, 24 Feb 2014 02:47:15 -0800 (PST) X-Received: by 10.14.8.194 with SMTP id 42mr23656844eer.16.1393238835522; Mon, 24 Feb 2014 02:47:15 -0800 (PST) Received: from neville.retis (nat-cataldo.sssup.it. [193.205.81.5]) by mx.google.com with ESMTPSA id x6sm62354816eew.20.2014.02.24.02.47.10 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Feb 2014 02:47:14 -0800 (PST) From: Juri Lelli To: mingo@redhat.com, peterz@infradead.org, tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, rostedt@goodmis.org, Juri Lelli Subject: [PATCH] sched/deadline: Switch CPU's presence test order Date: Mon, 24 Feb 2014 11:47:12 +0100 Message-Id: <1393238832-9100-1-git-send-email-juri.lelli@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: juri.lelli@gmail.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::235 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (bad format) header.i=@gmail.com; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Commit 82b9580 (sched/deadline: Test for CPU's presence explicitly) changed how we check if a CPU returned by cpudeadline machinery is valid. But, we don't want to call cpu_present() if best_cpu is equal to -1. So, switch the order of tests inside WARN_ON(). Signed-off-by: Juri Lelli --- kernel/sched/cpudeadline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/cpudeadline.c b/kernel/sched/cpudeadline.c index 5b8838b..5b9bb42 100644 --- a/kernel/sched/cpudeadline.c +++ b/kernel/sched/cpudeadline.c @@ -70,7 +70,7 @@ static void cpudl_heapify(struct cpudl *cp, int idx) static void cpudl_change_key(struct cpudl *cp, int idx, u64 new_dl) { - WARN_ON(!cpu_present(idx) || idx == IDX_INVALID); + WARN_ON(idx == IDX_INVALID || !cpu_present(idx)); if (dl_time_before(new_dl, cp->elements[idx].dl)) { cp->elements[idx].dl = new_dl; @@ -117,7 +117,7 @@ int cpudl_find(struct cpudl *cp, struct task_struct *p, } out: - WARN_ON(!cpu_present(best_cpu) && best_cpu != -1); + WARN_ON(best_cpu != -1 && !cpu_present(best_cpu)); return best_cpu; }