From patchwork Thu Apr 25 17:23:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 16401 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 46E492395D for ; Thu, 25 Apr 2013 17:25:56 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id m1sf2697297ves.10 for ; Thu, 25 Apr 2013 10:25:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=qQ53/e/Bo+GJbnEbjIlirMmtSiq4UYxlvzpL8GDMAlU=; b=a2sQosuwOu4Y0n96ywwRPRi4UfMNpWy/Ati5EY5Pzzw2vwDGTMQ0w8If+bOpIRidPJ z1rVAgKc38P3AU4WVP9qixaEQFGqJzHUgG/Lg/TpjgxHQ86CgmueWcQivlmxM3Ejv7ZJ u7+/Xs+6+RtQKI3Hh9SqWnImNdOIaksJmzhC1J2uCMOsIXb42Jj/EVyFqT/Dz9WBkNYo zWwpvp7ytPSD9s+3ga2vdbG5PDuMrx9rwqn48PV/4XN0LkQCn8Q9mdIkZdKn/093fvmA psGtirqgD/5EKHmSwOme0kote4caOTDMRLVVGI/6nJEy0zpzS6uejn91oPBjp06PTPOY Wtzw== X-Received: by 10.236.139.230 with SMTP id c66mr20253553yhj.55.1366910702270; Thu, 25 Apr 2013 10:25:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.60.232 with SMTP id k8ls1433190qer.99.gmail; Thu, 25 Apr 2013 10:25:02 -0700 (PDT) X-Received: by 10.52.243.196 with SMTP id xa4mr23270942vdc.22.1366910702001; Thu, 25 Apr 2013 10:25:02 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id os3si3690473vcb.23.2013.04.25.10.25.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Apr 2013 10:25:01 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id kw10so3008785vcb.19 for ; Thu, 25 Apr 2013 10:25:01 -0700 (PDT) X-Received: by 10.220.242.73 with SMTP id lh9mr1783306vcb.49.1366910701730; Thu, 25 Apr 2013 10:25:01 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp32659veb; Thu, 25 Apr 2013 10:25:01 -0700 (PDT) X-Received: by 10.180.205.226 with SMTP id lj2mr73817038wic.5.1366910700859; Thu, 25 Apr 2013 10:25:00 -0700 (PDT) Received: from mail-we0-x22b.google.com (mail-we0-x22b.google.com [2a00:1450:400c:c03::22b]) by mx.google.com with ESMTPS id fa9si5518462wib.124.2013.04.25.10.25.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Apr 2013 10:25:00 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::22b is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) client-ip=2a00:1450:400c:c03::22b; Received: by mail-we0-f171.google.com with SMTP id t57so921768wey.30 for ; Thu, 25 Apr 2013 10:25:00 -0700 (PDT) X-Received: by 10.180.20.37 with SMTP id k5mr37380826wie.27.1366910700468; Thu, 25 Apr 2013 10:25:00 -0700 (PDT) Received: from localhost.localdomain (LPuteaux-156-14-44-212.w82-127.abo.wanadoo.fr. [82.127.83.212]) by mx.google.com with ESMTPSA id q13sm12311485wie.8.2013.04.25.10.24.58 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Apr 2013 10:25:00 -0700 (PDT) From: Vincent Guittot To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, peterz@infradead.org, mingo@kernel.org, linux@arm.linux.org.uk, pjt@google.com, santosh.shilimkar@ti.com, Morten.Rasmussen@arm.com, chander.kashyap@linaro.org, cmetcalf@tilera.com, tony.luck@intel.com, alex.shi@intel.com, preeti@linux.vnet.ibm.com Cc: paulmck@linux.vnet.ibm.com, tglx@linutronix.de, len.brown@intel.com, arjan@linux.intel.com, amit.kucheria@linaro.org, corbet@lwn.net, l.majewski@samsung.com, Vincent Guittot Subject: [PATCH 06/14] sched: add a knob to choose the packing level Date: Thu, 25 Apr 2013 19:23:22 +0200 Message-Id: <1366910611-20048-7-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1366910611-20048-1-git-send-email-vincent.guittot@linaro.org> References: <1366910611-20048-1-git-send-email-vincent.guittot@linaro.org> X-Gm-Message-State: ALoCoQk+s+2UiJ44YCSVYrRdcfk30WQkkUQzYfJlJwl3hLvmSzhSqNX0hDU9N8CUooLo/4EgvBj4 X-Original-Sender: vincent.guittot@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.174 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , There are 3 packing levels: - the default one only packs the small tasks when the system is not busy - the none level doesn't pack anything - the full level uses as few as possible number of CPUs based on the current activity of the system Signed-off-by: Vincent Guittot --- include/linux/sched/sysctl.h | 8 ++++++++ kernel/sched/fair.c | 12 ++++++++++++ kernel/sysctl.c | 13 +++++++++++++ 3 files changed, 33 insertions(+) diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h index bf8086b..b72a8b8 100644 --- a/include/linux/sched/sysctl.h +++ b/include/linux/sched/sysctl.h @@ -44,6 +44,14 @@ enum sched_tunable_scaling { }; extern enum sched_tunable_scaling sysctl_sched_tunable_scaling; +enum sched_tunable_packing { + SCHED_PACKING_NONE, + SCHED_PACKING_DEFAULT, + SCHED_PACKING_FULL, +}; + +extern enum sched_tunable_packing __read_mostly sysctl_sched_packing_mode; + extern unsigned int sysctl_numa_balancing_scan_delay; extern unsigned int sysctl_numa_balancing_scan_period_min; extern unsigned int sysctl_numa_balancing_scan_period_max; diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index a985c98..98166aa 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -113,6 +113,18 @@ unsigned int __read_mostly sysctl_sched_shares_window = 10000000UL; unsigned int sysctl_sched_cfs_bandwidth_slice = 5000UL; #endif +#ifdef CONFIG_SMP +/* + * The packing policy of the scheduler + * + * Options are: + * SCHED_PACKING_NONE - No buddy is used for packing some tasks + * SCHED_PACKING_DEFAULT - The small tasks are packed on a not busy CPUs + * SCHED_PACKING_FULL - All Tasks are packed in a minimum number of CPUs + */ +enum sched_tunable_packing sysctl_sched_packing_mode = SCHED_PACKING_DEFAULT; + +#endif /* * Increase the granularity value when there are more CPUs, * because with more CPUs the 'effective latency' as visible diff --git a/kernel/sysctl.c b/kernel/sysctl.c index afc1dc6..ca22f59 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -265,6 +265,8 @@ static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ #ifdef CONFIG_SMP static int min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE; static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1; +static int min_sched_packing_mode = SCHED_PACKING_NONE; +static int max_sched_packing_mode = SCHED_PACKING_FULL-1; #endif /* CONFIG_SMP */ #endif /* CONFIG_SCHED_DEBUG */ @@ -281,6 +283,17 @@ static struct ctl_table kern_table[] = { .mode = 0644, .proc_handler = proc_dointvec, }, +#ifdef CONFIG_SMP + { + .procname = "sched_packing_mode", + .data = &sysctl_sched_packing_mode, + .maxlen = sizeof(enum sched_tunable_packing), + .mode = 0644, + .proc_handler = proc_dointvec, + .extra1 = &min_sched_packing_mode, + .extra2 = &max_sched_packing_mode, + }, +#endif #ifdef CONFIG_SCHED_DEBUG { .procname = "sched_min_granularity_ns",