Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751391AbdFAG6w (ORCPT ); Thu, 1 Jun 2017 02:58:52 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:55799 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751113AbdFAG6u (ORCPT ); Thu, 1 Jun 2017 02:58:50 -0400 Date: Thu, 1 Jun 2017 09:58:39 +0300 From: Mike Rapoport To: Andrea Arcangeli Cc: Michal Hocko , Vlastimil Babka , "Kirill A. Shutemov" , Andrew Morton , Arnd Bergmann , "Kirill A. Shutemov" , Pavel Emelyanov , linux-mm , lkml , Linux API Subject: Re: [PATCH] mm: introduce MADV_CLR_HUGEPAGE References: <20170524142735.GF3063@rapoport-lnx> <20170530074408.GA7969@dhcp22.suse.cz> <20170530101921.GA25738@rapoport-lnx> <20170530103930.GB7969@dhcp22.suse.cz> <20170530140456.GA8412@redhat.com> <20170530143941.GK7969@dhcp22.suse.cz> <20170530154326.GB8412@redhat.com> <20170531120822.GL27783@dhcp22.suse.cz> <8FA5E4C2-D289-4AF5-AA09-6C199E58F9A5@linux.vnet.ibm.com> <20170531141809.GB302@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170531141809.GB302@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 17060106-0016-0000-0000-000004B19854 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17060106-0017-0000-0000-000027DDE397 Message-Id: <20170601065838.GB30495@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-06-01_02:,, 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-1706010128 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1561 Lines: 30 On Wed, May 31, 2017 at 04:18:09PM +0200, Andrea Arcangeli wrote: > On Wed, May 31, 2017 at 03:39:22PM +0300, Mike Rapoport wrote: > > For the CRIU usecase, disabling THP for a while and re-enabling it > > back will do the trick, provided VMAs flags are not affected, like > > in the patch you've sent. Moreover, we may even get away with > > Are you going to check uname -r to know when the kABI changed in your > favor (so CRIU cannot ever work with enterprise backports unless you > expand the uname -r coverage), or how do you know the patch is > applied? CRIU does not rely on uname -r. We have code that checks what kernel features we can actually use. For instance, we use UFFDIO_API to see if we can do post-copy at all. > Optimistically assuming people is going to run new CRIU code only on > new kernels looks very risky, it would leads to silent random memory > corruption, so I doubt you can get away without a uname -r check. > > This is fairly simple change too, its main cons is that it adds a > branch to the page fault fast path, the old behavior of the prctl and > the new madvise were both zero cost. > > Still if the prctl is preferred despite the added branch, to avoid > uname -r clashes, to me it sounds better to add a new prctl ID and > keep the old one too. The old one could be implemented the same way as > the new one if you want to save a few bytes of .text. But the old one > should probably do a printk_once to print a deprecation warning so the > old ID with weaker (zero runtime cost) semantics can be removed later. >