From patchwork Mon Jan 19 04:49:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "pang.xunlei" X-Patchwork-Id: 43287 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1C8EB24107 for ; Mon, 19 Jan 2015 04:52:25 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id gf13sf2432169lab.0 for ; Sun, 18 Jan 2015 20:52:23 -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=Tgb8lhQBnXLp1/B1Q64E9yAVQ4UY6aEVwyw8cNr8sqk=; b=aZWT7hao0Anjn14C+FZWRryh24sq4W1vGi3TSJW76fyXqeDCHjefQC+tTYzEoj+Ov/ v4zpJXM2jZX3Wy94AZrHZCNfaHXooLPov+axA6uco4tKXRgg4bWENiF3aJh5KvsGfI51 Q1rVQaaTF46jiqUdJlA5ElAFWqt9UIiwnwdq7jtQf3XJVMf/z8S40hQW4MQs8Tyhj1u8 42mo203dwNZRhjPS8CFdoxZaTzFzlElhKoaq5hS7prNk6b7c/Wq55E0jCqXFavSnVso2 W79nT/ZbJHcrLshTKa6Jb9r/7T96hwK6Gnswy7EFQf9FwO5XXx9AYboE0Zc0hagAR4Ow 0RyQ== X-Gm-Message-State: ALoCoQkcTo1YuLaj5kX77JbyuCizwpQ7WV5PSuiagLC22iIgDuPaLjyN5f+wl9tpld031Nqn3C1T X-Received: by 10.112.137.70 with SMTP id qg6mr9174lbb.14.1421643143819; Sun, 18 Jan 2015 20:52:23 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.7 with SMTP id f7ls546074laa.100.gmail; Sun, 18 Jan 2015 20:52:23 -0800 (PST) X-Received: by 10.112.27.133 with SMTP id t5mr27795091lbg.45.1421643143572; Sun, 18 Jan 2015 20:52:23 -0800 (PST) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id lt6si11302431lac.47.2015.01.18.20.52.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 18 Jan 2015 20:52:23 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id q1so11306029lam.2 for ; Sun, 18 Jan 2015 20:52:23 -0800 (PST) X-Received: by 10.152.45.4 with SMTP id i4mr28060490lam.74.1421643143448; Sun, 18 Jan 2015 20:52: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.9.200 with SMTP id c8csp972652lbb; Sun, 18 Jan 2015 20:52:22 -0800 (PST) X-Received: by 10.66.118.109 with SMTP id kl13mr14994442pab.19.1421643141377; Sun, 18 Jan 2015 20:52:21 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ao1si14334868pad.182.2015.01.18.20.52.20; Sun, 18 Jan 2015 20:52: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 S1751617AbbASEv6 (ORCPT + 28 others); Sun, 18 Jan 2015 23:51:58 -0500 Received: from mail-qg0-f45.google.com ([209.85.192.45]:42584 "EHLO mail-qg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751166AbbASEv4 (ORCPT ); Sun, 18 Jan 2015 23:51:56 -0500 Received: by mail-qg0-f45.google.com with SMTP id q107so4274417qgd.4 for ; Sun, 18 Jan 2015 20:51:55 -0800 (PST) X-Received: by 10.140.92.138 with SMTP id b10mr41876956qge.59.1421643115399; Sun, 18 Jan 2015 20:51:55 -0800 (PST) Received: from ip-10-181-65-231.ec2.internal ([54.235.93.228]) by mx.google.com with ESMTPSA id k91sm4332434qgf.48.2015.01.18.20.51.54 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 18 Jan 2015 20:51:54 -0800 (PST) From: Xunlei Pang To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Juri Lelli , Xunlei Pang Subject: [PATCH 2/5] sched/deadline: Remove cpu_active_mask from cpudl_find() Date: Mon, 19 Jan 2015 04:49:37 +0000 Message-Id: <1421642980-10045-2-git-send-email-pang.xunlei@linaro.org> X-Mailer: git-send-email 2.2.1 In-Reply-To: <1421642980-10045-1-git-send-email-pang.xunlei@linaro.org> References: <1421642980-10045-1-git-send-email-pang.xunlei@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: pang.xunlei@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org 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: , 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) &&