Re: mremap vs sysctl_max_map_count

2019-02-20 Thread Vlastimil Babka
On 2/19/19 4:53 PM, Oscar Salvador wrote: > On Mon, Feb 18, 2019 at 02:15:35PM +0300, Kirill A. Shutemov wrote: >> On Mon, Feb 18, 2019 at 10:57:18AM +0100, Vlastimil Babka wrote: >>> IMHO it makes sense to do all such resource limit checks upfront. It >>> should all be protected by mmap_sem and th

Re: mremap vs sysctl_max_map_count

2019-02-19 Thread Oscar Salvador
On Mon, Feb 18, 2019 at 02:15:35PM +0300, Kirill A. Shutemov wrote: > On Mon, Feb 18, 2019 at 10:57:18AM +0100, Vlastimil Babka wrote: > > IMHO it makes sense to do all such resource limit checks upfront. It > > should all be protected by mmap_sem and thus stable, right? Even if it > > was racy, I'

Re: mremap vs sysctl_max_map_count

2019-02-18 Thread Kirill A. Shutemov
On Mon, Feb 18, 2019 at 10:57:18AM +0100, Vlastimil Babka wrote: > On 2/18/19 9:33 AM, Oscar Salvador wrote: > > > > Hi all, > > > > I would like to bring up a topic that comes from an issue a customer of ours > > is facing with the mremap syscall + hitting the max_map_count threshold: > > > > W

Re: mremap vs sysctl_max_map_count

2019-02-18 Thread Mike Rapoport
On Mon, Feb 18, 2019 at 10:57:18AM +0100, Vlastimil Babka wrote: > On 2/18/19 9:33 AM, Oscar Salvador wrote: > > > > Hi all, > > > > I would like to bring up a topic that comes from an issue a customer of ours > > is facing with the mremap syscall + hitting the max_map_count threshold: > > > > W

Re: mremap vs sysctl_max_map_count

2019-02-18 Thread Vlastimil Babka
On 2/18/19 9:33 AM, Oscar Salvador wrote: > > Hi all, > > I would like to bring up a topic that comes from an issue a customer of ours > is facing with the mremap syscall + hitting the max_map_count threshold: > > When passing the MREMAP_FIXED flag, mremap() calls mremap_to() which does the > fo

mremap vs sysctl_max_map_count

2019-02-18 Thread Oscar Salvador
Hi all, I would like to bring up a topic that comes from an issue a customer of ours is facing with the mremap syscall + hitting the max_map_count threshold: When passing the MREMAP_FIXED flag, mremap() calls mremap_to() which does the following: 1) it unmaps the region where we want to put th