From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Rapoport Subject: Re: [PATCH] mm: introduce MADV_CLR_HUGEPAGE Date: Tue, 30 May 2017 13:19:22 +0300 Message-ID: <20170530101921.GA25738@rapoport-lnx> References: <20170522133559.GE27382@rapoport-lnx> <20170522135548.GA8514@dhcp22.suse.cz> <20170522142927.GG27382@rapoport-lnx> <20170524075043.GB3063@rapoport-lnx> <20170524103947.GC3063@rapoport-lnx> <20170524111800.GD14733@dhcp22.suse.cz> <20170524142735.GF3063@rapoport-lnx> <20170530074408.GA7969@dhcp22.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20170530074408.GA7969-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Michal Hocko Cc: Vlastimil Babka , "Kirill A. Shutemov" , Andrew Morton , Arnd Bergmann , "Kirill A. Shutemov" , Andrea Arcangeli , Pavel Emelyanov , linux-mm , lkml , Linux API List-Id: linux-api@vger.kernel.org On Tue, May 30, 2017 at 09:44:08AM +0200, Michal Hocko wrote: > On Wed 24-05-17 17:27:36, Mike Rapoport wrote: > > On Wed, May 24, 2017 at 01:18:00PM +0200, Michal Hocko wrote: > [...] > > > Why cannot khugepaged simply skip over all VMAs which have userfault > > > regions registered? This would sound like a less error prone approach to > > > me. > > > > khugepaged does skip over VMAs which have userfault. We could register the > > regions with userfault before populating them to avoid collapses in the > > transition period. > > Why cannot you register only post-copy regions and "manually" copy the > pre-copy parts? We can register only post-copy regions, but this will cause VMA fragmentation. Now we register the entire VMA with userfaultfd, no matter how many pages were dirtied there since the pre-dump. If we register only post-copy regions, we will split out the VMAs for those regions. > > But then we'll have to populate these regions with > > UFFDIO_COPY which adds quite an overhead. > > How big is the performance impact? I don't have the numbers handy, but for each post-copy range it means that instead of memcpy() we will use ioctl(UFFDIO_COPY). > -- > Michal Hocko > SUSE Labs -- Sincerely yours, Mike.