Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-07 Thread Oleg Nesterov
On 12/06, Benjamin LaHaise wrote: > > On Wed, Dec 06, 2017 at 06:32:56PM +0100, Oleg Nesterov wrote: > > > > No. Again, this memory is not properly accounted, and unlike mlock()ed > > memory it is visible to shrinker which will do the unnecessary work on > > memory shortage which in turn will lead

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-06 Thread Kirill Tkhai
On 06.12.2017 21:30, Benjamin LaHaise wrote: > On Wed, Dec 06, 2017 at 09:19:09PM +0300, Kirill Tkhai wrote: >> On 06.12.2017 20:44, Benjamin LaHaise wrote: >>> On Wed, Dec 06, 2017 at 06:32:56PM +0100, Oleg Nesterov wrote: >> This memory lives in page-cache/lru, it is visible for shrinker whic

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-06 Thread Benjamin LaHaise
On Wed, Dec 06, 2017 at 09:19:09PM +0300, Kirill Tkhai wrote: > On 06.12.2017 20:44, Benjamin LaHaise wrote: > > On Wed, Dec 06, 2017 at 06:32:56PM +0100, Oleg Nesterov wrote: > This memory lives in page-cache/lru, it is visible for shrinker which > will unmap these pages for no reason on

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-06 Thread Kirill Tkhai
On 06.12.2017 20:44, Benjamin LaHaise wrote: > On Wed, Dec 06, 2017 at 06:32:56PM +0100, Oleg Nesterov wrote: This memory lives in page-cache/lru, it is visible for shrinker which will unmap these pages for no reason on memory shortage. IOW, aio fools the kernel, this memory looks re

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-06 Thread Benjamin LaHaise
On Wed, Dec 06, 2017 at 06:32:56PM +0100, Oleg Nesterov wrote: > > > This memory lives in page-cache/lru, it is visible for shrinker which > > > will unmap these pages for no reason on memory shortage. IOW, aio fools > > > the kernel, this memory looks reclaimable but it is not. And we only do > >

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-06 Thread Oleg Nesterov
On 12/05, Benjamin LaHaise wrote: > > On Tue, Dec 05, 2017 at 04:19:56PM +0100, Oleg Nesterov wrote: > > > > and memory. let me quote my old emails... > > > > > > This is off-topic, but the whole "vm" logic in aio_setup_ring() > > looks sub-optimal. I do not mean the code, just it seems to me it >

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-05 Thread Tejun Heo
Hello, Jeff. On Tue, Dec 05, 2017 at 10:41:11AM -0500, Jeff Moyer wrote: > Kirill Tkhai writes: > > >> I think you just need to account the completion ring. > > > > A request of struct aio_kiocb type consumes much more memory, than > > struct io_event does. Shouldn't we account it too? > > Not

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-05 Thread Jeff Moyer
Kirill Tkhai writes: >> I think you just need to account the completion ring. > > A request of struct aio_kiocb type consumes much more memory, than > struct io_event does. Shouldn't we account it too? Not in my opinion. The completion ring is the part that gets pinned for long periods of time.

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-05 Thread Benjamin LaHaise
On Tue, Dec 05, 2017 at 04:19:56PM +0100, Oleg Nesterov wrote: > On 12/05, Kirill Tkhai wrote: > > > > Currently, aio_nr and aio_max_nr are global. > > Yeah, I too tried to complain 2 years ago... > > > In case of containers this > > means that a single container may occupy all aio requests, whic

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-05 Thread Oleg Nesterov
On 12/05, Kirill Tkhai wrote: > > Currently, aio_nr and aio_max_nr are global. Yeah, I too tried to complain 2 years ago... > In case of containers this > means that a single container may occupy all aio requests, which are > available in the system, and memory. let me quote my old emails... T

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-04 Thread Kirill Tkhai
On 05.12.2017 01:59, Jeff Moyer wrote: > Kirill Tkhai writes: > >> On 05.12.2017 00:52, Tejun Heo wrote: >>> Hello, Kirill. >>> >>> On Tue, Dec 05, 2017 at 12:44:00AM +0300, Kirill Tkhai wrote: > Can you please explain how this is a fundamental resource which can't > be controlled otherwi

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-04 Thread Kirill Tkhai
On 05.12.2017 02:02, Tejun Heo wrote: > Hello, Kirill. > > On Tue, Dec 05, 2017 at 01:49:42AM +0300, Kirill Tkhai wrote: >>> If the only reason is kernel memory consumption protection, the only >>> thing we need to do is making sure that memory used for aio commands >>> are accounted against cgrou

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-04 Thread Tejun Heo
Hello, Kirill. On Tue, Dec 05, 2017 at 01:49:42AM +0300, Kirill Tkhai wrote: > > If the only reason is kernel memory consumption protection, the only > > thing we need to do is making sure that memory used for aio commands > > are accounted against cgroup kernel memory consumption and > > relaxing

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-04 Thread Jeff Moyer
Kirill Tkhai writes: > On 05.12.2017 00:52, Tejun Heo wrote: >> Hello, Kirill. >> >> On Tue, Dec 05, 2017 at 12:44:00AM +0300, Kirill Tkhai wrote: Can you please explain how this is a fundamental resource which can't be controlled otherwise? >>> >>> Currently, aio_nr and aio_max_nr are

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-04 Thread Kirill Tkhai
On 05.12.2017 00:52, Tejun Heo wrote: > Hello, Kirill. > > On Tue, Dec 05, 2017 at 12:44:00AM +0300, Kirill Tkhai wrote: >>> Can you please explain how this is a fundamental resource which can't >>> be controlled otherwise? >> >> Currently, aio_nr and aio_max_nr are global. In case of containers t

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-04 Thread Tejun Heo
Hello, Kirill. On Tue, Dec 05, 2017 at 12:44:00AM +0300, Kirill Tkhai wrote: > > Can you please explain how this is a fundamental resource which can't > > be controlled otherwise? > > Currently, aio_nr and aio_max_nr are global. In case of containers this > means that a single container may occup

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-04 Thread Kirill Tkhai
On 05.12.2017 00:35, Jeff Moyer wrote: > Kirill Tkhai writes: > >> Hi, Benjamin, >> >> On 04.12.2017 19:52, Benjamin LaHaise wrote: >>> Hi Kirill, >>> >>> On Mon, Dec 04, 2017 at 07:12:51PM +0300, Kirill Tkhai wrote: Hi, this patch set introduces accounting aio_nr and aio_max_nr pe

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-04 Thread Kirill Tkhai
Hello, Tejun, On 04.12.2017 23:07, Tejun Heo wrote: > On Mon, Dec 04, 2017 at 07:12:51PM +0300, Kirill Tkhai wrote: >> this patch set introduces accounting aio_nr and aio_max_nr per blkio cgroup. >> It may be used to limit number of aio requests, which are available for >> a cgroup, and could be u

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-04 Thread Jeff Moyer
Kirill Tkhai writes: > Hi, Benjamin, > > On 04.12.2017 19:52, Benjamin LaHaise wrote: >> Hi Kirill, >> >> On Mon, Dec 04, 2017 at 07:12:51PM +0300, Kirill Tkhai wrote: >>> Hi, >>> >>> this patch set introduces accounting aio_nr and aio_max_nr per blkio cgroup. >>> It may be used to limit number

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-04 Thread Kirill Tkhai
Hi, Benjamin, On 04.12.2017 19:52, Benjamin LaHaise wrote: > Hi Kirill, > > On Mon, Dec 04, 2017 at 07:12:51PM +0300, Kirill Tkhai wrote: >> Hi, >> >> this patch set introduces accounting aio_nr and aio_max_nr per blkio cgroup. >> It may be used to limit number of aio requests, which are availabl

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-04 Thread Tejun Heo
Hello, Kirill. On Mon, Dec 04, 2017 at 07:12:51PM +0300, Kirill Tkhai wrote: > this patch set introduces accounting aio_nr and aio_max_nr per blkio cgroup. > It may be used to limit number of aio requests, which are available for > a cgroup, and could be useful for containers. Can you please expl

Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-04 Thread Benjamin LaHaise
Hi Kirill, On Mon, Dec 04, 2017 at 07:12:51PM +0300, Kirill Tkhai wrote: > Hi, > > this patch set introduces accounting aio_nr and aio_max_nr per blkio cgroup. > It may be used to limit number of aio requests, which are available for > a cgroup, and could be useful for containers. > > The accoun

[PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup

2017-12-04 Thread Kirill Tkhai
Hi, this patch set introduces accounting aio_nr and aio_max_nr per blkio cgroup. It may be used to limit number of aio requests, which are available for a cgroup, and could be useful for containers. The accounting is hierarchical, and aio contexts, allocated in child cgroup, are accounted in pare