From patchwork Thu Aug 29 23:42:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1155565 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-104913-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="uSA2H3rA"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46KK183Z12z9sN1 for ; Fri, 30 Aug 2019 09:43:08 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; q=dns; s=default; b=E3v ZHQRmsWy7vuY+nKLdZHdm0Vo0vjiG9rQJhTWqSYGjrqMgifc1LWk+irfWYQ2l8qj O2ieADw7pwAUQLblvgMNCXPbWWtedoGsiy88h1ItW5Lusjnqh3qz/PrY64BS1hNi 6eJQD3+KpQGDaGblp7QNHEGQmeQF+X/6EIWs/4L8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; s=default; bh=UTLpHlZI7 +hpYNYtuu4TfwUIAs8=; b=uSA2H3rAoncIfNIp86Jk3+N0c5VUp1usZpehxVXxB Nnx+DV3fxFkvOOksavqiIHaw5i2+3EtS2XO1+qCPG3RlU3sZvyp1v9+BZrXW6hK8 oSyyK+0gADMDun0AOLYPZwRkSu4FIoVg0lCsTYYygIxpHkWrFRdPGFSs1X2mI0U0 RE= Received: (qmail 38072 invoked by alias); 29 Aug 2019 23:43:02 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 38064 invoked by uid 89); 29 Aug 2019 23:43:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-13.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NEUTRAL autolearn=ham version=3.3.1 spammy=HX-Languages-Length:2006, HContent-Transfer-Encoding:8bit X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [hurd, commited] hurd: Remove optimizing anonymous maps as __vm_allocate. Date: Fri, 30 Aug 2019 01:42:55 +0200 Message-Id: <20190829234255.22457-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 Optimizing anonymous maps brings bugs, and does not optimize much anyway. [BZ #19903] * sysdeps/mach/hurd/mmap.c (__mmap): Remove optimizing anonymous maps as __vm_allocate. --- ChangeLog | 4 ++++ sysdeps/mach/hurd/mmap.c | 23 ----------------------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index afd99a634e..98a86369d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,10 @@ EBADF case, or else POLLERR. - On error, make select simulated readiness. + [BZ #19903] + * sysdeps/mach/hurd/mmap.c (__mmap): Remove optimizing anonymous maps + as __vm_allocate. + 2019-08-30 Richard Braun * hurd/hurdselect.c (_hurd_select): Always call __io_select with no diff --git a/sysdeps/mach/hurd/mmap.c b/sysdeps/mach/hurd/mmap.c index 8eb741f7e1..e3ff77d6c9 100644 --- a/sysdeps/mach/hurd/mmap.c +++ b/sysdeps/mach/hurd/mmap.c @@ -44,29 +44,6 @@ __mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset) if ((mapaddr & (__vm_page_size - 1)) || (offset & (__vm_page_size - 1))) return (void *) (long int) __hurd_fail (EINVAL); - if ((flags & (MAP_TYPE|MAP_INHERIT)) == MAP_ANON - && prot == (PROT_READ|PROT_WRITE)) /* cf VM_PROT_DEFAULT */ - { - /* vm_allocate has (a little) less overhead in the kernel too. */ - err = __vm_allocate (__mach_task_self (), &mapaddr, len, mapaddr == 0); - - if (err == KERN_NO_SPACE) - { - if (flags & MAP_FIXED) - { - /* XXX this is not atomic as it is in unix! */ - /* The region is already allocated; deallocate it first. */ - err = __vm_deallocate (__mach_task_self (), mapaddr, len); - if (!err) - err = __vm_allocate (__mach_task_self (), &mapaddr, len, 0); - } - else if (mapaddr != 0) - err = __vm_allocate (__mach_task_self (), &mapaddr, len, 1); - } - - return err ? (void *) (long int) __hurd_fail (err) : (void *) mapaddr; - } - vmprot = VM_PROT_NONE; if (prot & PROT_READ) vmprot |= VM_PROT_READ;