From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D810BC0219E for ; Sat, 8 Feb 2025 16:03:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6C5B6280001; Sat, 8 Feb 2025 11:03:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 675CD6B008C; Sat, 8 Feb 2025 11:03:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4C81E280001; Sat, 8 Feb 2025 11:03:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 2A6C06B0089 for ; Sat, 8 Feb 2025 11:03:01 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id D196BA2763 for ; Sat, 8 Feb 2025 16:03:00 +0000 (UTC) X-FDA: 83097246120.12.31BBEB5 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf29.hostedemail.com (Postfix) with ESMTP id 6548C120007 for ; Sat, 8 Feb 2025 16:02:57 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=Wh+bffQe; dkim=fail ("body hash did not verify") header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=JPGnK+GV; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); spf=pass (imf29.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1739030577; a=rsa-sha256; cv=fail; b=Xvz5yIBegxSejIok+/li4enxdi+YI+QWAuUK8ZPXWMYwaaG0ZqrtyAhHCAFCxIYws05gRC IIfZqmfE02FzPFzuXFo8f8zlozVRcMJltMReMcYRR/+21/BlDzOufgvvynLeZa3wmxCyKE rA8xBNjUFDshpL28FaWKH5DWenEsN/U= ARC-Authentication-Results: i=2; imf29.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=Wh+bffQe; dkim=fail ("body hash did not verify") header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=JPGnK+GV; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); spf=pass (imf29.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1739030577; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=QIHOcm7FCNCPg83B2FatFbqq8hEpdlymofRnVvXnais=; b=23hUauHDuVWCsthOi3bfGTF+DWv6PeGceInUJQZZUvXEf8cGAlAOH9ClAg4qqtAiTm4OUn CwGvy2R6ltYArTDcyDwGSOk/PFyWyHxqkcYV+s6DH+eXee0KGgqw6c9IwxUiobQOuueCDp XVVn/u9wqcw2Tn/E7oWt4DzXEUhUues= Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 518Dfdb4006498; Sat, 8 Feb 2025 16:02:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=QIHOcm7FCNCPg83B2FatFbqq8hEpdlymofRnVvXnais=; b= Wh+bffQeWNdbTyW+9KEroTGr8OaGAjJuzeowuOSNFzr0I1vsL6A4NFzARnf1QBnO kCeHfh/tjb2sNXZhTDIVob0BwrLHM2IK4myfweSxI1wKMvIQimk+X5SPpT/kXfr0 f+KVsVrxulLyTTZ181jO0qv8ZqMTpIWL2cN2KIkk8M9l2Ro1kOHEOTdJ/7Dy6tr8 WaxQezJL4vl/2YSppQppd9gxBwmUMELjDeiiZuAygZylpfi8FcadgUTL63J6srxe EX11TubQO9u312VeMhdsuZK4mgHYWNzAJeOimIZK+LFnrMrZGHtfUKT3COlKZ7aQ 5qwYj7vnBFBqSlUtgw1ZEQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 44p0s3rbtq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 08 Feb 2025 16:02:54 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 518EblrC003963; Sat, 8 Feb 2025 16:02:53 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2049.outbound.protection.outlook.com [104.47.55.49]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 44nwq5ws9b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 08 Feb 2025 16:02:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KA5i56xchP8v4zpHPEyoRGmdLbybe4AfOv6Soy+x0c7omh6uHhaYSUVcCzxCVeoBEcks46lx6eevZebvHQjno16gFH1jWSBHih6Ma/Drv+XuqvaFdn2DCJdIC6tD+xW/soeo2g/RVxakFTB9Ggd13E2hA5fJJ4mUgKy/XOKl2cdt4y2bDDtAsP3UjyTygHnq4ksOQTrgMwgON+m2k/ID/rLeoalC2M9qZ86tVb8M0oKYGvx5BiEbX++bsQvhOXrG1+2GwbCk+s8C5OvPlyMMDVBvWTg/sHJeoOe8Sl6aJtOT9TOXWXJFwnhfGcQ4dFAS8otfIUXnVb+Sw66YDROA3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=NW0zqTmQfKKS0fT/uVmNw7SSqjwXk3Cfr0tOO4priqs=; b=fmVFDCiuKjze9lKWgKlBFyaSmsFDXNvIJDE0Vcc/HiME424UbD10zPv99OZVsE3gQIl51kkOWopIS/0dj/Fa7MPvp8IIlVj0Cwf9SxMX4oIgwB5Uf4R8f0IobkFTpvxT39T7j1r2Yx71owcMO0KpPCCLLcjdCFYFdBRV9cHtPD3a4XK95JK4VPbatwtJOPh+HlY/diWmEGjDlxkN/DWL+sQYTRU+G+9si3QiIy4xxXkQD5kZ/C/rmC5yespH6nTpACEYh6NqMWQfLH7aiAiUy+OCzLeCKvtc3TmR5+szAkbs3kmG7nz4WcTpjaU8S/8P6sIG5qUklWUK+8j8lwjjUQ== 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=NW0zqTmQfKKS0fT/uVmNw7SSqjwXk3Cfr0tOO4priqs=; b=JPGnK+GVQHz5Jj2ONKxKZF9qQYiPLXY6Vkwrx3pELcVD7s/RcYSkR89m1+egxE681/IZ2GUnOY5Mjt/igBOZyz6WVdQJnZytux/SEy193HFMFWO/mPrjLleG6g0DFgJPTUsuFKRPfEU05v46LwReW1gcVBoWlkiyhEIWG0zy/j8= Received: from BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) by MW4PR10MB5881.namprd10.prod.outlook.com (2603:10b6:303:18e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8422.12; Sat, 8 Feb 2025 16:02:50 +0000 Received: from BYAPR10MB3366.namprd10.prod.outlook.com ([fe80::baf2:dff1:d471:1c9]) by BYAPR10MB3366.namprd10.prod.outlook.com ([fe80::baf2:dff1:d471:1c9%4]) with mapi id 15.20.8398.025; Sat, 8 Feb 2025 16:02:50 +0000 Date: Sat, 8 Feb 2025 16:02:47 +0000 From: Lorenzo Stoakes To: =?utf-8?B?SsO2cm4=?= Engel Cc: Uday Shankar , Muchun Song , Andrew Morton , linux-mm@kvack.org, "Liam R. Howlett" , Vlastimil Babka , Jann Horn , Oscar Salvador Subject: Re: [bug report?] unintuitive behavior when mapping over hugepage-backed PROT_NONE regions Message-ID: <82afe852-4098-4eea-a646-37beab88604f@lucifer.local> References: Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: LO4P265CA0071.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2af::13) To BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB3366:EE_|MW4PR10MB5881:EE_ X-MS-Office365-Filtering-Correlation-Id: e723f1b4-a52d-4cda-99fc-08dd485a09bb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: =?iso-8859-1?Q?3zRyopKNxiKNF+xwvGiskZES+/mD0eiirtbj51oOeYquWTaVG1FFiIDcHp?= =?iso-8859-1?Q?5njL+Bl+rWXWoF8ZKKk3i8S0Xd2fAxNog+ynDTEBKZNamOV4ULGx+kH8cc?= =?iso-8859-1?Q?C76RodjfCkD64sB4FfaPMX/fxNxgcLU0RRedPmcJrKOtMMYceEn1bxvBbw?= =?iso-8859-1?Q?iV6BbkPncAsuwWmGnnwmRnXTyF3fFJDvwsFi6zu22Vq3UBX1EL0y00R4JC?= =?iso-8859-1?Q?JlKyFhzxr93ZuRE1/5Ho12JFVKrIGtjB3qOb7PfKR81Ydq1ckKKjF0vRVC?= =?iso-8859-1?Q?Ce66RtNNA0Lf8FAYzwRyABnz48LnHSHLsvY1BJe3QX46+tS9Wvr8SwF3tr?= =?iso-8859-1?Q?oZWfjOMncSnEVN3+KOKd8VDB0/4hA/L+bCmhVSj4Ct49+VPub2VV0FOqvQ?= =?iso-8859-1?Q?08vr9ccsWycm7JW0ULlaFm8vFNAh4JWrucG6wL1YxrfauRQU8T2LpFalXw?= =?iso-8859-1?Q?Q7h8irUEEOp+Pm48gGUbLdomXkgIW8JLX4XceHT9xmPNQk8s4j/5YIcY7U?= =?iso-8859-1?Q?GUMpoPXZ8anNHX44YWyMWxj+eQYRub/W8Ec5v2dKlaDJ9GWP6U+669CNn8?= =?iso-8859-1?Q?SGi2Va5Vzj61DzHD4vDKyHhKBpFZ4zxCAbqa9OlpsSxU9flmMrJABGfUb4?= =?iso-8859-1?Q?Ft2Jn6UQ36EClFEugq8gmivP+g726ptv8A+pcscbCuf0XvJIAog7eoi9AS?= =?iso-8859-1?Q?s2aqUY3cLTfLuDEDnwzQN3qrRszFOcxlr0B9+zRzQttekWaS8I7gj+noSQ?= =?iso-8859-1?Q?ZmaqWv2v5wm/mMNUlC6tHRvBPsk4b+FILkLUy8fk8ItUBVIfml7GEjqfOu?= =?iso-8859-1?Q?6DEwNGKs/NuzUDKEvnQ/MKyZGitDlks3MIKz/BlghWBJ0/DAQQ7TycD4Pe?= =?iso-8859-1?Q?4MlvjW1v4vjL4rQiH0Hxn0SD12U8VUlJ14A6AeQCkRGBLMWtFF2+7UpDbE?= =?iso-8859-1?Q?Jm/6qWeVWPFY/+FV7MDl+9DirmTmGScG4BJUkDAd42HKfxa3KU/pwYXPbC?= =?iso-8859-1?Q?VLWzGlrQEtAX6Tw9pJ+Zlahij6rTyVzKkNu0QvOeI3BPvnqOi3D25TG41d?= =?iso-8859-1?Q?QtGO753C2eGLQWLUbIKD6yCXkhqgUvfVzBQtXa2Ag1kJtaDYVIT4nl9TuK?= =?iso-8859-1?Q?J8CRmKOKa41jWEV6/bFJ5Q6WrJmvnrQUXEQ/yp/aJzjBc3QYrNEhYt72vm?= =?iso-8859-1?Q?WMquOSckSslotVvgd/c3x0sRfIYUCMcD9629lR6mSl1X4+lv5ySw8pEMkZ?= =?iso-8859-1?Q?WgoIh7VSzfcA4vLFqMVi1HAJGO4KBH/E7w/XYwksxKRfkWmGyd+iFBXo0v?= =?iso-8859-1?Q?ew/Y2QY7tgWitne/wHdoEk7iYXzZw5O9Aw8M7vGJbJiB6oNIjbxf4oO8ie?= =?iso-8859-1?Q?syBicwkGQeEEgZ6s0ZT29PGAeFeYkiQV+ymkJCPqTHsS68P3Q/FMo71fbV?= =?iso-8859-1?Q?PWzApA+5qWZW5a2X?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3366.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData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essageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 9i8MbrzGDwmf2wFqhxMhCVhgxFHlHP1gDE88V3ok8xtlJvBaJg6K0UFDHkBH8PI3M6Hd68FRTmoPW35fuyASi0/ty9OR6VYr5Zf02jAV/vaRJR3Zrihet5qFovlyL7RtcUZHt6lr5GJ+oGMQlTW5Sy2prp54N6cFqOAkWi59lJctTJeXIXojQ7QcHLCwZFIKRCisa9rHAliq3LGwVLBpz77ltIpLeg+zeZBEiFXI6f9P5fLWN7nRx8d7aeVxO/BZYvlSAQ8MuVEw3nNbB6O89olEDcnAvQMV0lqxyhGyagYE6UrJn78Xqu290+7PVRduIUpJaMnkJJZNC6MGkj3bBo3EBxA9qRKnBna0wZf+oiok/ehu1lYeso6pkS93D48BxY5tCcKk35jtx/oXxzQMmlQY+9wrxjOGNPujU0JpuZH5KjUdeNNIoFE99tGyUMkETabFGbSudrjn+PG2nfuWqq5fC4y+xfz21d5ZKEYFwVxhAcrLQ935XwD6ngRTsEKpU8olhECVxfXs2UGOqaBo6rn5oS3sPg9vUu/Pyw0hUZc8TXbBdXscq4UvXCKseom6W72uU4WQKs3GdkW7woqPW6wx+6xZPCLZMIqSVtn2Wok= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e723f1b4-a52d-4cda-99fc-08dd485a09bb X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3366.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2025 16:02:50.5158 (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: UptgHcXbrDg1vobRsXDNbo3+KpqbZCS9qc02XEQVJJETCNcl097aBc6GWj3j9eoByhMN5JND5RUfrFF0Q1+ndZAyiRsJ8VKIU/cjGkjIjp4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR10MB5881 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-08_06,2025-02-07_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 malwarescore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2501170000 definitions=main-2502080134 X-Proofpoint-GUID: oX9k-kCmw17uYUeguHWi6oifKjQ1ypQH X-Proofpoint-ORIG-GUID: oX9k-kCmw17uYUeguHWi6oifKjQ1ypQH X-Rspamd-Queue-Id: 6548C120007 X-Stat-Signature: dxjsqfj9sz355cz3c85sqbtwt8h6xbmd X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1739030577-12789 X-HE-Meta: U2FsdGVkX19HjnPl2DctE1zQXz22948he19FH//gXUXiZY8LJQLKx53w9Di/5K1Fh9zaO8DKW0oGk5t+7BINEhLmjFKmgR/FstifYZw7yEmVmc6SJ/ZQKaf7fZzYGd4MLP0VMToIXw4/K3EI0GgX3m/gFD7Sn5wf+91+9/aGj3JMYWS0PyaJJ0dqF1aufqTfIXFjVpoTs75UFgy6SQrhiEr8G9BN1rZaIC2FgtQ7NFO27yCBQ1YWoSqdL6cizh3z41li64q1t9HQwkYg0tEmt+fQoQ/Ji/FcjXPBUakhRdrAP0N1Ce3vUnALhVpFfYOwjXD+uUmuAgsjJv81qM2mbDhX9VR1gEJKNe/qnC5ezKpbB6EeJpe8bSHA+amlaJRdPQQujnWtOk4fiP1KNyfwwMj4qeZ/RIYZBKvKa0cH8r4Y5MqyPlxj0iz6CPSmG98/O6fPJ+gq3To3aRicLAdoiVhjoPKgU/sWgYj9OXnVQXHqGEvqIMgV150UCj2xqS43eY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iHnQzIXbjs/4n064nlSNaCHhWtwWkw6mPo1FQa1VPsbgluHNsQapP/P0NOgrKJmUNyWb0PJWD26s4AYG8qHFmaeREMIoBr4gSywWgbBg0cGYIvFBgjySjSJ8i9i5uTcY4Bt4eEgao546KDI/3wqu4ZmdwEOVe0VYnZh85IaekXfFD5fscPftLGUkJ7PetZ8r9nkEm6ghJHDeKAneDKsEEp5w2byY2 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000546, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Fri, Feb 07, 2025 at 11:35:40AM -0800, Jörn Engel wrote: > On Fri, Feb 07, 2025 at 01:12:33PM +0000, Lorenzo Stoakes wrote: > > > > So TL;DR is - aggregate operations failing means any or all of the > > operation failed, you can no longer rely on the mapping state being what > > you expected. > > Coming back to the "what should the interface be?" question, I can see > three reasonable answers: > 1. Failure should result in no change. We have a bug and will fix it. > 2. Failure should result in no change. But fixing things is exceedingly > hard and we may have to live with current reality for a long time. > 3. Failure should result in undefined behavior. > > I think you convincingly argue against the first answer. It might still > be useful to also argue against the third answer. To be clear, you won't get any kind of undefined behaviour (what that means wrt the kernel is not entirely clear - but if it were to mean as equivalent to the compiler sort 'anything might happen' - then no) or incomplete state. You simply cannot differentiate (without, at least, further investigation) between partial success and partial failure of an aggregate operation vs. total failure of an aggregate operation based on an error code. > > > For background, I wrote a somewhat weird memory allocator in 2017, > called "big_allocate". Underlying problem is that your favorite malloc > tends to do a reasonable job for small to medium objects, but eventually > gives up and calls mmap()/munmap() for large objects. With a heavily > threaded process, the combination of mmap_sem and TLB shootdown via IPI > is a big performance-killer. Solution is a specialized allocator for > large objects instead of mmap()/munmap(). > > The original (and still current) design of big_allocate has a mapping > structure somewhat similar to "struct page" in the kernel. It relies on > having a large chunk of virtual memory space that it directly controls, > so that it can have a simple 1:1 mapping between virtual memory and > "struct page". > > To get a large chunk of virtual memory space, big_allocate does a > MAP_NONE mmap(). It then later does the MAP_RW mmap() to allocate > memory. Often combined with MAP_HUGETLB, for obvious performance > reasons. (Side note: I wish MAP_RW existed in the headers.) > > If memory serves, big_allocate resulted in a 2-3% macrobenchmark > improvement. > > Current big_allocate has a number of ugly warts I rather dislike. One > of those warts is that you now have existing users that rely on mmap() > over existing MAP_NONE mappings working. At least with the special set > of conditions we care about. I guess you mean PROT_NONE? :) For the case in the thread you would have to have mapped a hugetlb area over the PROT_NONE one without MAP_NORESERVE and with insufficiently reserved hugetlb pages, a combination which should be expected to possibly fail. If you perform an mprotect() to R/W the range, you will end up with a 'one and done' operation. I'd also suggest that hugetlb doesn't seem to fit a malloc library like to me, as you rely on reserved pages, rather wouldn't it make more sense to try to allocate memory that gets THP pages? You could MADV_COLLAPSE to try to make sure... However, if aligned correctly, we should automagically give you those. > > I have some plans to rewrite big_allocate with a different design. But > for now we have existing code that may make your life harder than you > wished for. > > Jörn > > -- > Without congressional action or a strong judicial precedent, I would > _strongly_ recommend against anyone trusting their private data to a > company with physical ties to the United States. > -- Ladar Levison >