From patchwork Fri Mar 19 19:57:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 42706 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 21E83386F46A; Fri, 19 Mar 2021 19:58:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 21E83386F46A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1616183881; bh=9onc13niEAZOpFvUJZPt+lcmxGTqgvZlcAE5fvrA7Eo=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=VFYqT/fMiTuKS+VtAjF5uULwaP8dqWVgGof5xx7POaTYXADVnrLSY2x1QlY0UM31S +pGE0mEY4+WcnccAJBp3Q6dxUW9RGhWO4P88EsHHqsARsd5N84GGGsy4awHWOhBT5Z khssPI+Dw2DMnhIIkB0wiLdXFTzgit6VHbhvfO04= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id BE98D3857C73 for ; Fri, 19 Mar 2021 19:57:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BE98D3857C73 Received: by mail-pj1-x102d.google.com with SMTP id ha17so5201783pjb.2 for ; Fri, 19 Mar 2021 12:57:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9onc13niEAZOpFvUJZPt+lcmxGTqgvZlcAE5fvrA7Eo=; b=C1ONPkfl56td1c8fIYK3um/Z9yrxqOQmp8P3u2a2XV14yBIeJo+eZ4xF4f6VAq4AMC t4GKbrj96xPIcKL48mA//T56oiEN8uMXdXOhU4wO12F2CwuoxtAzxerqnGvFmqreG6y/ 3FxLDMJDgM4NhXSuQrL4rpzO4RHIJESRHTo6orP8aMorYhVc0YWcvInLwoMAI9jmh6io nNXVc8RgQ+upQKjxcGP2IuKjePdHy1NE6OWW9/Qg3KF/2N8aNBCt8r687gGNPcQRSNkg 1Mca73vqfG+92Tpgba068ecVjapBguVWbGIXDh4O5MAo87WhbSaDhh3UE5aMbtqed7YK sjwQ== X-Gm-Message-State: AOAM533qt6w8BR9edWGCtaNZfKCNobESRok35aYuN3sKrIIAX8K0b+dU mIdTGcKi8j/HFc23iISoEOY= X-Google-Smtp-Source: ABdhPJy7sh1C4hrbCob2V3iabH93Y4uB2vnFalfrQkSJoBkPgDmAimOWwWgtJOEIuYOI13IL47BRPw== X-Received: by 2002:a17:90a:ce0c:: with SMTP id f12mr160610pju.11.1616183877842; Fri, 19 Mar 2021 12:57:57 -0700 (PDT) Received: from gnu-cfl-2.localdomain ([172.56.38.37]) by smtp.gmail.com with ESMTPSA id w1sm5368218pgs.15.2021.03.19.12.57.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 12:57:57 -0700 (PDT) Received: from gnu-cfl-2.?040none?041 (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id DA8931A0111; Fri, 19 Mar 2021 12:57:55 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH] nptl: Remove MULTI_PAGE_ALIASING [BZ #23554] Date: Fri, 19 Mar 2021 12:57:55 -0700 Message-Id: <20210319195755.267261-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-3036.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Libc-alpha" From: "H.J. Lu" Reply-To: "H.J. Lu" Cc: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" MULTI_PAGE_ALIASING was introduced to mitigate an aliasing issue on Pentium 4. It is no longer needed for processors after Pentium 4. --- nptl/allocatestack.c | 10 ---------- nptl/stack-aliasing.h | 23 ----------------------- sysdeps/i386/i686/stack-aliasing.h | 23 ----------------------- sysdeps/x86_64/stack-aliasing.h | 1 - 4 files changed, 57 deletions(-) delete mode 100644 nptl/stack-aliasing.h delete mode 100644 sysdeps/i386/i686/stack-aliasing.h delete mode 100644 sysdeps/x86_64/stack-aliasing.h diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index 149b999603..00fddbd409 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -31,7 +31,6 @@ #include #include #include -#include #ifndef NEED_SEPARATE_REGISTER_STACK @@ -547,15 +546,6 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, pd = get_cached_stack (&size, &mem); if (pd == NULL) { - /* To avoid aliasing effects on a larger scale than pages we - adjust the allocated stack size if necessary. This way - allocations directly following each other will not have - aliasing problems. */ -#if MULTI_PAGE_ALIASING != 0 - if ((size % MULTI_PAGE_ALIASING) == 0) - size += pagesize_m1 + 1; -#endif - /* If a guard page is required, avoid committing memory by first allocate with PROT_NONE and then reserve with required permission excluding the guard page. */ diff --git a/nptl/stack-aliasing.h b/nptl/stack-aliasing.h deleted file mode 100644 index bfdde53e53..0000000000 --- a/nptl/stack-aliasing.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Define macros for stack address aliasing issues for NPTL. Stub version. - Copyright (C) 2014-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -/* This is a number of bytes that is an alignment that should be avoided - when choosing the exact size of a new thread's stack. If the size - chosen is aligned to this, an extra page will be added to render the - size off-aligned. */ -#define MULTI_PAGE_ALIASING 0 diff --git a/sysdeps/i386/i686/stack-aliasing.h b/sysdeps/i386/i686/stack-aliasing.h deleted file mode 100644 index d521dcdb75..0000000000 --- a/sysdeps/i386/i686/stack-aliasing.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Define macros for stack address aliasing issues for NPTL. i686 version. - Copyright (C) 2014-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -/* What is useful is to avoid the 64k aliasing problem which reliably - happens if all stacks use sizes which are a multiple of 64k. Tell - the stack allocator to disturb this by allocation one more page if - necessary. */ -#define MULTI_PAGE_ALIASING 65536 diff --git a/sysdeps/x86_64/stack-aliasing.h b/sysdeps/x86_64/stack-aliasing.h deleted file mode 100644 index 2efdacb3b4..0000000000 --- a/sysdeps/x86_64/stack-aliasing.h +++ /dev/null @@ -1 +0,0 @@ -#include