Re: [PATCH RESEND 7/8] pipe: account to kmemcg

2016-05-27 Thread Vladimir Davydov
On Thu, May 26, 2016 at 07:15:49AM -0700, Eric Dumazet wrote: > On Thu, 2016-05-26 at 16:59 +0300, Vladimir Davydov wrote: > > On Thu, May 26, 2016 at 04:04:55PM +0900, Minchan Kim wrote: > > > On Wed, May 25, 2016 at 01:30:11PM +0300, Vladimir Davydov wrote: > > > > On Tue, May 24, 2016 at 01:04:3

Re: [PATCH RESEND 7/8] pipe: account to kmemcg

2016-05-26 Thread Eric Dumazet
On Thu, 2016-05-26 at 16:59 +0300, Vladimir Davydov wrote: > On Thu, May 26, 2016 at 04:04:55PM +0900, Minchan Kim wrote: > > On Wed, May 25, 2016 at 01:30:11PM +0300, Vladimir Davydov wrote: > > > On Tue, May 24, 2016 at 01:04:33PM -0700, Eric Dumazet wrote: > > > > On Tue, 2016-05-24 at 19:13 +03

Re: [PATCH RESEND 7/8] pipe: account to kmemcg

2016-05-26 Thread Vladimir Davydov
On Thu, May 26, 2016 at 04:04:55PM +0900, Minchan Kim wrote: > On Wed, May 25, 2016 at 01:30:11PM +0300, Vladimir Davydov wrote: > > On Tue, May 24, 2016 at 01:04:33PM -0700, Eric Dumazet wrote: > > > On Tue, 2016-05-24 at 19:13 +0300, Vladimir Davydov wrote: > > > > On Tue, May 24, 2016 at 05:59:0

Re: [PATCH RESEND 7/8] pipe: account to kmemcg

2016-05-26 Thread Minchan Kim
On Wed, May 25, 2016 at 01:30:11PM +0300, Vladimir Davydov wrote: > On Tue, May 24, 2016 at 01:04:33PM -0700, Eric Dumazet wrote: > > On Tue, 2016-05-24 at 19:13 +0300, Vladimir Davydov wrote: > > > On Tue, May 24, 2016 at 05:59:02AM -0700, Eric Dumazet wrote: > > > ... > > > > > +static int anon_p

Re: [PATCH RESEND 7/8] pipe: account to kmemcg

2016-05-25 Thread Vladimir Davydov
On Tue, May 24, 2016 at 01:04:33PM -0700, Eric Dumazet wrote: > On Tue, 2016-05-24 at 19:13 +0300, Vladimir Davydov wrote: > > On Tue, May 24, 2016 at 05:59:02AM -0700, Eric Dumazet wrote: > > ... > > > > +static int anon_pipe_buf_steal(struct pipe_inode_info *pipe, > > > > +

Re: [PATCH RESEND 7/8] pipe: account to kmemcg

2016-05-24 Thread Eric Dumazet
On Tue, 2016-05-24 at 19:13 +0300, Vladimir Davydov wrote: > On Tue, May 24, 2016 at 05:59:02AM -0700, Eric Dumazet wrote: > ... > > > +static int anon_pipe_buf_steal(struct pipe_inode_info *pipe, > > > +struct pipe_buffer *buf) > > > +{ > > > + struct page *page = buf->page

Re: [PATCH RESEND 7/8] pipe: account to kmemcg

2016-05-24 Thread Vladimir Davydov
On Tue, May 24, 2016 at 05:59:02AM -0700, Eric Dumazet wrote: ... > > +static int anon_pipe_buf_steal(struct pipe_inode_info *pipe, > > + struct pipe_buffer *buf) > > +{ > > + struct page *page = buf->page; > > + > > + if (page_count(page) == 1) { > > This looks racy :

Re: [PATCH RESEND 7/8] pipe: account to kmemcg

2016-05-24 Thread Eric Dumazet
On Tue, 2016-05-24 at 11:49 +0300, Vladimir Davydov wrote: > Pipes can consume a significant amount of system memory, hence they > should be accounted to kmemcg. > > This patch marks pipe_inode_info and anonymous pipe buffer page > allocations as __GFP_ACCOUNT so that they would be charged to kmem

[PATCH RESEND 7/8] pipe: account to kmemcg

2016-05-24 Thread Vladimir Davydov
Pipes can consume a significant amount of system memory, hence they should be accounted to kmemcg. This patch marks pipe_inode_info and anonymous pipe buffer page allocations as __GFP_ACCOUNT so that they would be charged to kmemcg. Note, since a pipe buffer page can be "stolen" and get reused for