From patchwork Wed Dec 21 17:47:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 62238 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 48F3E385B505 for ; Wed, 21 Dec 2022 17:47:42 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id A47AD3858425 for ; Wed, 21 Dec 2022 17:47:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A47AD3858425 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.96,263,1665475200"; d="scan'208";a="91131142" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 21 Dec 2022 09:47:24 -0800 IronPort-SDR: rjOqzlddaxa6cSQSlYD106bGbpOSgChuj8a9XaJmvRl315dzETEus/YqVuFOsxJEpgJg+/0zEe eeZs1YJWQgbESuHh0LsCukQwTIr6OTuTWcAnOht1o2FiKdrSaANiEOIgjBVH7qAWSOuQS2k0e4 Fq6uFsxr8JRe9rvupvfoyI6c8w2QSUZDIWZv62E8W0el+AP/dVp2HFT+uikSyfX1pmOVDfsK0/ dWMdI77rMrVAwP+2NFp5l6PUGlb+vJJneYHEpvokNYtNlA52GrbP2chxuSU+nEvhzT2PGvzBd0 Z0w= Date: Wed, 21 Dec 2022 17:47:20 +0000 From: Joseph Myers To: Subject: Define MADV_COLLAPSE from Linux 6.1 Message-ID: <3026a082-68e8-d5be-9fcd-9f35a4239253@codesourcery.com> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3115.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_NUMSUBJECT, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP 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: 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: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Add the MADV_COLLAPSE constant from Linux 6.1 to bits/mman-linux.h and the hppa bits/mman.h. Tested for x86_64. diff --git a/sysdeps/unix/sysv/linux/bits/mman-linux.h b/sysdeps/unix/sysv/linux/bits/mman-linux.h index 1fb7f888aa..c3818ce356 100644 --- a/sysdeps/unix/sysv/linux/bits/mman-linux.h +++ b/sysdeps/unix/sysv/linux/bits/mman-linux.h @@ -91,6 +91,7 @@ writable. */ # define MADV_DONTNEED_LOCKED 24 /* Like MADV_DONTNEED, but drop locked pages too. */ +# define MADV_COLLAPSE 25 /* Synchronous hugepage collapse. */ # define MADV_HWPOISON 100 /* Poison a page for testing. */ #endif diff --git a/sysdeps/unix/sysv/linux/hppa/bits/mman.h b/sysdeps/unix/sysv/linux/hppa/bits/mman.h index acaa1cc3e7..1d895a5234 100644 --- a/sysdeps/unix/sysv/linux/hppa/bits/mman.h +++ b/sysdeps/unix/sysv/linux/hppa/bits/mman.h @@ -79,4 +79,6 @@ # define MADV_WIPEONFORK 71 /* Zero memory on fork, child only. */ # undef MADV_KEEPONFORK # define MADV_KEEPONFORK 72 /* Undo MADV_WIPEONFORK. */ +# undef MADV_COLLAPSE +# define MADV_COLLAPSE 73 /* Synchronous hugepage collapse. */ #endif