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: 20055 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;