From patchwork Sun Apr 16 18:48:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John David Anglin X-Patchwork-Id: 751170 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3w5gQm02Tnz9s1h for ; Mon, 17 Apr 2017 04:48:47 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="whqfvErq"; dkim-atps=neutral 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:mime-version:content-type:date:subject:cc :to:message-id; q=dns; s=default; b=VWx95q1zsRPds13n2kt0E2oMw0DW AcJOaG3gIlqwNs9V0yHLSRjEdLcE9BjofZ3gM1+N4EwlFmNzgT8m/nOlmpiai3kw bpwZSLvTudJ7jMYHCMegdehuqugwmI3ODsqx/AIb6ZdBq8MWt38L8NK3xXCA3K92 BkdiSkks67Dqevc= 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:mime-version:content-type:date:subject:cc :to:message-id; s=default; bh=saryI0PD/i5zYjM2PAv18O1QupM=; b=wh qfvErqjhOg7/6qSMyUjXDteKOv02IRECvMKxWMyNVYslUCup8wP5sbli+whPyeO3 vJpaXBhg2r4GHA4FdRT2gfLOmU/f8WSvrGwhwuF2a0Y0z5DvVWU80SzFzcmOBJ4N mjCCSPAR8bsfkz2YtgavYFubeCX7EkjTCptsOMTnI= Received: (qmail 84765 invoked by alias); 16 Apr 2017 18:48:31 -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 84642 invoked by uid 89); 16 Apr 2017 18:48:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS, UNPARSEABLE_RELAY autolearn=ham version=3.3.2 spammy=Hx-spam-relays-external:184.150.200.80, H*r:mtlfep02, HX-Cloudmark-Analysis:UIIyJGXy, H*r:sk:mtlfep0 X-HELO: mtlfep02.bell.net From: John David Anglin Mime-Version: 1.0 (Apple Message framework v1085) Date: Sun, 16 Apr 2017 14:48:06 -0400 Subject: [PATCH] Set SHMLBA to page size on hppa (BZ locale/19838) Cc: Carlos O'Donell , Mike Frysinger , Aurelien Jarno , Helge Deller To: GNU C Library Message-Id: Setting SHMLBA to 4MB results in applications failing to allocate memory using mmap too early. Examples are localedef and perl. The attached patch fixes this by reducing SHMLBA to the page size (4096). The patch has been installed on Debian for a long time. It goes back to the following discussion: https://patchwork.kernel.org/patch/3933841/ Although there may be issues in old IPC applications, the general consensus is that the smaller 4KB value is more useful. I might add that the kernel code in sys_parisc.c does 4MB color alignment for file and shared maps. Please install. Dave --- John David Anglin dave.anglin@bell.net 2017-04-16 John David Anglin [BZ locale/19838] * sysdeps/unix/sysv/linux/hppa/bits/shm.h (SHMLBA): Align to page boundary using __getpagesize. diff --git a/sysdeps/unix/sysv/linux/hppa/bits/shm.h b/sysdeps/unix/sysv/linux/hppa/bits/shm.h index 794f0ab2da..52632d0dea 100644 --- a/sysdeps/unix/sysv/linux/hppa/bits/shm.h +++ b/sysdeps/unix/sysv/linux/hppa/bits/shm.h @@ -37,7 +37,7 @@ #define SHM_UNLOCK 12 /* unlock segment (root only) */ /* Segment low boundary address multiple. */ -#define SHMLBA 0x00400000 /* address needs to be 4 Mb aligned */ +#define SHMLBA (__getpagesize ()) /* Type to count number of attaches. */ typedef unsigned long int shmatt_t;