Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2911030iog; Mon, 27 Jun 2022 05:35:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vIkWDESWwP0zzzvv+CZ4eBpECFP6ez3p0MxWguHfhBtI8USTMXEKo0OuCrPkKbUuANgSJu X-Received: by 2002:a17:902:f602:b0:16a:178a:7b0b with SMTP id n2-20020a170902f60200b0016a178a7b0bmr14198798plg.20.1656333353830; Mon, 27 Jun 2022 05:35:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1656333353; cv=pass; d=google.com; s=arc-20160816; b=NlPKvwmNU04Gg6YABvAJ/UBbaxO8S3uvTZe+w7JXyQ0ATxVFyEhUG+61koUpAzDEAk 0GEXBtSLmRg7kf2OuG5zE9qx27RT/UteYuYMRA0D23/J8CREoOFEfeAQzboEJY0bJQwG tu0Q5s5eygFFScvr+I8pXdsvvLibY3OTo6dkq2IZqtIEhZh9w6RW078PXE3Vka13BuSS b636q3x9qcLeOPai/fVhs91TtV0MYDaMKAVepNr8bEpEVeLZ9AdVn2ns9YF6v+kMpnf+ /YhUbF58YC5EYu0Bcgj7ckGfZRzwBoHyuwbvJSLYkvZxbnXY/DWVLnrZu/RkBBgia0Vq c9Hw== 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:subject:user-agent:date :message-id:dkim-signature; bh=8gWFmd2uxiMGCfj/CZWLJUF8k6y0zmmD4mwWgulD9Qw=; b=o52vP8RCbAITtGyGrzO2TpIsTXe+CWUKJbjV3rnG9Nk/7RSoxrbmqn4raAIN3/sfKi 6Zjiw+QDfjQh8JmttWulKsNCx9KJ+hJP4LO6SN5wg4p6wCfDTURYMu/pnaG83gmn7vh8 Z644f23cMBp5kVkpQbu2Ps4Memnrb5IBQjufXs5WT6HZk1uwiNgnMVVA/VEdTuTRCPlJ lxzbhseciBFd3HR4vi6AThDNmGAqTmQa08hGgj1FU5RDhXKlvJC2WfzQrivQ1ngL9b0r 56GoLmCMhhyvQJQeYn4UEKXZT9Nl4D+JZSMh6zXEwXvug8F59omuxnxUVd4OPyIiPDiH JyBw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nutanix.com header.s=proofpoint20171006 header.b=R5v1pcQx; arc=pass (i=1 spf=pass spfdomain=nutanix.com dkim=pass dkdomain=nutanix.com dmarc=pass fromdomain=nutanix.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=nutanix.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d18-20020a056a0010d200b0052554bbb4d8si14223991pfu.217.2022.06.27.05.35.41; Mon, 27 Jun 2022 05:35:53 -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=@nutanix.com header.s=proofpoint20171006 header.b=R5v1pcQx; arc=pass (i=1 spf=pass spfdomain=nutanix.com dkim=pass dkdomain=nutanix.com dmarc=pass fromdomain=nutanix.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=nutanix.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235727AbiF0MOH (ORCPT + 99 others); Mon, 27 Jun 2022 08:14:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233238AbiF0MOG (ORCPT ); Mon, 27 Jun 2022 08:14:06 -0400 Received: from mx0b-002c1b01.pphosted.com (mx0b-002c1b01.pphosted.com [148.163.155.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 586ABDEE4 for ; Mon, 27 Jun 2022 05:14:02 -0700 (PDT) Received: from pps.filterd (m0127841.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25RA63w9032477; Mon, 27 Jun 2022 05:13:54 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=proofpoint20171006; bh=8gWFmd2uxiMGCfj/CZWLJUF8k6y0zmmD4mwWgulD9Qw=; b=R5v1pcQx63xaEdcxRTUplgbnB13fBqs+qNT/pnhI2uD9N3qgYztcoGKllg6jnT5ofpmG HAChaO+yCGi1A7XrvGoroG8xuWHdoiHPj26rARwZ8kfRjvSfo7nhHIGsqNmz0aWzJgQm IROMWtXR3iBMQHDpnrp2xe1mh77TRyiHhbgtLXQvnY8Y9y6ytneg27PKkahruPWydtlY XS6KtOPlYDLUAFSn18vJqwoGmmq2mYQesJCnOIbo9ujloYG6k7kb+INHWk1MNvCKQ9q+ g8TmUHD3TdjnrhJYE6jCY5uglqo2TD5aN9PmR2aXSd81paDCONq07jn5VuBp0uSKvEEa hw== Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2101.outbound.protection.outlook.com [104.47.55.101]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3gwyw9kjdr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Jun 2022 05:13:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LGI2sEsnkxCd15DqKT4KNgVQTZKb2G8PAhPi1DOvD1RR5B8cGLAdiAcoKnz9/dW171UVCRZeOXf2dacz8g0qK/Op7YMD3XJ+gqyxRMS1czh+V2aDHcB0L4rYRHTV3XvNz1IWmahoScYzhjCcTX/TipXLAvnMfG4fkPOklE82XBTavB5V1UMUGZs4YUS6WbltRQC7D7Cz6KbQaENWhX+/j0CUm7AB6NtvJJoX3yGdyB+aOTnayuQahWQ1QrKC0h83GV9BpwMxOQ12/8qOAalW4+0PEy6HM+w/agnkqHmBrcEvg7dbs5OEa2IwWEXzlds7FNo4FLz2mgrDvetbnFSE6Q== 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=8gWFmd2uxiMGCfj/CZWLJUF8k6y0zmmD4mwWgulD9Qw=; b=iuC0Ptc63nk8JPsWB8xhOg/f6n9tZiauEimCpmYBG4mPg7YuZuwZubJT4X5WuWO7CoSc/iW7SljgXrGfP4Je01XVBziEiBnhqtQSceTNherIaMbKKkYqJKimbcyaShRLM4UeVORf4ojrdxkwYd8keR1qjp9yoUisclwJBZKEypRx+qIYp/mEH56ruRbcUu03SsqpmbrJSsollB5YIKov6b9xaVUqJ1nEZ+aT/VJgC8Em5iVS6aD7ARkkH2Jt8td798OaSUEi7kJhf36m+21tVBZPA9RMiIEmdSluwqkF+YnFZiUdiBJqDFKveOx4jRm7n3AAT2yP2teZf5Cp3mv2Dg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nutanix.com; dmarc=pass action=none header.from=nutanix.com; dkim=pass header.d=nutanix.com; arc=none Received: from PH0PR02MB7384.namprd02.prod.outlook.com (2603:10b6:510:12::12) by CH0PR02MB8225.namprd02.prod.outlook.com (2603:10b6:610:ea::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.15; Mon, 27 Jun 2022 12:13:51 +0000 Received: from PH0PR02MB7384.namprd02.prod.outlook.com ([fe80::898c:892a:2385:3df6]) by PH0PR02MB7384.namprd02.prod.outlook.com ([fe80::898c:892a:2385:3df6%5]) with mapi id 15.20.5373.018; Mon, 27 Jun 2022 12:13:51 +0000 Message-ID: <4889b697-c962-a043-f2d2-0788a5bd1deb@nutanix.com> Date: Mon, 27 Jun 2022 17:43:38 +0530 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [RFC PATCH 03/26] hugetlb: add make_huge_pte_with_shift To: James Houghton , Mike Kravetz , Muchun Song , Peter Xu Cc: David Hildenbrand , David Rientjes , Axel Rasmussen , Mina Almasry , Jue Wang , "Dr . David Alan Gilbert" , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20220624173656.2033256-1-jthoughton@google.com> <20220624173656.2033256-4-jthoughton@google.com> From: "manish.mishra" In-Reply-To: <20220624173656.2033256-4-jthoughton@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SY3PR01CA0146.ausprd01.prod.outlook.com (2603:10c6:0:1b::31) To PH0PR02MB7384.namprd02.prod.outlook.com (2603:10b6:510:12::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8ac9734f-0ec3-4b37-f64c-08da58367f54 X-MS-TrafficTypeDiagnostic: CH0PR02MB8225:EE_ x-proofpoint-crosstenant: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Za4zA5btTVXMAWsuTbCnon8iUdamprHuTI9AsCoOgkOZP2pTQ3Nwm2azbLWOvCztz4vvGUz9Dx0qI3H8AKt6Tsf7Wu+ds5/k4yCaTKWstfh0Owm11Qr3/KwCBEYIIuu/+0NgVx7KirAVPBSzsCSumsszltW3nBBwi/yDcsz7z8DaOfxdT7AskcF9iNwFtoPL6//baZb5y1eOsk7EAbjQBJg17BjSLI9VFp6emyT+kQvsZW5LPsSNFJ8CWX+ojZeX3CMI0yuGgqmbqwRLVWFpdfg6Hbp0TrjgbNVp5L0BiTW5z8ezC+ZGbZl30HQtrU4xri+rhWjwLSjwZN/hPeCWBlgPPCrNg9sse/Kf19ARM75+pozwT7ZraSGZlb9JMINo7qOsmeL5/GcKU+vT0v3XbOKEnS9jSQte/AyVgd0kJXBxOzMGEBQZucb7RqSLspszJj5kVr4gi+WV5WO/4K6D+qxeyc4Ne+26izTlYTIolHq9KvCckM3P3kkBSs8XpyOv5vEx8Pw73lwI2oJ2+vPUSJD0rzk+pIJXRpnN+ZTv6c/IuPmYL6Wspt/Ckeybo4mpvcu77HLLQDL7CytO+qCESw2q+yYzOMa3RR2tY1eANYYhn4oeWK+gmpR8oN/fOfCIjO63n4pGpL7srjW/EpW/bHppc8hQN/pK2vJUU5JVTSZA1YC6E4rdfcqPe05lj+5zOgBwF6qqgQuycVZfDzKmpe9RRCqeQiLEveE87cohk5GAvMTIEW0b7DSMI3IS3D6A9ZMdwK0GaL/K8Qvv4hu/kNlBrFxoU9CzQq5dO2CisGRF3LFc6A8fgMj1/kyCkwylQBh9EyOBqWgZ54rcriAWaPjkofPudNrQyAJQuf6DFA8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR02MB7384.namprd02.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(39860400002)(346002)(376002)(366004)(396003)(136003)(31686004)(8936002)(38100700002)(53546011)(5660300002)(2906002)(7416002)(478600001)(4326008)(66476007)(31696002)(66556008)(110136005)(36756003)(83380400001)(86362001)(186003)(6506007)(8676002)(6512007)(26005)(6486002)(2616005)(41300700001)(54906003)(6666004)(66946007)(316002)(14583001)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS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qdnhveDdLdHJrczBzV0JScWhEbXNHMXJmUFpHb2E4UGdVRnhZcG10?= =?utf-8?B?Q0sxVnlSUFF5WTgxTEh4c2FVN253VzZOeHRCeHk4ejhYc2pEYkJLT3Z3UzJ0?= =?utf-8?B?VGZtdjZWakZOYXBGbjk5em1raG55a0tUVEdKMEVVQ3pSemRYY3Z3RXlPQWhQ?= =?utf-8?B?YXpldjMxam8rcDNDVWNTOE9VUGJYRFZBcktpSG5CR0FRSVpDL0NPYmNYWGN4?= =?utf-8?B?R2lWaUN3Y0U3dzk5c3BjVnR4TkNRbTVSTzVBSWFGK0owMXVHYm00cEZGenBE?= =?utf-8?B?STA5d3RjbU00KytlVVlZeFNYRkV4dlhVR3E4M0RGcjQrYUViNlBTWXdYMVAv?= =?utf-8?B?c3RSbUFSeWxhUjh2SlFORC9BNkl4dnBIdloyYm1FQjVyN0R6L1VFdmZPYVFW?= =?utf-8?B?Y2c9PQ==?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ac9734f-0ec3-4b37-f64c-08da58367f54 X-MS-Exchange-CrossTenant-AuthSource: PH0PR02MB7384.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2022 12:13:51.7067 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bb047546-786f-4de1-bd75-24e5b6f79043 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xuwnMAZL0rAWBGxk0bABpEGiq8wkROwR2yAslGtLEvEcpJH8B0ZN1u6AslvAOXiueIELakyBdcFkWs0UsD920IHSwbO8ZKdj9ewFrFbAg1k= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR02MB8225 X-Proofpoint-ORIG-GUID: a6vK394OPPHDMCm1qDn86FdeBYKTHN-A X-Proofpoint-GUID: a6vK394OPPHDMCm1qDn86FdeBYKTHN-A X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-06-27_06,2022-06-24_01,2022-06-22_01 X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, 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 24/06/22 11:06 pm, James Houghton wrote: > This allows us to make huge PTEs at shifts other than the hstate shift, > which will be necessary for high-granularity mappings. > > Signed-off-by: James Houghton > --- > mm/hugetlb.c | 33 ++++++++++++++++++++------------- > 1 file changed, 20 insertions(+), 13 deletions(-) > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index 5df838d86f32..0eec34edf3b2 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -4686,23 +4686,30 @@ const struct vm_operations_struct hugetlb_vm_ops = { > .pagesize = hugetlb_vm_op_pagesize, > }; reviewed-by: manish.mishra@nutanix.com > > +static pte_t make_huge_pte_with_shift(struct vm_area_struct *vma, > + struct page *page, int writable, > + int shift) > +{ > + bool huge = shift > PAGE_SHIFT; > + pte_t entry = huge ? mk_huge_pte(page, vma->vm_page_prot) > + : mk_pte(page, vma->vm_page_prot); > + > + if (writable) > + entry = huge ? huge_pte_mkwrite(entry) : pte_mkwrite(entry); > + else > + entry = huge ? huge_pte_wrprotect(entry) : pte_wrprotect(entry); > + pte_mkyoung(entry); > + if (huge) > + entry = arch_make_huge_pte(entry, shift, vma->vm_flags); > + return entry; > +} > + > static pte_t make_huge_pte(struct vm_area_struct *vma, struct page *page, > - int writable) > + int writable) > { > - pte_t entry; > unsigned int shift = huge_page_shift(hstate_vma(vma)); > > - if (writable) { > - entry = huge_pte_mkwrite(huge_pte_mkdirty(mk_huge_pte(page, > - vma->vm_page_prot))); > - } else { > - entry = huge_pte_wrprotect(mk_huge_pte(page, > - vma->vm_page_prot)); > - } > - entry = pte_mkyoung(entry); > - entry = arch_make_huge_pte(entry, shift, vma->vm_flags); > - > - return entry; > + return make_huge_pte_with_shift(vma, page, writable, shift); > } > > static void set_huge_ptep_writable(struct vm_area_struct *vma,