Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1075597iob; Wed, 18 May 2022 21:29:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsxDtno6zR3Jqlzxny5WEuR1SqT9L9RcwShqA/kjZS8Ns5ZcJ49fvl9TLs+yrgMpNn7PJb X-Received: by 2002:a17:906:9749:b0:6f5:38d:d4d8 with SMTP id o9-20020a170906974900b006f5038dd4d8mr2523787ejy.405.1652934589546; Wed, 18 May 2022 21:29:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1652934589; cv=pass; d=google.com; s=arc-20160816; b=t0nlxJo7nol3suVXV6CA29Y3MvVn0e8VAhhzqk/2L61cniT6EHX+ST/vOKoXP4pYnj pvOACV0o4yqA7uiBnMgun3HmWepXWKIJf1WaOl/PtF1mnGWvJYnJfHgDVcFDDcbctqxq WiDUnLsbmj7zm06uKS/DOEuEzYKcHQplagt+G/77YaPNtexerwsBmsXiuMy8j+t+ilTl LyQRBFXU2QEA7rHCqLH10XaT8G2D5o8wBQNBl1SYHDoERzuF7APyWhGyO6/3DuH6z2KA hTu/TClGxN0ecvLDWE5/MSJLnP0QY7vAiw0SA2OqYpYcV/u8UKenHiFHbAcEJMkT4Dcw +kcg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature:dkim-signature; bh=3E/O8AuINLgANbErtoOw7Y85IDi/sCQml8Xl8teHJJ8=; b=a8R82p5in9NQ37M5Y/ifvPstjKfr3Yr8w1PX9ic0oWXJE6nFphFlDR3Nt9M6L4u7kA YDvxy6tJ+0vtgSy4xg+74o1KeQPkL/juvYEIfPTOHIcml1Ug6/bzfreU7I92DG1JeSlq lEtvJDCN/VCl87HLYXJad+LroLXCAb8/MmiENmrdFnMIqT9cchC9GrDZ5VxntJqFVrak HinAIHUU0phG75WQTa52gPT7GUHfUCu8EjR5JOqDZ5greKDZFHvFJMb7PRVAjush4InV vDgGBVtnCm5XmchGJRK3oSQX5hLnSCEzW1ZZ1f15+1liMeCER2lpS3fRJXsToNKiGwRd 1nXw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=Dqc5tamm; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=kRjKv0Y9; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb40-20020a170907162800b006df839dcf36si4358127ejc.110.2022.05.18.21.29.24; Wed, 18 May 2022 21:29:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=Dqc5tamm; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=kRjKv0Y9; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233248AbiESDhI (ORCPT + 99 others); Wed, 18 May 2022 23:37:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233239AbiESDhG (ORCPT ); Wed, 18 May 2022 23:37:06 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C47A692AC for ; Wed, 18 May 2022 20:37:04 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24IMIlMO005301; Thu, 19 May 2022 03:36:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=3E/O8AuINLgANbErtoOw7Y85IDi/sCQml8Xl8teHJJ8=; b=Dqc5tammtL7GcHC2z0dg1c07YIee99qjegH3hwrM5uMFoAvJRUBtO5aVAV9vk5dsbfYD GNizgx3V3Z6yUxYoo/IsYUVUo0nHnWMj4UdjtzTPB85y0Dh+56JNv4/2aJ7cdB86p4tI G9+JinYWO8esPF9uv0lbcO8+y7r4PiE2y6SGc1dnY1R1sKqMZj/UWX2HYBbaMY6VagR1 qzHfqmlT5kwLd7bWrUh+VmZf9fG5TrU+u6aur9vyD15Nmsn8njdhE4pKDgNOakCFS3SG 32juBjI9dcAtKJepGLjnPYgIBb/tAkZFPB2Vc60xBLYJ4jzv+paB2oRWlHHEfodptp8u DA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3g2372378v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 May 2022 03:36:50 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 24J3VbU4027222; Thu, 19 May 2022 03:36:50 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2171.outbound.protection.outlook.com [104.47.58.171]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3g22v4kbds-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 May 2022 03:36:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KyavpUGvQ5jsOZTmaO/rakaTP5ROfSC489Fmg86PDKML1M94QZQORiA60aPf26SFcDvhkqfkTZezqgVTKH1UoHVWzqGJlE6gqeyefpknPc4yJcQ+DmpHIv3pREnnTihZAHfy+6QRcXWZK2Ng/mIIa6yC76FZJwtQX/1e4+HMqIdAo1MZhCN8EcXaC00FVDE8popk7oOsxJVCJSIj7i8G0i04YQdkioL4ixtfT/SSZq2QLivuojpSj/q0v9bBaKLnMZfAkuDywNqhj5sPNucbzItrixhpM04lsc4uevITDIVFv40UockP06Dfrf4z1akdYh0enIoGCWZ3X7qoFQ5TCg== 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=3E/O8AuINLgANbErtoOw7Y85IDi/sCQml8Xl8teHJJ8=; b=KdDMvSfDV2Dht9LFJH2yG1YDYzaN+H/G7SusibnLYKJIWm2fSDuzpARKKL11sr8Al9jALoKZp4yQ1heD9Q9Vtoti92zRWLp/WaW0Del9FfnA08GvTzEuPDyJ+KtAYH27TnAUwvCWyb7FjDbEOcUwGWtjfzxfNVdmGgQwuVZBKtOlOvL4te+7UYvwnRf1CKUm+gnCl/NQq1HoYfXedBVF8qizaqg7cjRdMfqg6gTVVFK4jlOmZvhwDeaWbScXr2MHorrZPo0Oa3Jg2oK7jHl2Hs2xJgB9rDwIXNmYx8gamTfTg1S8IBQDDPBc8bb9FFeUObCOMN6tAGee14F1aSQxUw== 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=3E/O8AuINLgANbErtoOw7Y85IDi/sCQml8Xl8teHJJ8=; b=kRjKv0Y9WW/uQhSWdeGEFBQczZshwZwr7G8Lm/7cL04JPPDpi77ObsZTwCzZkQtv5/hjBx9SKo3FNHNPPPtTkLWJPm/fYVyVw23Rsp11EQht/dwtn/ob6Lv72yr7/G6APrEA04gH1cuyUF1mwMEpI3slb0vCVGeo5UNYva4VlRw= Received: from BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) by DM5PR10MB1882.namprd10.prod.outlook.com (2603:10b6:3:10e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.14; Thu, 19 May 2022 03:36:48 +0000 Received: from BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::2125:9bb7:bfeb:81f9]) by BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::2125:9bb7:bfeb:81f9%9]) with mapi id 15.20.5273.014; Thu, 19 May 2022 03:36:48 +0000 Message-ID: Date: Wed, 18 May 2022 20:36:46 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: vma_needs_copy always true for VM_HUGETLB ? Content-Language: en-US To: Hugh Dickins Cc: "linux-mm@kvack.org" , linux-kernel , Michal Hocko , Oscar Salvador , David Hildenbrand , Naoya Horiguchi , Peter Xu , Nick Piggin , Andi Kleen References: <872b743d-ac21-59a3-bd31-109229f63112@google.com> From: Mike Kravetz In-Reply-To: <872b743d-ac21-59a3-bd31-109229f63112@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MW4PR03CA0035.namprd03.prod.outlook.com (2603:10b6:303:8e::10) To BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 420197c3-bb07-4305-a3e5-08da3948cde7 X-MS-TrafficTypeDiagnostic: DM5PR10MB1882:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AuTXsiKir4IcyGz+Pk+pw3eJZxPPcF7K8aKzFWE6pvylKeY9OgPlNEJ6iiU6Vb4LhytJ2ioC3FZD2uAm19rJYiltPojftJ5MvIgerVAkhla8Ya91uTjxOxvY+q6ENvGQtvK4tKL5yJECSYcS2c6jtpl8k/MViTzuqPhEkOqWskMWCmGxJBOsxzVGVK5A+H4mjt6ucinJyJlW2szj/dEFkYZUY/Irk3LJOrVH0H+2tl5tqsNCrL0ndL+nUiIYYJjtSbGM+aX0vbuB1m47j0icI+w9TdBg1DaJbfY0bvMugMc4aCq42OUbTC0ziRHm7XejFsKVHtUK6F67iTZA1PLs3WnDKt+7/bfOMqWZrDetAQixL7dKjL6LFu78FumA5EMQU00C2yqw7RC9FZKava1kwLgtx6NufkKGZE9ac3DlHKkOCwVq7UA5WZM/lvRQdptP+ZmQ9ohOT+R3chSKIMr46+Ge/QkBsL6jQVjvcoRG/CwmOEYC92BypxeftBC0eE8thtqIEkx1ZS3XLBQKOyqcTUwVijrU7J1t65ahZr1FpqGTSFqp5iJyqcJk5gHtstd7PzhtFawrnXXPHf+9WEefAZvgQBtfLEW6mUmXyHQdiOsEpbEB7RyqMHv/kMPsf8tp1ox9Bhxrs4mqc9cBq4Mdy8icpm4v8GkFp/7lvT/Pb4hwD41IP4hRZXmfB/iFAG4vEAjftQ2YC73iJ7XjFsPHbKlonJeXe1tbeZVGoklT0B/IBiesfenB/8SmaUaf6npxIHDHF1IbrRIc8DTyygD7/7sabV/ThNJ5fOyzNCOA5xKO/Anpnoo3q7xFDt7AYzj6SEjcjwtPxUqWeL8k6Spdo3whqQJKNIwd8IcwQ1xtyiQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4196.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(2616005)(8936002)(31686004)(6506007)(6486002)(508600001)(83380400001)(5660300002)(2906002)(36756003)(186003)(86362001)(66476007)(38100700002)(38350700002)(8676002)(4326008)(66556008)(31696002)(26005)(6512007)(7416002)(53546011)(54906003)(6916009)(316002)(66946007)(44832011)(966005)(52116002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RTZxaVJxTFB4OEo0TXdiZXFWSVNEV1ZEQkt0MGJ5WXZ3SVM3MnJIQ1hrTGdN?= =?utf-8?B?VE1ubXgwcmlhdUMwYTlLNmtUaFpGV29jMG0waVhqUWVrSFVGVjFkeEVzamFD?= =?utf-8?B?TGFnT1M0bXM1dG0xMHRGeXRubUJFSFBVVHFEZkN0WDhXNUFtd1BlUGhXNUNZ?= =?utf-8?B?UGVzOXpBbWRxWWZXcjVHZ0VTRmFlVFBxZGNKVUhTYktOZmtDNFRZSTU5Wmlp?= =?utf-8?B?bTl0ZFp6d0R5enVTaW1KdnVBR0RwMjJLMFk4NWdPd2ZSKzFYM1NMQXVhMm9n?= =?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nOXVGaFRPcVNE?= =?utf-8?B?ajgrd25sd0t1VWp1d0pFYkZ5UG1jZTk3dHQwYTJhb3hzdkd5UDVKa09oL2xz?= =?utf-8?B?bS9jWFdZM3RxcGRMZTFFVFNRMzRqZXg3MTJ4UmdpWHM1a3NLNGhpL1VMMlQz?= =?utf-8?B?Tkpub01TY042aC9pNXdOK1M5WFQyK1paK0VJbkxCWlZIVm1YMjZ6Qk8zSW1j?= =?utf-8?B?eDUyc3o5djlTVDkzRWU5ZXB1T0VOZEFWZFBXa3ZEYytPUEd3ZFUza20vdUpr?= =?utf-8?Q?/KXK8bOlkT8N5zno=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 420197c3-bb07-4305-a3e5-08da3948cde7 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4196.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2022 03:36:48.3159 (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: yRKtiSzc3E1BDEF+aav7zA+jnaDrzJZebeWSLeCl6SYebdHTECvshxW5ssmcxxtza8gYQUKBc/kH2x+UvMDgJQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR10MB1882 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486,18.0.874 definitions=2022-05-18_06:2022-05-17,2022-05-18 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205190020 X-Proofpoint-GUID: jG1ckxSuBB_GwdrgNgiBcBnH4c8ZQWJP X-Proofpoint-ORIG-GUID: jG1ckxSuBB_GwdrgNgiBcBnH4c8ZQWJP X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/18/22 18:30, Hugh Dickins wrote: > On Wed, 18 May 2022, Mike Kravetz wrote: > >> For most non-anonymous vmas, we do not copy page tables at fork time, but >> rather lazily populate the tables after fork via faults. The routine >> vma_needs_copy() is used to make this decision. For VM_HUGETLB vmas, it always >> returns true. > > "vma_needs_copy()" is *very* recent coinage, not reached Linus yet. > >> >> Anyone know/remember why? The code was added more than 15 years ago and >> my search for why hugetlb vmas were excluded came up empty. >> >> I do not see a reason why VM_HUGETLB is in this list. Initial testing did >> not reveal any problems when I removed the VM_HUGETLB check. >> >> FYI - I am looking at the performance of fork and exec (unmap) of processes >> with very large hugetlb mappings. Skipping the copy at fork time would >> certainly speed things up. Of course, there could some users who would >> notice if hugetlb page tables are not copied at fork time. However, this >> is the behavior for 'normal' mappings. I am inclined to make hugetlb be >> 'more normal'. > > Good question, not obvious to me either: but I've found the answer. Thank you Hugh! You went above and beyond as usual. > The commit was of course Nick's d992895ba2b2 ("[PATCH] Lazy page table > copies in fork()") in 2.6.14; but it doesn't explain why VM_HUGETLB is > there in the test, and goes on to be copied. > > I haven't re-read through the whole mail thread which led to that > commit, but I think you'll find the crucial observation comes from > Andi in https://lore.kernel.org/lkml/200508251756.07849.ak@suse.de/#t Sorry, that I did not find the entire thread. There were only a couple pieces on linux-mm and that is the only place I looked. > > "Actually I disabled it for hugetlbfs (... !is_huge...vma). The reason > is that lazy faulting for huge pages is still not in mainline." > > and indeed, look at the 2.6.13 or 2.6.14 mm/hugetlb.c and you find > /* > * We cannot handle pagefaults against hugetlb pages at all. They cause > * handle_mm_fault() to try to instantiate regular-sized pages in the > * hugegpage VMA. do_page_fault() is supposed to trap this, so BUG is we get > * this far. > */ > static struct page *hugetlb_nopage(struct vm_area_struct *vma, > unsigned long address, int *unused) > { > BUG(); > return NULL; > } > > Oh, and that pretty much still exists to this day, to cover that path > to a fault; but 2.6.16 implemented hugetlb_no_page(), which is what > then actually got used to satisfy a hugetlb fault. > > So the reason for fork copying VM_HUGETLB appears to have gone away > in 2.6.16. Yes, that is the likely reason. Functionality was not originally supported, and when it was added this 'optimization' was not enabled. > (I haven't a clue on private hugetlb mappings and reservations and > whether anon_vma means the same on hugetlb, but you know all that.) Yes, I believe anon_vma means the same on hugetlb for this purpose. Although, I do need to look closer just to make sure there are not hidden surprises. Thanks again, -- Mike Kravetz