From patchwork Sat Feb 21 21:04:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 5860651 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B139ABF440 for ; Sat, 21 Feb 2015 21:04:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D2FD120531 for ; Sat, 21 Feb 2015 21:04:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C11AD2052A for ; Sat, 21 Feb 2015 21:04:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751647AbbBUVEP (ORCPT ); Sat, 21 Feb 2015 16:04:15 -0500 Received: from mout.gmx.net ([212.227.17.21]:62872 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750746AbbBUVEO (ORCPT ); Sat, 21 Feb 2015 16:04:14 -0500 Received: from [192.168.20.60] ([84.173.1.4]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0LeRKD-1Xkg9W11W1-00q8VW; Sat, 21 Feb 2015 22:04:11 +0100 Message-ID: <54E8F2CA.6060904@gmx.de> Date: Sat, 21 Feb 2015 22:04:10 +0100 From: Helge Deller User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: John David Anglin , Carlos O'Donell CC: Aaro Koskinen , Mike Frysinger , linux-parisc Subject: Re: parisc: fix mmap(MAP_FIXED|MAP_SHARED) to already mmapped address References: <20131219191750.GC2881@blackmetal.musicnaut.iki.fi> <201312191619.05005.vapier@gentoo.org> <5313A12E.7010307@gmx.de> <20140401182627.GA3285@drone.musicnaut.iki.fi> <533B0A57.2060700@gmx.de> <533C7C9A.5080703@gmx.de> <533DB961.9010607@gmx.de> <533DC3E8.5010701@gmx.de> In-Reply-To: X-Provags-ID: V03:K0:QoXnUYCPV6jYxSNSjjLEqXxVTRLJJX3W1a1hUrpHuSsHuZVJ3vy buKndlCvnZT5acaux5PlB7lEVmu9o8k6aHOHWbqlDWkKoBZdHNcTxEwKUa4s9wyb0v+n3A0 fQWUC1re/Ss9v/OeIIcFSb98CPZR/2NyaC6rvJirNELfcFBxEzYTpuf9HCFd0v7GhGM4TPF 6sWyykxccscxRlB6CNdBw== X-UI-Out-Filterresults: notjunk:1; Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 21.02.2015 21:31, John David Anglin wrote: > On 2015-02-20, at 4:36 PM, Carlos O'Donell wrote: > >> On Thu, Apr 3, 2014 at 4:26 PM, Helge Deller wrote: >>> In current eglibc it's set to 0x00400000 >>> That's what my eglibc-patch changes... >>> I'm currently building a eglibc on hpviz with SHMLBA set to 4096 (__getpagesize()). >> >> Anyone object to me fixing this upstream by making SHMLBA match the kernel? I think to remember that that would be best. Didn't I pushed this (SHMLBA=4k) to eglibc? >> I plan to use a fixed value of 4096, since I never expect hppa >> userspace to have to care (even if the kernel uses superpages). Yes. > We currently use (__getpagesize ()) in Debian and this seems to be a common definition. > Is there a performance advantage in using 4096? Yes, we have: > At one time, we thought this value needed to be 4 MB. Helge was working on improving the mmap > allocation scheme but this work stalled after some improvement. They are just on hold, but not that needed any more after we have the flexmap implementation. > I can't remember the issues and how they relate to SHMLBA. I would need to recall too. IIRC, SHMLBA and the 4MB cache alignments do not really relate to each other. Userspace should just mmap(X) where X is aligned to SHMLBA. The mmap will then mmap to the next possible address (starting somewhere above/equal to X) and still fulfilling the 4MB cache alignment (if it's a shared mmap). Helge --- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: eglibc-2.18/ports/sysdeps/unix/sysv/linux/hppa/bits/shm.h =================================================================== --- eglibc-2.18.orig/ports/sysdeps/unix/sysv/linux/hppa/bits/shm.h 2013-01-09 19:28:48.000000000 -0500 +++ eglibc-2.18/ports/sysdeps/unix/sysv/linux/hppa/bits/shm.h 2014-04-09 21:08:06.516202583 -0400 @@ -36,7 +36,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 ()) I prefer this for glibc as well.