From patchwork Mon Jan 13 05:57:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 23149 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6074120A64 for ; Mon, 13 Jan 2014 05:57:52 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id vb8sf26465142obc.4 for ; Sun, 12 Jan 2014 21:57:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe :content-type:content-transfer-encoding; bh=24hFE/sjOIp1dcccdoAX8twLKtO7Bp46PZUTcVe4EXo=; b=ZJtd8MxNQt9goj5s3hDc+tfz+LgT3U+VXyvmoi0OiJ6nCWd86JZmCJRz36DTmuVwKC ukBcbzYAhLpLitKHZyYNwYCkNesxO/QH17XY6fEOQZhn9VP2a6+OD+VAWbGfnekUq00x Co0J+/0IU0Sev/FQmgV1Uc2LwdAKRiA0BMOnh9lJVKZE/aI45glfFZm6duwbwPA1eF0S ejJar4/wu4vFxJJezAur09DGOUMz/hcvOKl6eNuM9p/aIwebphEXX/XnJjJ0PS4yLNYm nVhWrEafcywf5JdnowT3r5oQB2I7Iddq5dmB7A5rw3nxaC5AydB6J6aziIrXdDan/5gT TMIw== X-Gm-Message-State: ALoCoQmrV54Nzr6nyfAt5mq3vKq4/PRSJKjbJFmlBC9PPGx6HYvxrvdA7CivjpkYCjGm/Fgi9vgZ X-Received: by 10.42.53.135 with SMTP id n7mr7127160icg.11.1389592671038; Sun, 12 Jan 2014 21:57:51 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.27.33 with SMTP id q1ls2353279qeg.80.gmail; Sun, 12 Jan 2014 21:57:50 -0800 (PST) X-Received: by 10.59.7.202 with SMTP id de10mr38506ved.65.1389592670949; Sun, 12 Jan 2014 21:57:50 -0800 (PST) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id er6si10508200vdc.36.2014.01.12.21.57.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 12 Jan 2014 21:57:50 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id jz11so5043472veb.11 for ; Sun, 12 Jan 2014 21:57:50 -0800 (PST) X-Received: by 10.58.181.71 with SMTP id du7mr3387393vec.25.1389592670440; Sun, 12 Jan 2014 21:57:50 -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.59.13.131 with SMTP id ey3csp105617ved; Sun, 12 Jan 2014 21:57:49 -0800 (PST) X-Received: by 10.66.155.102 with SMTP id vv6mr27689673pab.89.1389592669458; Sun, 12 Jan 2014 21:57:49 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pu3si14647854pbc.240.2014.01.12.21.57.48; Sun, 12 Jan 2014 21:57:48 -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 S1751299AbaAMF5m (ORCPT + 26 others); Mon, 13 Jan 2014 00:57:42 -0500 Received: from mail-pd0-f182.google.com ([209.85.192.182]:54676 "EHLO mail-pd0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750771AbaAMF5k (ORCPT ); Mon, 13 Jan 2014 00:57:40 -0500 Received: by mail-pd0-f182.google.com with SMTP id g10so820199pdj.41 for ; Sun, 12 Jan 2014 21:57:39 -0800 (PST) X-Received: by 10.68.111.98 with SMTP id ih2mr27268009pbb.73.1389592659433; Sun, 12 Jan 2014 21:57:39 -0800 (PST) Received: from [192.168.1.4] ([101.80.222.92]) by mx.google.com with ESMTPSA id wp8sm34980458pbc.26.2014.01.12.21.57.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 12 Jan 2014 21:57:38 -0800 (PST) Message-ID: <52D3804A.8060700@linaro.org> Date: Mon, 13 Jan 2014 13:57:30 +0800 From: Alex Shi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Fengguang Wu CC: LKML , Peter Zijlstra , lkp@linux.intel.com Subject: Re: [sched] 73628fba4: +69% context switches References: <20140111101956.GA11150@localhost> In-Reply-To: <20140111101956.GA11150@localhost> 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: alex.shi@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.180 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 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: , On 01/11/2014 06:19 PM, Fengguang Wu wrote: > Alex, > > FYI, we find much increased interrupts and context switches introduced > by commit 73628fba4 ("sched: unify imbalance bias for target group") > in your noload branch: Many thanks for the generous and quick testing! :) few questions for the results and give a testing patch for try. it also push on github. What's about the aim7 shell_rtns_1 and shared throughput? > > 7bea8c18805a5f1 73628fba451ae72221b155696 > --------------- ------------------------- > 14979 ~ 4% +1304.8% 210434 ~ 1% lkp-ne04/micro/aim7/shell_rtns_1 > 2748 ~ 5% +977.4% 29607 ~ 0% nhm-white/micro/aim7/shared > 17727 +1254.1% 240041 TOTAL interrupts.RES RES interrupt increased about 200,000, but vmstat's interrupt increased a little. guess the vmstat data is per seconds, right? If so, it is better give how long time the vmstat running. The same problem on the time.involuntary_context_switches and vmstat cs. According to involuntary CS definition in time, RES interrupt will cause involuntary CS. but here 29607 RES of aim7/shared cause 233218 time inv CS, does sth I missed or the data is incorrect? > > 7bea8c18805a5f1 73628fba451ae72221b155696 > --------------- ------------------------- > 3617 ~ 0% +69.2% 6118 ~ 0% lkp-ne04/micro/aim7/shell_rtns_1 > 3617 +69.2% 6118 TOTAL vmstat.system.in > > 7bea8c18805a5f1 73628fba451ae72221b155696 > --------------- ------------------------- > 132746 ~ 0% +69.0% 224346 ~ 1% lkp-ne04/micro/aim7/shell_rtns_1 > 220038 ~ 0% +6.0% 233218 ~ 0% nhm-white/micro/aim7/shared > 352785 +29.7% 457564 TOTAL time.involuntary_context_switches > > 7bea8c18805a5f1 73628fba451ae72221b155696 > --------------- ------------------------- > 1424581 ~ 0% +8.6% 1546786 ~ 0% lkp-ne04/micro/aim7/shell_rtns_1 > 1424581 +8.6% 1546786 TOTAL time.voluntary_context_switches > > 7bea8c18805a5f1 73628fba451ae72221b155696 > --------------- ------------------------- > 20982 ~ 0% +12.5% 23599 ~ 0% lkp-ne04/micro/aim7/shell_rtns_1 > 6005 ~ 0% +4.2% 6256 ~ 0% nhm-white/micro/aim7/shared > 26988 +10.6% 29856 TOTAL vmstat.system.cs > > vmstat.system.cs > commit c5a8778a132cfa882609fbccb4ee6542eac9866d Author: Alex Shi Date: Mon Jan 13 13:54:30 2014 +0800 more bias towards local cpu group diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 2b216ad..046ca2c 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4008,7 +4008,6 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, int sync) struct task_group *tg; unsigned long weight; int balanced; - int bias = 100 + (sd->imbalance_pct -100) / 2; /* * If we wake multiple tasks be careful to not bounce @@ -4020,7 +4019,7 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, int sync) this_cpu = smp_processor_id(); prev_cpu = task_cpu(p); load = source_load(prev_cpu); - this_load = target_load(this_cpu, bias); + this_load = target_load(this_cpu, sd->imbalance_pct); /* * If sync wakeup then subtract the (maximum possible) @@ -4055,7 +4054,7 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, int sync) this_eff_load *= this_load + effective_load(tg, this_cpu, weight, weight); - prev_eff_load = bias; + prev_eff_load = 100 + (sd->imbalance_pct - 100) / 2; prev_eff_load *= power_of(this_cpu); prev_eff_load *= load + effective_load(tg, prev_cpu, 0, weight); @@ -4100,7 +4099,6 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, int this_cpu) { struct sched_group *idlest = NULL, *group = sd->groups; unsigned long min_load = ULONG_MAX, this_load = 0; - int imbalance = 100 + (sd->imbalance_pct-100)/2; do { unsigned long load, avg_load; @@ -4123,7 +4121,7 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, int this_cpu) if (local_group) load = source_load(i); else - load = target_load(i, imbalance); + load = target_load(i, sd->imbalance_pct); avg_load += load; }