From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-f173.google.com (mail-ig0-f173.google.com [209.85.213.173]) by kanga.kvack.org (Postfix) with ESMTP id 2A3F06B0088 for ; Tue, 28 Apr 2015 12:57:12 -0400 (EDT) Received: by igbhj9 with SMTP id hj9so26491307igb.1 for ; Tue, 28 Apr 2015 09:57:12 -0700 (PDT) Received: from mail-ig0-x233.google.com (mail-ig0-x233.google.com. [2607:f8b0:4001:c05::233]) by mx.google.com with ESMTPS id ck6si8950286igb.9.2015.04.28.09.57.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Apr 2015 09:57:11 -0700 (PDT) Received: by igbhj9 with SMTP id hj9so26491059igb.1 for ; Tue, 28 Apr 2015 09:57:11 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20150428164302.GI2659@dhcp22.suse.cz> References: <20150114095019.GC4706@dhcp22.suse.cz> <1430223111-14817-1-git-send-email-mhocko@suse.cz> <20150428164302.GI2659@dhcp22.suse.cz> Date: Tue, 28 Apr 2015 09:57:11 -0700 Message-ID: Subject: Re: Should mmap MAP_LOCKED fail if mm_poppulate fails? From: Linus Torvalds Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: linux-mm , Cyril Hrubis , Andrew Morton , Hugh Dickins , Michel Lespinasse , Rik van Riel , Michael Kerrisk , LKML , Linux API On Tue, Apr 28, 2015 at 9:43 AM, Michal Hocko wrote: > > Hmm, no other thread has the address from the current mmap call except > for MAP_FIXED (more on that below). With things like opportunistic SIGSEGV handlers that map/unmap things as the user takes faults, that's actually not at all guaranteed. Yeah, it's unusual, but I've seen it, with threaded applications where people play games with user-space memory management, and do "demand allocation" with mmap() in response to signals. Admittedly we already do bad things in mmap(MAP_FIXED) for that case, since we dropped the vm lock. But at least it shouldn't be any worse than a thread speculatively touching the pages.. Linus -- 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