Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755691AbbHYO3V (ORCPT ); Tue, 25 Aug 2015 10:29:21 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:32930 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752059AbbHYO3S (ORCPT ); Tue, 25 Aug 2015 10:29:18 -0400 Date: Tue, 25 Aug 2015 16:29:15 +0200 From: Michal Hocko To: Vlastimil Babka Cc: Eric B Munson , 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 Subject: Re: [PATCH v7 3/6] mm: Introduce VM_LOCKONFAULT Message-ID: <20150825142914.GF6285@dhcp22.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> <20150820075611.GD4780@dhcp22.suse.cz> <20150820170309.GA11557@akamai.com> <20150821072552.GF23723@dhcp22.suse.cz> <20150821183132.GA12835@akamai.com> <20150825134154.GB6285@dhcp22.suse.cz> <55DC73E2.6050509@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55DC73E2.6050509@suse.cz> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1738 Lines: 45 On Tue 25-08-15 15:55:46, Vlastimil Babka wrote: > On 08/25/2015 03:41 PM, Michal Hocko wrote: [...] > >So what we have as a result is that partially populated ranges are > >preserved and fully populated ones work in the best effort mode the same > >way as they are now. > > > >Does that sound at least remotely reasonably? > > I'll basically repeat what I said earlier: > > - mremap scanning existing pte's to figure out the population would slow it > down for no good reason So do we really need to populate the enlarged range? All the man page is saying is that the lock is maintained. Which will be still the case. It is true that the failure is unlikely (unless you are running in the memcg) but you cannot rely on the full mlock semantic so what would be a problem? > - it would be unreliable anyway: > - example: was the area completely populated because MLOCK_ONFAULT was not > used or because the process faulted it already OK, I see this as being a problem. Especially if the buffer is increase 2*original_len > - example: was the area not completely populated because MLOCK_ONFAULT was > used, or because mmap(MAP_LOCKED) failed to populate it fully? What would be the difference? Both are ONFAULT now. > I think the first point is a pointless regression for workloads that use > just plain mlock() and don't want the onfault semantics. Unless there's some > shortcut? Does vma have a counter of how much is populated? (I don't think > so?) -- Michal Hocko SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/