Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp2272905img; Wed, 27 Feb 2019 13:34:49 -0800 (PST) X-Google-Smtp-Source: AHgI3Iadbt7xTtmMFi3lcSlzxrYyYS1JpxY2GbQU0M82RV2ZtCnFJOlQrvBY/KMOYxkTDZPJ57Es X-Received: by 2002:a17:902:9008:: with SMTP id a8mr4413520plp.38.1551303289572; Wed, 27 Feb 2019 13:34:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551303289; cv=none; d=google.com; s=arc-20160816; b=UJnQdzGFzKEyV32F+d04Yh4hOKXaFHgGrZFzmfL16weAcaIS+DDxaIKcqA52okX3DW 1FU6rqCLNPrT6pXjkQF9hxyKOppGbADR9F8fchq7tQ0/nsclKAlVxskBxM5KOym3/fsk JhAsNjrwxcMTsac1R45pNASZnz7p5iJcQoACYkFbULFiGrGfjUic/Jmh9IT5++YA6w54 DFQVHsqzU/Tm6pwc1CULq8uhGfQow4aKwH9J1vPHq52xQnNPb7QyaAQgRQpK3PReTKUT l3NF41+OnjwNrCYHmQ0dTElUcf4FCqK73qrUkHtDqY2sfzFagcGpJDNaleLPeCTYEXRt QAZA== 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; bh=EL4WBc+QHYJmrrDir69Cl7DD1KVpPrBr23JxqcuYE+s=; b=Ev/i9CLV/h8rIu/kAnAhtzazw0YvCHiUX6WfUOWAcZ+ySvBk3uFcfgecuzkgHCUh3O V1ZnrjPWnzd2zUDyK7TcKRf9kkgyr+i43YxPJtYqvn9uMoIv6ZeeaoahnMmLCmYK/g7Q xGZT2phZRtMqmduXSmUqhnqLwUupewNfT+vTt5DmJYUK/61lPgQGfHC5vc3SkjGfowTJ is9bMt1nQmZg1t/ioMDVjicWE1pSXAWzwXl6LSgy0cFCuI5mxfQLqeOTz2TsGIZgNRgP HqYijOP3252pJwGSLQmjc6CiGbnOCHglCB8qDYm4ZcIdzpAPBK/e1jrB4MGtGt14GRHu hgzQ== 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 z18si16268378pgf.66.2019.02.27.13.34.33; Wed, 27 Feb 2019 13:34:49 -0800 (PST) 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 S1730530AbfB0VcL (ORCPT + 99 others); Wed, 27 Feb 2019 16:32:11 -0500 Received: from nat.nue.novell.com ([195.135.221.2]:42112 "EHLO suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727488AbfB0VcL (ORCPT ); Wed, 27 Feb 2019 16:32:11 -0500 Received: by suse.de (Postfix, from userid 1000) id 90D6C43ED; Wed, 27 Feb 2019 22:32:09 +0100 (CET) Date: Wed, 27 Feb 2019 22:32:09 +0100 From: Oscar Salvador To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, hughd@google.com, kirill@shutemov.name, vbabka@suse.cz, joel@joelfernandes.org, jglisse@redhat.com, yang.shi@linux.alibaba.com, mgorman@techsingularity.net Subject: Re: [PATCH] mm,mremap: Bail out earlier in mremap_to under map pressure Message-ID: <20190227213205.5wdjucqdgfqx33tr@d104.suse.de> References: <20190226091314.18446-1-osalvador@suse.de> <20190226140428.3e7c8188eda6a54f9da08c43@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190226140428.3e7c8188eda6a54f9da08c43@linux-foundation.org> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 26, 2019 at 02:04:28PM -0800, Andrew Morton wrote: > How is this going to affect existing userspace which is aware of the > current behaviour? Well, current behavior is not really predictable. Our customer was "surprised" that the call to mremap() failed, but the regions got unmapped nevertheless. They found it the hard way when they got a segfault when trying to write to those regions when cleaning up. As I said in the changelog, the possibility for false positives exists, due to the fact that we might get rid of several vma's when unmapping, but I do not expect existing userspace applications to start failing. Should be that the case, we can revert the patch, it is not that it adds a lot of churn. > And how does it affect your existing cleanup code, come to that? Does > it work as well or better after this change? I guess the customer can trust more reliable that the maps were left untouched. I still have my reserves though. We can get as far as move_vma(), and copy_vma() can fail returning -ENOMEM. (Or not due to the "too small to fail" ?) -- Oscar Salvador SUSE L3