* [PATCH v4 8/8] Disable task moving when using kernel memory accounting
From: Glauber Costa @ 2011-10-03 10:18 UTC (permalink / raw)
To: linux-kernel
Cc: paul, lizf, kamezawa.hiroyu, ebiederm, davem, gthelen, netdev,
linux-mm, kirill, avagin, Glauber Costa
In-Reply-To: <1317637123-18306-1-git-send-email-glommer@parallels.com>
Since this code is still experimental, we are leaving the exact
details of how to move tasks between cgroups when kernel memory
accounting is used as future work.
For now, we simply disallow movement if there are any pending
accounted memory.
Signed-off-by: Glauber Costa <glommer@parallels.com>
CC: Hiroyouki Kamezawa <kamezawa.hiroyu@jp.fujitsu.com>
---
include/net/tcp.h | 1 +
mm/memcontrol.c | 37 ++++++++++++++++++++++---------------
2 files changed, 23 insertions(+), 15 deletions(-)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 2606713..b47a8e9 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -257,6 +257,7 @@ struct mem_cgroup;
struct tcp_memcontrol {
/* per-cgroup tcp memory pressure knobs */
int tcp_max_memory;
+ atomic_t refcnt;
atomic_long_t tcp_memory_allocated;
struct percpu_counter tcp_sockets_allocated;
/* those two are read-mostly, leave them at the end */
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 3b38d0a..66740d3 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -366,28 +366,17 @@ void sock_update_memcg(struct sock *sk)
rcu_read_lock();
sk->sk_cgrp = mem_cgroup_from_task(current);
-
- /*
- * We don't need to protect against anything task-related, because
- * we are basically stuck with the sock pointer that won't change,
- * even if the task that originated the socket changes cgroups.
- *
- * What we do have to guarantee, is that the chain leading us to
- * the top level won't change under our noses. Incrementing the
- * reference count via cgroup_exclude_rmdir guarantees that.
- */
- cgroup_exclude_rmdir(mem_cgroup_css(sk->sk_cgrp));
rcu_read_unlock();
}
void sock_release_memcg(struct sock *sk)
{
- cgroup_release_and_wakeup_rmdir(mem_cgroup_css(sk->sk_cgrp));
}
void memcg_sock_mem_alloc(struct mem_cgroup *mem, struct proto *prot,
int amt, int *parent_failure)
{
+ atomic_inc(&mem->tcp.refcnt);
mem = parent_mem_cgroup(mem);
for (; mem != NULL; mem = parent_mem_cgroup(mem)) {
long alloc;
@@ -406,9 +395,12 @@ EXPORT_SYMBOL(memcg_sock_mem_alloc);
void memcg_sock_mem_free(struct mem_cgroup *mem, struct proto *prot, int amt)
{
- mem = parent_mem_cgroup(mem);
- for (; mem != NULL; mem = parent_mem_cgroup(mem))
- atomic_long_sub(amt, prot->memory_allocated(mem));
+ struct mem_cgroup *parent;
+ parent = parent_mem_cgroup(mem);
+ for (; parent != NULL; parent = parent_mem_cgroup(parent))
+ atomic_long_sub(amt, prot->memory_allocated(parent));
+
+ atomic_dec(&mem->tcp.refcnt);
}
EXPORT_SYMBOL(memcg_sock_mem_free);
@@ -519,6 +511,7 @@ static void tcp_create_cgroup(struct mem_cgroup *cg, struct cgroup_subsys *ss)
{
cg->tcp.tcp_memory_pressure = 0;
atomic_long_set(&cg->tcp.tcp_memory_allocated, 0);
+ atomic_set(&cg->tcp.refcnt, 0);
percpu_counter_init(&cg->tcp.tcp_sockets_allocated, 0);
}
@@ -5778,6 +5771,12 @@ static int mem_cgroup_can_attach(struct cgroup_subsys *ss,
int ret = 0;
struct mem_cgroup *mem = mem_cgroup_from_cont(cgroup);
+ if (atomic_read(&mem->tcp.refcnt)) {
+ printk(KERN_WARNING "Can't move tasks between cgroups: "
+ "Kernel memory held. task: %s\n", p->comm);
+ return 1;
+ }
+
if (mem->move_charge_at_immigrate) {
struct mm_struct *mm;
struct mem_cgroup *from = mem_cgroup_from_task(p);
@@ -5948,6 +5947,14 @@ static int mem_cgroup_can_attach(struct cgroup_subsys *ss,
struct cgroup *cgroup,
struct task_struct *p)
{
+ struct mem_cgroup *mem = mem_cgroup_from_cont(cgroup);
+
+ if (atomic_read(&mem->tcp.refcnt)) {
+ printk(KERN_WARNING "Can't move tasks between cgroups: "
+ "Kernel memory held. task: %s\n", p->comm);
+ return 1;
+ }
+
return 0;
}
static void mem_cgroup_cancel_attach(struct cgroup_subsys *ss,
--
1.7.6
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. 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:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related
* Re: [PATCH v4 1/8] Basic kernel memory functionality for the Memory Controller
From: Kirill A. Shutemov @ 2011-10-03 10:41 UTC (permalink / raw)
To: Glauber Costa
Cc: linux-kernel, paul, lizf, kamezawa.hiroyu, ebiederm, davem,
gthelen, netdev, linux-mm, avagin
In-Reply-To: <1317637123-18306-2-git-send-email-glommer@parallels.com>
On Mon, Oct 03, 2011 at 02:18:36PM +0400, Glauber Costa wrote:
> This patch lays down the foundation for the kernel memory component
> of the Memory Controller.
>
> As of today, I am only laying down the following files:
>
> * memory.independent_kmem_limit
> * memory.kmem.limit_in_bytes (currently ignored)
> * memory.kmem.usage_in_bytes (always zero)
>
> Signed-off-by: Glauber Costa <glommer@parallels.com>
> CC: Paul Menage <paul@paulmenage.org>
> CC: Greg Thelen <gthelen@google.com>
Reviewed-by: Kirill A. Shutemov <kirill@shutemov.name>
One comment bellow.
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index ebd1e86..8aaf4ce 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -72,8 +72,6 @@ static int really_do_swap_account __initdata = 0;
> #else
> #define do_swap_account (0)
> #endif
> -
> -
> /*
> * Statistics for memory cgroup.
> */
Please drop this hunk.
--
Kirill A. Shutemov
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. 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:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH v4 1/8] Basic kernel memory functionality for the Memory Controller
From: Glauber Costa @ 2011-10-03 10:41 UTC (permalink / raw)
To: Kirill A. Shutemov
Cc: linux-kernel, paul, lizf, kamezawa.hiroyu, ebiederm, davem,
gthelen, netdev, linux-mm, avagin
In-Reply-To: <20111003104133.GA29312@shutemov.name>
On 10/03/2011 02:41 PM, Kirill A. Shutemov wrote:
> On Mon, Oct 03, 2011 at 02:18:36PM +0400, Glauber Costa wrote:
>> This patch lays down the foundation for the kernel memory component
>> of the Memory Controller.
>>
>> As of today, I am only laying down the following files:
>>
>> * memory.independent_kmem_limit
>> * memory.kmem.limit_in_bytes (currently ignored)
>> * memory.kmem.usage_in_bytes (always zero)
>>
>> Signed-off-by: Glauber Costa<glommer@parallels.com>
>> CC: Paul Menage<paul@paulmenage.org>
>> CC: Greg Thelen<gthelen@google.com>
>
> Reviewed-by: Kirill A. Shutemov<kirill@shutemov.name>
>
> One comment bellow.
>
>> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
>> index ebd1e86..8aaf4ce 100644
>> --- a/mm/memcontrol.c
>> +++ b/mm/memcontrol.c
>> @@ -72,8 +72,6 @@ static int really_do_swap_account __initdata = 0;
>> #else
>> #define do_swap_account (0)
>> #endif
>> -
>> -
>> /*
>> * Statistics for memory cgroup.
>> */
>
> Please drop this hunk.
>
Just did. Thanks for noticing, I missed this one.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. 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:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH v4 2/8] socket: initial cgroup code.
From: Kirill A. Shutemov @ 2011-10-03 10:47 UTC (permalink / raw)
To: Glauber Costa
Cc: linux-kernel, paul, lizf, kamezawa.hiroyu, ebiederm, davem,
gthelen, netdev, linux-mm, avagin
In-Reply-To: <1317637123-18306-3-git-send-email-glommer@parallels.com>
On Mon, Oct 03, 2011 at 02:18:37PM +0400, Glauber Costa wrote:
> We aim to control the amount of kernel memory pinned at any
> time by tcp sockets. To lay the foundations for this work,
> this patch adds a pointer to the kmem_cgroup to the socket
> structure.
>
> Signed-off-by: Glauber Costa <glommer@parallels.com>
> CC: David S. Miller <davem@davemloft.net>
> CC: Hiroyouki Kamezawa <kamezawa.hiroyu@jp.fujitsu.com>
> CC: Eric W. Biederman <ebiederm@xmission.com>
> ---
> include/linux/memcontrol.h | 15 +++++++++++++++
> include/net/sock.h | 2 ++
> mm/memcontrol.c | 33 +++++++++++++++++++++++++++++++++
> net/core/sock.c | 3 +++
> 4 files changed, 53 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
> index 3b535db..2cb9226 100644
> --- a/include/linux/memcontrol.h
> +++ b/include/linux/memcontrol.h
> @@ -395,5 +395,20 @@ mem_cgroup_print_bad_page(struct page *page)
> }
> #endif
>
> +#ifdef CONFIG_INET
> +struct sock;
> +#ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM
> +void sock_update_memcg(struct sock *sk);
> +void sock_release_memcg(struct sock *sk);
> +
> +#else
> +static inline void sock_update_memcg(struct sock *sk)
> +{
> +}
> +static inline void sock_release_memcg(struct sock *sk)
> +{
> +}
> +#endif /* CONFIG_CGROUP_MEM_RES_CTLR_KMEM */
> +#endif /* CONFIG_INET */
> #endif /* _LINUX_MEMCONTROL_H */
>
> diff --git a/include/net/sock.h b/include/net/sock.h
> index 8e4062f..afe1467 100644
> --- a/include/net/sock.h
> +++ b/include/net/sock.h
> @@ -228,6 +228,7 @@ struct sock_common {
> * @sk_security: used by security modules
> * @sk_mark: generic packet mark
> * @sk_classid: this socket's cgroup classid
> + * @sk_cgrp: this socket's kernel memory (kmem) cgroup
> * @sk_write_pending: a write to stream socket waits to start
> * @sk_state_change: callback to indicate change in the state of the sock
> * @sk_data_ready: callback to indicate there is data to be processed
> @@ -339,6 +340,7 @@ struct sock {
> #endif
> __u32 sk_mark;
> u32 sk_classid;
> + struct mem_cgroup *sk_cgrp;
> void (*sk_state_change)(struct sock *sk);
> void (*sk_data_ready)(struct sock *sk, int bytes);
> void (*sk_write_space)(struct sock *sk);
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 8aaf4ce..08a520e 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -339,6 +339,39 @@ struct mem_cgroup {
> spinlock_t pcp_counter_lock;
> };
>
> +/* Writing them here to avoid exposing memcg's inner layout */
> +#ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM
> +#ifdef CONFIG_INET
> +#include <net/sock.h>
> +
> +void sock_update_memcg(struct sock *sk)
> +{
> + /* right now a socket spends its whole life in the same cgroup */
> + BUG_ON(sk->sk_cgrp);
Do we really want to panic in this case?
What about WARN() + return?
Otherwise: Acked-by: Kirill A. Shutemov <kirill@shutemov.name>
> +
> + rcu_read_lock();
> + sk->sk_cgrp = mem_cgroup_from_task(current);
> +
> + /*
> + * We don't need to protect against anything task-related, because
> + * we are basically stuck with the sock pointer that won't change,
> + * even if the task that originated the socket changes cgroups.
> + *
> + * What we do have to guarantee, is that the chain leading us to
> + * the top level won't change under our noses. Incrementing the
> + * reference count via cgroup_exclude_rmdir guarantees that.
> + */
> + cgroup_exclude_rmdir(mem_cgroup_css(sk->sk_cgrp));
> + rcu_read_unlock();
> +}
--
Kirill A. Shutemov
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. 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:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH v4 2/8] socket: initial cgroup code.
From: Glauber Costa @ 2011-10-03 10:48 UTC (permalink / raw)
To: Kirill A. Shutemov
Cc: linux-kernel, paul, lizf, kamezawa.hiroyu, ebiederm, davem,
gthelen, netdev, linux-mm, avagin
In-Reply-To: <20111003104733.GB29312@shutemov.name>
On 10/03/2011 02:47 PM, Kirill A. Shutemov wrote:
> On Mon, Oct 03, 2011 at 02:18:37PM +0400, Glauber Costa wrote:
>> We aim to control the amount of kernel memory pinned at any
>> time by tcp sockets. To lay the foundations for this work,
>> this patch adds a pointer to the kmem_cgroup to the socket
>> structure.
>>
>> Signed-off-by: Glauber Costa<glommer@parallels.com>
>> CC: David S. Miller<davem@davemloft.net>
>> CC: Hiroyouki Kamezawa<kamezawa.hiroyu@jp.fujitsu.com>
>> CC: Eric W. Biederman<ebiederm@xmission.com>
>> ---
>> include/linux/memcontrol.h | 15 +++++++++++++++
>> include/net/sock.h | 2 ++
>> mm/memcontrol.c | 33 +++++++++++++++++++++++++++++++++
>> net/core/sock.c | 3 +++
>> 4 files changed, 53 insertions(+), 0 deletions(-)
>>
>> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
>> index 3b535db..2cb9226 100644
>> --- a/include/linux/memcontrol.h
>> +++ b/include/linux/memcontrol.h
>> @@ -395,5 +395,20 @@ mem_cgroup_print_bad_page(struct page *page)
>> }
>> #endif
>>
>> +#ifdef CONFIG_INET
>> +struct sock;
>> +#ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM
>> +void sock_update_memcg(struct sock *sk);
>> +void sock_release_memcg(struct sock *sk);
>> +
>> +#else
>> +static inline void sock_update_memcg(struct sock *sk)
>> +{
>> +}
>> +static inline void sock_release_memcg(struct sock *sk)
>> +{
>> +}
>> +#endif /* CONFIG_CGROUP_MEM_RES_CTLR_KMEM */
>> +#endif /* CONFIG_INET */
>> #endif /* _LINUX_MEMCONTROL_H */
>>
>> diff --git a/include/net/sock.h b/include/net/sock.h
>> index 8e4062f..afe1467 100644
>> --- a/include/net/sock.h
>> +++ b/include/net/sock.h
>> @@ -228,6 +228,7 @@ struct sock_common {
>> * @sk_security: used by security modules
>> * @sk_mark: generic packet mark
>> * @sk_classid: this socket's cgroup classid
>> + * @sk_cgrp: this socket's kernel memory (kmem) cgroup
>> * @sk_write_pending: a write to stream socket waits to start
>> * @sk_state_change: callback to indicate change in the state of the sock
>> * @sk_data_ready: callback to indicate there is data to be processed
>> @@ -339,6 +340,7 @@ struct sock {
>> #endif
>> __u32 sk_mark;
>> u32 sk_classid;
>> + struct mem_cgroup *sk_cgrp;
>> void (*sk_state_change)(struct sock *sk);
>> void (*sk_data_ready)(struct sock *sk, int bytes);
>> void (*sk_write_space)(struct sock *sk);
>> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
>> index 8aaf4ce..08a520e 100644
>> --- a/mm/memcontrol.c
>> +++ b/mm/memcontrol.c
>> @@ -339,6 +339,39 @@ struct mem_cgroup {
>> spinlock_t pcp_counter_lock;
>> };
>>
>> +/* Writing them here to avoid exposing memcg's inner layout */
>> +#ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM
>> +#ifdef CONFIG_INET
>> +#include<net/sock.h>
>> +
>> +void sock_update_memcg(struct sock *sk)
>> +{
>> + /* right now a socket spends its whole life in the same cgroup */
>> + BUG_ON(sk->sk_cgrp);
>
> Do we really want to panic in this case?
>
> What about WARN() + return?
Kirill,
I am keeping this code just to have something workable in between.
If you take a look at the last patch, this hunk is going away anyway.
So if you don't oppose it, I'll just keep it to avoid rebasing it.
> Otherwise: Acked-by: Kirill A. Shutemov<kirill@shutemov.name>
>
>> +
>> + rcu_read_lock();
>> + sk->sk_cgrp = mem_cgroup_from_task(current);
>> +
>> + /*
>> + * We don't need to protect against anything task-related, because
>> + * we are basically stuck with the sock pointer that won't change,
>> + * even if the task that originated the socket changes cgroups.
>> + *
>> + * What we do have to guarantee, is that the chain leading us to
>> + * the top level won't change under our noses. Incrementing the
>> + * reference count via cgroup_exclude_rmdir guarantees that.
>> + */
>> + cgroup_exclude_rmdir(mem_cgroup_css(sk->sk_cgrp));
>> + rcu_read_unlock();
>> +}
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. 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:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH net-next] drivers/net: Add module.h to wireless/ath/ath6kl/sdio.c
From: Kalle Valo @ 2011-10-03 10:48 UTC (permalink / raw)
To: Paul Gortmaker
Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q, netdev-u79uwXL29TY76Z2rM5mHXA,
linville-2XuSBdqkA4R54TAoqtyWWQ,
linux-wireless-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1317424079-31793-1-git-send-email-paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
On 10/01/2011 02:07 AM, Paul Gortmaker wrote:
> This file uses various MODULE_* macros, and so needs the full
> module.h header called out explicitly.
FWIW last week I added a similar patch to ath6kl.git (but not the same
as the file has changed):
https://github.com/kvalo/ath6kl/commit/c6efe578fc5dd02463d2ee20343494da56bdd3a9
I also sent a pull request to John so it should be in wireless-next soon.
Kalle
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH 0/2] IPVS netns shutdown/startup dead-lock Take II
From: Hans Schillström @ 2011-10-03 10:55 UTC (permalink / raw)
To: horms@verge.net.au, Julian Anastasov, Wensong Zhang,
lvs-devel@vger.kernel.org, "netdev@vger.k
Hello,
This two patches are for the current kernel, i.e. based on ipvs.git
The first one is a trivial fix for lockdep warnings,
and the second is to solve a Deadlock.
We have observed one more Deadlock case in our lab during startup of multiple containers i.e. netns.
The back trace indicates some more issues with "sk_lock-AF_INET"
However it has only been seen once during almost 4 month of testing.
I can't reproduce it and not find any possibly scenario where it could occur.
This patch fix the case when a name-space dies while another is created.
Regards
Hans Schillstrom <hans.schillstrom@ericsson.com>
^ permalink raw reply
* [PATCH 1/2] fix lockdep warning
From: Hans Schillstrom @ 2011-10-03 10:56 UTC (permalink / raw)
To: horms, ja, wensong, lvs-devel, netdev, netfilter-devel
Cc: hans, Hans Schillstrom
From: Hans Schillstrom <hans@schillstrom.com>
rs_lock needs a key to make lock dep happy.
Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 2b771dc..a1af72f 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -57,6 +57,7 @@ static DEFINE_MUTEX(__ip_vs_mutex);
/* lock for service table */
static DEFINE_RWLOCK(__ip_vs_svc_lock);
+static struct lock_class_key ip_vs_rs_key;
/* sysctl variables */
@@ -3680,6 +3681,7 @@ int __net_init ip_vs_control_net_init(struct net *net)
struct netns_ipvs *ipvs = net_ipvs(net);
ipvs->rs_lock = __RW_LOCK_UNLOCKED(ipvs->rs_lock);
+ __rwlock_init(&ipvs->rs_lock, "ipvs->rs_lock", &ip_vs_rs_key);
/* Initialize rs_table */
for (idx = 0; idx < IP_VS_RTAB_SIZE; idx++)
--
1.7.4.4
^ permalink raw reply related
* [PATCH 2/2] IPVS netns shutdown/startup dead-lock (Take II)
From: Hans Schillstrom @ 2011-10-03 10:56 UTC (permalink / raw)
To: horms, ja, wensong, lvs-devel, netdev, netfilter-devel
Cc: hans, Hans Schillstrom
In-Reply-To: <1317639399-4522-1-git-send-email-hans.schillstrom@ericsson.com>
From: Hans Schillstrom <hans@schillstrom.com>
ip_vs_mutext is used by both netns shutdown code and startup
and both implicit uses sk_lock-AF_INET mutex.
cleanup CPU-1 startup CPU-2
ip_vs_dst_event() ip_vs_genl_set_cmd()
sk_lock-AF_INET __ip_vs_mutex
sk_lock-AF_INET
__ip_vs_mutex
* DEAD LOCK *
A new mutex placed in ip_vs netns struct called sync_mutex is added.
Comments from Julian and Simon added.
This patch has been running for more than 3 month now and it seems to work.
Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 1aaf915..8fa4430 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -900,6 +900,7 @@ struct netns_ipvs {
volatile int sync_state;
volatile int master_syncid;
volatile int backup_syncid;
+ struct mutex sync_mutex;
/* multicast interface name */
char master_mcast_ifn[IP_VS_IFNAME_MAXLEN];
char backup_mcast_ifn[IP_VS_IFNAME_MAXLEN];
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index a1af72f..cb5c25c 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -2284,6 +2284,7 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
struct ip_vs_service *svc;
struct ip_vs_dest_user *udest_compat;
struct ip_vs_dest_user_kern udest;
+ struct netns_ipvs *ipvs = net_ipvs(net);
if (!capable(CAP_NET_ADMIN))
return -EPERM;
@@ -2304,6 +2305,24 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
/* increase the module use count */
ip_vs_use_count_inc();
+ /* Handle daemons since they have another lock */
+ if (cmd == IP_VS_SO_SET_STARTDAEMON ||
+ cmd == IP_VS_SO_SET_STOPDAEMON) {
+ struct ip_vs_daemon_user *dm = (struct ip_vs_daemon_user *)arg;
+
+ if (mutex_lock_interruptible(&ipvs->sync_mutex)) {
+ ret = -ERESTARTSYS;
+ goto out_dec;
+ }
+ if (cmd == IP_VS_SO_SET_STARTDAEMON)
+ ret = start_sync_thread(net, dm->state, dm->mcast_ifn,
+ dm->syncid);
+ else
+ ret = stop_sync_thread(net, dm->state);
+ mutex_unlock(&ipvs->sync_mutex);
+ goto out_dec;
+ }
+
if (mutex_lock_interruptible(&__ip_vs_mutex)) {
ret = -ERESTARTSYS;
goto out_dec;
@@ -2317,15 +2336,6 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
/* Set timeout values for (tcp tcpfin udp) */
ret = ip_vs_set_timeout(net, (struct ip_vs_timeout_user *)arg);
goto out_unlock;
- } else if (cmd == IP_VS_SO_SET_STARTDAEMON) {
- struct ip_vs_daemon_user *dm = (struct ip_vs_daemon_user *)arg;
- ret = start_sync_thread(net, dm->state, dm->mcast_ifn,
- dm->syncid);
- goto out_unlock;
- } else if (cmd == IP_VS_SO_SET_STOPDAEMON) {
- struct ip_vs_daemon_user *dm = (struct ip_vs_daemon_user *)arg;
- ret = stop_sync_thread(net, dm->state);
- goto out_unlock;
}
usvc_compat = (struct ip_vs_service_user *)arg;
@@ -3206,7 +3216,7 @@ static int ip_vs_genl_dump_daemons(struct sk_buff *skb,
struct net *net = skb_sknet(skb);
struct netns_ipvs *ipvs = net_ipvs(net);
- mutex_lock(&__ip_vs_mutex);
+ mutex_lock(&ipvs->sync_mutex);
if ((ipvs->sync_state & IP_VS_STATE_MASTER) && !cb->args[0]) {
if (ip_vs_genl_dump_daemon(skb, IP_VS_STATE_MASTER,
ipvs->master_mcast_ifn,
@@ -3226,7 +3236,7 @@ static int ip_vs_genl_dump_daemons(struct sk_buff *skb,
}
nla_put_failure:
- mutex_unlock(&__ip_vs_mutex);
+ mutex_unlock(&ipvs->sync_mutex);
return skb->len;
}
@@ -3272,13 +3282,9 @@ static int ip_vs_genl_set_config(struct net *net, struct nlattr **attrs)
return ip_vs_set_timeout(net, &t);
}
-static int ip_vs_genl_set_cmd(struct sk_buff *skb, struct genl_info *info)
+static int ip_vs_genl_set_daemon(struct sk_buff *skb, struct genl_info *info)
{
- struct ip_vs_service *svc = NULL;
- struct ip_vs_service_user_kern usvc;
- struct ip_vs_dest_user_kern udest;
int ret = 0, cmd;
- int need_full_svc = 0, need_full_dest = 0;
struct net *net;
struct netns_ipvs *ipvs;
@@ -3286,19 +3292,10 @@ static int ip_vs_genl_set_cmd(struct sk_buff *skb, struct genl_info *info)
ipvs = net_ipvs(net);
cmd = info->genlhdr->cmd;
- mutex_lock(&__ip_vs_mutex);
-
- if (cmd == IPVS_CMD_FLUSH) {
- ret = ip_vs_flush(net);
- goto out;
- } else if (cmd == IPVS_CMD_SET_CONFIG) {
- ret = ip_vs_genl_set_config(net, info->attrs);
- goto out;
- } else if (cmd == IPVS_CMD_NEW_DAEMON ||
- cmd == IPVS_CMD_DEL_DAEMON) {
-
+ if (cmd == IPVS_CMD_NEW_DAEMON || cmd == IPVS_CMD_DEL_DAEMON) {
struct nlattr *daemon_attrs[IPVS_DAEMON_ATTR_MAX + 1];
+ mutex_lock(&ipvs->sync_mutex);
if (!info->attrs[IPVS_CMD_ATTR_DAEMON] ||
nla_parse_nested(daemon_attrs, IPVS_DAEMON_ATTR_MAX,
info->attrs[IPVS_CMD_ATTR_DAEMON],
@@ -3311,6 +3308,33 @@ static int ip_vs_genl_set_cmd(struct sk_buff *skb, struct genl_info *info)
ret = ip_vs_genl_new_daemon(net, daemon_attrs);
else
ret = ip_vs_genl_del_daemon(net, daemon_attrs);
+out:
+ mutex_unlock(&ipvs->sync_mutex);
+ }
+ return ret;
+}
+
+static int ip_vs_genl_set_cmd(struct sk_buff *skb, struct genl_info *info)
+{
+ struct ip_vs_service *svc = NULL;
+ struct ip_vs_service_user_kern usvc;
+ struct ip_vs_dest_user_kern udest;
+ int ret = 0, cmd;
+ int need_full_svc = 0, need_full_dest = 0;
+ struct net *net;
+ struct netns_ipvs *ipvs;
+
+ net = skb_sknet(skb);
+ ipvs = net_ipvs(net);
+ cmd = info->genlhdr->cmd;
+
+ mutex_lock(&__ip_vs_mutex);
+
+ if (cmd == IPVS_CMD_FLUSH) {
+ ret = ip_vs_flush(net);
+ goto out;
+ } else if (cmd == IPVS_CMD_SET_CONFIG) {
+ ret = ip_vs_genl_set_config(net, info->attrs);
goto out;
} else if (cmd == IPVS_CMD_ZERO &&
!info->attrs[IPVS_CMD_ATTR_SERVICE]) {
@@ -3537,13 +3561,13 @@ static struct genl_ops ip_vs_genl_ops[] __read_mostly = {
.cmd = IPVS_CMD_NEW_DAEMON,
.flags = GENL_ADMIN_PERM,
.policy = ip_vs_cmd_policy,
- .doit = ip_vs_genl_set_cmd,
+ .doit = ip_vs_genl_set_daemon,
},
{
.cmd = IPVS_CMD_DEL_DAEMON,
.flags = GENL_ADMIN_PERM,
.policy = ip_vs_cmd_policy,
- .doit = ip_vs_genl_set_cmd,
+ .doit = ip_vs_genl_set_daemon,
},
{
.cmd = IPVS_CMD_GET_DAEMON,
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index 7ee7215..3cdd479 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -61,6 +61,7 @@
#define SYNC_PROTO_VER 1 /* Protocol version in header */
+static struct lock_class_key __ipvs_sync_key;
/*
* IPVS sync connection entry
* Version 0, i.e. original version.
@@ -1545,6 +1546,7 @@ int start_sync_thread(struct net *net, int state, char *mcast_ifn, __u8 syncid)
IP_VS_DBG(7, "Each ip_vs_sync_conn entry needs %Zd bytes\n",
sizeof(struct ip_vs_sync_conn_v0));
+
if (state == IP_VS_STATE_MASTER) {
if (ipvs->master_thread)
return -EEXIST;
@@ -1667,6 +1669,7 @@ int __net_init ip_vs_sync_net_init(struct net *net)
{
struct netns_ipvs *ipvs = net_ipvs(net);
+ __mutex_init(&ipvs->sync_mutex, "ipvs->sync_mutex", &__ipvs_sync_key);
INIT_LIST_HEAD(&ipvs->sync_queue);
spin_lock_init(&ipvs->sync_lock);
spin_lock_init(&ipvs->sync_buff_lock);
@@ -1680,7 +1683,9 @@ int __net_init ip_vs_sync_net_init(struct net *net)
void ip_vs_sync_net_cleanup(struct net *net)
{
int retc;
+ struct netns_ipvs *ipvs = net_ipvs(net);
+ mutex_lock(&ipvs->sync_mutex);
retc = stop_sync_thread(net, IP_VS_STATE_MASTER);
if (retc && retc != -ESRCH)
pr_err("Failed to stop Master Daemon\n");
@@ -1688,4 +1693,5 @@ void ip_vs_sync_net_cleanup(struct net *net)
retc = stop_sync_thread(net, IP_VS_STATE_BACKUP);
if (retc && retc != -ESRCH)
pr_err("Failed to stop Backup Daemon\n");
+ mutex_unlock(&ipvs->sync_mutex);
}
--
1.7.4.4
^ permalink raw reply related
* Re: [PATCH v4 2/8] socket: initial cgroup code.
From: Kirill A. Shutemov @ 2011-10-03 11:02 UTC (permalink / raw)
To: Glauber Costa
Cc: linux-kernel, paul, lizf, kamezawa.hiroyu, ebiederm, davem,
gthelen, netdev, linux-mm, avagin
In-Reply-To: <4E8992EF.30001@parallels.com>
On Mon, Oct 03, 2011 at 02:48:15PM +0400, Glauber Costa wrote:
> On 10/03/2011 02:47 PM, Kirill A. Shutemov wrote:
> > On Mon, Oct 03, 2011 at 02:18:37PM +0400, Glauber Costa wrote:
> >> We aim to control the amount of kernel memory pinned at any
> >> time by tcp sockets. To lay the foundations for this work,
> >> this patch adds a pointer to the kmem_cgroup to the socket
> >> structure.
> >>
> >> Signed-off-by: Glauber Costa<glommer@parallels.com>
> >> CC: David S. Miller<davem@davemloft.net>
> >> CC: Hiroyouki Kamezawa<kamezawa.hiroyu@jp.fujitsu.com>
> >> CC: Eric W. Biederman<ebiederm@xmission.com>
> >> ---
> >> include/linux/memcontrol.h | 15 +++++++++++++++
> >> include/net/sock.h | 2 ++
> >> mm/memcontrol.c | 33 +++++++++++++++++++++++++++++++++
> >> net/core/sock.c | 3 +++
> >> 4 files changed, 53 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
> >> index 3b535db..2cb9226 100644
> >> --- a/include/linux/memcontrol.h
> >> +++ b/include/linux/memcontrol.h
> >> @@ -395,5 +395,20 @@ mem_cgroup_print_bad_page(struct page *page)
> >> }
> >> #endif
> >>
> >> +#ifdef CONFIG_INET
> >> +struct sock;
> >> +#ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM
> >> +void sock_update_memcg(struct sock *sk);
> >> +void sock_release_memcg(struct sock *sk);
> >> +
> >> +#else
> >> +static inline void sock_update_memcg(struct sock *sk)
> >> +{
> >> +}
> >> +static inline void sock_release_memcg(struct sock *sk)
> >> +{
> >> +}
> >> +#endif /* CONFIG_CGROUP_MEM_RES_CTLR_KMEM */
> >> +#endif /* CONFIG_INET */
> >> #endif /* _LINUX_MEMCONTROL_H */
> >>
> >> diff --git a/include/net/sock.h b/include/net/sock.h
> >> index 8e4062f..afe1467 100644
> >> --- a/include/net/sock.h
> >> +++ b/include/net/sock.h
> >> @@ -228,6 +228,7 @@ struct sock_common {
> >> * @sk_security: used by security modules
> >> * @sk_mark: generic packet mark
> >> * @sk_classid: this socket's cgroup classid
> >> + * @sk_cgrp: this socket's kernel memory (kmem) cgroup
> >> * @sk_write_pending: a write to stream socket waits to start
> >> * @sk_state_change: callback to indicate change in the state of the sock
> >> * @sk_data_ready: callback to indicate there is data to be processed
> >> @@ -339,6 +340,7 @@ struct sock {
> >> #endif
> >> __u32 sk_mark;
> >> u32 sk_classid;
> >> + struct mem_cgroup *sk_cgrp;
> >> void (*sk_state_change)(struct sock *sk);
> >> void (*sk_data_ready)(struct sock *sk, int bytes);
> >> void (*sk_write_space)(struct sock *sk);
> >> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> >> index 8aaf4ce..08a520e 100644
> >> --- a/mm/memcontrol.c
> >> +++ b/mm/memcontrol.c
> >> @@ -339,6 +339,39 @@ struct mem_cgroup {
> >> spinlock_t pcp_counter_lock;
> >> };
> >>
> >> +/* Writing them here to avoid exposing memcg's inner layout */
> >> +#ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM
> >> +#ifdef CONFIG_INET
> >> +#include<net/sock.h>
> >> +
> >> +void sock_update_memcg(struct sock *sk)
> >> +{
> >> + /* right now a socket spends its whole life in the same cgroup */
> >> + BUG_ON(sk->sk_cgrp);
> >
> > Do we really want to panic in this case?
> >
> > What about WARN() + return?
>
> Kirill,
>
> I am keeping this code just to have something workable in between.
> If you take a look at the last patch, this hunk is going away anyway.
>
> So if you don't oppose it, I'll just keep it to avoid rebasing it.
Sorry, but I don't see where you remove BUG_ON().
You remove only cgroup_exclude_rmdir().
--
Kirill A. Shutemov
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. 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:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH v4 2/8] socket: initial cgroup code.
From: Glauber Costa @ 2011-10-03 11:03 UTC (permalink / raw)
To: Kirill A. Shutemov
Cc: linux-kernel, paul, lizf, kamezawa.hiroyu, ebiederm, davem,
gthelen, netdev, linux-mm, avagin
In-Reply-To: <20111003110230.GC29312@shutemov.name>
On 10/03/2011 03:02 PM, Kirill A. Shutemov wrote:
> On Mon, Oct 03, 2011 at 02:48:15PM +0400, Glauber Costa wrote:
>> On 10/03/2011 02:47 PM, Kirill A. Shutemov wrote:
>>> On Mon, Oct 03, 2011 at 02:18:37PM +0400, Glauber Costa wrote:
>>>> We aim to control the amount of kernel memory pinned at any
>>>> time by tcp sockets. To lay the foundations for this work,
>>>> this patch adds a pointer to the kmem_cgroup to the socket
>>>> structure.
>>>>
>>>> Signed-off-by: Glauber Costa<glommer@parallels.com>
>>>> CC: David S. Miller<davem@davemloft.net>
>>>> CC: Hiroyouki Kamezawa<kamezawa.hiroyu@jp.fujitsu.com>
>>>> CC: Eric W. Biederman<ebiederm@xmission.com>
>>>> ---
>>>> include/linux/memcontrol.h | 15 +++++++++++++++
>>>> include/net/sock.h | 2 ++
>>>> mm/memcontrol.c | 33 +++++++++++++++++++++++++++++++++
>>>> net/core/sock.c | 3 +++
>>>> 4 files changed, 53 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
>>>> index 3b535db..2cb9226 100644
>>>> --- a/include/linux/memcontrol.h
>>>> +++ b/include/linux/memcontrol.h
>>>> @@ -395,5 +395,20 @@ mem_cgroup_print_bad_page(struct page *page)
>>>> }
>>>> #endif
>>>>
>>>> +#ifdef CONFIG_INET
>>>> +struct sock;
>>>> +#ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM
>>>> +void sock_update_memcg(struct sock *sk);
>>>> +void sock_release_memcg(struct sock *sk);
>>>> +
>>>> +#else
>>>> +static inline void sock_update_memcg(struct sock *sk)
>>>> +{
>>>> +}
>>>> +static inline void sock_release_memcg(struct sock *sk)
>>>> +{
>>>> +}
>>>> +#endif /* CONFIG_CGROUP_MEM_RES_CTLR_KMEM */
>>>> +#endif /* CONFIG_INET */
>>>> #endif /* _LINUX_MEMCONTROL_H */
>>>>
>>>> diff --git a/include/net/sock.h b/include/net/sock.h
>>>> index 8e4062f..afe1467 100644
>>>> --- a/include/net/sock.h
>>>> +++ b/include/net/sock.h
>>>> @@ -228,6 +228,7 @@ struct sock_common {
>>>> * @sk_security: used by security modules
>>>> * @sk_mark: generic packet mark
>>>> * @sk_classid: this socket's cgroup classid
>>>> + * @sk_cgrp: this socket's kernel memory (kmem) cgroup
>>>> * @sk_write_pending: a write to stream socket waits to start
>>>> * @sk_state_change: callback to indicate change in the state of the sock
>>>> * @sk_data_ready: callback to indicate there is data to be processed
>>>> @@ -339,6 +340,7 @@ struct sock {
>>>> #endif
>>>> __u32 sk_mark;
>>>> u32 sk_classid;
>>>> + struct mem_cgroup *sk_cgrp;
>>>> void (*sk_state_change)(struct sock *sk);
>>>> void (*sk_data_ready)(struct sock *sk, int bytes);
>>>> void (*sk_write_space)(struct sock *sk);
>>>> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
>>>> index 8aaf4ce..08a520e 100644
>>>> --- a/mm/memcontrol.c
>>>> +++ b/mm/memcontrol.c
>>>> @@ -339,6 +339,39 @@ struct mem_cgroup {
>>>> spinlock_t pcp_counter_lock;
>>>> };
>>>>
>>>> +/* Writing them here to avoid exposing memcg's inner layout */
>>>> +#ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM
>>>> +#ifdef CONFIG_INET
>>>> +#include<net/sock.h>
>>>> +
>>>> +void sock_update_memcg(struct sock *sk)
>>>> +{
>>>> + /* right now a socket spends its whole life in the same cgroup */
>>>> + BUG_ON(sk->sk_cgrp);
>>>
>>> Do we really want to panic in this case?
>>>
>>> What about WARN() + return?
>>
>> Kirill,
>>
>> I am keeping this code just to have something workable in between.
>> If you take a look at the last patch, this hunk is going away anyway.
>>
>> So if you don't oppose it, I'll just keep it to avoid rebasing it.
>
> Sorry, but I don't see where you remove BUG_ON().
> You remove only cgroup_exclude_rmdir().
>
Oh yeah, you are right, sorry.
So, I guess some kind of check is sane here. I am happy to change it to
WARN_ON.
^ permalink raw reply
* Re: Network problem with bridge and virtualbox
From: William Thompson @ 2011-10-03 11:30 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
In-Reply-To: <20110930171839.2893bfa6@nehalam.linuxnetplumber.net>
On Fri, Sep 30, 2011 at 05:18:39PM -0700, Stephen Hemminger wrote:
> On Thu, 29 Sep 2011 08:49:41 -0400
> William Thompson <wt@electro-mechanical.com> wrote:
>
> > Please keep me in the CC as I am not subscribed.
> >
> > I'm using a 64-bit kernel 3.0.0 and virtualbox 4.1.2.
> >
> > My problem is that I cannot ping the host from a virtual machine.
> >
> > My bridge is configured as follows:
> > # brctl addbr br0
> > # brctl setfd br0 0
> > # brctl stp br0 off
> > # ifconfig br0 10.2.3.1 netmask 255.255.255.0
> >
> > In the virtual machine, it is set to use br0 as it's interface (bridge mode)
> > and it's IP is 10.2.3.10.
> >
> > The host gets packets from the vm, but the vm does not receive packets back.
> >
> > I have this same setup working on a 32-bit kernel 2.6.38.6 on another
> > machine with virtualbox 4.0.4.
> >
> > I had a thought that the bridge on the host wasn't responding due to having
> > no ports configured so I added one of my spare ethernet cards to it as
> > follows:
> > # brctl addif br0 eth1
> > # ifconfig eth1 up
> >
> > The card was plugged into a switch. After doing this, the vm still could not
> > talk to the host. I added a physical machine to the switch that eth1 was
> > connected to and configured it to 10.2.3.2. I was able to ping 10.2.3.2 but
> > not 10.2.3.1
>
> Did you add any interface to the bridge?
Initially, no.
> I think you were bit by the change in carrier behavior. No carrier on the
> bridge interface tracks the union of the devices in the bridge.
> Several people have been using bridge in strange way (as a dummy device)
> with no physical interfaces and some applications are checking for carrier.
That's how I have been using it.
Using it as a dummy, ie no interfaces added to the bridge, on 3.0.0 I was
unable to communicate with the host from the VM. I added eth1 to it. This
has a link to a physical network. I assigned IPs to the host and the VM to
be on the same network that eth1 was attached. From the VM I could
communicate with devices on the physical network but not the host. The host
could also communicate with the other devices.
^ permalink raw reply
* Re: [RFC patch net-next-2.6] net: introduce ethernet teaming device
From: Jiri Pirko @ 2011-10-03 11:37 UTC (permalink / raw)
To: Jesse Gross
Cc: netdev, davem, eric.dumazet, bhutchings, shemminger, fubar, andy,
tgraf, ebiederm, mirqus, kaber, greearb
In-Reply-To: <CAEP_g=8uJnngfKJRGLLnd8U7M9aJTfOSUheB62-O7OX6Ud0DLw@mail.gmail.com>
Sat, Oct 01, 2011 at 08:15:01PM CEST, jesse@nicira.com wrote:
>On Fri, Sep 30, 2011 at 5:44 AM, Jiri Pirko <jpirko@redhat.com> wrote:
>> This patch introduces new network device called team. It supposes to be
>> very fast, simple, userspace-driven parallel to existing bonding device.
>> Userspace library called libteam with couple of demo apps is available
>> here:
>> https://github.com/jpirko/libteam
>> Note it's still in its dipers atm.
>>
>> team<->libteam use generic netlink for communication. That and rtnl
>> suppose to be the only way to configure team device, no sysfs etc.
>>
>> In near future python binding for libteam will be introduced. Also
>> daemon providing arpmon/miimon active-backup functionality will
>> be introduced. All what's necessary is already implemented in kernel team
>> driver.
>>
>> Plan is to support 8023ad in near future with it's logic mainly in
>> userspace daemon as well.
>>
>> Please review, try, comment. All feedback would be much appreciated.
>>
>> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>
>Not to push my own agenda too much but you might want to take a look
>at Open vSwitch. It uses the same strategy of userspace directed
>bonding and already supports active-backup, 802.3ad, and quite a few
>other networking tools all controlled by userspace.
>
>I know there's been a lot of talk and not a lot of action when it
>comes to upstreaming but that's changing. We're fixing up a few loose
>ends in the userspace/kernel interface and then intend to propose a
>patch fairly soon.
Looks interesting. From quick peak the code is much bigger and fairly
complicated. The main reason for doing "team" is to do ethernet teaming
in as much simple way as it can be done. Final user destination areas
of openvswitch and team seem different to me.
Jirka
^ permalink raw reply
* Re: [PATCH v4 7/8] Display current tcp memory allocation in kmem cgroup
From: Kirill A. Shutemov @ 2011-10-03 12:14 UTC (permalink / raw)
To: Glauber Costa
Cc: linux-kernel, paul, lizf, kamezawa.hiroyu, ebiederm, davem,
gthelen, netdev, linux-mm, avagin
In-Reply-To: <1317637123-18306-8-git-send-email-glommer@parallels.com>
On Mon, Oct 03, 2011 at 02:18:42PM +0400, Glauber Costa wrote:
> This patch introduces kmem.tcp_current_memory file, living in the
> kmem_cgroup filesystem. It is a simple read-only file that displays the
> amount of kernel memory currently consumed by the cgroup.
>
> Signed-off-by: Glauber Costa <glommer@parallels.com>
> CC: David S. Miller <davem@davemloft.net>
> CC: Hiroyouki Kamezawa <kamezawa.hiroyu@jp.fujitsu.com>
> CC: Eric W. Biederman <ebiederm@xmission.com>
> ---
> Documentation/cgroups/memory.txt | 1 +
> mm/memcontrol.c | 11 +++++++++++
> 2 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
> index 1ffde3e..f5a539d 100644
> --- a/Documentation/cgroups/memory.txt
> +++ b/Documentation/cgroups/memory.txt
> @@ -79,6 +79,7 @@ Brief summary of control files.
> memory.independent_kmem_limit # select whether or not kernel memory limits are
> independent of user limits
> memory.kmem.tcp.max_memory # set/show hard limit for tcp buf memory
> + memory.kmem.tcp.current_memory # show current tcp buf memory allocation
Both are in pages, right?
Shouldn't it be scaled to bytes and named uniform with other memcg file?
memory.kmem.tcp.limit_in_bytes/usage_in_bytes.
--
Kirill A. Shutemov
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. 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:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH v4 7/8] Display current tcp memory allocation in kmem cgroup
From: Glauber Costa @ 2011-10-03 12:19 UTC (permalink / raw)
To: Kirill A. Shutemov
Cc: linux-kernel, paul, lizf, kamezawa.hiroyu, ebiederm, davem,
gthelen, netdev, linux-mm, avagin
In-Reply-To: <20111003121446.GD29312@shutemov.name>
On 10/03/2011 04:14 PM, Kirill A. Shutemov wrote:
> On Mon, Oct 03, 2011 at 02:18:42PM +0400, Glauber Costa wrote:
>> This patch introduces kmem.tcp_current_memory file, living in the
>> kmem_cgroup filesystem. It is a simple read-only file that displays the
>> amount of kernel memory currently consumed by the cgroup.
>>
>> Signed-off-by: Glauber Costa<glommer@parallels.com>
>> CC: David S. Miller<davem@davemloft.net>
>> CC: Hiroyouki Kamezawa<kamezawa.hiroyu@jp.fujitsu.com>
>> CC: Eric W. Biederman<ebiederm@xmission.com>
>> ---
>> Documentation/cgroups/memory.txt | 1 +
>> mm/memcontrol.c | 11 +++++++++++
>> 2 files changed, 12 insertions(+), 0 deletions(-)
>>
>> diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
>> index 1ffde3e..f5a539d 100644
>> --- a/Documentation/cgroups/memory.txt
>> +++ b/Documentation/cgroups/memory.txt
>> @@ -79,6 +79,7 @@ Brief summary of control files.
>> memory.independent_kmem_limit # select whether or not kernel memory limits are
>> independent of user limits
>> memory.kmem.tcp.max_memory # set/show hard limit for tcp buf memory
>> + memory.kmem.tcp.current_memory # show current tcp buf memory allocation
>
> Both are in pages, right?
> Shouldn't it be scaled to bytes and named uniform with other memcg file?
> memory.kmem.tcp.limit_in_bytes/usage_in_bytes.
>
You are absolutely correct.
Since the internal tcp comparison works, I just ended up never noticing
this.
Thanks.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. 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:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH v4 7/8] Display current tcp memory allocation in kmem cgroup
From: Kirill A. Shutemov @ 2011-10-03 12:25 UTC (permalink / raw)
To: Glauber Costa
Cc: linux-kernel, paul, lizf, kamezawa.hiroyu, ebiederm, davem,
gthelen, netdev, linux-mm, avagin
In-Reply-To: <4E89A846.1010200@parallels.com>
On Mon, Oct 03, 2011 at 04:19:18PM +0400, Glauber Costa wrote:
> On 10/03/2011 04:14 PM, Kirill A. Shutemov wrote:
> > On Mon, Oct 03, 2011 at 02:18:42PM +0400, Glauber Costa wrote:
> >> This patch introduces kmem.tcp_current_memory file, living in the
> >> kmem_cgroup filesystem. It is a simple read-only file that displays the
> >> amount of kernel memory currently consumed by the cgroup.
> >>
> >> Signed-off-by: Glauber Costa<glommer@parallels.com>
> >> CC: David S. Miller<davem@davemloft.net>
> >> CC: Hiroyouki Kamezawa<kamezawa.hiroyu@jp.fujitsu.com>
> >> CC: Eric W. Biederman<ebiederm@xmission.com>
> >> ---
> >> Documentation/cgroups/memory.txt | 1 +
> >> mm/memcontrol.c | 11 +++++++++++
> >> 2 files changed, 12 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
> >> index 1ffde3e..f5a539d 100644
> >> --- a/Documentation/cgroups/memory.txt
> >> +++ b/Documentation/cgroups/memory.txt
> >> @@ -79,6 +79,7 @@ Brief summary of control files.
> >> memory.independent_kmem_limit # select whether or not kernel memory limits are
> >> independent of user limits
> >> memory.kmem.tcp.max_memory # set/show hard limit for tcp buf memory
> >> + memory.kmem.tcp.current_memory # show current tcp buf memory allocation
> >
> > Both are in pages, right?
> > Shouldn't it be scaled to bytes and named uniform with other memcg file?
> > memory.kmem.tcp.limit_in_bytes/usage_in_bytes.
> >
> You are absolutely correct.
> Since the internal tcp comparison works, I just ended up never noticing
> this.
Should we have failcnt and max_usage_in_bytes for tcp as well?
--
Kirill A. Shutemov
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. 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:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH v4 7/8] Display current tcp memory allocation in kmem cgroup
From: Glauber Costa @ 2011-10-03 12:26 UTC (permalink / raw)
To: Kirill A. Shutemov
Cc: linux-kernel, paul, lizf, kamezawa.hiroyu, ebiederm, davem,
gthelen, netdev, linux-mm, avagin
In-Reply-To: <20111003122511.GA29982@shutemov.name>
On 10/03/2011 04:25 PM, Kirill A. Shutemov wrote:
> On Mon, Oct 03, 2011 at 04:19:18PM +0400, Glauber Costa wrote:
>> On 10/03/2011 04:14 PM, Kirill A. Shutemov wrote:
>>> On Mon, Oct 03, 2011 at 02:18:42PM +0400, Glauber Costa wrote:
>>>> This patch introduces kmem.tcp_current_memory file, living in the
>>>> kmem_cgroup filesystem. It is a simple read-only file that displays the
>>>> amount of kernel memory currently consumed by the cgroup.
>>>>
>>>> Signed-off-by: Glauber Costa<glommer@parallels.com>
>>>> CC: David S. Miller<davem@davemloft.net>
>>>> CC: Hiroyouki Kamezawa<kamezawa.hiroyu@jp.fujitsu.com>
>>>> CC: Eric W. Biederman<ebiederm@xmission.com>
>>>> ---
>>>> Documentation/cgroups/memory.txt | 1 +
>>>> mm/memcontrol.c | 11 +++++++++++
>>>> 2 files changed, 12 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
>>>> index 1ffde3e..f5a539d 100644
>>>> --- a/Documentation/cgroups/memory.txt
>>>> +++ b/Documentation/cgroups/memory.txt
>>>> @@ -79,6 +79,7 @@ Brief summary of control files.
>>>> memory.independent_kmem_limit # select whether or not kernel memory limits are
>>>> independent of user limits
>>>> memory.kmem.tcp.max_memory # set/show hard limit for tcp buf memory
>>>> + memory.kmem.tcp.current_memory # show current tcp buf memory allocation
>>>
>>> Both are in pages, right?
>>> Shouldn't it be scaled to bytes and named uniform with other memcg file?
>>> memory.kmem.tcp.limit_in_bytes/usage_in_bytes.
>>>
>> You are absolutely correct.
>> Since the internal tcp comparison works, I just ended up never noticing
>> this.
>
> Should we have failcnt and max_usage_in_bytes for tcp as well?
>
Well, we get a fail count from the tracer anyway, so I don't really see
a need for that. I see value in having it for the slab allocation
itself, but since this only controls the memory pressure framework, I
think we can live without it.
That said, this is not a strong opinion. I can add it if you'd prefer.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. 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:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH v4 7/8] Display current tcp memory allocation in kmem cgroup
From: Glauber Costa @ 2011-10-03 12:36 UTC (permalink / raw)
To: Kirill A. Shutemov
Cc: linux-kernel, paul, lizf, kamezawa.hiroyu, ebiederm, davem,
gthelen, netdev, linux-mm, avagin
In-Reply-To: <20111003123620.GA30018@shutemov.name>
On 10/03/2011 04:36 PM, Kirill A. Shutemov wrote:
> On Mon, Oct 03, 2011 at 04:26:41PM +0400, Glauber Costa wrote:
>> On 10/03/2011 04:25 PM, Kirill A. Shutemov wrote:
>>> On Mon, Oct 03, 2011 at 04:19:18PM +0400, Glauber Costa wrote:
>>>> On 10/03/2011 04:14 PM, Kirill A. Shutemov wrote:
>>>>> On Mon, Oct 03, 2011 at 02:18:42PM +0400, Glauber Costa wrote:
>>>>>> This patch introduces kmem.tcp_current_memory file, living in the
>>>>>> kmem_cgroup filesystem. It is a simple read-only file that displays the
>>>>>> amount of kernel memory currently consumed by the cgroup.
>>>>>>
>>>>>> Signed-off-by: Glauber Costa<glommer@parallels.com>
>>>>>> CC: David S. Miller<davem@davemloft.net>
>>>>>> CC: Hiroyouki Kamezawa<kamezawa.hiroyu@jp.fujitsu.com>
>>>>>> CC: Eric W. Biederman<ebiederm@xmission.com>
>>>>>> ---
>>>>>> Documentation/cgroups/memory.txt | 1 +
>>>>>> mm/memcontrol.c | 11 +++++++++++
>>>>>> 2 files changed, 12 insertions(+), 0 deletions(-)
>>>>>>
>>>>>> diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
>>>>>> index 1ffde3e..f5a539d 100644
>>>>>> --- a/Documentation/cgroups/memory.txt
>>>>>> +++ b/Documentation/cgroups/memory.txt
>>>>>> @@ -79,6 +79,7 @@ Brief summary of control files.
>>>>>> memory.independent_kmem_limit # select whether or not kernel memory limits are
>>>>>> independent of user limits
>>>>>> memory.kmem.tcp.max_memory # set/show hard limit for tcp buf memory
>>>>>> + memory.kmem.tcp.current_memory # show current tcp buf memory allocation
>>>>>
>>>>> Both are in pages, right?
>>>>> Shouldn't it be scaled to bytes and named uniform with other memcg file?
>>>>> memory.kmem.tcp.limit_in_bytes/usage_in_bytes.
>>>>>
>>>> You are absolutely correct.
>>>> Since the internal tcp comparison works, I just ended up never noticing
>>>> this.
>>>
>>> Should we have failcnt and max_usage_in_bytes for tcp as well?
>>>
>>
>> Well, we get a fail count from the tracer anyway, so I don't really see
>> a need for that. I see value in having it for the slab allocation
>> itself, but since this only controls the memory pressure framework, I
>> think we can live without it.
>>
>> That said, this is not a strong opinion. I can add it if you'd prefer.
>
> It's good for userspace to have the same set of files for all domains:
> - memory;
> - memory.memsw;
> - memory.kmem;
> - memory.kmem.tcp;
> - etc.
> Userspace can reuse code for handling them in this case.
>
Fine.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. 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:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH v4 7/8] Display current tcp memory allocation in kmem cgroup
From: Kirill A. Shutemov @ 2011-10-03 12:36 UTC (permalink / raw)
To: Glauber Costa
Cc: linux-kernel, paul, lizf, kamezawa.hiroyu, ebiederm, davem,
gthelen, netdev, linux-mm, avagin
In-Reply-To: <4E89AA01.3000803@parallels.com>
On Mon, Oct 03, 2011 at 04:26:41PM +0400, Glauber Costa wrote:
> On 10/03/2011 04:25 PM, Kirill A. Shutemov wrote:
> > On Mon, Oct 03, 2011 at 04:19:18PM +0400, Glauber Costa wrote:
> >> On 10/03/2011 04:14 PM, Kirill A. Shutemov wrote:
> >>> On Mon, Oct 03, 2011 at 02:18:42PM +0400, Glauber Costa wrote:
> >>>> This patch introduces kmem.tcp_current_memory file, living in the
> >>>> kmem_cgroup filesystem. It is a simple read-only file that displays the
> >>>> amount of kernel memory currently consumed by the cgroup.
> >>>>
> >>>> Signed-off-by: Glauber Costa<glommer@parallels.com>
> >>>> CC: David S. Miller<davem@davemloft.net>
> >>>> CC: Hiroyouki Kamezawa<kamezawa.hiroyu@jp.fujitsu.com>
> >>>> CC: Eric W. Biederman<ebiederm@xmission.com>
> >>>> ---
> >>>> Documentation/cgroups/memory.txt | 1 +
> >>>> mm/memcontrol.c | 11 +++++++++++
> >>>> 2 files changed, 12 insertions(+), 0 deletions(-)
> >>>>
> >>>> diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
> >>>> index 1ffde3e..f5a539d 100644
> >>>> --- a/Documentation/cgroups/memory.txt
> >>>> +++ b/Documentation/cgroups/memory.txt
> >>>> @@ -79,6 +79,7 @@ Brief summary of control files.
> >>>> memory.independent_kmem_limit # select whether or not kernel memory limits are
> >>>> independent of user limits
> >>>> memory.kmem.tcp.max_memory # set/show hard limit for tcp buf memory
> >>>> + memory.kmem.tcp.current_memory # show current tcp buf memory allocation
> >>>
> >>> Both are in pages, right?
> >>> Shouldn't it be scaled to bytes and named uniform with other memcg file?
> >>> memory.kmem.tcp.limit_in_bytes/usage_in_bytes.
> >>>
> >> You are absolutely correct.
> >> Since the internal tcp comparison works, I just ended up never noticing
> >> this.
> >
> > Should we have failcnt and max_usage_in_bytes for tcp as well?
> >
>
> Well, we get a fail count from the tracer anyway, so I don't really see
> a need for that. I see value in having it for the slab allocation
> itself, but since this only controls the memory pressure framework, I
> think we can live without it.
>
> That said, this is not a strong opinion. I can add it if you'd prefer.
It's good for userspace to have the same set of files for all domains:
- memory;
- memory.memsw;
- memory.kmem;
- memory.kmem.tcp;
- etc.
Userspace can reuse code for handling them in this case.
--
Kirill A. Shutemov
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. 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:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* [PATCH net-next-2.6] be2net: Add 60 second delay to allow FAT dump completion on recovery from EEH
From: Somnath Kotur @ 2011-10-03 18:10 UTC (permalink / raw)
To: netdev, davem; +Cc: Somnath Kotur
Add 60s delay before timeout on polling Bit 31 so that FAT dump can
complete when reset occurs.
Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
---
drivers/net/ethernet/emulex/benet/be_cmds.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index 38c9222..6e7b521 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -416,7 +416,7 @@ int be_cmd_POST(struct be_adapter *adapter)
} else {
return 0;
}
- } while (timeout < 40);
+ } while (timeout < 60);
dev_err(dev, "POST timeout; stage=0x%x\n", stage);
return -1;
--
1.5.6.1
^ permalink raw reply related
* [PATCH] SELinux: Fix RCU deref check warning in sel_netport_insert()
From: David Howells @ 2011-10-03 13:58 UTC (permalink / raw)
To: selinux; +Cc: netdev, dhowells
Fix the following bug in sel_netport_insert() where rcu_dereference() should
be rcu_dereference_protected() as sel_netport_lock is held.
===================================================
[ INFO: suspicious rcu_dereference_check() usage. ]
---------------------------------------------------
security/selinux/netport.c:127 invoked rcu_dereference_check() without protection!
other info that might help us debug this:
rcu_scheduler_active = 1, debug_locks = 0
1 lock held by ossec-rootcheck/3323:
#0: (sel_netport_lock){+.....}, at: [<ffffffff8117d775>] sel_netport_sid+0xbb/0x226
stack backtrace:
Pid: 3323, comm: ossec-rootcheck Not tainted 3.1.0-rc8-fsdevel+ #1095
Call Trace:
[<ffffffff8105cfb7>] lockdep_rcu_dereference+0xa7/0xb0
[<ffffffff8117d871>] sel_netport_sid+0x1b7/0x226
[<ffffffff8117d6ba>] ? sel_netport_avc_callback+0xbc/0xbc
[<ffffffff8117556c>] selinux_socket_bind+0x115/0x230
[<ffffffff810a5388>] ? might_fault+0x4e/0x9e
[<ffffffff810a53d1>] ? might_fault+0x97/0x9e
[<ffffffff81171cf4>] security_socket_bind+0x11/0x13
[<ffffffff812ba967>] sys_bind+0x56/0x95
[<ffffffff81380dac>] ? sysret_check+0x27/0x62
[<ffffffff8105b767>] ? trace_hardirqs_on_caller+0x11e/0x155
[<ffffffff81076fcd>] ? audit_syscall_entry+0x17b/0x1ae
[<ffffffff811b5eae>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[<ffffffff81380d7b>] system_call_fastpath+0x16/0x1b
Signed-off-by: David Howells <dhowells@redhat.com>
---
security/selinux/netport.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/security/selinux/netport.c b/security/selinux/netport.c
index 0b62bd1..39e2138 100644
--- a/security/selinux/netport.c
+++ b/security/selinux/netport.c
@@ -123,7 +123,9 @@ static void sel_netport_insert(struct sel_netport *port)
if (sel_netport_hash[idx].size == SEL_NETPORT_HASH_BKT_LIMIT) {
struct sel_netport *tail;
tail = list_entry(
- rcu_dereference(sel_netport_hash[idx].list.prev),
+ rcu_dereference_protected(
+ sel_netport_hash[idx].list.prev,
+ spin_is_locked(&sel_netport_lock)),
struct sel_netport, list);
list_del_rcu(&tail->list);
kfree_rcu(tail, rcu);
^ permalink raw reply related
* Re: [PATCH] mlx4_en: fix transmit of packages when blue frame is enabled
From: Thadeu Lima de Souza Cascardo @ 2011-10-03 14:37 UTC (permalink / raw)
To: Yevgeny Petrilin; +Cc: netdev@vger.kernel.org
In-Reply-To: <953B660C027164448AE903364AC447D2235D9A8C@MTLDAG02.mtl.com>
On Sun, Oct 02, 2011 at 08:58:21AM +0000, Yevgeny Petrilin wrote:
>
> > With the addition of Blue Frame support in the network driver for mlx4, the doorbell is not written in the path where blue frame is enabled and the package follows some characteristics.
> >
> > The consequence of that is that ICMP ECHO requests, for example, were not transmitted by the device. A ping flood, for example, would make the
> > watchdog dispatch, because the ring was full and transmissions have timed out.
> >
> > After this fix, I could ping two systems using mlx4_en (both with the fix).
> >
> > Signed-off-by: Thadeu Lima de Souza Cascardo
> > <cascardo@linux.vnet.ibm.com>
> > Cc: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
> > ---
> > drivers/net/ethernet/mellanox/mlx4/en_tx.c | 5 +++--
> > 1 files changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> > b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> > index 6e03de0..270da80 100644
> > --- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> > +++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> > @@ -811,10 +811,11 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb,
> > struct net_device *dev)
> > * before setting ownership of this descriptor to HW */
> > wmb();
> > tx_desc->ctrl.owner_opcode = op_own;
> > - wmb();
> > - writel(ring->doorbell_qpn, ring->bf.uar->map + MLX4_SEND_DOORBELL);
> > }
> >
> > + wmb();
> > + writel(ring->doorbell_qpn, ring->bf.uar->map + MLX4_SEND_DOORBELL);
> > +
> > /* Poll CQ here */
> > mlx4_en_xmit_poll(priv, tx_ind);
> >
> > --
> > 1.7.4.4
>
> What this patch does is ringing the doorbell unconditionally, whether blue flame is used or not.
> The whole idea, is to copy the data to the blueflame register and have the HW take the data from there and save the memory access to the work queue entry.
> In this patch you do both, copy the data to the register, and then still the HW accesses the memory to take it.
> For some reason Blue flame is not working on your system and we need to understand why, I'll be glad to work with you to debug it.
> Anyway, this patch is not the solution (even that it works on your systems) for the problem.
>
> Yevgeny
Hello, Yevgeny.
We use a MT26448 (lspci -v output bellow) on a POWER7. Any other
information, tests or debug patches you want me to try, just tell me.
I expected this was really not the proper fix, but thought it would be
better to send it than just guess. Any clues what the problem might be?
Perhaps, we would have to disable blue frame for this particular device?
Regards,
Cascardo.
---
lspci output
0006:01:00.0 Ethernet controller: Mellanox Technologies MT26448 [ConnectX EN 10GigE, PCIe 2.0 5GT/s] (rev b0)
---
lspci -v output
0006:01:00.0 0200: 15b3:6750 (rev b0)
Subsystem: 1014:0416
Flags: bus master, fast devsel, latency 0, IRQ 31
Memory at 3da47be00000 (64-bit, non-prefetchable) [size=1M]
Memory at 3da47c000000 (64-bit, prefetchable) [size=32M]
Expansion ROM at 3da47bf00000 [disabled] [size=1M]
Capabilities: [40] Power Management version 3
Capabilities: [48] Vital Product Data
Capabilities: [9c] MSI-X: Enable+ Count=128 Masked-
Capabilities: [60] Express Endpoint, MSI 00
Capabilities: [100] Alternative Routing-ID Interpretation (ARI)
Capabilities: [148] Device Serial Number 00-02-c9-03-00-0f-50-be
Kernel driver in use: mlx4_core
Kernel modules: mlx4_en, mlx4_core
---
^ permalink raw reply
* [PATCH net-next] RPS: Ensure that an expired hardware filter can be re-added later
From: Ben Hutchings @ 2011-10-03 14:42 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-net-drivers, Amir Vadai
Amir Vadai wrote:
> When a stream is paused, and its rule is expired while it is paused,
> no new rule will be configured to the HW when traffic resume.
[...]
> - When stream was resumed, traffic was steered again by RSS, and
> because current-cpu was equal to desired-cpu, ndo_rx_flow_steer
> wasn't called and no rule was configured to the HW.
Fix this by setting the flow's current CPU only in the table for the
newly selected RX queue.
Reported-and-tested-by: Amir Vadai <amirv@dev.mellanox.co.il>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
net/core/dev.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 7f4486e..70ecb86 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2670,10 +2670,7 @@ static struct rps_dev_flow *
set_rps_cpu(struct net_device *dev, struct sk_buff *skb,
struct rps_dev_flow *rflow, u16 next_cpu)
{
- u16 tcpu;
-
- tcpu = rflow->cpu = next_cpu;
- if (tcpu != RPS_NO_CPU) {
+ if (next_cpu != RPS_NO_CPU) {
#ifdef CONFIG_RFS_ACCEL
struct netdev_rx_queue *rxqueue;
struct rps_dev_flow_table *flow_table;
@@ -2701,16 +2698,16 @@ set_rps_cpu(struct net_device *dev, struct sk_buff *skb,
goto out;
old_rflow = rflow;
rflow = &flow_table->flows[flow_id];
- rflow->cpu = next_cpu;
rflow->filter = rc;
if (old_rflow->filter == rflow->filter)
old_rflow->filter = RPS_NO_FILTER;
out:
#endif
rflow->last_qtail =
- per_cpu(softnet_data, tcpu).input_queue_head;
+ per_cpu(softnet_data, next_cpu).input_queue_head;
}
+ rflow->cpu = next_cpu;
return rflow;
}
--
1.7.4.4
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* RE: [PATCH] mlx4_en: fix transmit of packages when blue frame is enabled
From: Yevgeny Petrilin @ 2011-10-03 14:56 UTC (permalink / raw)
To: Thadeu Lima de Souza Cascardo
Cc: netdev@vger.kernel.org, Eli Cohen, eli@dev.mellanox.co.il
In-Reply-To: <20111003143721.GA3596@oc1711230544.ibm.com>
> Hello, Yevgeny.
>
> We use a MT26448 (lspci -v output bellow) on a POWER7. Any other
> information, tests or debug patches you want me to try, just tell me.
>
> I expected this was really not the proper fix, but thought it would be
> better to send it than just guess. Any clues what the problem might be?
> Perhaps, we would have to disable blue frame for this particular device?
>
> Regards,
> Cascardo.
>
> ---
> lspci output
> 0006:01:00.0 Ethernet controller: Mellanox Technologies MT26448 [ConnectX EN 10GigE, PCIe 2.0 5GT/s] (rev b0)
> ---
> lspci -v output
> 0006:01:00.0 0200: 15b3:6750 (rev b0)
> Subsystem: 1014:0416
> Flags: bus master, fast devsel, latency 0, IRQ 31
> Memory at 3da47be00000 (64-bit, non-prefetchable) [size=1M]
> Memory at 3da47c000000 (64-bit, prefetchable) [size=32M]
> Expansion ROM at 3da47bf00000 [disabled] [size=1M]
> Capabilities: [40] Power Management version 3
> Capabilities: [48] Vital Product Data
> Capabilities: [9c] MSI-X: Enable+ Count=128 Masked-
> Capabilities: [60] Express Endpoint, MSI 00
> Capabilities: [100] Alternative Routing-ID Interpretation (ARI)
> Capabilities: [148] Device Serial Number 00-02-c9-03-00-0f-50-be
> Kernel driver in use: mlx4_core
> Kernel modules: mlx4_en, mlx4_core
> ---
Cascardo,
Can you also send me the output of ethtool -i?
It seems that there is a problem with write combining on Power processors, we will check this issue.
Yevgeny
^ permalink raw reply
* Re: [PATCH v4 3/8] foundations of per-cgroup memory pressure controlling.
From: Andrew Vagin @ 2011-10-03 15:13 UTC (permalink / raw)
To: Glauber Costa
Cc: linux-kernel, paul, lizf, kamezawa.hiroyu, ebiederm, davem,
gthelen, netdev, linux-mm, kirill
In-Reply-To: <1317637123-18306-4-git-send-email-glommer@parallels.com>
I have some compilation issues:
[root@ws-qual linux-2.6]# make -j 32
CHK include/linux/version.h
CHK include/generated/utsrelease.h
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CHK kernel/config_data.h
CHK include/linux/version.h
Building modules, stage 2.
MODPOST 78 modules
Kernel: arch/x86/boot/bzImage is ready (#127)
ERROR: "memory_pressure_tcp" [net/ipv6/ipv6.ko] undefined!
ERROR: "tcp_sysctl_mem" [net/ipv6/ipv6.ko] undefined!
ERROR: "memory_allocated_tcp" [net/ipv6/ipv6.ko] undefined!
ERROR: "tcp_enter_memory_pressure" [net/ipv6/ipv6.ko] undefined!
ERROR: "sockets_allocated_tcp" [net/ipv6/ipv6.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
I compile ipv6 as module.
mm/memcontrol.c
I think you forgot export some functions.
On Mon, Oct 03, 2011 at 02:18:38PM +0400, Glauber Costa wrote:
> This patch converts struct sock fields memory_pressure,
> memory_allocated, sockets_allocated, and sysctl_mem (now prot_mem)
> to function pointers, receiving a struct mem_cgroup parameter.
>
> enter_memory_pressure is kept the same, since all its callers
> have socket a context, and the kmem_cgroup can be derived from
> the socket itself.
>
> To keep things working, the patch convert all users of those fields
> to use acessor functions.
>
> In my benchmarks I didn't see a significant performance difference
> with this patch applied compared to a baseline (around 1 % diff, thus
> inside error margin).
>
> Signed-off-by: Glauber Costa <glommer@parallels.com>
> CC: David S. Miller <davem@davemloft.net>
> CC: Hiroyouki Kamezawa <kamezawa.hiroyu@jp.fujitsu.com>
> CC: Eric W. Biederman <ebiederm@xmission.com>
> ---
> crypto/af_alg.c | 7 ++-
> include/linux/memcontrol.h | 29 +++++++++++-
> include/net/sock.h | 112 +++++++++++++++++++++++++++++++++++++++++--
> include/net/tcp.h | 11 +++--
> include/net/udp.h | 3 +-
> include/trace/events/sock.h | 10 ++--
> mm/memcontrol.c | 45 +++++++++++++++++-
> net/core/sock.c | 62 ++++++++++++++----------
> net/decnet/af_decnet.c | 21 +++++++-
> net/ipv4/proc.c | 7 ++-
> net/ipv4/tcp.c | 27 +++++++++-
> net/ipv4/tcp_input.c | 12 ++--
> net/ipv4/tcp_ipv4.c | 12 ++--
> net/ipv4/tcp_output.c | 2 +-
> net/ipv4/tcp_timer.c | 2 +-
> net/ipv4/udp.c | 20 ++++++--
> net/ipv6/tcp_ipv6.c | 10 ++--
> net/ipv6/udp.c | 4 +-
> net/sctp/socket.c | 35 ++++++++++---
> 19 files changed, 345 insertions(+), 86 deletions(-)
>
> diff --git a/crypto/af_alg.c b/crypto/af_alg.c
> index ac33d5f..9f41324 100644
> --- a/crypto/af_alg.c
> +++ b/crypto/af_alg.c
> @@ -29,10 +29,15 @@ struct alg_type_list {
>
> static atomic_long_t alg_memory_allocated;
>
> +static atomic_long_t *memory_allocated_alg(struct mem_cgroup *memcg)
> +{
> + return &alg_memory_allocated;
> +}
> +
> static struct proto alg_proto = {
> .name = "ALG",
> .owner = THIS_MODULE,
> - .memory_allocated = &alg_memory_allocated,
> + .memory_allocated = memory_allocated_alg,
> .obj_size = sizeof(struct alg_sock),
> };
>
> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
> index 2cb9226..d0b973c 100644
> --- a/include/linux/memcontrol.h
> +++ b/include/linux/memcontrol.h
> @@ -380,6 +380,10 @@ static inline
> void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx)
> {
> }
> +static inline struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p)
> +{
> + return NULL;
> +}
> #endif /* CONFIG_CGROUP_MEM_CONT */
>
> #if !defined(CONFIG_CGROUP_MEM_RES_CTLR) || !defined(CONFIG_DEBUG_VM)
> @@ -397,11 +401,34 @@ mem_cgroup_print_bad_page(struct page *page)
>
> #ifdef CONFIG_INET
> struct sock;
> +struct proto;
> #ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM
> void sock_update_memcg(struct sock *sk);
> void sock_release_memcg(struct sock *sk);
> -
> +void memcg_sock_mem_alloc(struct mem_cgroup *mem, struct proto *prot,
> + int amt, int *parent_failure);
> +void memcg_sock_mem_free(struct mem_cgroup *mem, struct proto *prot, int amt);
> +void memcg_sockets_allocated_dec(struct mem_cgroup *mem, struct proto *prot);
> +void memcg_sockets_allocated_inc(struct mem_cgroup *mem, struct proto *prot);
> #else
> +/* memcontrol includes sockets.h, that includes memcontrol.h ... */
> +static inline void memcg_sock_mem_alloc(struct mem_cgroup *mem,
> + struct proto *prot, int amt,
> + int *parent_failure)
> +{
> +}
> +static inline void memcg_sock_mem_free(struct mem_cgroup *mem,
> + struct proto *prot, int amt)
> +{
> +}
> +static inline void memcg_sockets_allocated_dec(struct mem_cgroup *mem,
> + struct proto *prot)
> +{
> +}
> +static inline void memcg_sockets_allocated_inc(struct mem_cgroup *mem,
> + struct proto *prot)
> +{
> +}
> static inline void sock_update_memcg(struct sock *sk)
> {
> }
> diff --git a/include/net/sock.h b/include/net/sock.h
> index afe1467..c6983cf 100644
> --- a/include/net/sock.h
> +++ b/include/net/sock.h
> @@ -54,6 +54,7 @@
> #include <linux/security.h>
> #include <linux/slab.h>
> #include <linux/uaccess.h>
> +#include <linux/cgroup.h>
>
> #include <linux/filter.h>
> #include <linux/rculist_nulls.h>
> @@ -168,6 +169,8 @@ struct sock_common {
> /* public: */
> };
>
> +struct mem_cgroup;
> +
> /**
> * struct sock - network layer representation of sockets
> * @__sk_common: shared layout with inet_timewait_sock
> @@ -786,18 +789,32 @@ struct proto {
> unsigned int inuse_idx;
> #endif
>
> + /*
> + * per-cgroup memory tracking:
> + *
> + * The following functions track memory consumption of network buffers
> + * by cgroup (kmem_cgroup) for the current protocol. As of the rest
> + * of the fields in this structure, not all protocols are required
> + * to implement them. Protocols that don't want to do per-cgroup
> + * memory pressure management, can just assume the root cgroup is used.
> + *
> + */
> /* Memory pressure */
> void (*enter_memory_pressure)(struct sock *sk);
> - atomic_long_t *memory_allocated; /* Current allocated memory. */
> - struct percpu_counter *sockets_allocated; /* Current number of sockets. */
> + /* Pointer to the current memory allocation of this cgroup. */
> + atomic_long_t *(*memory_allocated)(struct mem_cgroup *memcg);
> + /* Pointer to the current number of sockets in this cgroup. */
> + struct percpu_counter *(*sockets_allocated)(struct mem_cgroup *memcg);
> /*
> - * Pressure flag: try to collapse.
> + * Per cgroup pointer to the pressure flag: try to collapse.
> * Technical note: it is used by multiple contexts non atomically.
> * All the __sk_mem_schedule() is of this nature: accounting
> * is strict, actions are advisory and have some latency.
> */
> - int *memory_pressure;
> - long *sysctl_mem;
> + int *(*memory_pressure)(struct mem_cgroup *memcg);
> + /* Pointer to the per-cgroup version of the the sysctl_mem field */
> + long *(*prot_mem)(struct mem_cgroup *memcg);
> +
> int *sysctl_wmem;
> int *sysctl_rmem;
> int max_header;
> @@ -856,6 +873,91 @@ static inline void sk_refcnt_debug_release(const struct sock *sk)
> #define sk_refcnt_debug_release(sk) do { } while (0)
> #endif /* SOCK_REFCNT_DEBUG */
>
> +#include <linux/memcontrol.h>
> +static inline int *sk_memory_pressure(struct sock *sk)
> +{
> + int *ret = NULL;
> + if (sk->sk_prot->memory_pressure)
> + ret = sk->sk_prot->memory_pressure(sk->sk_cgrp);
> + return ret;
> +}
> +
> +static inline long sk_prot_mem(struct sock *sk, int index)
> +{
> + long *prot = sk->sk_prot->prot_mem(sk->sk_cgrp);
> + return prot[index];
> +}
> +
> +static inline long
> +sk_memory_allocated(struct sock *sk)
> +{
> + struct proto *prot = sk->sk_prot;
> + struct mem_cgroup *cg = sk->sk_cgrp;
> +
> + return atomic_long_read(prot->memory_allocated(cg));
> +}
> +
> +static inline long
> +sk_memory_allocated_add(struct sock *sk, int amt, int *parent_failure)
> +{
> + struct proto *prot = sk->sk_prot;
> + struct mem_cgroup *cg = sk->sk_cgrp;
> + long allocated;
> +
> + allocated = atomic_long_add_return(amt, prot->memory_allocated(cg));
> + memcg_sock_mem_alloc(cg, prot, amt, parent_failure);
> + return allocated;
> +}
> +
> +static inline void
> +sk_memory_allocated_sub(struct sock *sk, int amt)
> +{
> + struct proto *prot = sk->sk_prot;
> + struct mem_cgroup *cg = sk->sk_cgrp;
> +
> + atomic_long_sub(amt, prot->memory_allocated(cg));
> + memcg_sock_mem_free(cg, prot, amt);
> +}
> +
> +static inline void sk_sockets_allocated_dec(struct sock *sk)
> +{
> + struct proto *prot = sk->sk_prot;
> + struct mem_cgroup *cg = sk->sk_cgrp;
> +
> + percpu_counter_dec(prot->sockets_allocated(cg));
> + memcg_sockets_allocated_dec(cg, prot);
> +}
> +
> +static inline void sk_sockets_allocated_inc(struct sock *sk)
> +{
> + struct proto *prot = sk->sk_prot;
> + struct mem_cgroup *cg = sk->sk_cgrp;
> +
> + percpu_counter_inc(prot->sockets_allocated(cg));
> + memcg_sockets_allocated_inc(cg, prot);
> +}
> +
> +static inline int
> +sk_sockets_allocated_read_positive(struct sock *sk)
> +{
> + struct proto *prot = sk->sk_prot;
> + struct mem_cgroup *cg = sk->sk_cgrp;
> +
> + return percpu_counter_sum_positive(prot->sockets_allocated(cg));
> +}
> +
> +static inline int
> +kcg_sockets_allocated_sum_positive(struct proto *prot, struct mem_cgroup *cg)
> +{
> + return percpu_counter_sum_positive(prot->sockets_allocated(cg));
> +}
> +
> +static inline long
> +kcg_memory_allocated(struct proto *prot, struct mem_cgroup *cg)
> +{
> + return atomic_long_read(prot->memory_allocated(cg));
> +}
> +
>
> #ifdef CONFIG_PROC_FS
> /* Called with local bh disabled */
> diff --git a/include/net/tcp.h b/include/net/tcp.h
> index 149a415..2200694 100644
> --- a/include/net/tcp.h
> +++ b/include/net/tcp.h
> @@ -45,6 +45,7 @@
> #include <net/dst.h>
>
> #include <linux/seq_file.h>
> +#include <linux/memcontrol.h>
>
> extern struct inet_hashinfo tcp_hashinfo;
>
> @@ -253,9 +254,11 @@ extern int sysctl_tcp_cookie_size;
> extern int sysctl_tcp_thin_linear_timeouts;
> extern int sysctl_tcp_thin_dupack;
>
> -extern atomic_long_t tcp_memory_allocated;
> -extern struct percpu_counter tcp_sockets_allocated;
> -extern int tcp_memory_pressure;
> +struct mem_cgroup;
> +extern long *tcp_sysctl_mem(struct mem_cgroup *memcg);
> +struct percpu_counter *sockets_allocated_tcp(struct mem_cgroup *memcg);
> +int *memory_pressure_tcp(struct mem_cgroup *memcg);
> +atomic_long_t *memory_allocated_tcp(struct mem_cgroup *memcg);
>
> /*
> * The next routines deal with comparing 32 bit unsigned ints
> @@ -286,7 +289,7 @@ static inline bool tcp_too_many_orphans(struct sock *sk, int shift)
> }
>
> if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF &&
> - atomic_long_read(&tcp_memory_allocated) > sysctl_tcp_mem[2])
> + sk_memory_allocated(sk) > sk_prot_mem(sk, 2))
> return true;
> return false;
> }
> diff --git a/include/net/udp.h b/include/net/udp.h
> index 67ea6fc..b96ed51 100644
> --- a/include/net/udp.h
> +++ b/include/net/udp.h
> @@ -105,7 +105,8 @@ static inline struct udp_hslot *udp_hashslot2(struct udp_table *table,
>
> extern struct proto udp_prot;
>
> -extern atomic_long_t udp_memory_allocated;
> +atomic_long_t *memory_allocated_udp(struct mem_cgroup *memcg);
> +long *udp_sysctl_mem(struct mem_cgroup *memcg);
>
> /* sysctl variables for udp */
> extern long sysctl_udp_mem[3];
> diff --git a/include/trace/events/sock.h b/include/trace/events/sock.h
> index 779abb9..12a6083 100644
> --- a/include/trace/events/sock.h
> +++ b/include/trace/events/sock.h
> @@ -37,7 +37,7 @@ TRACE_EVENT(sock_exceed_buf_limit,
>
> TP_STRUCT__entry(
> __array(char, name, 32)
> - __field(long *, sysctl_mem)
> + __field(long *, prot_mem)
> __field(long, allocated)
> __field(int, sysctl_rmem)
> __field(int, rmem_alloc)
> @@ -45,7 +45,7 @@ TRACE_EVENT(sock_exceed_buf_limit,
>
> TP_fast_assign(
> strncpy(__entry->name, prot->name, 32);
> - __entry->sysctl_mem = prot->sysctl_mem;
> + __entry->prot_mem = sk->sk_prot->prot_mem(sk->sk_cgrp);
> __entry->allocated = allocated;
> __entry->sysctl_rmem = prot->sysctl_rmem[0];
> __entry->rmem_alloc = atomic_read(&sk->sk_rmem_alloc);
> @@ -54,9 +54,9 @@ TRACE_EVENT(sock_exceed_buf_limit,
> TP_printk("proto:%s sysctl_mem=%ld,%ld,%ld allocated=%ld "
> "sysctl_rmem=%d rmem_alloc=%d",
> __entry->name,
> - __entry->sysctl_mem[0],
> - __entry->sysctl_mem[1],
> - __entry->sysctl_mem[2],
> + __entry->prot_mem[0],
> + __entry->prot_mem[1],
> + __entry->prot_mem[2],
> __entry->allocated,
> __entry->sysctl_rmem,
> __entry->rmem_alloc)
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 08a520e..1586332 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -339,6 +339,7 @@ struct mem_cgroup {
> spinlock_t pcp_counter_lock;
> };
>
> +static struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *mem);
> /* Writing them here to avoid exposing memcg's inner layout */
> #ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM
> #ifdef CONFIG_INET
> @@ -369,6 +370,49 @@ void sock_release_memcg(struct sock *sk)
> {
> cgroup_release_and_wakeup_rmdir(mem_cgroup_css(sk->sk_cgrp));
> }
> +
> +void memcg_sock_mem_alloc(struct mem_cgroup *mem, struct proto *prot,
> + int amt, int *parent_failure)
> +{
> + mem = parent_mem_cgroup(mem);
> + for (; mem != NULL; mem = parent_mem_cgroup(mem)) {
> + long alloc;
> + long *prot_mem = prot->prot_mem(mem);
> + /*
> + * Large nestings are not the common case, and stopping in the
> + * middle would be complicated enough, that we bill it all the
> + * way through the root, and if needed, unbill everything later
> + */
> + alloc = atomic_long_add_return(amt,
> + prot->memory_allocated(mem));
> + *parent_failure |= (alloc > prot_mem[2]);
> + }
> +}
> +EXPORT_SYMBOL(memcg_sock_mem_alloc);
> +
> +void memcg_sock_mem_free(struct mem_cgroup *mem, struct proto *prot, int amt)
> +{
> + mem = parent_mem_cgroup(mem);
> + for (; mem != NULL; mem = parent_mem_cgroup(mem))
> + atomic_long_sub(amt, prot->memory_allocated(mem));
> +}
> +EXPORT_SYMBOL(memcg_sock_mem_free);
> +
> +void memcg_sockets_allocated_dec(struct mem_cgroup *mem, struct proto *prot)
> +{
> + mem = parent_mem_cgroup(mem);
> + for (; mem; mem = parent_mem_cgroup(mem))
> + percpu_counter_dec(prot->sockets_allocated(mem));
> +}
> +EXPORT_SYMBOL(memcg_sockets_allocated_dec);
> +
> +void memcg_sockets_allocated_inc(struct mem_cgroup *mem, struct proto *prot)
> +{
> + mem = parent_mem_cgroup(mem);
> + for (; mem; mem = parent_mem_cgroup(mem))
> + percpu_counter_inc(prot->sockets_allocated(mem));
> +}
> +EXPORT_SYMBOL(memcg_sockets_allocated_inc);
> #endif /* CONFIG_INET */
> #endif /* CONFIG_CGROUP_MEM_RES_CTLR_KMEM */
>
> @@ -454,7 +498,6 @@ enum mem_type {
>
> static void mem_cgroup_get(struct mem_cgroup *mem);
> static void mem_cgroup_put(struct mem_cgroup *mem);
> -static struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *mem);
> static void drain_all_stock_async(struct mem_cgroup *mem);
>
> static struct mem_cgroup_per_zone *
> diff --git a/net/core/sock.c b/net/core/sock.c
> index 5426ba0..6e3ace7 100644
> --- a/net/core/sock.c
> +++ b/net/core/sock.c
> @@ -1293,7 +1293,7 @@ struct sock *sk_clone(const struct sock *sk, const gfp_t priority)
> newsk->sk_wq = NULL;
>
> if (newsk->sk_prot->sockets_allocated)
> - percpu_counter_inc(newsk->sk_prot->sockets_allocated);
> + sk_sockets_allocated_inc(newsk);
>
> if (sock_flag(newsk, SOCK_TIMESTAMP) ||
> sock_flag(newsk, SOCK_TIMESTAMPING_RX_SOFTWARE))
> @@ -1684,30 +1684,33 @@ int __sk_mem_schedule(struct sock *sk, int size, int kind)
> struct proto *prot = sk->sk_prot;
> int amt = sk_mem_pages(size);
> long allocated;
> + int *memory_pressure;
> + int parent_failure = 0;
>
> sk->sk_forward_alloc += amt * SK_MEM_QUANTUM;
> - allocated = atomic_long_add_return(amt, prot->memory_allocated);
> +
> + memory_pressure = sk_memory_pressure(sk);
> + allocated = sk_memory_allocated_add(sk, amt, &parent_failure);
> +
> + /* Over hard limit (we, or our parents) */
> + if (parent_failure || (allocated > sk_prot_mem(sk, 2)))
> + goto suppress_allocation;
>
> /* Under limit. */
> - if (allocated <= prot->sysctl_mem[0]) {
> - if (prot->memory_pressure && *prot->memory_pressure)
> - *prot->memory_pressure = 0;
> - return 1;
> - }
> + if (allocated <= sk_prot_mem(sk, 0))
> + if (memory_pressure && *memory_pressure)
> + *memory_pressure = 0;
>
> /* Under pressure. */
> - if (allocated > prot->sysctl_mem[1])
> + if (allocated > sk_prot_mem(sk, 1))
> if (prot->enter_memory_pressure)
> prot->enter_memory_pressure(sk);
>
> - /* Over hard limit. */
> - if (allocated > prot->sysctl_mem[2])
> - goto suppress_allocation;
> -
> /* guarantee minimum buffer size under pressure */
> if (kind == SK_MEM_RECV) {
> if (atomic_read(&sk->sk_rmem_alloc) < prot->sysctl_rmem[0])
> return 1;
> +
> } else { /* SK_MEM_SEND */
> if (sk->sk_type == SOCK_STREAM) {
> if (sk->sk_wmem_queued < prot->sysctl_wmem[0])
> @@ -1717,13 +1720,13 @@ int __sk_mem_schedule(struct sock *sk, int size, int kind)
> return 1;
> }
>
> - if (prot->memory_pressure) {
> + if (memory_pressure) {
> int alloc;
>
> - if (!*prot->memory_pressure)
> + if (!*memory_pressure)
> return 1;
> - alloc = percpu_counter_read_positive(prot->sockets_allocated);
> - if (prot->sysctl_mem[2] > alloc *
> + alloc = sk_sockets_allocated_read_positive(sk);
> + if (sk_prot_mem(sk, 2) > alloc *
> sk_mem_pages(sk->sk_wmem_queued +
> atomic_read(&sk->sk_rmem_alloc) +
> sk->sk_forward_alloc))
> @@ -1746,7 +1749,9 @@ suppress_allocation:
>
> /* Alas. Undo changes. */
> sk->sk_forward_alloc -= amt * SK_MEM_QUANTUM;
> - atomic_long_sub(amt, prot->memory_allocated);
> +
> + sk_memory_allocated_sub(sk, amt);
> +
> return 0;
> }
> EXPORT_SYMBOL(__sk_mem_schedule);
> @@ -1757,15 +1762,15 @@ EXPORT_SYMBOL(__sk_mem_schedule);
> */
> void __sk_mem_reclaim(struct sock *sk)
> {
> - struct proto *prot = sk->sk_prot;
> + int *memory_pressure = sk_memory_pressure(sk);
>
> - atomic_long_sub(sk->sk_forward_alloc >> SK_MEM_QUANTUM_SHIFT,
> - prot->memory_allocated);
> + sk_memory_allocated_sub(sk,
> + sk->sk_forward_alloc >> SK_MEM_QUANTUM_SHIFT);
> sk->sk_forward_alloc &= SK_MEM_QUANTUM - 1;
>
> - if (prot->memory_pressure && *prot->memory_pressure &&
> - (atomic_long_read(prot->memory_allocated) < prot->sysctl_mem[0]))
> - *prot->memory_pressure = 0;
> + if (memory_pressure && *memory_pressure &&
> + (sk_memory_allocated(sk) < sk_prot_mem(sk, 0)))
> + *memory_pressure = 0;
> }
> EXPORT_SYMBOL(__sk_mem_reclaim);
>
> @@ -2484,13 +2489,20 @@ static char proto_method_implemented(const void *method)
>
> static void proto_seq_printf(struct seq_file *seq, struct proto *proto)
> {
> + struct mem_cgroup *cg = mem_cgroup_from_task(current);
> + int *memory_pressure = NULL;
> +
> + if (proto->memory_pressure)
> + memory_pressure = proto->memory_pressure(cg);
> +
> seq_printf(seq, "%-9s %4u %6d %6ld %-3s %6u %-3s %-10s "
> "%2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c %2c\n",
> proto->name,
> proto->obj_size,
> sock_prot_inuse_get(seq_file_net(seq), proto),
> - proto->memory_allocated != NULL ? atomic_long_read(proto->memory_allocated) : -1L,
> - proto->memory_pressure != NULL ? *proto->memory_pressure ? "yes" : "no" : "NI",
> + proto->memory_allocated != NULL ?
> + kcg_memory_allocated(proto, cg) : -1L,
> + memory_pressure != NULL ? *memory_pressure ? "yes" : "no" : "NI",
> proto->max_header,
> proto->slab == NULL ? "no" : "yes",
> module_name(proto->owner),
> diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
> index 19acd00..39f83b4 100644
> --- a/net/decnet/af_decnet.c
> +++ b/net/decnet/af_decnet.c
> @@ -458,13 +458,28 @@ static void dn_enter_memory_pressure(struct sock *sk)
> }
> }
>
> +static atomic_long_t *memory_allocated_dn(struct mem_cgroup *memcg)
> +{
> + return &decnet_memory_allocated;
> +}
> +
> +static int *memory_pressure_dn(struct mem_cgroup *memcg)
> +{
> + return &dn_memory_pressure;
> +}
> +
> +static long *dn_sysctl_mem(struct mem_cgroup *memcg)
> +{
> + return sysctl_decnet_mem;
> +}
> +
> static struct proto dn_proto = {
> .name = "NSP",
> .owner = THIS_MODULE,
> .enter_memory_pressure = dn_enter_memory_pressure,
> - .memory_pressure = &dn_memory_pressure,
> - .memory_allocated = &decnet_memory_allocated,
> - .sysctl_mem = sysctl_decnet_mem,
> + .memory_pressure = memory_pressure_dn,
> + .memory_allocated = memory_allocated_dn,
> + .prot_mem = dn_sysctl_mem,
> .sysctl_wmem = sysctl_decnet_wmem,
> .sysctl_rmem = sysctl_decnet_rmem,
> .max_header = DN_MAX_NSP_DATA_HEADER + 64,
> diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
> index b14ec7d..ba56702 100644
> --- a/net/ipv4/proc.c
> +++ b/net/ipv4/proc.c
> @@ -52,20 +52,21 @@ static int sockstat_seq_show(struct seq_file *seq, void *v)
> {
> struct net *net = seq->private;
> int orphans, sockets;
> + struct mem_cgroup *cg = mem_cgroup_from_task(current);
>
> local_bh_disable();
> orphans = percpu_counter_sum_positive(&tcp_orphan_count);
> - sockets = percpu_counter_sum_positive(&tcp_sockets_allocated);
> + sockets = kcg_sockets_allocated_sum_positive(&tcp_prot, cg);
> local_bh_enable();
>
> socket_seq_show(seq);
> seq_printf(seq, "TCP: inuse %d orphan %d tw %d alloc %d mem %ld\n",
> sock_prot_inuse_get(net, &tcp_prot), orphans,
> tcp_death_row.tw_count, sockets,
> - atomic_long_read(&tcp_memory_allocated));
> + kcg_memory_allocated(&tcp_prot, cg));
> seq_printf(seq, "UDP: inuse %d mem %ld\n",
> sock_prot_inuse_get(net, &udp_prot),
> - atomic_long_read(&udp_memory_allocated));
> + kcg_memory_allocated(&udp_prot, cg));
> seq_printf(seq, "UDPLITE: inuse %d\n",
> sock_prot_inuse_get(net, &udplite_prot));
> seq_printf(seq, "RAW: inuse %d\n",
> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> index 46febca..ca82b90 100644
> --- a/net/ipv4/tcp.c
> +++ b/net/ipv4/tcp.c
> @@ -291,13 +291,11 @@ EXPORT_SYMBOL(sysctl_tcp_rmem);
> EXPORT_SYMBOL(sysctl_tcp_wmem);
>
> atomic_long_t tcp_memory_allocated; /* Current allocated memory. */
> -EXPORT_SYMBOL(tcp_memory_allocated);
>
> /*
> * Current number of TCP sockets.
> */
> struct percpu_counter tcp_sockets_allocated;
> -EXPORT_SYMBOL(tcp_sockets_allocated);
>
> /*
> * TCP splice context
> @@ -315,7 +313,18 @@ struct tcp_splice_state {
> * is strict, actions are advisory and have some latency.
> */
> int tcp_memory_pressure __read_mostly;
> -EXPORT_SYMBOL(tcp_memory_pressure);
> +
> +int *memory_pressure_tcp(struct mem_cgroup *memcg)
> +{
> + return &tcp_memory_pressure;
> +}
> +EXPORT_SYMBOL(memory_pressure_tcp);
> +
> +struct percpu_counter *sockets_allocated_tcp(struct mem_cgroup *memcg)
> +{
> + return &tcp_sockets_allocated;
> +}
> +EXPORT_SYMBOL(sockets_allocated_tcp);
>
> void tcp_enter_memory_pressure(struct sock *sk)
> {
> @@ -326,6 +335,18 @@ void tcp_enter_memory_pressure(struct sock *sk)
> }
> EXPORT_SYMBOL(tcp_enter_memory_pressure);
>
> +long *tcp_sysctl_mem(struct mem_cgroup *memcg)
> +{
> + return sysctl_tcp_mem;
> +}
> +EXPORT_SYMBOL(tcp_sysctl_mem);
> +
> +atomic_long_t *memory_allocated_tcp(struct mem_cgroup *memcg)
> +{
> + return &tcp_memory_allocated;
> +}
> +EXPORT_SYMBOL(memory_allocated_tcp);
> +
> /* Convert seconds to retransmits based on initial and max timeout */
> static u8 secs_to_retrans(int seconds, int timeout, int rto_max)
> {
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index ea0d218..3f17423 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -316,7 +316,7 @@ static void tcp_grow_window(struct sock *sk, struct sk_buff *skb)
> /* Check #1 */
> if (tp->rcv_ssthresh < tp->window_clamp &&
> (int)tp->rcv_ssthresh < tcp_space(sk) &&
> - !tcp_memory_pressure) {
> + !sk_memory_pressure(sk)) {
> int incr;
>
> /* Check #2. Increase window, if skb with such overhead
> @@ -398,8 +398,8 @@ static void tcp_clamp_window(struct sock *sk)
>
> if (sk->sk_rcvbuf < sysctl_tcp_rmem[2] &&
> !(sk->sk_userlocks & SOCK_RCVBUF_LOCK) &&
> - !tcp_memory_pressure &&
> - atomic_long_read(&tcp_memory_allocated) < sysctl_tcp_mem[0]) {
> + !sk_memory_pressure(sk) &&
> + sk_memory_allocated(sk) < sk_prot_mem(sk, 0)) {
> sk->sk_rcvbuf = min(atomic_read(&sk->sk_rmem_alloc),
> sysctl_tcp_rmem[2]);
> }
> @@ -4806,7 +4806,7 @@ static int tcp_prune_queue(struct sock *sk)
>
> if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf)
> tcp_clamp_window(sk);
> - else if (tcp_memory_pressure)
> + else if (sk_memory_pressure(sk))
> tp->rcv_ssthresh = min(tp->rcv_ssthresh, 4U * tp->advmss);
>
> tcp_collapse_ofo_queue(sk);
> @@ -4872,11 +4872,11 @@ static int tcp_should_expand_sndbuf(struct sock *sk)
> return 0;
>
> /* If we are under global TCP memory pressure, do not expand. */
> - if (tcp_memory_pressure)
> + if (sk_memory_pressure(sk))
> return 0;
>
> /* If we are under soft global TCP memory pressure, do not expand. */
> - if (atomic_long_read(&tcp_memory_allocated) >= sysctl_tcp_mem[0])
> + if (sk_memory_allocated(sk) >= sk_prot_mem(sk, 0))
> return 0;
>
> /* If we filled the congestion window, do not expand. */
> diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
> index 1c12b8e..cbb0d5e 100644
> --- a/net/ipv4/tcp_ipv4.c
> +++ b/net/ipv4/tcp_ipv4.c
> @@ -1901,7 +1901,7 @@ static int tcp_v4_init_sock(struct sock *sk)
> sk->sk_rcvbuf = sysctl_tcp_rmem[1];
>
> local_bh_disable();
> - percpu_counter_inc(&tcp_sockets_allocated);
> + sk_sockets_allocated_inc(sk);
> local_bh_enable();
>
> return 0;
> @@ -1957,7 +1957,7 @@ void tcp_v4_destroy_sock(struct sock *sk)
> tp->cookie_values = NULL;
> }
>
> - percpu_counter_dec(&tcp_sockets_allocated);
> + sk_sockets_allocated_dec(sk);
> }
> EXPORT_SYMBOL(tcp_v4_destroy_sock);
>
> @@ -2598,11 +2598,11 @@ struct proto tcp_prot = {
> .unhash = inet_unhash,
> .get_port = inet_csk_get_port,
> .enter_memory_pressure = tcp_enter_memory_pressure,
> - .sockets_allocated = &tcp_sockets_allocated,
> + .memory_pressure = memory_pressure_tcp,
> + .sockets_allocated = sockets_allocated_tcp,
> .orphan_count = &tcp_orphan_count,
> - .memory_allocated = &tcp_memory_allocated,
> - .memory_pressure = &tcp_memory_pressure,
> - .sysctl_mem = sysctl_tcp_mem,
> + .memory_allocated = memory_allocated_tcp,
> + .prot_mem = tcp_sysctl_mem,
> .sysctl_wmem = sysctl_tcp_wmem,
> .sysctl_rmem = sysctl_tcp_rmem,
> .max_header = MAX_TCP_HEADER,
> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> index 882e0b0..06aeb31 100644
> --- a/net/ipv4/tcp_output.c
> +++ b/net/ipv4/tcp_output.c
> @@ -1912,7 +1912,7 @@ u32 __tcp_select_window(struct sock *sk)
> if (free_space < (full_space >> 1)) {
> icsk->icsk_ack.quick = 0;
>
> - if (tcp_memory_pressure)
> + if (sk_memory_pressure(sk))
> tp->rcv_ssthresh = min(tp->rcv_ssthresh,
> 4U * tp->advmss);
>
> diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
> index ecd44b0..2c67617 100644
> --- a/net/ipv4/tcp_timer.c
> +++ b/net/ipv4/tcp_timer.c
> @@ -261,7 +261,7 @@ static void tcp_delack_timer(unsigned long data)
> }
>
> out:
> - if (tcp_memory_pressure)
> + if (sk_memory_pressure(sk))
> sk_mem_reclaim(sk);
> out_unlock:
> bh_unlock_sock(sk);
> diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
> index 1b5a193..f8d72ce 100644
> --- a/net/ipv4/udp.c
> +++ b/net/ipv4/udp.c
> @@ -120,9 +120,6 @@ EXPORT_SYMBOL(sysctl_udp_rmem_min);
> int sysctl_udp_wmem_min __read_mostly;
> EXPORT_SYMBOL(sysctl_udp_wmem_min);
>
> -atomic_long_t udp_memory_allocated;
> -EXPORT_SYMBOL(udp_memory_allocated);
> -
> #define MAX_UDP_PORTS 65536
> #define PORTS_PER_CHAIN (MAX_UDP_PORTS / UDP_HTABLE_SIZE_MIN)
>
> @@ -1918,6 +1915,19 @@ unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait)
> }
> EXPORT_SYMBOL(udp_poll);
>
> +static atomic_long_t udp_memory_allocated;
> +atomic_long_t *memory_allocated_udp(struct mem_cgroup *memcg)
> +{
> + return &udp_memory_allocated;
> +}
> +EXPORT_SYMBOL(memory_allocated_udp);
> +
> +long *udp_sysctl_mem(struct mem_cgroup *memcg)
> +{
> + return sysctl_udp_mem;
> +}
> +EXPORT_SYMBOL(udp_sysctl_mem);
> +
> struct proto udp_prot = {
> .name = "UDP",
> .owner = THIS_MODULE,
> @@ -1936,8 +1946,8 @@ struct proto udp_prot = {
> .unhash = udp_lib_unhash,
> .rehash = udp_v4_rehash,
> .get_port = udp_v4_get_port,
> - .memory_allocated = &udp_memory_allocated,
> - .sysctl_mem = sysctl_udp_mem,
> + .memory_allocated = &memory_allocated_udp,
> + .prot_mem = udp_sysctl_mem,
> .sysctl_wmem = &sysctl_udp_wmem_min,
> .sysctl_rmem = &sysctl_udp_rmem_min,
> .obj_size = sizeof(struct udp_sock),
> diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
> index d1fb63f..807797a 100644
> --- a/net/ipv6/tcp_ipv6.c
> +++ b/net/ipv6/tcp_ipv6.c
> @@ -2012,7 +2012,7 @@ static int tcp_v6_init_sock(struct sock *sk)
> sk->sk_rcvbuf = sysctl_tcp_rmem[1];
>
> local_bh_disable();
> - percpu_counter_inc(&tcp_sockets_allocated);
> + sk_sockets_allocated_inc(sk);
> local_bh_enable();
>
> return 0;
> @@ -2221,11 +2221,11 @@ struct proto tcpv6_prot = {
> .unhash = inet_unhash,
> .get_port = inet_csk_get_port,
> .enter_memory_pressure = tcp_enter_memory_pressure,
> - .sockets_allocated = &tcp_sockets_allocated,
> - .memory_allocated = &tcp_memory_allocated,
> - .memory_pressure = &tcp_memory_pressure,
> + .sockets_allocated = sockets_allocated_tcp,
> + .memory_allocated = memory_allocated_tcp,
> + .memory_pressure = memory_pressure_tcp,
> .orphan_count = &tcp_orphan_count,
> - .sysctl_mem = sysctl_tcp_mem,
> + .prot_mem = tcp_sysctl_mem,
> .sysctl_wmem = sysctl_tcp_wmem,
> .sysctl_rmem = sysctl_tcp_rmem,
> .max_header = MAX_TCP_HEADER,
> diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
> index 29213b5..ef4b5b3 100644
> --- a/net/ipv6/udp.c
> +++ b/net/ipv6/udp.c
> @@ -1465,8 +1465,8 @@ struct proto udpv6_prot = {
> .unhash = udp_lib_unhash,
> .rehash = udp_v6_rehash,
> .get_port = udp_v6_get_port,
> - .memory_allocated = &udp_memory_allocated,
> - .sysctl_mem = sysctl_udp_mem,
> + .memory_allocated = memory_allocated_udp,
> + .prot_mem = udp_sysctl_mem,
> .sysctl_wmem = &sysctl_udp_wmem_min,
> .sysctl_rmem = &sysctl_udp_rmem_min,
> .obj_size = sizeof(struct udp6_sock),
> diff --git a/net/sctp/socket.c b/net/sctp/socket.c
> index 836aa63..62eb178 100644
> --- a/net/sctp/socket.c
> +++ b/net/sctp/socket.c
> @@ -119,11 +119,30 @@ static int sctp_memory_pressure;
> static atomic_long_t sctp_memory_allocated;
> struct percpu_counter sctp_sockets_allocated;
>
> +static long *sctp_sysctl_mem(struct mem_cgroup *memcg)
> +{
> + return sysctl_sctp_mem;
> +}
> +
> static void sctp_enter_memory_pressure(struct sock *sk)
> {
> sctp_memory_pressure = 1;
> }
>
> +static int *memory_pressure_sctp(struct mem_cgroup *memcg)
> +{
> + return &sctp_memory_pressure;
> +}
> +
> +static atomic_long_t *memory_allocated_sctp(struct mem_cgroup *memcg)
> +{
> + return &sctp_memory_allocated;
> +}
> +
> +static struct percpu_counter *sockets_allocated_sctp(struct mem_cgroup *memcg)
> +{
> + return &sctp_sockets_allocated;
> +}
>
> /* Get the sndbuf space available at the time on the association. */
> static inline int sctp_wspace(struct sctp_association *asoc)
> @@ -6831,13 +6850,13 @@ struct proto sctp_prot = {
> .unhash = sctp_unhash,
> .get_port = sctp_get_port,
> .obj_size = sizeof(struct sctp_sock),
> - .sysctl_mem = sysctl_sctp_mem,
> + .prot_mem = sctp_sysctl_mem,
> .sysctl_rmem = sysctl_sctp_rmem,
> .sysctl_wmem = sysctl_sctp_wmem,
> - .memory_pressure = &sctp_memory_pressure,
> + .memory_pressure = memory_pressure_sctp,
> .enter_memory_pressure = sctp_enter_memory_pressure,
> - .memory_allocated = &sctp_memory_allocated,
> - .sockets_allocated = &sctp_sockets_allocated,
> + .memory_allocated = memory_allocated_sctp,
> + .sockets_allocated = sockets_allocated_sctp,
> };
>
> #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
> @@ -6863,12 +6882,12 @@ struct proto sctpv6_prot = {
> .unhash = sctp_unhash,
> .get_port = sctp_get_port,
> .obj_size = sizeof(struct sctp6_sock),
> - .sysctl_mem = sysctl_sctp_mem,
> + .prot_mem = sctp_sysctl_mem,
> .sysctl_rmem = sysctl_sctp_rmem,
> .sysctl_wmem = sysctl_sctp_wmem,
> - .memory_pressure = &sctp_memory_pressure,
> + .memory_pressure = memory_pressure_sctp,
> .enter_memory_pressure = sctp_enter_memory_pressure,
> - .memory_allocated = &sctp_memory_allocated,
> - .sockets_allocated = &sctp_sockets_allocated,
> + .memory_allocated = memory_allocated_sctp,
> + .sockets_allocated = sockets_allocated_sctp,
> };
> #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */
> --
> 1.7.6
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. 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:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox