Re: [PATCH] net/sock: move memory_allocated over to percpu_counter variables

2018-09-09 Thread Eric Dumazet
On Sat, Sep 8, 2018 at 10:02 AM Olof Johansson wrote: > > Hi, > > On Fri, Sep 7, 2018 at 12:21 AM, Eric Dumazet wrote: > > On Fri, Sep 7, 2018 at 12:03 AM Eric Dumazet wrote: > > > >> Problem is : we have platforms with more than 100 cpus, and > >> sk_memory_allocated() cost will be too expensiv

Re: [PATCH] net/sock: move memory_allocated over to percpu_counter variables

2018-09-08 Thread Olof Johansson
Hi, On Fri, Sep 7, 2018 at 12:21 AM, Eric Dumazet wrote: > On Fri, Sep 7, 2018 at 12:03 AM Eric Dumazet wrote: > >> Problem is : we have platforms with more than 100 cpus, and >> sk_memory_allocated() cost will be too expensive, >> especially if the host is under memory pressure, since all cpus

Re: [PATCH] net/sock: move memory_allocated over to percpu_counter variables

2018-09-07 Thread Eric Dumazet
On Fri, Sep 7, 2018 at 12:03 AM Eric Dumazet wrote: > Problem is : we have platforms with more than 100 cpus, and > sk_memory_allocated() cost will be too expensive, > especially if the host is under memory pressure, since all cpus will > touch their private counter. > > per cpu variables do not

Re: [PATCH] net/sock: move memory_allocated over to percpu_counter variables

2018-09-07 Thread Eric Dumazet
On Thu, Sep 6, 2018 at 11:20 PM Olof Johansson wrote: > > Hi, > > On Thu, Sep 6, 2018 at 8:32 PM, Herbert Xu > wrote: > > On Thu, Sep 06, 2018 at 12:33:58PM -0700, Eric Dumazet wrote: > >> On Thu, Sep 6, 2018 at 12:21 PM Olof Johansson wrote: > >> > > >> > Today these are all global shared vari

Re: [PATCH] net/sock: move memory_allocated over to percpu_counter variables

2018-09-06 Thread Olof Johansson
Hi, On Thu, Sep 6, 2018 at 8:32 PM, Herbert Xu wrote: > On Thu, Sep 06, 2018 at 12:33:58PM -0700, Eric Dumazet wrote: >> On Thu, Sep 6, 2018 at 12:21 PM Olof Johansson wrote: >> > >> > Today these are all global shared variables per protocol, and in >> > particular tcp_memory_allocated can get h

Re: [PATCH] net/sock: move memory_allocated over to percpu_counter variables

2018-09-06 Thread Herbert Xu
On Thu, Sep 06, 2018 at 12:33:58PM -0700, Eric Dumazet wrote: > On Thu, Sep 6, 2018 at 12:21 PM Olof Johansson wrote: > > > > Today these are all global shared variables per protocol, and in > > particular tcp_memory_allocated can get hot on a system with > > large number of CPUs and a substantial

Re: [PATCH] net/sock: move memory_allocated over to percpu_counter variables

2018-09-06 Thread Eric Dumazet
On Thu, Sep 6, 2018 at 12:21 PM Olof Johansson wrote: > > Today these are all global shared variables per protocol, and in > particular tcp_memory_allocated can get hot on a system with > large number of CPUs and a substantial number of connections. > > Moving it over to a per-cpu variable makes i

[PATCH] net/sock: move memory_allocated over to percpu_counter variables

2018-09-06 Thread Olof Johansson
Today these are all global shared variables per protocol, and in particular tcp_memory_allocated can get hot on a system with large number of CPUs and a substantial number of connections. Moving it over to a per-cpu variable makes it significantly cheaper, and the added overhead when summing up th