All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Wang <wangyun@linux.vnet.ibm.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: mingo@redhat.com, Peter Zijlstra <peterz@infradead.org>,
	paul@paulmenage.org
Subject: [PATCH 5/5] cpusets: add the configuration facility
Date: Tue, 17 Jul 2012 17:04:29 +0800	[thread overview]
Message-ID: <50052A9D.3040001@linux.vnet.ibm.com> (raw)

From: Michael Wang <wangyun@linux.vnet.ibm.com>

Add the facility for user to configure the dynamical domain flags and
enable/disable it.

Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
---
 kernel/cpuset.c |   85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 85 insertions(+), 0 deletions(-)

diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 066c61c..5ff649d 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1506,6 +1506,17 @@ typedef enum {
 	FILE_MEM_HARDWALL,
 	FILE_SCHED_LOAD_BALANCE,
 	FILE_SCHED_RELAX_DOMAIN_LEVEL,
+#ifdef CONFIG_SCHED_SMT
+	FILE_SCHED_SMT_DDF,
+#endif
+#ifdef CONFIG_SCHED_MC
+	FILE_SCHED_MC_DDF,
+#endif
+#ifdef CONFIG_SCHED_BOOK
+	FILE_SCHED_BOOK_DDF,
+#endif
+	FILE_SCHED_CPU_DDF,
+	FILE_SCHED_ENABLE_DDF,
 	FILE_MEMORY_PRESSURE_ENABLED,
 	FILE_MEMORY_PRESSURE,
 	FILE_SPREAD_PAGE,
@@ -1549,6 +1560,27 @@ static int cpuset_write_u64(struct cgroup *cgrp, struct cftype *cft, u64 val)
 	case FILE_SPREAD_SLAB:
 		retval = update_flag(CS_SPREAD_SLAB, cs, val);
 		break;
+#ifdef CONFIG_SCHED_SMT
+	case FILE_SCHED_SMT_DDF:
+		retval = update_ddf(SMT_DDF, cs, val);
+		break;
+#endif
+#ifdef CONFIG_SCHED_MC
+	case FILE_SCHED_MC_DDF:
+		retval = update_ddf(MC_DDF, cs, val);
+		break;
+#endif
+#ifdef CONFIG_SCHED_BOOK
+	case FILE_SCHED_BOOK_DDF:
+		retval = update_ddf(BOOK_DDF, cs, val);
+		break;
+#endif
+	case FILE_SCHED_CPU_DDF:
+		retval = update_ddf(CPU_DDF, cs, val);
+		break;
+	case FILE_SCHED_ENABLE_DDF:
+		retval = enable_ddf(cs, val);
+		break;
 	default:
 		retval = -EINVAL;
 		break;
@@ -1708,6 +1740,22 @@ static u64 cpuset_read_u64(struct cgroup *cont, struct cftype *cft)
 		return is_spread_page(cs);
 	case FILE_SPREAD_SLAB:
 		return is_spread_slab(cs);
+#ifdef CONFIG_SCHED_SMT
+	case FILE_SCHED_SMT_DDF:
+		return cs->ddf[SMT_DDF];
+#endif
+#ifdef CONFIG_SCHED_MC
+	case FILE_SCHED_MC_DDF:
+		return cs->ddf[MC_DDF];
+#endif
+#ifdef CONFIG_SCHED_BOOK
+	case FILE_SCHED_BOOK_DDF:
+		return cs->ddf[BOOK_DDF];
+#endif
+	case FILE_SCHED_CPU_DDF:
+		return cs->ddf[CPU_DDF];
+	case FILE_SCHED_ENABLE_DDF:
+		return cs->enable_ddf;
 	default:
 		BUG();
 	}
@@ -1788,6 +1836,43 @@ static struct cftype files[] = {
 		.private = FILE_SCHED_RELAX_DOMAIN_LEVEL,
 	},
 
+#ifdef CONFIG_SCHED_SMT
+	{
+		.name = "sched_smt_domain_flag",
+		.read_u64 = cpuset_read_u64,
+		.write_u64 = cpuset_write_u64,
+		.private = FILE_SCHED_SMT_DDF,
+	},
+#endif
+#ifdef CONFIG_SCHED_MC
+	{
+		.name = "sched_mc_domain_flag",
+		.read_u64 = cpuset_read_u64,
+		.write_u64 = cpuset_write_u64,
+		.private = FILE_SCHED_MC_DDF,
+	},
+#endif
+#ifdef CONFIG_SCHED_BOOK
+	{
+		.name = "sched_book_domain_flag",
+		.read_u64 = cpuset_read_u64,
+		.write_u64 = cpuset_write_u64,
+		.private = FILE_SCHED_BOOK_DDF,
+	},
+#endif
+	{
+		.name = "sched_cpu_domain_flag",
+		.read_u64 = cpuset_read_u64,
+		.write_u64 = cpuset_write_u64,
+		.private = FILE_SCHED_CPU_DDF,
+	},
+	{
+		.name = "sched_enable_domain_flag",
+		.read_u64 = cpuset_read_u64,
+		.write_u64 = cpuset_write_u64,
+		.private = FILE_SCHED_ENABLE_DDF,
+	},
+
 	{
 		.name = "memory_migrate",
 		.read_u64 = cpuset_read_u64,
-- 
1.7.4.1


                 reply	other threads:[~2012-07-17  9:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50052A9D.3040001@linux.vnet.ibm.com \
    --to=wangyun@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paul@paulmenage.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.