From patchwork Thu May 30 13:01:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 1941707 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=cebitec.uni-bielefeld.de header.i=@cebitec.uni-bielefeld.de header.a=rsa-sha256 header.s=20200306 header.b=DEdgBopV; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VqmcC0QqMz20Pb for ; Thu, 30 May 2024 23:02:03 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 48D323858417 for ; Thu, 30 May 2024 13:02:01 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp.CeBiTec.Uni-Bielefeld.DE (smtp.CeBiTec.Uni-Bielefeld.DE [129.70.160.84]) by sourceware.org (Postfix) with ESMTPS id 8B8653858288 for ; Thu, 30 May 2024 13:01:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8B8653858288 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cebitec.uni-bielefeld.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8B8653858288 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=129.70.160.84 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717074098; cv=none; b=akSGCPRgmO4bjZ/c5sTl4/d1Enbs8kJ3KO1sFhgqFPxklG2qT9bFdtuLU/q3WX0PjI8XDfj84TMHdmnO09WHMfvCtJyHTinS4IJrNdfhzB0KufBCqB0WYawMX2wxkf4qltSjORzisJWRGH7HvQxtu+/+NuOzLaWpo2Qud55dLQ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717074098; c=relaxed/simple; bh=bLVlSs0+RvwG8jzaITvSj2rxZp5HrbaTvy4O36L0rjY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=s2I1RhhqxhG3xSvlInz/FaAyqQdZfZP9WkGOaloSoHdDxSsIHdaVSYBSCJYS4bWrloKznk8AofNTy4Udvje+WokQxh65PysN80EL+Er2WWGafJZ81KnDjgREijKyVeNULordEnGw7JQkLZCmAHdcKnmVHx6BnjCHwUKzWXBY+eg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost (localhost [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 6A0C0CF4B0 for ; Thu, 30 May 2024 15:01:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= cebitec.uni-bielefeld.de; h=content-type:content-type :mime-version:user-agent:message-id:date:date:subject:subject :from:from:received:received; s=20200306; t=1717074095; bh=bLVlS s0+RvwG8jzaITvSj2rxZp5HrbaTvy4O36L0rjY=; b=DEdgBopV5AK+Hma5Oupsr 6RBLBZKwDPDS9PqSgZ7/DmczVYZ4woFAPjUrDozWfi0JVtFWU7S9tohSGK96skyv dFQyYFHJRLDAU085NMDpe64IjKG3b60rpmaNFsR9iSjeg8Mc/EoI2447BEqUmIN+ 3bVszpJEZdd27muJOeTO+xsMblQLrdsqfqpGhqcHWxX4ABuK3DjcorEp+NTMFAhQ YR8tqcLOL1LmkbZXsf3i8qkVFRZ7m+YAyEiw0l0hqZfsvT7FuywwMh/crk9LbkNS ZEboXSpAr0rINYS4D+H0lkK6TfhdOFvcocfNnbh60krNwkdekJbm8UVNJTyjVT3e g== X-Virus-Scanned: amavisd-new at cebitec.uni-bielefeld.de Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (smtp.cebitec.uni-bielefeld.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 1HIKZa6bmALe for ; Thu, 30 May 2024 15:01:35 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p508551cc.dip0.t-ipconnect.de [80.133.81.204]) (Authenticated sender: ro) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id EDC10CF4AF for ; Thu, 30 May 2024 15:01:34 +0200 (CEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Subject: [COMMITTED] ggc: Reduce GGC_QUIRE_SIZE on Solaris/SPARC [PR115031] Date: Thu, 30 May 2024 15:01:34 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (usg-unix-v) MIME-Version: 1.0 X-Spam-Status: No, score=-3789.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org g++.dg/modules/pr99023_b.X currently FAILs on 32-bit Solaris/SPARC: FAIL: g++.dg/modules/pr99023_b.X -std=c++2a 1 blank line(s) in output FAIL: g++.dg/modules/pr99023_b.X -std=c++2a (test for excess errors) Excess errors: cc1plus: out of memory allocating 1048344 bytes after a total of 7913472 bytes It turns out that this exhaustion of the 32-bit address space happens due to a combination of three issues: * the SPARC pagesize of 8 kB, * ggc-page.cc's chunk size of 512 * pagesize, i.e. 4 MB, and * mmap adding two 8 kB unmapped red-zone pages to each mapping which result in the 4 MB mappings to actually consume 4.5 MB of address space. To avoid this, this patch reduces the chunk size so it remains at 4 MB even when combined with the red-zone pages, as recommended by mmap(2). Tested on sparc-sun-solaris2.11 and sparcv9-sun-solaris2.11, committed to trunk. Rainer # HG changeset patch # Parent 5c140588dce73c5358387df3bb9597de45fa5524 ggc: Reduce GGC_QUIRE_SIZE on 32-bit Solaris/SPARC [PR115031] diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h --- a/gcc/config/sparc/sol2.h +++ b/gcc/config/sparc/sol2.h @@ -38,6 +38,9 @@ along with GCC; see the file COPYING3. #undef SPARC_DEFAULT_CMODEL #define SPARC_DEFAULT_CMODEL CM_MEDMID +/* Redue ggc-page.cc's chunk size to account for mmap red-zone pages. */ +#define GGC_QUIRE_SIZE 510 + /* Select a format to encode pointers in exception handling data. CODE is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is true if the symbol may be affected by dynamic relocations.