From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vlastimil Babka Subject: Re: [PATCH v7 3/6] mm: Introduce VM_LOCKONFAULT Date: Thu, 20 Aug 2015 09:53:50 +0200 Message-ID: <55D5878E.5030206@suse.cz> References: <1439097776-27695-1-git-send-email-emunson@akamai.com> <1439097776-27695-4-git-send-email-emunson@akamai.com> <20150812115909.GA5182@dhcp22.suse.cz> <20150819213345.GB4536@akamai.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150819213345.GB4536-JqFfY2XvxFXQT0dZR+AlfA@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Eric B Munson , Michal Hocko Cc: Andrew Morton , Jonathan Corbet , "Kirill A. Shutemov" , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-api@vger.kernel.org On 08/19/2015 11:33 PM, Eric B Munson wrote: > On Wed, 12 Aug 2015, Michal Hocko wrote: > >> On Sun 09-08-15 01:22:53, Eric B Munson wrote: >> >> I do not like this very much to be honest. We have only few bits >> left there and it seems this is not really necessary. I thought that >> LOCKONFAULT acts as a modifier to the mlock call to tell whether to >> poppulate or not. The only place we have to persist it is >> mlockall(MCL_FUTURE) AFAICS. And this can be handled by an additional >> field in the mm_struct. This could be handled at __mm_populate level. >> So unless I am missing something this would be much more easier >> in the end we no new bit in VM flags would be necessary. >> >> This would obviously mean that the LOCKONFAULT couldn't be exported to >> the userspace but is this really necessary? > > Sorry for the latency here, I was on vacation and am now at plumbers. > > I am not sure that growing the mm_struct by another flags field instead > of using available bits in the vm_flags is the right choice. I was making the same objection on one of the earlier versions and since you sticked with a new vm flag, I thought it doesn't matter, as we could change it later if we run out of bits. But now I realize that since you export this difference to userspace (and below you say that it's by request), we won't be able to change it later. So it's a more difficult choice. > After this > patch, we still have 3 free bits on 32 bit architectures (2 after the > userfaultfd set IIRC). The group which asked for this feature here > wants the ability to distinguish between LOCKED and LOCKONFAULT regions > and without the VMA flag there isn't a way to do that. > > Do we know that these last two open flags are needed right now or is > this speculation that they will be and that none of the other VMA flags > can be reclaimed? I think it's the latter, we can expect that flags will be added rather than removed, as removal is hard or impossible. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by kanga.kvack.org (Postfix) with ESMTP id C99546B0038 for ; Thu, 20 Aug 2015 03:53:53 -0400 (EDT) Received: by wicne3 with SMTP id ne3so8271748wic.1 for ; Thu, 20 Aug 2015 00:53:53 -0700 (PDT) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id fa6si11182638wid.57.2015.08.20.00.53.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Aug 2015 00:53:52 -0700 (PDT) Subject: Re: [PATCH v7 3/6] mm: Introduce VM_LOCKONFAULT References: <1439097776-27695-1-git-send-email-emunson@akamai.com> <1439097776-27695-4-git-send-email-emunson@akamai.com> <20150812115909.GA5182@dhcp22.suse.cz> <20150819213345.GB4536@akamai.com> From: Vlastimil Babka Message-ID: <55D5878E.5030206@suse.cz> Date: Thu, 20 Aug 2015 09:53:50 +0200 MIME-Version: 1.0 In-Reply-To: <20150819213345.GB4536@akamai.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Eric B Munson , Michal Hocko Cc: Andrew Morton , Jonathan Corbet , "Kirill A. Shutemov" , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mm@kvack.org, linux-api@vger.kernel.org On 08/19/2015 11:33 PM, Eric B Munson wrote: > On Wed, 12 Aug 2015, Michal Hocko wrote: > >> On Sun 09-08-15 01:22:53, Eric B Munson wrote: >> >> I do not like this very much to be honest. We have only few bits >> left there and it seems this is not really necessary. I thought that >> LOCKONFAULT acts as a modifier to the mlock call to tell whether to >> poppulate or not. The only place we have to persist it is >> mlockall(MCL_FUTURE) AFAICS. And this can be handled by an additional >> field in the mm_struct. This could be handled at __mm_populate level. >> So unless I am missing something this would be much more easier >> in the end we no new bit in VM flags would be necessary. >> >> This would obviously mean that the LOCKONFAULT couldn't be exported to >> the userspace but is this really necessary? > > Sorry for the latency here, I was on vacation and am now at plumbers. > > I am not sure that growing the mm_struct by another flags field instead > of using available bits in the vm_flags is the right choice. I was making the same objection on one of the earlier versions and since you sticked with a new vm flag, I thought it doesn't matter, as we could change it later if we run out of bits. But now I realize that since you export this difference to userspace (and below you say that it's by request), we won't be able to change it later. So it's a more difficult choice. > After this > patch, we still have 3 free bits on 32 bit architectures (2 after the > userfaultfd set IIRC). The group which asked for this feature here > wants the ability to distinguish between LOCKED and LOCKONFAULT regions > and without the VMA flag there isn't a way to do that. > > Do we know that these last two open flags are needed right now or is > this speculation that they will be and that none of the other VMA flags > can be reclaimed? I think it's the latter, we can expect that flags will be added rather than removed, as removal is hard or impossible. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752339AbbHTHxy (ORCPT ); Thu, 20 Aug 2015 03:53:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:40659 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751279AbbHTHxx (ORCPT ); Thu, 20 Aug 2015 03:53:53 -0400 Subject: Re: [PATCH v7 3/6] mm: Introduce VM_LOCKONFAULT To: Eric B Munson , Michal Hocko References: <1439097776-27695-1-git-send-email-emunson@akamai.com> <1439097776-27695-4-git-send-email-emunson@akamai.com> <20150812115909.GA5182@dhcp22.suse.cz> <20150819213345.GB4536@akamai.com> Cc: Andrew Morton , Jonathan Corbet , "Kirill A. Shutemov" , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mm@kvack.org, linux-api@vger.kernel.org From: Vlastimil Babka Message-ID: <55D5878E.5030206@suse.cz> Date: Thu, 20 Aug 2015 09:53:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20150819213345.GB4536@akamai.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/19/2015 11:33 PM, Eric B Munson wrote: > On Wed, 12 Aug 2015, Michal Hocko wrote: > >> On Sun 09-08-15 01:22:53, Eric B Munson wrote: >> >> I do not like this very much to be honest. We have only few bits >> left there and it seems this is not really necessary. I thought that >> LOCKONFAULT acts as a modifier to the mlock call to tell whether to >> poppulate or not. The only place we have to persist it is >> mlockall(MCL_FUTURE) AFAICS. And this can be handled by an additional >> field in the mm_struct. This could be handled at __mm_populate level. >> So unless I am missing something this would be much more easier >> in the end we no new bit in VM flags would be necessary. >> >> This would obviously mean that the LOCKONFAULT couldn't be exported to >> the userspace but is this really necessary? > > Sorry for the latency here, I was on vacation and am now at plumbers. > > I am not sure that growing the mm_struct by another flags field instead > of using available bits in the vm_flags is the right choice. I was making the same objection on one of the earlier versions and since you sticked with a new vm flag, I thought it doesn't matter, as we could change it later if we run out of bits. But now I realize that since you export this difference to userspace (and below you say that it's by request), we won't be able to change it later. So it's a more difficult choice. > After this > patch, we still have 3 free bits on 32 bit architectures (2 after the > userfaultfd set IIRC). The group which asked for this feature here > wants the ability to distinguish between LOCKED and LOCKONFAULT regions > and without the VMA flag there isn't a way to do that. > > Do we know that these last two open flags are needed right now or is > this speculation that they will be and that none of the other VMA flags > can be reclaimed? I think it's the latter, we can expect that flags will be added rather than removed, as removal is hard or impossible.