login
Login
/
Register
Search
Header Space
Forums
News
Jobs
Blogs
Features
Man Pages
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
April
»
10
Re: [RFC] Control Groups Roadmap ideas
view
thread
Score:
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From:
Paul Menage <menage@...>
To: Li Zefan <lizf@...>
Cc: Linux Containers <containers@...>, lkml <linux-kernel@...>
Subject:
Re: [RFC] Control Groups Roadmap ideas
Date: Thursday, April 10, 2008 - 4:10 pm
On Tue, Apr 8, 2008 at 7:28 PM, Li Zefan <lizf@cn.fujitsu.com> wrote:
quoted text
> > Sounds good, and I wrote a prototype in a quick:
Yes, that's pretty much what I was envisaging, thanks. Paul
quoted text
> > diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h > index a6a6035..091bc21 100644 > --- a/include/linux/cgroup.h > +++ b/include/linux/cgroup.h > @@ -254,6 +254,7 @@ struct cgroup_subsys { > struct cgroup *cgrp); > void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cgrp); > void (*bind)(struct cgroup_subsys *ss, struct cgroup *root); > + int (*can_mount)(struct cgroup_subsys *ss, unsigned long subsys_bits); > int subsys_id; > int active; > int disabled; > diff --git a/kernel/cgroup.c b/kernel/cgroup.c > index 62f1a52..3d43ff2 100644 > --- a/kernel/cgroup.c > +++ b/kernel/cgroup.c > @@ -824,6 +824,25 @@ static int parse_cgroupfs_options(char *data, > return 0; > } > > +static int check_mount(unsigned long subsys_bits) > +{ > + int i; > + int ret; > + struct cgroup_subsys *ss; > + > + for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { > + ss = subsys[i]; > + > + if (test_bit(i, &subsys_bits) && ss->can_mount) { > + ret = ss->can_mount(ss, subsys_bits); > + if (ret) > + return ret; > + } > + } > + > + return 0; > +} > + > static int cgroup_remount(struct super_block *sb, int *flags, char *data) > { > int ret = 0; > @@ -839,6 +858,10 @@ static int cgroup_remount(struct super_block *sb, int *flags, char *data) > if (ret) > goto out_unlock; > > + ret = check_mount(opts.subsys_bits); > + if (ret) > + goto out_unlock; > + > /* Don't allow flags to change at remount */ > if (opts.flags != root->flags) { > ret = -EINVAL; > @@ -959,6 +982,13 @@ static int cgroup_get_sb(struct file_system_type *fs_type, > return ret; > } > > + ret = check_mount(opts.subsys_bits); > + if (ret) { > + if (opts.release_agent) > + kfree(opts.release_agent); > + return ret; > + } > + > root = kzalloc(sizeof(*root), GFP_KERNEL); > if (!root) { > if (opts.release_agent) > ------- > > for the example about swap controller and memory controller: > > static int swap_cgroup_can_mount(struct cgroup_subsys *ss, > unsigned long subsys_bits) > { > if (!test_bit(mem_cgroup_subsys_id, &subsys_bits)) > return -EINVAL; > return 0; > } > > 'mem_cgroup_subsys_id' is a member of enum cgroup_subsys_id defined in cgroup.h >
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[RFC] Control Groups Roadmap ideas
, Paul Menage
, (Tue Apr 8, 5:14 pm)
Re: [RFC] Control Groups Roadmap ideas
, Serge E. Hallyn
, (Fri Apr 11, 10:48 am)
Re: [RFC] Control Groups Roadmap ideas
, Paul Menage
, (Mon Apr 14, 1:24 am)
Re: [RFC] Control Groups Roadmap ideas
, Serge E. Hallyn
, (Mon Apr 14, 10:11 am)
Re: [RFC] Control Groups Roadmap ideas
, Paul Menage
, (Mon Apr 14, 11:03 am)
Re: [RFC] Control Groups Roadmap ideas
, Balbir Singh
, (Sat Apr 12, 1:10 am)
Re: [RFC] Control Groups Roadmap ideas
, Serge E. Hallyn
, (Sun Apr 13, 12:11 pm)
Re: [RFC] Control Groups Roadmap ideas
, Balbir Singh
, (Mon Apr 14, 10:31 am)
Re: [RFC] Control Groups Roadmap ideas
, Li Zefan
, (Tue Apr 8, 10:28 pm)
Re: [RFC] Control Groups Roadmap ideas
, Paul Menage
, (Thu Apr 10, 4:10 pm)
Navigation
Create content
Mailing list archives
Recent posts
Mail archive search
Enter your search terms.
all mailing lists
alsa-devel
dragonflybsd-bugs
dragonflybsd-commit
dragonflybsd-docs
dragonflybsd-kernel
dragonflybsd-submit
dragonflybsd-user
freebsd-announce
freebsd-bugs
freebsd-chat
freebsd-cluster
freebsd-current
freebsd-drivers
freebsd-embeded
freebsd-fs
freebsd-hackers
freebsd-hardware
freebsd-mobile
freebsd-net
freebsd-performance
freebsd-pf
freebsd-security
freebsd-security-notifications
freebsd-threads
git
git-commits-head
linux-activists
linux-arm
linux-ath5k-devel
linux-btrfs
linux-c-programming
linux-driver-devel
linux-ext4
linux-fsdevel
linux-ia64
linux-input
linux-kernel
linux-kernel-janitors
linux-kernel-mentors
linux-kernel-newbies
linux-kvm
linux-net
linux-netdev
linux-newbie
linux-nfs
linux-raid
linux-scsi
linux-security-module
linux-sparse
linux-usb
linux-usb-devel
madwifi-devel
netbsd-announce
netbsd-tech-kern
openbsd-announce
openbsd-bugs
openbsd-ipv6
openbsd-misc
openbsd-security-announce
openbsd-smp
openbsd-source-changes
openbsd-tech
openfabrics-general
openmoko-community
openmoko-devel
openmoko-kernel
reiserfs-devel
tux3
ucarp
Optionally limit your search to a specific mailing list.
advanced
Popular discussions
linux-kernel
:
Greg KH
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Greg Kroah-Hartman
[PATCH 011/196] sysfs: Fix a copy-n-paste typo in comment
Greg KH
Re: Linux 2.6.25.10
Sam Ravnborg
Re: [RFC/PATCH] Documentation of kernel messages
git
:
Peter Stahlir
Git as a filesystem
Ken Pratt
Re: pack operation is thrashing my server
Andy Parkins
svn:externals using git submodules
Junio C Hamano
Re: [PATCH] Teach remote machinery about remotes.default config variable
openbsd-misc
:
GVG GVG
ssh_exchange_identification: Connection closed by remote host
Mayuresh Kathe
Re: What is our ultimate goal??
Richard Stallman
Real men don't attack straw men
L. V. Lammert
Re: How to find all package files
linux-netdev
:
Natalie Protasevich
[BUG] New Kernel Bugs
Mark Lord
Re: 2.6.25-rc8: FTP transfer errors
Jarek Poplawski
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Vivek Dasmohapatra
2.6.24 ipw2200 driver can't be reset after firmware explodes
Latest forum posts
trouble with my Asus Mainboard
2 hours ago
Linux kernel
windows folder creation surprise
5 hours ago
Windows
Random kernel panic with PPP in 2.6.16.26 kernel
5 hours ago
Linux kernel
sata/ide timeout errors on asus server-mb
9 hours ago
Linux kernel
Resetting the bios password for Toshiba Laptop
13 hours ago
Hardware
Testing for EXT3 filesystem corruption
1 day ago
Linux kernel
Easter Eggs in windows XP
1 day ago
Windows
The state of Linux audio
1 day ago
Linux kernel
reading and writing to configuration register of PCI device
2 days ago
Linux kernel
[HFSX] how to read HFSX partion label
2 days ago
Linux general
Show all forums...
Recent Tags
git 1.6.0
Linus Torvalds
Daniel Phillips
filesystem
ext3
mailing lists
HAMMER
Linux
git
64-bit
ZFS
performance
Junio Hamano
git 1.6
Ingo Molnar
ufs
security
Tux3
Rik van Riel
quote
more tags
Colocation donated by:
Who's online
There are currently
6 users
and
928 guests
online.
Online users
Jeremy
mmessano
tuomoks
ccurtis
Mr_Z
strcmp
Syndicate
speck-geostationary