From patchwork Thu Jan 29 15:53:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xunlei Pang X-Patchwork-Id: 43951 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 06BB42410D for ; Thu, 29 Jan 2015 16:02:25 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id fb4sf13982415wid.3 for ; Thu, 29 Jan 2015 08:02:24 -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:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=XIOorNbuzSUlRFh5iqMWAB3gu9b6LJ1qRUILP/bICfo=; b=PYOPxNbrka4wQzg8saxeVy1Z7VH96/JySjf5g8VD+odr6wOS8fLL8h39/Tyz8ELIAw OM8VoMrkbJDeBIwwD1+vF7knm4CrCN6EJ7+P8mld2oLs+ErVqqJryOdbA3I44FgJ1H6a J6kQgcsunhANBAVfQ5jfb6Oj50CrRqTcV78z043CkEE5Utc7yONPXcsXVtUjZBXnaQU9 ll41EzaFw8MiOxIbik9no97qalNIXNQE+Ix+keyXroHNbPq0/vULXy1KMt8O7i7Z+g8q mwD/wLGHJu1A4qiLaHg4qJXDSxKp4z3T1tJMXlPXC8n2hLgZpRQ5YyUl3JLonY99gAun l26g== X-Gm-Message-State: ALoCoQmspochRK1GOwAN8mocG7XnRS7XQZ7ZW0tSnHw+lLhqQZduuQTg5z8UwBjQvFfJG+eri/U4 X-Received: by 10.194.201.10 with SMTP id jw10mr208306wjc.3.1422547344295; Thu, 29 Jan 2015 08:02:24 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.121.35 with SMTP id lh3ls330583lab.12.gmail; Thu, 29 Jan 2015 08:02:24 -0800 (PST) X-Received: by 10.152.243.44 with SMTP id wv12mr1687836lac.78.1422547344045; Thu, 29 Jan 2015 08:02:24 -0800 (PST) Received: from mail-lb0-x22a.google.com (mail-lb0-x22a.google.com. [2a00:1450:4010:c04::22a]) by mx.google.com with ESMTPS id v4si7857774lav.14.2015.01.29.08.02.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Jan 2015 08:02:23 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22a as permitted sender) client-ip=2a00:1450:4010:c04::22a; Received: by mail-lb0-f170.google.com with SMTP id w7so29673442lbi.1 for ; Thu, 29 Jan 2015 08:02:23 -0800 (PST) X-Received: by 10.112.170.36 with SMTP id aj4mr1677864lbc.3.1422547343766; Thu, 29 Jan 2015 08:02:23 -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.112.35.133 with SMTP id h5csp1807002lbj; Thu, 29 Jan 2015 08:02:22 -0800 (PST) X-Received: by 10.68.133.165 with SMTP id pd5mr1743581pbb.13.1422547341954; Thu, 29 Jan 2015 08:02:21 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id td9si10438674pac.75.2015.01.29.08.02.20; Thu, 29 Jan 2015 08:02:21 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755400AbbA2QCR (ORCPT + 29 others); Thu, 29 Jan 2015 11:02:17 -0500 Received: from m50-111.126.com ([123.125.50.111]:43578 "EHLO m50-111.126.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752477AbbA2QCQ (ORCPT ); Thu, 29 Jan 2015 11:02:16 -0500 Received: from localhost.localdomain (unknown [210.21.223.3]) by smtp5 (Coremail) with SMTP id jtKowABHc+eGV8pUbY0NDQ--.885S3; Thu, 29 Jan 2015 23:53:55 +0800 (CST) From: Xunlei Pang To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Steven Rostedt , Juri Lelli , Xunlei Pang Subject: [PATCH v2 2/4] sched/deadline: Remove cpu_active_mask from cpudl_find() Date: Thu, 29 Jan 2015 23:53:18 +0800 Message-Id: <1422546800-2935-2-git-send-email-xlpang@126.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1422546800-2935-1-git-send-email-xlpang@126.com> References: <1422546800-2935-1-git-send-email-xlpang@126.com> X-CM-TRANSID: jtKowABHc+eGV8pUbY0NDQ--.885S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7CFWUJry5Gr4xZF15Aw1xuFg_yoW8GF48pF 4Dtry7Gr48JFyYqay5Aws3Jr98uw1kJ3savas2gw4FkF9ayF10vF90qa13Wry5KFn5uF42 yFWFvr1qg3WjyrJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jTq2NUUUUU= X-Originating-IP: [210.21.223.3] X-CM-SenderInfo: p0ost0bj6rjloofrz/1tbipBuQv1GofOMxmgAAsd Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: xlpang@126.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22a as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@; dmarc=fail (p=NONE dis=NONE) header.from=126.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: , From: Xunlei Pang cpu_active_mask is rarely changeable, so remove this operation to gain a little performance. If there is a change in cpu_active_mask, rq_online_dl() and rq_offline_dl() should take care of it normally, so cpudl:: free_cpus carries enough information for us. For the rare case(causing a task put onto a dying cpu) which rq_offline_dl() can't handle timely, then it can be handled through _cpu_down()->...->multi_cpu_stop()->migration_call() ->migrate_tasks(), preventing the task from hanging on the dead cpu. Signed-off-by: Xunlei Pang --- kernel/sched/cpudeadline.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/sched/cpudeadline.c b/kernel/sched/cpudeadline.c index fd9d3fb..c6acb07 100644 --- a/kernel/sched/cpudeadline.c +++ b/kernel/sched/cpudeadline.c @@ -108,8 +108,7 @@ int cpudl_find(struct cpudl *cp, struct task_struct *p, const struct sched_dl_entity *dl_se = &p->dl; if (later_mask && - cpumask_and(later_mask, cp->free_cpus, &p->cpus_allowed) && - cpumask_and(later_mask, later_mask, cpu_active_mask)) { + cpumask_and(later_mask, cp->free_cpus, &p->cpus_allowed)) { best_cpu = cpumask_any(later_mask); goto out; } else if (cpumask_test_cpu(cpudl_maximum(cp), &p->cpus_allowed) &&