Received: by 10.192.165.156 with SMTP id m28csp357692imm; Thu, 12 Apr 2018 23:58:22 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/bRK+QRH+H+1F2nSDgs6AcdBKBOJk0CXuVXejadx0VMz2oLIZ5JTNn0R5R9Mdli+yzkW57 X-Received: by 10.98.7.152 with SMTP id 24mr10357591pfh.94.1523602702709; Thu, 12 Apr 2018 23:58:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523602702; cv=none; d=google.com; s=arc-20160816; b=cLR2PnjnS6iXE08DB3F6Kiay+o0Un1HKzdkun16zcwa9cGosYIAYBKEUHHSb6q4qml 9CGq5zfaXTDw5/A7JgTyrrsGn3pNwtsaq/wnh/OU2AtsdZIVGNMGqNRyeMfqz84QRM9c G5x+tJmErNDFYQNwCp/FCbnVv8MFLujP9JARUPbmzgbfJlClgptpggNOs5yo3nDGgQ9c 3YtGhL5jMf8Sv357zTJaZf/0oW6ugwOBEEhhs3FgoBHv2tzqxgBw4NpGzdCWPizLot+5 owpKZgZlZfx/xGgTr8WBhNbxRL31kzlv/kXiXxRDp8wfFGdGgVlw3cgZtaxr357hJVh+ yf1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=RuGQumqTlX974BwfX4CMhqbhpg6XJ7DMc4h/fecPpXA=; b=BhQTIRGeBbccsa4W+ViOziXfMOWyMvkPTLrClKLxxTrbJJrTQLrPfRq5Q/Ds7ugDFQ WEw/VET+KTOClbLQTXm32baLUbWEG5bAUw1nnrBqyd6L6HPJ5T2ncA21NGbnDQolcRTK QUtBHnB5unNbNohu3g5egukayI88YTq9sjW7psrABU5OSA08bA2PAXU6O+8JepgFlR1F Og+LBedxtre9bDMnBeGtzpk8dwQd+j1a4LkenWOsWCfEaJMxOrrnZGTBjFG2DnS0y8tK KTi4bdOMbo4PtSmfEb6gJt9aeOQyhM2K5ZBuUi4hBSJy7pgP047H3iTN+uBFpS2DCHdF KxnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v4-v6si4739760plo.644.2018.04.12.23.58.09; Thu, 12 Apr 2018 23:58:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753584AbeDMGtV (ORCPT + 99 others); Fri, 13 Apr 2018 02:49:21 -0400 Received: from mx2.suse.de ([195.135.220.15]:40924 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750980AbeDMGtT (ORCPT ); Fri, 13 Apr 2018 02:49:19 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E1759AE91; Fri, 13 Apr 2018 06:49:17 +0000 (UTC) Date: Fri, 13 Apr 2018 08:49:17 +0200 From: Michal Hocko To: "Michael Kerrisk (man-pages)" Cc: John Hubbard , Jann Horn , linux-man , Andrew Morton , Linux-MM , lkml , Linux API Subject: Re: [PATCH] mmap.2: MAP_FIXED is okay if the address range has been reserved Message-ID: <20180413064917.GC17484@dhcp22.suse.cz> References: <20180412153941.170849-1-jannh@google.com> <13801e2a-c44d-e940-f872-890a0612a483@nvidia.com> <9c714917-fc29-4d12-b5e8-cff28761a2c1@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9c714917-fc29-4d12-b5e8-cff28761a2c1@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 13-04-18 08:43:27, Michael Kerrisk wrote: [...] > So, you mean remove this entire paragraph: > > For cases in which the specified memory region has not been > reserved using an existing mapping, newer kernels (Linux > 4.17 and later) provide an option MAP_FIXED_NOREPLACE that > should be used instead; older kernels require the caller to > use addr as a hint (without MAP_FIXED) and take appropriate > action if the kernel places the new mapping at a different > address. > > It seems like some version of the first half of the paragraph is worth > keeping, though, so as to point the reader in the direction of a remedy. > How about replacing that text with the following: > > Since Linux 4.17, the MAP_FIXED_NOREPLACE flag can be used > in a multithreaded program to avoid the hazard described > above. Yes, that sounds reasonable to me. -- Michal Hocko SUSE Labs