Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-25 Thread Michal Hocko
On Thu 25-03-21 12:47:04, Johannes Weiner wrote: > On Thu, Mar 25, 2021 at 10:02:28AM +0100, Michal Hocko wrote: > > On Wed 24-03-21 15:49:15, Arjun Roy wrote: > > > On Wed, Mar 24, 2021 at 2:24 PM Johannes Weiner > > > wrote: > > > > > > > > On Wed, Mar 24, 2021 at 10:12:46AM +0100, Michal

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-25 Thread Johannes Weiner
On Thu, Mar 25, 2021 at 10:02:28AM +0100, Michal Hocko wrote: > On Wed 24-03-21 15:49:15, Arjun Roy wrote: > > On Wed, Mar 24, 2021 at 2:24 PM Johannes Weiner wrote: > > > > > > On Wed, Mar 24, 2021 at 10:12:46AM +0100, Michal Hocko wrote: > > > > On Tue 23-03-21 11:47:54, Arjun Roy wrote: > > >

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-25 Thread Michal Hocko
On Wed 24-03-21 15:49:15, Arjun Roy wrote: > On Wed, Mar 24, 2021 at 2:24 PM Johannes Weiner wrote: > > > > On Wed, Mar 24, 2021 at 10:12:46AM +0100, Michal Hocko wrote: > > > On Tue 23-03-21 11:47:54, Arjun Roy wrote: > > > > On Tue, Mar 23, 2021 at 7:34 AM Michal Hocko wrote: > > > > > > > > >

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-24 Thread Arjun Roy
On Wed, Mar 24, 2021 at 2:24 PM Johannes Weiner wrote: > > On Wed, Mar 24, 2021 at 10:12:46AM +0100, Michal Hocko wrote: > > On Tue 23-03-21 11:47:54, Arjun Roy wrote: > > > On Tue, Mar 23, 2021 at 7:34 AM Michal Hocko wrote: > > > > > > > > On Wed 17-03-21 18:12:55, Johannes Weiner wrote: > > >

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-24 Thread Arjun Roy
On Wed, Mar 24, 2021 at 11:26 AM Shakeel Butt wrote: > > On Tue, Mar 23, 2021 at 11:42 AM Arjun Roy wrote: > > > [...] > > > > To summarize then, it seems to me that we're on the same page now. > > I'll put together a tentative v3 such that: > > 1. It uses pre-charging, as previously discussed.

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-24 Thread Michal Hocko
On Wed 24-03-21 13:53:34, Shakeel Butt wrote: [...] > > Given that's the case, the options seem to be: > > 1) Use a page flag - with the downside that they are a severely > > limited resource, > > 2) Use some bits inside page->memcg_data - this I believe Johannes had > > reasons against, and it

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-24 Thread Johannes Weiner
On Wed, Mar 24, 2021 at 10:12:46AM +0100, Michal Hocko wrote: > On Tue 23-03-21 11:47:54, Arjun Roy wrote: > > On Tue, Mar 23, 2021 at 7:34 AM Michal Hocko wrote: > > > > > > On Wed 17-03-21 18:12:55, Johannes Weiner wrote: > > > [...] > > > > Here is an idea of how it could work: > > > > > > > >

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-24 Thread Shakeel Butt
On Wed, Mar 24, 2021 at 1:39 PM Arjun Roy wrote: > > On Wed, Mar 24, 2021 at 2:12 AM Michal Hocko wrote: > > > > On Tue 23-03-21 11:47:54, Arjun Roy wrote: > > > On Tue, Mar 23, 2021 at 7:34 AM Michal Hocko wrote: > > > > > > > > On Wed 17-03-21 18:12:55, Johannes Weiner wrote: > > > > [...] >

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-24 Thread Arjun Roy
On Wed, Mar 24, 2021 at 2:12 AM Michal Hocko wrote: > > On Tue 23-03-21 11:47:54, Arjun Roy wrote: > > On Tue, Mar 23, 2021 at 7:34 AM Michal Hocko wrote: > > > > > > On Wed 17-03-21 18:12:55, Johannes Weiner wrote: > > > [...] > > > > Here is an idea of how it could work: > > > > > > > > struct

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-24 Thread Shakeel Butt
On Tue, Mar 23, 2021 at 11:42 AM Arjun Roy wrote: > [...] > > To summarize then, it seems to me that we're on the same page now. > I'll put together a tentative v3 such that: > 1. It uses pre-charging, as previously discussed. > 2. It uses a page flag to delineate pages of a certain networking

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-24 Thread Michal Hocko
On Tue 23-03-21 11:47:54, Arjun Roy wrote: > On Tue, Mar 23, 2021 at 7:34 AM Michal Hocko wrote: > > > > On Wed 17-03-21 18:12:55, Johannes Weiner wrote: > > [...] > > > Here is an idea of how it could work: > > > > > > struct page already has > > > > > > struct {/*

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-23 Thread Arjun Roy
On Tue, Mar 23, 2021 at 7:34 AM Michal Hocko wrote: > > On Wed 17-03-21 18:12:55, Johannes Weiner wrote: > [...] > > Here is an idea of how it could work: > > > > struct page already has > > > > struct {/* page_pool used by netstack */ > > /** > >

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-23 Thread Arjun Roy
On Tue, Mar 23, 2021 at 10:01 AM Johannes Weiner wrote: > > On Mon, Mar 22, 2021 at 02:35:11PM -0700, Arjun Roy wrote: > > To make sure we're on the same page, then, here's a tentative > > mechanism - I'd rather get buy in before spending too much time on > > something that wouldn't pass muster

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-23 Thread Johannes Weiner
On Mon, Mar 22, 2021 at 02:35:11PM -0700, Arjun Roy wrote: > To make sure we're on the same page, then, here's a tentative > mechanism - I'd rather get buy in before spending too much time on > something that wouldn't pass muster afterwards. > > A) An opt-in mechanism, that a driver needs to

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-23 Thread Michal Hocko
On Wed 17-03-21 18:12:55, Johannes Weiner wrote: [...] > Here is an idea of how it could work: > > struct page already has > > struct {/* page_pool used by netstack */ > /** > * @dma_addr: might require a 64-bit value even

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-22 Thread Arjun Roy
On Wed, Mar 17, 2021 at 3:12 PM Johannes Weiner wrote: > > On Tue, Mar 16, 2021 at 11:05:11PM -0700, Arjun Roy wrote: > > On Tue, Mar 16, 2021 at 3:27 AM Johannes Weiner wrote: > > > > > > Hello, > > > > > > On Mon, Mar 15, 2021 at 09:16:45PM -0700, Arjun Roy wrote: > > > > From: Arjun Roy > >

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-22 Thread Arjun Roy
On Wed, Mar 17, 2021 at 8:21 PM Andrew Morton wrote: > > On Mon, 15 Mar 2021 18:30:03 -0700 Arjun Roy wrote: > > > From: Arjun Roy > > > > TCP zerocopy receive is used by high performance network applications > > to further scale. For RX zerocopy, the memory containing the network > > data

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-17 Thread Andrew Morton
On Mon, 15 Mar 2021 18:30:03 -0700 Arjun Roy wrote: > From: Arjun Roy > > TCP zerocopy receive is used by high performance network applications > to further scale. For RX zerocopy, the memory containing the network > data filled by the network driver is directly mapped into the address > space

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-17 Thread Johannes Weiner
On Tue, Mar 16, 2021 at 11:05:11PM -0700, Arjun Roy wrote: > On Tue, Mar 16, 2021 at 3:27 AM Johannes Weiner wrote: > > > > Hello, > > > > On Mon, Mar 15, 2021 at 09:16:45PM -0700, Arjun Roy wrote: > > > From: Arjun Roy > > > > > > TCP zerocopy receive is used by high performance network

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-17 Thread Arjun Roy
On Tue, Mar 16, 2021 at 3:27 AM Johannes Weiner wrote: > > Hello, > > On Mon, Mar 15, 2021 at 09:16:45PM -0700, Arjun Roy wrote: > > From: Arjun Roy > > > > TCP zerocopy receive is used by high performance network applications > > to further scale. For RX zerocopy, the memory containing the

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-16 Thread Jakub Kicinski
On Mon, 15 Mar 2021 23:28:08 -0700 Arjun Roy wrote: > On Mon, Mar 15, 2021 at 11:22 PM Arjun Roy wrote: > > > > On Mon, Mar 15, 2021 at 9:29 PM Shakeel Butt wrote: > > > > > > On Mon, Mar 15, 2021 at 9:20 PM Arjun Roy wrote: > [...] > > > [...] > [...] > [...] > > > > > > It is

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-16 Thread Johannes Weiner
Hello, On Mon, Mar 15, 2021 at 09:16:45PM -0700, Arjun Roy wrote: > From: Arjun Roy > > TCP zerocopy receive is used by high performance network applications > to further scale. For RX zerocopy, the memory containing the network > data filled by the network driver is directly mapped into the

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-16 Thread Arjun Roy
On Mon, Mar 15, 2021 at 11:22 PM Arjun Roy wrote: > > On Mon, Mar 15, 2021 at 9:29 PM Shakeel Butt wrote: > > > > On Mon, Mar 15, 2021 at 9:20 PM Arjun Roy wrote: > > > > > [...] > > > > > > > > > > Apologies for the spam - looks like I forgot to rebase the first time > > > I sent this out. > >

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-16 Thread Arjun Roy
On Mon, Mar 15, 2021 at 9:29 PM Shakeel Butt wrote: > > On Mon, Mar 15, 2021 at 9:20 PM Arjun Roy wrote: > > > [...] > > > > > > > Apologies for the spam - looks like I forgot to rebase the first time > > I sent this out. > > > > Actually, on a related note, it's not 100% clear to me whether

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-15 Thread Shakeel Butt
On Mon, Mar 15, 2021 at 9:20 PM Arjun Roy wrote: > [...] > > > > Apologies for the spam - looks like I forgot to rebase the first time > I sent this out. > > Actually, on a related note, it's not 100% clear to me whether this > patch (which in its current form, applies to net-next) should instead

Re: [mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-15 Thread Arjun Roy
On Mon, Mar 15, 2021 at 9:16 PM Arjun Roy wrote: > > From: Arjun Roy > > TCP zerocopy receive is used by high performance network applications > to further scale. For RX zerocopy, the memory containing the network > data filled by the network driver is directly mapped into the address > space of

[mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-15 Thread Arjun Roy
From: Arjun Roy TCP zerocopy receive is used by high performance network applications to further scale. For RX zerocopy, the memory containing the network data filled by the network driver is directly mapped into the address space of high performance applications. To keep the TLB cost low, these

[mm, net-next v2] mm: net: memcg accounting for TCP rx zerocopy

2021-03-15 Thread Arjun Roy
From: Arjun Roy TCP zerocopy receive is used by high performance network applications to further scale. For RX zerocopy, the memory containing the network data filled by the network driver is directly mapped into the address space of high performance applications. To keep the TLB cost low, these