From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id 6FD1E3858431 for ; Tue, 28 Mar 2023 08:49:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6FD1E3858431 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32S8jIS0015438; Tue, 28 Mar 2023 08:49:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=references : from : to : cc : subject : in-reply-to : date : message-id : content-type : mime-version; s=corp-2022-7-12; bh=qHUHpcReP/VqJuexET3JUZ/pjuxRZgA6sfFnczht6r4=; b=J4hyusgq9j9COrtsBv+8x6dB+VVeaJJACfsI7ptoN87GjbXlORRKDUevrOk8HSNeXpSZ tvKZP/2DVAu7HnmS1frLlF0Y6GawZrTwE+AyerknJWQuwnW8CZ3Div3/Ghz7MkCyDxYV WWijHof5kc4LwsnFUtxOCM/CD7TOMBrfmUA00vpHWIp2fl0X7/6eAKBdsZAhdvcSXKrr ZB6TA+/UvI8v8SuZs5qjhCSk+Hp29CmGwPuMx3XN0kZHY1E056HG8CbflGfQ05w8C4J8 OIF+j1OKFB14ATwQKzyXSWygsiO7Dz7ZunF6vuPsMtosiSow+Qmta+tjBExtaSnGGoCD 4Q== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3pkw05g154-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Mar 2023 08:49:02 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 32S7808e027751; Tue, 28 Mar 2023 08:49:01 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3phqd63ku9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Mar 2023 08:49:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IQ3EnJiqd6tq05dck8Ca9M/iY6FL+UtO4lPNc5J9xPifYiLTXS9hUisVCU2Lgq5rTUiPJ7BDVADxJksw8B9C1IPMEb24r5sZevpOnJqsgopIk2Zm283ejbXpfJkpLljAMUAHwPc7sZQAFhw4KZAveFD4J7eJlVGRfKo18zFuw5SlD3LKpyVjwS8C55qObz7+o8HrhRGrpwN8cvQOU5SMidb3g3W93r22zl4nv+SY2YuR7tnmmoKAF1W1GcGLT6GZADfT+bxUrcepkEoF+Z4EBBAV6TDThu/ti73P7zSuX5D8jAMSrvfnBeRVUTh1zxJd78GPugqRY0cCl+EULB6xcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qHUHpcReP/VqJuexET3JUZ/pjuxRZgA6sfFnczht6r4=; b=kZjiZBHGDx+/q/RzaObn1NfB3lsXyK87nHOdTxZSKb1k+k2KjYk4z7wPXavAxUJY3WfnfxYjgj05FoDKeM+R8LHuCE7OBwJRejGIImK6VkqnJEbZPx/MVtE3S/rI4A/iaVgLierVqjCZZ65EX5IiKQjP4aOEAKbFvsU2hyFMdfW0fCtD7BtfTJWmEHbybW9854E3D7zEpLusKQ0XqtrwPHal4mibQ1cekERRg9B3F9uSfTSBJk7zXFvizDsvmJHhHOr0WELPY784w8/01+aYx1/Xv5qib2CZO1hQlqU33V6L/CBpQ/wkW+CClwTOsq2uOXcrYlLYMhPJBc+tPo+EEw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qHUHpcReP/VqJuexET3JUZ/pjuxRZgA6sfFnczht6r4=; b=era8i9EHkAvRqH5gMgY2hA5ocqejXErEjbcOU6UPnKtiL/0ZRJxxWKC9/lyZ2zDTFUzu2O8cL0I4J910VfHCWhIsdX4Rl/nDJh6lfaD6a+UG8mZshdNZnNxvIIApNipGKkeuaEIXUkEdnwhMFNfIwP4co1DSr8XObPnDTVCHrag= Received: from BN6PR1001MB2340.namprd10.prod.outlook.com (2603:10b6:405:30::36) by CH0PR10MB4907.namprd10.prod.outlook.com (2603:10b6:610:db::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.41; Tue, 28 Mar 2023 08:48:58 +0000 Received: from BN6PR1001MB2340.namprd10.prod.outlook.com ([fe80::a502:c948:c3f6:9728]) by BN6PR1001MB2340.namprd10.prod.outlook.com ([fe80::a502:c948:c3f6:9728%6]) with mapi id 15.20.6178.038; Tue, 28 Mar 2023 08:48:57 +0000 References: <20230321145116.571178-1-cupertino.miranda@oracle.com> <20230321145116.571178-2-cupertino.miranda@oracle.com> <8d44ed82-72c3-9ff4-47d1-8822ec9225c9@linaro.org> User-agent: mu4e 1.4.15; emacs 28.1 From: Cupertino Miranda To: Adhemerval Zanella Netto Cc: libc-alpha@sourceware.org Subject: Re: [PATCH v3 1/1] Created tunable to force small pages on stack allocation. In-reply-to: <8d44ed82-72c3-9ff4-47d1-8822ec9225c9@linaro.org> Date: Tue, 28 Mar 2023 09:48:51 +0100 Message-ID: <87edp9i7m4.fsf@oracle.com> Content-Type: text/plain X-ClientProxiedBy: LO2P265CA0100.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:c::16) To BN6PR1001MB2340.namprd10.prod.outlook.com (2603:10b6:405:30::36) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN6PR1001MB2340:EE_|CH0PR10MB4907:EE_ X-MS-Office365-Filtering-Correlation-Id: 1dc5abc6-4d68-48ef-7a58-08db2f6944b5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: otaImD3cikhA1TuwjykEv7ZtTyPXu/CUPQSey7OLvJeo3wypNjDUKpfc0GBWLIey4IJ8nqoT0IR/XOk16NB1hpqrYTjj0xY0FIO1jiiFo4FBBGUem3tF7bKPEpa3VvQFPyhNWl/sVHgb8sMctQmzIM/ApYMbMSM0yFBTZ4Wi+9IgzT8DqjIst4TGI2vkcJPE5I0pfTN0/uIKD96erhKdvo1fvyYRb1tFLe5fCMYriqYpuRgBsyWYJCKTClB+/A01/4htUb1B0qemFFDyAW/QzgKwckJv3e7HL3Yjdk3z0EcFqDZPYcJZ9suBHqf+fCDKaupz1f+hVxb7zV9c77HhQOWIjTN79hpg1RPi2MGOoJyNQnx5HQZnkRldVzP2B05B0pD9oOw0DlG0XdxZWYBRl6+wriKrpyYU/bLHcxWWeZwEWOV7VGMCEF272fa0LtkJLOBxAj/AbOICg82HI2hF0D7rXbkHaxE4l+RyL5oFo7UrSMIFGrSQj3fCDBLDQb2/GsZYATr4t+q/ITiqU56eIg9bFQmQkBRKMdOPspPtJqzFNenEoX6wKMYk14bwBaBz X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR1001MB2340.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(39860400002)(396003)(136003)(376002)(366004)(451199021)(478600001)(41300700001)(36756003)(6666004)(6486002)(2616005)(316002)(6506007)(6512007)(53546011)(66556008)(66946007)(8676002)(66476007)(186003)(4326008)(6916009)(2906002)(83380400001)(5660300002)(38100700002)(86362001)(8936002)(44832011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?DQL9EyNFlNt9icN5S23+TKhOWdS6Xtil8dmDV+UMoeRSHqazGky8wyj140lq?= =?us-ascii?Q?v+koAjnCSg52lfLpcMcVbz+KWR3p7iVCFAOKzx1zKwS9lDBLwFfomiJm29PE?= =?us-ascii?Q?ou9tVXowLLfDo6XbXUwR4Mxd7sMyrppvfz9IVRWXDg/VicE52jZKoN8Zyeaq?= =?us-ascii?Q?qLQaib2ObOgWmCfxi3qbu/nEnW9cbweY6FUFcnWdr+8PMJUWtXx6I3tyy3Hn?= =?us-ascii?Q?gMfJbHBGG6ZgzZ7p5cxgzSxzRRBzZ8gGNKtS2W4BYmiy/5D2A660qwzo31KP?= =?us-ascii?Q?H889a/3kBSFVGYot5WFE7SE5+/n+jCH8ih+/fwCm0y4kAsn4jzTGXKuTWH8m?= =?us-ascii?Q?Bmnl/zLzrZn3sdruydp2qxpmAPiwEY6EuT0C2iu/31fSHHJ2ItAQSVKrPrLD?= =?us-ascii?Q?Ovq7KO7ZGlOG7J7PjGsMVgezP2cgXkapsUl6/EBoE+b+tDVi7yemQ02TsAYH?= =?us-ascii?Q?ldGXiLTfyEZm5mHJEQ36grSvbtAC7SVDRhJPj2H6sS9dQRQ4BcMm2uSGkPBV?= =?us-ascii?Q?4jSikVCkDP0Thrt1JxN7qInlxZHULrU2/nW1hIgZzkNjvBl1PTAg1O23MHnD?= =?us-ascii?Q?KWLoYw6T5XHPfw6SILA+xx/qVo5uEvzM7qoD86NNLwAWul/DSAm5F1dyDLwU?= =?us-ascii?Q?cZGwi1GScbEx7qt1jm+JYMuJBdbp2JUyq1/hgMTpLcFaOqmuTz6ZiXOupyKY?= =?us-ascii?Q?bOITGHdREZJ0vifPuSZZZ/ak5YRZRVDFzI+GI1nkX3gYpi1QT1E4OT9VUtTy?= =?us-ascii?Q?Csh3xEEwtWBJGJIOO1lxXvBKDhhH26dPzha0F9p6ufreEVCYJFOtxE63k7R+?= =?us-ascii?Q?w8GJLhLjAQPyci58xzxoKmNk/w0/n1/ehFu+UQaUxY23epMAZswhSrgdSBI4?= =?us-ascii?Q?EtiUXFBQdPi9T6lyprwRQgKPhaE2E7TX9I0CqW/ZpjPNUp3Ke7uCZpvAEvAg?= =?us-ascii?Q?CVSUEnnFCyNbgf1IeN+C9+XDM2Hs2LCuBy8Yo9yExnmuD26azCOc+sRnnKU6?= =?us-ascii?Q?xjOrDzNq48HW5bswjqpzJ5IwrIqy5B+rrsXxyIN4x3b23RMtW5Hy8IM+lRkE?= =?us-ascii?Q?J3J7lYI4QuAcCyy7blKRJ/p2beFmwn8FxuJ5URKNJxerWVrOAFXVXpqBrsk+?= =?us-ascii?Q?eZFchoihjo8Bf3svR6nRCZTRLsQszsaJmvl7K20GJMoCyWDHoDxR3YtIy5nN?= =?us-ascii?Q?bInLJVnSVUowXd9V7RZttJ6LG0pAye0T4jqKZj95jeIMv89JRFExPoorws9a?= =?us-ascii?Q?COWws9ubUd6u/v6UCIB2J4sO+al/OBSrSPaAA9jfDOLqQEEDqGyi24DPXmtc?= =?us-ascii?Q?/bDtQ9jh8JXUtHdYzgEy2cvTcx1pEAGeiKnbv2RjZOgbwT/blg5MvLYAPm4A?= =?us-ascii?Q?pSEb4rju45WenJbBkhp9jxkCQpSUwYdsbbnxxkSbzhByk/bSfvlHJCLDIW/E?= =?us-ascii?Q?ECyXEbGo4gO+fu13DJtbEVQc+imVSHP+r4sxAztulNrDoEu6tCUIa9f+IqpB?= =?us-ascii?Q?0QJisc2xXncKahisl+mT5suwjxSXowFyYvAGWSzdIHSOm9vHMcQ/cUvKGgIf?= =?us-ascii?Q?DnmPOb1E8GtTgY+rCBRbQcbSkdeDZH5RbIIlYv08+ExBzMFz/7pKZ054I4sF?= =?us-ascii?Q?KU3mGtGig2KtRdvEKqxfxv4=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: sIM6YA2QC45wY5BP22Y9+c+MmsOWtEFDtyXKdUUmXeiTFHL3k6Pg3Bgp4cgENx5/0BOLEYfjP8bSyL8tD2pDSwUJq1kI45xYWDmxXQy+dJa2nTGPlLclKMZeEuZzAmufHh8x3VE0AshGCtiGALC7dRxrjshoBf6nURNZ3yNihkV0TvFR+u5OYHmMDSLUgeewrDN6Ffbt9DLZsf83PifMXk+3o0mOL32M9Mij111oWuegeQ6jDGa2AS1ol6gDlkeHzx64mDUU1x+gDRHRMkpjRWFyC1Tu08qINmpbABI6DbiyczXnAwh+xogy5q4dy22zP9gDiLuBZRaqnwTK7yR/aMeYyFGID8A2d//Buk6Jq3tJcGFtGPmaMwXcezkhdhH+f3xwmBMsESdmlcDnZJaRDikEJtzIICetPr+bL9Mqrf79qtVjciM74XUwXhJekd3nfuE+J5lKqTrTzrL4WMbCqzIBywn5thRItaNAgfk3+Mkif8GemXzHY1EfMxMmy5aEV+4SZBaoses4OPigpKsWGOwAV9YJaoh0L9JFYc62koFYFITKF4q4sJ5XktlWpe66+mRrOZsUzLldaFisun3jJpiVKF3pllbEO1p7QoZFQtelpRFPjFFrXoNqmrCvMDNvdXlCjD98nZSlh+N8dxgjgEHOapC4nTFw6j+vcwTsG9orvXFLZtVx/SN5tZz7B6zK1ZggFH5pG/akWdjNfgQEzkuiBjwYies6zaSd+bFguRMPctbOtgrDANOCpf4mOkgEoX+82qSJBpmj1rKNRJ5r3rZuPQ0d2HBPoC2yPKH2n94= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1dc5abc6-4d68-48ef-7a58-08db2f6944b5 X-MS-Exchange-CrossTenant-AuthSource: BN6PR1001MB2340.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2023 08:48:57.7310 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sTZ7+CjOvut7cJovWIrXBsmfOcCM7FhXotRFS69WlwrF8/FOdhAJzMoSSiqPFvDJVCvSNs3xU3LCU9CWrtAm/l4xs3UD15T4SW78uJPKH7E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB4907 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-24_11,2023-03-27_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303280073 X-Proofpoint-GUID: xFFiuwmIH-TD7Ub9LKXBlnsUg-htf5l8 X-Proofpoint-ORIG-GUID: xFFiuwmIH-TD7Ub9LKXBlnsUg-htf5l8 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 List-Id: Adhemerval Zanella Netto via Libc-alpha writes: > On 21/03/23 11:51, Cupertino Miranda via Libc-alpha wrote: >> Created tunable glibc.pthread.stack_hugetlb to control when hugepages >> can be used for stack allocation. >> In case THP are enabled and glibc.pthread.stack_hugetlb is set to >> 0, glibc will madvise the kernel not to use allow hugepages for stack >> allocations. >> >> Changed from v1: >> - removed the __malloc_thp_mode calls to check if hugetlb is >> enabled. >> >> Changed from v2: >> - Added entry in manual/tunables.texi >> - Fixed tunable default to description >> - Code style corrections. >> --- >> manual/tunables.texi | 11 +++++++++++ >> nptl/allocatestack.c | 6 ++++++ >> nptl/nptl-stack.c | 1 + >> nptl/nptl-stack.h | 3 +++ >> nptl/pthread_mutex_conf.c | 8 ++++++++ >> sysdeps/nptl/dl-tunables.list | 6 ++++++ >> 6 files changed, 35 insertions(+) >> >> diff --git a/manual/tunables.texi b/manual/tunables.texi >> index 70dd2264c5..de6fd9d6b3 100644 >> --- a/manual/tunables.texi >> +++ b/manual/tunables.texi >> @@ -459,6 +459,17 @@ registration on behalf of the application. >> Restartable sequences are a Linux-specific extension. >> @end deftp >> >> +@deftp Tunable glibc.pthread.stack_hugetlb >> +This tunable allows to configure stack allocation never to use hugetlbs. > > I think we should improve the wording here to make it clear this for the > stack allocated for newly created threads even though the tunables > name implies it ('stack allocation' might infer that all stack allocation, > even for single-thread programs) and that does not affect stack set by > pthread_attr_setstack. Thanks for the feedback. Will update it right away. > >> +This is more of an RSS optimization, for example in scenarios where many >> +threads get created, keeping RSS to a minimum, but also allowing hugestlbs to >> +be used for malloc allocations. >> + >> +The default is @samp{1} and preservs glibc default behaviour. >> +When set to @samp{0}, it advises the kernel not to use hugetlbs for stack >> +allocation. >> +@end deftp >> + >> @node Hardware Capability Tunables >> @section Hardware Capability Tunables >> @cindex hardware capability tunables >> diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c >> index c7adbccd6f..f9d8cdfd08 100644 >> --- a/nptl/allocatestack.c >> +++ b/nptl/allocatestack.c >> @@ -369,6 +369,12 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, >> if (__glibc_unlikely (mem == MAP_FAILED)) >> return errno; >> >> + /* Do madvise in case the tunable glibc.pthread.stack_hugetlb is >> + set to 0, disabling hugetlb. */ >> + if (__glibc_unlikely (__nptl_stack_hugetlb == 0) >> + && __madvise (mem, size, MADV_NOHUGEPAGE) != 0) >> + return errno; >> + >> /* SIZE is guaranteed to be greater than zero. >> So we can never get a null pointer back from mmap. */ >> assert (mem != NULL); >> diff --git a/nptl/nptl-stack.c b/nptl/nptl-stack.c >> index 5eb7773575..e829711cb5 100644 >> --- a/nptl/nptl-stack.c >> +++ b/nptl/nptl-stack.c >> @@ -21,6 +21,7 @@ >> #include >> >> size_t __nptl_stack_cache_maxsize = 40 * 1024 * 1024; >> +int32_t __nptl_stack_hugetlb = 1; >> >> void >> __nptl_stack_list_del (list_t *elem) >> diff --git a/nptl/nptl-stack.h b/nptl/nptl-stack.h >> index 34f8bbb15e..cf90b27c2b 100644 >> --- a/nptl/nptl-stack.h >> +++ b/nptl/nptl-stack.h >> @@ -27,6 +27,9 @@ >> /* Maximum size of the cache, in bytes. 40 MiB by default. */ >> extern size_t __nptl_stack_cache_maxsize attribute_hidden; >> >> +/* Should allow stacks to use hugetlb. (1) is default. */ >> +extern int32_t __nptl_stack_hugetlb; >> + >> /* Check whether the stack is still used or not. */ >> static inline bool >> __nptl_stack_in_use (struct pthread *pd) >> diff --git a/nptl/pthread_mutex_conf.c b/nptl/pthread_mutex_conf.c >> index 329c4cbb8f..60ef9095aa 100644 >> --- a/nptl/pthread_mutex_conf.c >> +++ b/nptl/pthread_mutex_conf.c >> @@ -45,6 +45,12 @@ TUNABLE_CALLBACK (set_stack_cache_size) (tunable_val_t *valp) >> __nptl_stack_cache_maxsize = valp->numval; >> } >> >> +static void >> +TUNABLE_CALLBACK (set_stack_hugetlb) (tunable_val_t *valp) >> +{ >> + __nptl_stack_hugetlb = (int32_t) valp->numval; >> +} >> + >> void >> __pthread_tunables_init (void) >> { >> @@ -52,5 +58,7 @@ __pthread_tunables_init (void) >> TUNABLE_CALLBACK (set_mutex_spin_count)); >> TUNABLE_GET (stack_cache_size, size_t, >> TUNABLE_CALLBACK (set_stack_cache_size)); >> + TUNABLE_GET (stack_hugetlb, int32_t, >> + TUNABLE_CALLBACK (set_stack_hugetlb)); >> } >> #endif >> diff --git a/sysdeps/nptl/dl-tunables.list b/sysdeps/nptl/dl-tunables.list >> index bd1ddb121d..4cde9500b6 100644 >> --- a/sysdeps/nptl/dl-tunables.list >> +++ b/sysdeps/nptl/dl-tunables.list >> @@ -33,5 +33,11 @@ glibc { >> maxval: 1 >> default: 1 >> } >> + stack_hugetlb { >> + type: INT_32 >> + minval: 0 >> + maxval: 1 >> + default: 1 >> + } >> } >> }