From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751295AbdE3KTh (ORCPT ); Tue, 30 May 2017 06:19:37 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:50676 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750992AbdE3KTf (ORCPT ); Tue, 30 May 2017 06:19:35 -0400 Date: Tue, 30 May 2017 13:19:22 +0300 From: Mike Rapoport 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 Subject: Re: [PATCH] mm: introduce MADV_CLR_HUGEPAGE 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 Content-Disposition: inline In-Reply-To: <20170530074408.GA7969@dhcp22.suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 17053010-0040-0000-0000-0000039B1834 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17053010-0041-0000-0000-0000258D6BFA Message-Id: <20170530101921.GA25738@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-05-30_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705300196 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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.