cpuset: Remove unneeded NODEMASK_ALLOC() in cpuset_sprintf_memlist()
PATCH 1/4 cpuset: Remove unneeded NODEMASK_ALLOC() in cpuset_sprintf_memlist()
It's not necessary to copy cpuset->mems_allowed to a buffer allocated by NODEMASK_ALLOC(). Just pass it to nodelist_scnprintf().
--- kernel/cpuset.c | 10 +--------- 1 files changed, 1 insertions(+), 9 deletions(-)
kernel/cpuset.c +1 -9
@@ -1620,20 +1620,12 @@ static int cpuset_sprintf_cpulist(char *page, struct cpuset *cs)static int cpuset_sprintf_memlist (char *page,struct cpuset *cs) { -NODEMASK_ALLOC (nodemask_t, mask,GFP_KERNEL );int retval; -if (mask ==NULL ) -return -ENOMEM ; -mutex_lock (&callback_mutex); - *mask = cs->mems_allowed; + retval =nodelist_scnprintf (page,PAGE_SIZE , cs->mems_allowed);mutex_unlock (&callback_mutex); - retval =nodelist_scnprintf (page,PAGE_SIZE , *mask); - -NODEMASK_FREE (mask); -return retval; }
Signature · 1 line
1.7.3.1
PATCH 2/4 cpuset: Remove unneeded NODEMASK_ALLOC() in cpuset_attch()
oldcs->mems_allowed is not modified during cpuset_attch(), so we don't have to copy it to a buffer allocated by NODEMASK_ALLOC(). Just pass it to cpuset_migrate_mm().
--- kernel/cpuset.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)
kernel/cpuset.c +2 -5
@@ -1438,10 +1438,9 @@ static void cpuset_attach(struct cgroup_subsys *ss, struct cgroup *cont,struct mm_struct *mm;struct cpuset *cs =cgroup_cs (cont);struct cpuset *oldcs =cgroup_cs (oldcont); -NODEMASK_ALLOC (nodemask_t, from,GFP_KERNEL );NODEMASK_ALLOC (nodemask_t, to,GFP_KERNEL ); -if (from ==NULL || to ==NULL ) +if (to ==NULL ) goto alloc_fail;if (cs == &top_cpuset) {
@@ -1463,18 +1462,16 @@ static void cpuset_attach(struct cgroup_subsys *ss, struct cgroup *cont, }/* change mm; only needs to be done once even if threadgroup */ - *from = oldcs->mems_allowed; *to = cs->mems_allowed; mm =get_task_mm (tsk);if (mm) {mpol_rebind_mm (mm, to);if (is_memory_migrate (cs)) -cpuset_migrate_mm (mm, from, to); +cpuset_migrate_mm (mm, &oldcs->mems_allowed, to);mmput (mm); } alloc_fail: -NODEMASK_FREE (from);NODEMASK_FREE (to); }
Signature · 8 lines
1.7.3.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 2/4] cpuset: Remove unneeded NODEMASK_ALLOC() in cpuset_attch()
Quoted 5 lines · Li Zefan
oldcs->mems_allowedis not modified duringcpuset_attch(), so we don't have to copy it to a buffer allocated byNODEMASK_ALLOC(). Just pass it tocpuset_migrate_mm().Signed-off-by Li Zefan <[email protected]>
I'd be inclined to skip this one - we're already allocating one nodemask, so one more isn't really any extra complexity, and we're doing horrendously complicated stuff in cpuset_migrate_mm() that's much more likely to fail in low-memory situations.
It's true that mems_allowed can't change during the call to cpuset_attach(), but that's due to the fact that both cgroup_attach() and the cpuset.mems write paths take cgroup_mutex. I might prefer to leave the allocated nodemask here and wrap callback_mutex around the places in cpuset_attach() where we're reading from a cpuset's mems_allowed - that would remove the implicit synchronization via cgroup_mutex and leave the code a little more understandable.
Quoted 40 lines
---
kernel/cpuset.c | 7 ++-----1 files changed, 2 insertions(+), 5 deletions(-)kernel/cpuset.c +2
-4@@ -1438,10 +1438,9 @@ static void cpuset_attach(struct cgroup_subsys *ss, struct cgroup *cont, struct mm_struct *mm; struct cpuset *cs = cgroup_cs(cont); struct cpuset *oldcs = cgroup_cs(oldcont); - NODEMASK_ALLOC(nodemask_t, from, GFP_KERNEL); NODEMASK_ALLOC(nodemask_t, to, GFP_KERNEL); - if (from == NULL || to == NULL) + if (to == NULL) goto alloc_fail; if (cs == &top_cpuset) {@@ -1463,18 +1462,16 @@ static void cpuset_attach(struct cgroup_subsys *ss, struct cgroup *cont, } /* change mm; only needs to be done once even if threadgroup */ - *from = oldcs->mems_allowed; *to = cs->mems_allowed; mm = get_task_mm(tsk); if (mm) { mpol_rebind_mm(mm, to); if (is_memory_migrate(cs)) - cpuset_migrate_mm(mm, from, to); + cpuset_migrate_mm(mm, &oldcs->mems_allowed, to); mmput(mm); }alloc_fail:
-NODEMASK_FREE(from);
NODEMASK_FREE(to);
}
Quoted 3 lines
--
1.7.3.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 2/4] cpuset: Remove unneeded NODEMASK_ALLOC() in cpuset_attch()
Quoted 11 lines · Paul Menage
Quoted 5 lines · Li Zefan
oldcs->mems_allowedis not modified duringcpuset_attch(), so we don't have to copy it to a buffer allocated byNODEMASK_ALLOC(). Just pass it tocpuset_migrate_mm().Signed-off-by Li Zefan <[email protected]>I'd be inclined to skip this one - we're already allocating one nodemask, so one more isn't really any extra complexity, and we're doing horrendously complicated stuff in
cpuset_migrate_mm()that's much more likely to fail in low-memory situations.
That's true, but it's not a reason to add more cases that can fail.
Quoted 2 lines
It's true that
mems_allowedcan't change during the call to
Sorry to lead you to mistake what I meant. I meant 'from' is not modified after it's copied from oldcs->mems_allowed, so the two are exactly the same and thus we only need one.
Quoted 6 lines
cpuset_attach(), but that's due to the fact that bothcgroup_attach()and the cpuset.mems write paths takecgroup_mutex. I might prefer to leave the allocated nodemask here and wrapcallback_mutexaround the places incpuset_attach()where we're reading from a cpuset'smems_allowed- that would remove the implicit synchronization viacgroup_mutexand leave the code a little more understandable.
It's not an implicit synchronization, but instead the lock rule for reading/writing a cpuset's mems/cpus is described in the comment.
Quoted 36 lines
Quoted 36 lines
--- kernel/cpuset.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)kernel/cpuset.c +2
-4@@ -1438,10 +1438,9 @@ static void cpuset_attach(struct cgroup_subsys *ss, struct cgroup *cont,struct mm_struct *mm;struct cpuset *cs =cgroup_cs (cont);struct cpuset *oldcs =cgroup_cs (oldcont); -NODEMASK_ALLOC (nodemask_t, from,GFP_KERNEL );NODEMASK_ALLOC (nodemask_t, to,GFP_KERNEL ); -if (from ==NULL || to ==NULL ) +if (to ==NULL ) goto alloc_fail;if (cs == &top_cpuset) {@@ -1463,18 +1462,16 @@ static void cpuset_attach(struct cgroup_subsys *ss, struct cgroup *cont, }/* change mm; only needs to be done once even if threadgroup */ - *from = oldcs->mems_allowed; *to = cs->mems_allowed; mm =get_task_mm (tsk);if (mm) {mpol_rebind_mm (mm, to);if (is_memory_migrate (cs)) -cpuset_migrate_mm (mm, from, to); +cpuset_migrate_mm (mm, &oldcs->mems_allowed, to);mmput (mm); }
Quoted 9 lines
Quoted 8 lines
kernel/cpuset.c +0
-2alloc_fail: -NODEMASK_FREE (from);NODEMASK_FREE (to); } --1.7.3.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 2/4] cpuset: Remove unneeded NODEMASK_ALLOC() in cpuset_attch()
In reply to Li ZefanQuoted 5 lines · Li Zefan
oldcs->mems_allowedis not modified duringcpuset_attch(), so we don't have to copy it to a buffer allocated byNODEMASK_ALLOC(). Just pass it tocpuset_migrate_mm().Signed-off-by Li Zefan <[email protected]>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH 3/4 cpuset: Fix unchecked calls to NODEMASK_ALLOC()
In reply to Li ZefanThose functions that use NODEMASK_ALLOC() can't propogate errno to users, but will fail silently.
Since all of them are called with cgroup_mutex held, here we use a global nodemask_t variable.
--- kernel/cpuset.c | 45 +++++++++++++++------------------------------ 1 files changed, 15 insertions(+), 30 deletions(-)
kernel/cpuset.c +15 -30
@@ -79,6 +79,15 @@ int number_of_cpusets __read_mostly;struct cgroup_subsys cpuset_subsys;struct cpuset ; +/* +* In functions that can't propogate errno to users, to avoid declaring a +* nodemask_t variable, and avoid using NODEMASK_ALLOC that can return +* -ENOMEM, we use this global cpuset_mems. +* +* It should be used with cgroup_lock held. +*/ +static nodemask_t cpuset_mems; +/* See "Frequency meter" comments, below. */ struct fmeter {
@@ -1015,17 +1024,11 @@ static void cpuset_change_nodemask(struct task_struct *p,struct cpuset *cs;int migrate;const nodemask_t *oldmem = scan->data; -NODEMASK_ALLOC (nodemask_t, newmems,GFP_KERNEL ); - -if (!newmems) -return ; cs =cgroup_cs (scan->cg); -guarantee_online_mems (cs, newmems); - -cpuset_change_task_nodemask (p, newmems); +guarantee_online_mems (cs, &cpuset_mems); -NODEMASK_FREE (newmems); +cpuset_change_task_nodemask (p, &cpuset_mems); mm =get_task_mm (p);if (!mm)
@@ -1096,13 +1099,10 @@ static void update_tasks_nodemask(struct cpuset *cs, const nodemask_t *oldmem,static int update_nodemask (struct cpuset *cs,struct cpuset *trialcs,const char *buf) { -NODEMASK_ALLOC (nodemask_t, oldmem,GFP_KERNEL ); +nodemask_t *oldmem = &cpuset_mems;int retval;struct ptr_heap heap; -if (!oldmem) -return -ENOMEM ; -/* * top_cpuset.mems_allowed tracks node_stats[N_HIGH_MEMORY]; * it's read-only
@@ -1152,7 +1152,6 @@ static int update_nodemask(struct cpuset *cs, struct cpuset *trialcs,heap_free (&heap); done: -NODEMASK_FREE (oldmem);return retval; }
@@ -1438,10 +1437,7 @@ static void cpuset_attach(struct cgroup_subsys *ss, struct cgroup *cont,struct mm_struct *mm;struct cpuset *cs =cgroup_cs (cont);struct cpuset *oldcs =cgroup_cs (oldcont); -NODEMASK_ALLOC (nodemask_t, to,GFP_KERNEL ); - -if (to ==NULL ) - goto alloc_fail; +nodemask_t *to = &cpuset_mems;if (cs == &top_cpuset) {cpumask_copy (cpus_attach, cpu_possible_mask);
@@ -1470,9 +1466,6 @@ static void cpuset_attach(struct cgroup_subsys *ss, struct cgroup *cont,cpuset_migrate_mm (mm, &oldcs->mems_allowed, to);mmput (mm); } - -alloc_fail: -NODEMASK_FREE (to); }/* The various types of files and directories in a cpuset file system */
@@ -2051,10 +2044,7 @@ static void scan_for_empty_cpusets(struct cpuset *root)struct cpuset *cp;/* scans cpusets being updated */ struct cpuset *child;/* scans child cpusets of cp */ struct cgroup *cont; -NODEMASK_ALLOC (nodemask_t, oldmems,GFP_KERNEL ); - -if (oldmems ==NULL ) -return ; +nodemask_t *oldmems = &cpuset_mems;list_add_tail ((struct list_head *)&root->stack_list, &queue);
@@ -2090,7 +2080,6 @@ static void scan_for_empty_cpusets(struct cpuset *root)update_tasks_nodemask (cp, oldmems,NULL ); } } -NODEMASK_FREE (oldmems); }/*
@@ -2132,10 +2121,7 @@ void cpuset_update_active_cpus(void)static int cpuset_track_online_nodes (struct notifier_block *self,unsigned long action,void *arg) { -NODEMASK_ALLOC (nodemask_t, oldmems,GFP_KERNEL ); - -if (oldmems ==NULL ) -return NOTIFY_DONE ; +nodemask_t *oldmems = &cpuset_mems;cgroup_lock ();switch (action) {
@@ -2158,7 +2144,6 @@ static int cpuset_track_online_nodes(struct notifier_block *self, }cgroup_unlock (); -NODEMASK_FREE (oldmems);return NOTIFY_OK ; }#endif
Signature · 1 line
1.7.3.1
Andrew Morton
maintainerRe: [PATCH 3/4] cpuset: Fix unchecked calls to NODEMASK_ALLOC()
Quoted 6 lines · On Thu, 17 Feb 2011 09:50:09 +0800 Li Zefan <[email protected]> wrote:
+/*
+ * In functions that can't propogate errno to users, to avoid declaring a
+ *nodemask_tvariable, and avoid usingNODEMASK_ALLOCthat can return
+ *-ENOMEM, we use this globalcpuset_mems.
+ *
+ * It should be used withcgroup_lockheld.
I'll do s/should/must/ - that would be a nasty bug.
I'd be more comfortable about the maintainability of this optimisation if we had
WARN_ON(!cgroup_is_locked());
at each site.
Quoted 2 lines
+ */
+staticnodemask_tcpuset_mems;
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 3/4] cpuset: Fix unchecked calls to NODEMASK_ALLOC()
Quoted 10 lines · Andrew Morton
Quoted 6 lines · On Thu, 17 Feb 2011 09:50:09 +0800 Li Zefan <[email protected]> wrote:
+/*
+ * In functions that can't propogate errno to users, to avoid declaring a
+ *nodemask_tvariable, and avoid usingNODEMASK_ALLOCthat can return
+ *-ENOMEM, we use this globalcpuset_mems.
+ *
+ * It should be used withcgroup_lockheld.
Quoted 9 lines
I'll do s/should/must/ - that would be a nasty bug.
I'd be more comfortable about the maintainability of this optimisation if we had
WARN_ON(!cgroup_is_locked());
at each site.
Agreed - that was my first thought on reading the patch. How about:
static nodemask_t *cpuset_static_nodemask() {
static nodemask_t nodemask;
WARN_ON(!cgroup_is_locked());
return &nodemask;
}
and then just call cpuset_static_nodemask() in the various locations being patched?
Paul
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 3/4] cpuset: Fix unchecked calls to NODEMASK_ALLOC()
Quoted 17 lines · Paul Menage
Quoted 15 lines · Andrew Morton
Quoted 6 lines · On Thu, 17 Feb 2011 09:50:09 +0800 Li Zefan <[email protected]> wrote:
+/*
+ * In functions that can't propogate errno to users, to avoid declaring a
+ *nodemask_tvariable, and avoid usingNODEMASK_ALLOCthat can return
+ *-ENOMEM, we use this globalcpuset_mems.
+ *
+ * It should be used withcgroup_lockheld.I'll do s/should/must/ - that would be a nasty bug.
I'd be more comfortable about the maintainability of this optimisation if we had
Quoted 8 lines
Quoted 4 lines
WARN_ON(!cgroup_is_locked());at each site.
Agreed - that was my first thought on reading the patch. How about:
static
nodemask_t*cpuset_static_nodemask(){
Then this should be 'noinline', otherwise we'll have one copy for each function that calls it.
Quoted 8 lines
static
nodemask_tnodemask;
WARN_ON(!cgroup_is_locked());
return &nodemask;
}and then just call
cpuset_static_nodemask()in the various locations being patched?
I think a defect of this is people might call it twice in one function but don't know it returns the same variable?
For example in cpuset_attach():
void cpuset_attach(...)
{
nodemask_t *from = cpuset_static_nodemask();
nodemask_t *to = cpuset_static_nodemask();
...
}--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 3/4] cpuset: Fix unchecked calls to NODEMASK_ALLOC()
Quoted 3 lines · Li Zefan
I think a defect of this is people might call it twice in one function but don't know it returns the same variable?
Hopefully they'd read the comments...
But it's not a big issue either way - having the WARN_ON() statements in front of each use works OK too, given that there are only a few of them.
Paul
Re: [PATCH 3/4] cpuset: Fix unchecked calls to NODEMASK_ALLOC()
In reply to Li ZefanQuoted 7 lines · Li Zefan
Those functions that use
NODEMASK_ALLOC()can't propogate errno to users, but will fail silently.Since all of them are called with
cgroup_mutexheld, here we use a globalnodemask_tvariable.Signed-off-by Li Zefan <[email protected]>
I like the idea and the comment is explicit enough that we don't need any refcounting to ensure double usage under cgroup_lock. I think each function should be modified to use cpuset_mems directly, though, instead of defining local variables that indirectly access it which only serves to make this patch smaller. Then we can ensure that all occurrences of cpuset_mems appear within the lock without being concerned about other references.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 3/4] cpuset: Fix unchecked calls to NODEMASK_ALLOC()
Quoted 10 lines · David Rientjes
Quoted 7 lines · Li Zefan
Those functions that use
NODEMASK_ALLOC()can't propogate errno to users, but will fail silently.Since all of them are called with
cgroup_mutexheld, here we use a globalnodemask_tvariable.Signed-off-by Li Zefan <[email protected]>
Quoted 8 lines
I like the idea and the comment is explicit enough that we don't need any refcounting to ensure double usage under
cgroup_lock. I think each function should be modified to usecpuset_memsdirectly, though, instead of defining local variables that indirectly access it which only serves to make this patch smaller. Then we can ensure that all occurrences ofcpuset_memsappear within the lock without being concerned about other references.
Unfortunately, as I looked into the code again I found cpuset_change_nodemask() is called by other functions that use the global cpuset_mems, so I think we'd better check the refcnt of cpuset_mems.
How about this:
[PATCH 3/4] cpuset: Fix unchecked calls to NODEMASK_ALLOC()
Those functions that use NODEMASK_ALLOC() can't propogate errno to users, so might fail silently.
Based on the fact that all of them are called with cgroup_mutex held, we fix this by using a global nodemask.
cpuset_change_nodemask() is an exception, because it's called by other functions. Here we declare a static nodemask in the function for its own use.
--- kernel/cpuset.c | 82 +++++++++++++++++++++++++++++++++---------------------- 1 files changed, 49 insertions(+), 33 deletions(-)
kernel/cpuset.c +49 -33
@@ -79,6 +79,38 @@ int number_of_cpusets __read_mostly;struct cgroup_subsys cpuset_subsys;struct cpuset ; +static nodemask_t cpuset_mems; +static int cpuset_mems_ref; + +/* +* In functions that can't propagate errno to users, to avoid declaring a +* nodemask_t variable in stack, and avoid using NODEMASK_ALLOC that can +* return -ENOMEM, we use a global cpuset_mems. +* +* It must be used with cgroup_lock held. +*/ +static nodemask_t *cpuset_static_nodemask (void ) +{ +WARN_ON (!cgroup_lock_is_held ()); +WARN_ON (cpuset_mems_ref); + + cpuset_mems_ref++; +return &cpuset_mems; +} + +/* +* Calling cpuset_static_nodemask() should be paired with this function, +* so we insure the global nodemask won't be used by more than one user +* at the one time. +*/ +static void cpuset_release_static_nodemask (void ) +{ +WARN_ON (!cgroup_lock_is_held ()); + + cpuset_mems_ref--; +WARN_ON (!cpuset_mems_ref); +} +/* See "Frequency meter" comments, below. */ struct fmeter {
@@ -1015,17 +1047,12 @@ static void cpuset_change_nodemask(struct task_struct *p,struct cpuset *cs;int migrate;const nodemask_t *oldmem = scan->data; -NODEMASK_ALLOC (nodemask_t, newmems,GFP_KERNEL ); - -if (!newmems) -return ; +static nodemask_t newmems;/* protected by cgroup_mutex */ cs =cgroup_cs (scan->cg); -guarantee_online_mems (cs, newmems); - -cpuset_change_task_nodemask (p, newmems); +guarantee_online_mems (cs, &newmems); -NODEMASK_FREE (newmems); +cpuset_change_task_nodemask (p, &newmems); mm =get_task_mm (p);if (!mm)
@@ -1096,13 +1123,10 @@ static void update_tasks_nodemask(struct cpuset *cs, const nodemask_t *oldmem,static int update_nodemask (struct cpuset *cs,struct cpuset *trialcs,const char *buf) { -NODEMASK_ALLOC (nodemask_t, oldmem,GFP_KERNEL ); +nodemask_t *oldmem =cpuset_static_nodemask ();int retval;struct ptr_heap heap; -if (!oldmem) -return -ENOMEM ; -/* * top_cpuset.mems_allowed tracks node_stats[N_HIGH_MEMORY]; * it's read-only
@@ -1152,7 +1176,7 @@ static int update_nodemask(struct cpuset *cs, struct cpuset *trialcs,heap_free (&heap); done: -NODEMASK_FREE (oldmem); +cpuset_release_static_nodemask ();return retval; }
@@ -1438,10 +1462,7 @@ static void cpuset_attach(struct cgroup_subsys *ss, struct cgroup *cont,struct mm_struct *mm;struct cpuset *cs =cgroup_cs (cont);struct cpuset *oldcs =cgroup_cs (oldcont); -NODEMASK_ALLOC (nodemask_t, to,GFP_KERNEL ); - -if (to ==NULL ) - goto alloc_fail; +nodemask_t *to =cpuset_static_nodemask ();if (cs == &top_cpuset) {cpumask_copy (cpus_attach, cpu_possible_mask);
@@ -1461,18 +1482,17 @@ static void cpuset_attach(struct cgroup_subsys *ss, struct cgroup *cont,rcu_read_unlock (); } +cpuset_release_static_nodemask (); +/* change mm; only needs to be done once even if threadgroup */ - *to = cs->mems_allowed; mm =get_task_mm (tsk);if (mm) { -mpol_rebind_mm (mm, to); +mpol_rebind_mm (mm, &cs->mems_allowed);if (is_memory_migrate (cs)) -cpuset_migrate_mm (mm, &oldcs->mems_allowed, to); +cpuset_migrate_mm (mm, &oldcs->mems_allowed, + &cs->mems_allowed);mmput (mm); } - -alloc_fail: -NODEMASK_FREE (to); }/* The various types of files and directories in a cpuset file system */
@@ -2051,10 +2071,7 @@ static void scan_for_empty_cpusets(struct cpuset *root)struct cpuset *cp;/* scans cpusets being updated */ struct cpuset *child;/* scans child cpusets of cp */ struct cgroup *cont; -NODEMASK_ALLOC (nodemask_t, oldmems,GFP_KERNEL ); - -if (oldmems ==NULL ) -return ; +nodemask_t *oldmems =cpuset_static_nodemask ();list_add_tail ((struct list_head *)&root->stack_list, &queue);
@@ -2090,7 +2107,8 @@ static void scan_for_empty_cpusets(struct cpuset *root)update_tasks_nodemask (cp, oldmems,NULL ); } } -NODEMASK_FREE (oldmems); + +cpuset_release_static_nodemask (); }/*
@@ -2132,19 +2150,18 @@ void cpuset_update_active_cpus(void)static int cpuset_track_online_nodes (struct notifier_block *self,unsigned long action,void *arg) { -NODEMASK_ALLOC (nodemask_t, oldmems,GFP_KERNEL ); - -if (oldmems ==NULL ) -return NOTIFY_DONE ; +nodemask_t *oldmems;cgroup_lock ();switch (action) {case MEM_ONLINE : + oldmems =cpuset_static_nodemask (); *oldmems = top_cpuset.mems_allowed;mutex_lock (&callback_mutex); top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY ];mutex_unlock (&callback_mutex);update_tasks_nodemask (&top_cpuset, oldmems,NULL ); +cpuset_release_static_nodemask ();break ;case MEM_OFFLINE :/*
@@ -2158,7 +2175,6 @@ static int cpuset_track_online_nodes(struct notifier_block *self, }cgroup_unlock (); -NODEMASK_FREE (oldmems);return NOTIFY_OK ; }#endif
Signature · 1 line
1.7.3.1
Re: [PATCH 3/4] cpuset: Fix unchecked calls to NODEMASK_ALLOC()
kernel/cpuset.c int number_of_cpusets __read_mostly; · line 111
Quoted 11 lines
kernel/cpuset.c +11
-0+/* +* Calling cpuset_static_nodemask() should be paired with this function, +* so we insure the global nodemask won't be used by more than one user +* at the one time. +*/ +static void cpuset_release_static_nodemask (void ) +{ +WARN_ON (!cgroup_lock_is_held ()); + + cpuset_mems_ref--; +WARN_ON (!cpuset_mems_ref);
WARN_ON(cpuset_mems_ref);
Quoted 1 line
+}
Re: [PATCH 3/4] cpuset: Fix unchecked calls to NODEMASK_ALLOC()
In reply to Li ZefanQuoted 6 lines · Li Zefan
Unfortunately, as I looked into the code again I found
cpuset_change_nodemask()is called by other functions that use the globalcpuset_mems, so I think we'd better check the refcnt ofcpuset_mems.How about this:
Quoted 8 lines
[PATCH 3/4] cpuset: Fix unchecked calls to
NODEMASK_ALLOC()Those functions that use
NODEMASK_ALLOC()can't propogate errno to users, so might fail silently.Based on the fact that all of them are called with
cgroup_mutexheld, we fix this by using a global nodemask.
If all of the functions that require a nodemask are protected by cgroup_mutex, then I think it would be much better to just statically allocate them within the function and avoid any nodemask in file scope. cpuset_mems cannot be shared so introducing it with a refcount would probably just be confusing.
Re: [PATCH 3/4] cpuset: Fix unchecked calls to NODEMASK_ALLOC()
Quoted 17 lines · David Rientjes
Quoted 6 lines · Li Zefan
Unfortunately, as I looked into the code again I found
cpuset_change_nodemask()is called by other functions that use the globalcpuset_mems, so I think we'd better check the refcnt ofcpuset_mems.How about this:
Quoted 8 lines
[PATCH 3/4] cpuset: Fix unchecked calls to
NODEMASK_ALLOC()Those functions that use
NODEMASK_ALLOC()can't propogate errno to users, so might fail silently.Based on the fact that all of them are called with
cgroup_mutexheld, we fix this by using a global nodemask.
Quoted 6 lines
If all of the functions that require a nodemask are protected by
cgroup_mutex, then I think it would be much better to just statically allocate them within the function and avoid any nodemask in file scope.cpuset_memscannot be shared so introducing it with a refcount would probably just be confusing.
I'll repost the patchset after you ack this patch.
[PATCH 3/4] cpuset: Fix unchecked calls to NODEMASK_ALLOC()
Those functions that use NODEMASK_ALLOC() can't propogate errno to users, so might fail silently.
Fix it by using one static nodemask_t variable for each function, and those variables are protected by cgroup_mutex.
--- kernel/cpuset.c | 50 ++++++++++++++++---------------------------------- 1 files changed, 16 insertions(+), 34 deletions(-)
kernel/cpuset.c +16 -34
@@ -1015,17 +1015,12 @@ static void cpuset_change_nodemask(struct task_struct *p,struct cpuset *cs;int migrate;const nodemask_t *oldmem = scan->data; -NODEMASK_ALLOC (nodemask_t, newmems,GFP_KERNEL ); - -if (!newmems) -return ; +static nodemask_t newmems;/* protected by cgroup_mutex */ cs =cgroup_cs (scan->cg); -guarantee_online_mems (cs, newmems); - -cpuset_change_task_nodemask (p, newmems); +guarantee_online_mems (cs, &newmems); -NODEMASK_FREE (newmems); +cpuset_change_task_nodemask (p, &newmems); mm =get_task_mm (p);if (!mm)
@@ -1438,41 +1433,35 @@ static void cpuset_attach(struct cgroup_subsys *ss, struct cgroup *cont,struct mm_struct *mm;struct cpuset *cs =cgroup_cs (cont);struct cpuset *oldcs =cgroup_cs (oldcont); -NODEMASK_ALLOC (nodemask_t, to,GFP_KERNEL ); - -if (to ==NULL ) - goto alloc_fail; +static nodemask_t to;/* protected by cgroup_mutex */ if (cs == &top_cpuset) {cpumask_copy (cpus_attach, cpu_possible_mask); }else {guarantee_online_cpus (cs, cpus_attach); } -guarantee_online_mems (cs, to); +guarantee_online_mems (cs, &to);/* do per-task migration stuff possibly for each in the threadgroup */ -cpuset_attach_task (tsk, to, cs); +cpuset_attach_task (tsk, &to, cs);if (threadgroup) {struct task_struct *c;rcu_read_lock ();list_for_each_entry_rcu (c, &tsk->thread_group, thread_group) { -cpuset_attach_task (c, to, cs); +cpuset_attach_task (c, &to, cs); }rcu_read_unlock (); }/* change mm; only needs to be done once even if threadgroup */ - *to = cs->mems_allowed; + to = cs->mems_allowed; mm =get_task_mm (tsk);if (mm) { -mpol_rebind_mm (mm, to); +mpol_rebind_mm (mm, &to);if (is_memory_migrate (cs)) -cpuset_migrate_mm (mm, &oldcs->mems_allowed, to); +cpuset_migrate_mm (mm, &oldcs->mems_allowed, &to);mmput (mm); } - -alloc_fail: -NODEMASK_FREE (to); }/* The various types of files and directories in a cpuset file system */
@@ -2051,10 +2040,7 @@ static void scan_for_empty_cpusets(struct cpuset *root)struct cpuset *cp;/* scans cpusets being updated */ struct cpuset *child;/* scans child cpusets of cp */ struct cgroup *cont; -NODEMASK_ALLOC (nodemask_t, oldmems,GFP_KERNEL ); - -if (oldmems ==NULL ) -return ; +static nodemask_t oldmems;/* protected by cgroup_mutex */ list_add_tail ((struct list_head *)&root->stack_list, &queue);
@@ -2071,7 +2057,7 @@ static void scan_for_empty_cpusets(struct cpuset *root) nodes_subset(cp->mems_allowed, node_states[N_HIGH_MEMORY])) continue; - *oldmems = cp->mems_allowed; + oldmems = cp->mems_allowed;/* Remove offline cpus and mems from this cpuset. */ mutex_lock (&callback_mutex);
@@ -2087,10 +2073,9 @@ static void scan_for_empty_cpusets(struct cpuset *root)remove_tasks_in_empty_cpuset (cp); else {update_tasks_cpumask (cp,NULL ); -update_tasks_nodemask (cp, oldmems,NULL ); +update_tasks_nodemask (cp, &oldmems,NULL ); } } -NODEMASK_FREE (oldmems); }/*
@@ -2132,19 +2117,16 @@ void cpuset_update_active_cpus(void)static int cpuset_track_online_nodes (struct notifier_block *self,unsigned long action,void *arg) { -NODEMASK_ALLOC (nodemask_t, oldmems,GFP_KERNEL ); - -if (oldmems ==NULL ) -return NOTIFY_DONE ; +static nodemask_t oldmems;/* protected by cgroup_mutex */ cgroup_lock ();switch (action) {case MEM_ONLINE : - *oldmems = top_cpuset.mems_allowed; + oldmems = top_cpuset.mems_allowed;mutex_lock (&callback_mutex); top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY ];mutex_unlock (&callback_mutex); -update_tasks_nodemask (&top_cpuset, oldmems,NULL ); +update_tasks_nodemask (&top_cpuset, &oldmems,NULL );break ;case MEM_OFFLINE :/*
Signature · 1 line
1.7.3.1
David Rientjes
Acked-byRe: [PATCH 3/4] cpuset: Fix unchecked calls to NODEMASK_ALLOC()
Quoted 8 lines · Li Zefan
[PATCH 3/4] cpuset: Fix unchecked calls to
NODEMASK_ALLOC()Those functions that use
NODEMASK_ALLOC()can't propogate errno to users, so might fail silently.Fix it by using one static
nodemask_tvariable for each function, and those variables are protected bycgroup_mutex.
I think there would also be incentive to do the same thing for update_nodemask() even though its caller can handle -ENOMEM. Imagine current being out of memory and the NODEMASK_ALLOC() subsequently failing because it is oom yet it may be trying to give itself more memory. It's also protected by cgroup_mutex so the only thing we're sacrificing is 8 bytes on the defconfig and 256 bytes even with CONFIG_NODES_SHIFT == 10. On machines that large, this seems like an acceptable cost to ensure we can give ourselves more memory :)
Quoted 14 lines
Signed-off-by Li Zefan <[email protected]>--- kernel/cpuset.c | 50 ++++++++++++++++---------------------------------- 1 files changed, 16 insertions(+), 34 deletions(-)kernel/cpuset.c +0
-1@@ -1015,17 +1015,12 @@ static void cpuset_change_nodemask(struct task_struct *p,struct cpuset *cs;int migrate;const nodemask_t *oldmem = scan->data; -NODEMASK_ALLOC (nodemask_t, newmems,GFP_KERNEL );
kernel/cpuset.c static void cpuset_change_nodemask(struct task_struct *p, · line 1021
Quoted 10 lines
kernel/cpuset.c +2
-6- -if (!newmems) -return ; +static nodemask_t newmems;/* protected by cgroup_mutex */ cs =cgroup_cs (scan->cg); -guarantee_online_mems (cs, newmems); - -cpuset_change_task_nodemask (p, newmems); +guarantee_online_mems (cs, &newmems);
The newmems nodemask is going to be persistant across calls since it is static, so we have to be careful that nothing depends on it being NODE_MASK_NONE. Indeed, NODEMASK_ALLOC() with just GFP_KERNEL doesn't guarantee anything different. guarantee_online_mems() sets the nodemask, so this looks good.
Quoted 101 lines
kernel/cpuset.c +12
-25-NODEMASK_FREE (newmems); +cpuset_change_task_nodemask (p, &newmems); mm =get_task_mm (p);if (!mm)@@ -1438,41 +1433,35 @@ static void cpuset_attach(struct cgroup_subsys *ss, struct cgroup *cont,struct mm_struct *mm;struct cpuset *cs =cgroup_cs (cont);struct cpuset *oldcs =cgroup_cs (oldcont); -NODEMASK_ALLOC (nodemask_t, to,GFP_KERNEL ); - -if (to ==NULL ) - goto alloc_fail; +static nodemask_t to;/* protected by cgroup_mutex */ if (cs == &top_cpuset) {cpumask_copy (cpus_attach, cpu_possible_mask); }else {guarantee_online_cpus (cs, cpus_attach); } -guarantee_online_mems (cs, to); +guarantee_online_mems (cs, &to);/* do per-task migration stuff possibly for each in the threadgroup */ -cpuset_attach_task (tsk, to, cs); +cpuset_attach_task (tsk, &to, cs);if (threadgroup) {struct task_struct *c;rcu_read_lock ();list_for_each_entry_rcu (c, &tsk->thread_group, thread_group) { -cpuset_attach_task (c, to, cs); +cpuset_attach_task (c, &to, cs); }rcu_read_unlock (); }/* change mm; only needs to be done once even if threadgroup */ - *to = cs->mems_allowed; + to = cs->mems_allowed; mm =get_task_mm (tsk);if (mm) { -mpol_rebind_mm (mm, to); +mpol_rebind_mm (mm, &to);if (is_memory_migrate (cs)) -cpuset_migrate_mm (mm, &oldcs->mems_allowed, to); +cpuset_migrate_mm (mm, &oldcs->mems_allowed, &to);mmput (mm); } - -alloc_fail: -NODEMASK_FREE (to); }/* The various types of files and directories in a cpuset file system */ @@ -2051,10 +2040,7 @@ static void scan_for_empty_cpusets(struct cpuset *root)struct cpuset *cp;/* scans cpusets being updated */ struct cpuset *child;/* scans child cpusets of cp */ struct cgroup *cont; -NODEMASK_ALLOC (nodemask_t, oldmems,GFP_KERNEL ); - -if (oldmems ==NULL ) -return ; +static nodemask_t oldmems;/* protected by cgroup_mutex */ list_add_tail ((struct list_head *)&root->stack_list, &queue);@@ -2071,7 +2057,7 @@ static void scan_for_empty_cpusets(struct cpuset *root) nodes_subset(cp->mems_allowed, node_states[N_HIGH_MEMORY])) continue; - *oldmems = cp->mems_allowed; + oldmems = cp->mems_allowed;/* Remove offline cpus and mems from this cpuset. */ mutex_lock (&callback_mutex);@@ -2087,10 +2073,9 @@ static void scan_for_empty_cpusets(struct cpuset *root)remove_tasks_in_empty_cpuset (cp); else {update_tasks_cpumask (cp,NULL ); -update_tasks_nodemask (cp, oldmems,NULL ); +update_tasks_nodemask (cp, &oldmems,NULL ); } } -NODEMASK_FREE (oldmems); }/* @@ -2132,19 +2117,16 @@ void cpuset_update_active_cpus(void)static int cpuset_track_online_nodes (struct notifier_block *self,unsigned long action,void *arg) { -NODEMASK_ALLOC (nodemask_t, oldmems,GFP_KERNEL ); - -if (oldmems ==NULL ) -return NOTIFY_DONE ; +static nodemask_t oldmems;/* protected by cgroup_mutex */ cgroup_lock ();switch (action) {case MEM_ONLINE :
kernel/cpuset.c void cpuset_update_active_cpus(void) · line 2132
Quoted 10 lines
kernel/cpuset.c +2
-2- *oldmems = top_cpuset.mems_allowed; + oldmems = top_cpuset.mems_allowed;mutex_lock (&callback_mutex); top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY ];mutex_unlock (&callback_mutex); -update_tasks_nodemask (&top_cpuset, oldmems,NULL ); +update_tasks_nodemask (&top_cpuset, &oldmems,NULL );break ;case MEM_OFFLINE :/*
The NODEMASK_FREE() wasn't removed from cpuset_track_online_nodes(). After that's fixed:
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH 4/4 cpuset: Hold callback_mutex in cpuset_clone()
In reply to Li ZefanChaning cpuset->mems/cpuset->cpus should be protected under callback_mutex.
cpuset_clone() doesn't follow this rule. It's ok because it's called when creating and initializing a cgroup, but we'd better hold the lock to avoid subtil break in the future.
--- kernel/cpuset.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
kernel/cpuset.c +2 -0
@@ -1840,8 +1840,10 @@ static void cpuset_post_clone(struct cgroup_subsys *ss, cs =cgroup_cs (cgroup); parent_cs =cgroup_cs (parent); +mutex_lock (&callback_mutex); cs->mems_allowed = parent_cs->mems_allowed;cpumask_copy (cs->cpus_allowed, parent_cs->cpus_allowed); +mutex_unlock (&callback_mutex);return ; }
Signature · 8 lines
1.7.3.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 4/4] cpuset: Hold callback_mutex in cpuset_clone()
Quoted 8 lines · Li Zefan
Chaning cpuset->mems/cpuset->cpus should be protected under
callback_mutex.
cpuset_clone()doesn't follow this rule. It's ok because it's called when creating and initializing a cgroup, but we'd better hold the lock to avoid subtil break in the future.Signed-off-by Li Zefan <[email protected]>
Patch title should be s/cpuset_clone/cpuset_post_clone/
Quoted 20 lines
---
kernel/cpuset.c | 2 ++1 files changed, 2 insertions(+), 0 deletions(-)kernel/cpuset.c +2
-1@@ -1840,8 +1840,10 @@ static void cpuset_post_clone(struct cgroup_subsys *ss, cs = cgroup_cs(cgroup); parent_cs = cgroup_cs(parent); + mutex_lock(&callback_mutex); cs->mems_allowed = parent_cs->mems_allowed; cpumask_copy(cs->cpus_allowed, parent_cs->cpus_allowed); + mutex_unlock(&callback_mutex); return; } --
Quoted 2 lines
1.7.3.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 4/4] cpuset: Hold callback_mutex in cpuset_clone()
In reply to Li ZefanQuoted 8 lines · Li Zefan
Chaning cpuset->mems/cpuset->cpus should be protected under
callback_mutex.
cpuset_clone()doesn't follow this rule. It's ok because it's called when creating and initializing a cgroup, but we'd better hold the lock to avoid subtil break in the future.Signed-off-by Li Zefan <[email protected]>
Quoted 4 lines · Li Zefan
It's not necessary to copy
cpuset->mems_allowedto a buffer allocated byNODEMASK_ALLOC(). Just pass it tonodelist_scnprintf().Signed-off-by Li Zefan <[email protected]>
The only downside is that we're now doing more work (and more complex work) inside callback_mutex, but I guess that's OK compared to having to do a memory allocation. (I poked around in lib/vsprintf.c and I couldn't see any cases where it might allocate memory, but it would be particularly bad if there was any way to trigger an Oops.)
Quoted 9 lines
---
kernel/cpuset.c | 10 +---------1 files changed, 1 insertions(+), 9 deletions(-)kernel/cpuset.c +0
-0
kernel/cpuset.c static int cpuset_sprintf_cpulist(char *page, struct cpuset *cs) · line 1628
Quoted 9 lines
kernel/cpuset.c +0
-4@@ -1620,20 +1620,12 @@ static int cpuset_sprintf_cpulist(char *page, struct cpuset *cs) static int cpuset_sprintf_memlist(char *page, struct cpuset *cs) { - NODEMASK_ALLOC(nodemask_t, mask, GFP_KERNEL); int retval; - if (mask == NULL) - return -ENOMEM; -
And this was particularly broken since the only caller of cpuset_sprintf_memlist() doesn't handle a negative error response anyway and would then overwrite byte 4083 on the preceding page with a '\n'. And then since the (size_t)(s-page) that's passed to simple_read_from_buffer() would be a very large number, it would write arbitrary (user-controlled) amounts of kernel data to the userspace buffer.
Maybe we could also rename 'retval' to 'count' in this function (and cpuset_sprintf_cpulist()) to make it clearer that callers don't expect negative error values?
Quoted 13 lines
kernel/cpuset.c +1
-6mutex_lock(&callback_mutex); - *mask = cs->mems_allowed; + retval = nodelist_scnprintf(page, PAGE_SIZE, cs->mems_allowed); mutex_unlock(&callback_mutex); - retval = nodelist_scnprintf(page, PAGE_SIZE, *mask); - - NODEMASK_FREE(mask); - return retval; } --
Quoted 2 lines
1.7.3.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 41 lines · Paul Menage
Quoted 4 lines · Li Zefan
It's not necessary to copy
cpuset->mems_allowedto a buffer allocated byNODEMASK_ALLOC(). Just pass it tonodelist_scnprintf().Signed-off-by Li Zefan <[email protected]>Acked-by Paul Menage <[email protected]>The only downside is that we're now doing more work (and more complex work) inside
callback_mutex, but I guess that's OK compared to having to do a memory allocation. (I poked around inlib/vsprintf.cand I couldn't see any cases where it might allocate memory, but it would be particularly bad if there was any way to trigger an Oops.)Quoted 9 lines
--- kernel/cpuset.c | 10 +--------- 1 files changed, 1 insertions(+), 9 deletions(-)kernel/cpuset.c +0
-0kernel/cpuset.c static int cpuset_sprintf_cpulist(char *page, struct cpuset *cs) · line 1628
Quoted 9 lines
kernel/cpuset.c +0
-4@@ -1620,20 +1620,12 @@ static int cpuset_sprintf_cpulist(char *page, struct cpuset *cs)static int cpuset_sprintf_memlist (char *page,struct cpuset *cs) { -NODEMASK_ALLOC (nodemask_t, mask,GFP_KERNEL );int retval; -if (mask ==NULL ) -return -ENOMEM ; -And this was particularly broken since the only caller of
cpuset_sprintf_memlist()doesn't handle a negative error response anyway and would then overwrite byte 4083 on the preceding page with a '\n'. And then since the (size_t)(s-page) that's passed tosimple_read_from_buffer()would be a very large number, it would write arbitrary (user-controlled) amounts of kernel data to the userspace buffer.
Quoted 4 lines
Maybe we could also rename 'retval' to 'count' in this function (and
cpuset_sprintf_cpulist()) to make it clearer that callers don't expect negative error values?
Good spot!
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 4 lines · Li Zefan
It's not necessary to copy
cpuset->mems_allowedto a buffer allocated byNODEMASK_ALLOC(). Just pass it tonodelist_scnprintf().Signed-off-by Li Zefan <[email protected]>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>