Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2512398rwd; Fri, 2 Jun 2023 10:22:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4G1W1gqq664R+zQGzUpuzKA9/7sjwMsf8i3YdIvGNUHC6YJv0C+NrLN4rIqEgKQXn3mg+m X-Received: by 2002:a17:902:b687:b0:1ac:40f7:8b52 with SMTP id c7-20020a170902b68700b001ac40f78b52mr411660pls.64.1685726548125; Fri, 02 Jun 2023 10:22:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685726548; cv=pass; d=google.com; s=arc-20160816; b=dHmKlf6iB0eEBjutPsWGylXko5ohFS3ieCHbQCAjsnC6hQQBacF6MfysTgZDzLgxn7 TTHWudw29iQLH+XZ99z/xtIKq30dtE72wCQlrA0YAVeW9RQkdRE6VkojPMneKZHVIEu2 jYeOKGV9FLfXGeuIQpe1Sk+aTpeZF0REKFl+G2E7fVRezt4pqKmOoCozIl4mXNoUtwUM mTqwwIrR9TqankJWmpeNyYbZPsBMbMVBbMnkLN91Y79mahpxmGdHmP+NPV/LDQ3Vbx/b ak6/CfTD3YC0Jwe6d8S7Nw7U2xR0Zd6g77vaPKWdn3Y8vkxIfUFOaBDIJyH2NSdDyE1c O2xA== 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:content-language:references:cc:to:subject :user-agent:date:message-id:dkim-signature:dkim-signature; bh=TQfgBwu1xoEK4/E05pXxX9e5fg1iH9uWSgSQhnopm88=; b=ZRGrThjT7/THMSXqkWHdI1d2BJB+Gd0Ux1P80ZpK7xR8NE4fxaCOdtN7WN12ryzLOD fMXnWTy7cPKAuMnsdwi0o03Vr8B5rT+GpzqAa+2IWs+aQD/L9Plwxi/D/bAqTMRDauNx uLHwXMDFbevbVqoeUd2RrNlzgkhHjBLtTVI1AZORBMiRk7VxGcu+bK+vA30vsWqvU84k xGmB853aDwoVnesoqtPoL7535gbW0qr9RqIA+NML5kY8QkK56w0OQq6B5yxRBHE+GIoZ /62QAYK+jXw3sYBeqnveyXCUfPQwKiIrl2UhRn550UroSkDGrSzWu/kF5ueOIaZSkwT8 gOyg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=KViOOVmb; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=SVIVTHMj; 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 c11-20020a170902d48b00b001a93c1d66e0si1223227plg.269.2023.06.02.10.22.13; Fri, 02 Jun 2023 10:22:28 -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-2023-03-30 header.b=KViOOVmb; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=SVIVTHMj; 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 S236593AbjFBQog (ORCPT + 99 others); Fri, 2 Jun 2023 12:44:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236232AbjFBQof (ORCPT ); Fri, 2 Jun 2023 12:44:35 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26B3E194 for ; Fri, 2 Jun 2023 09:44:34 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 352CahGt030637; Fri, 2 Jun 2023 16:44:07 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-2023-03-30; bh=TQfgBwu1xoEK4/E05pXxX9e5fg1iH9uWSgSQhnopm88=; b=KViOOVmbwaL9TvgiO+9bg61KezKQnHQulIER4XPrFiHpMwSZUIpVYsiGbbq3hhm2YoIt 91jCZoD3EkRQsVwriQ2zkreYULZPMvEAoLT27ONGeR/7Bxvmw6dHk1Naqwd/xmbrXCvd jqHdyYDGhajNWGV1tqn2uZulSqHIsPSUaXLEi7kYFIzKk2HuV6UrZtiBzrfeD2J5wYKd 54BBiRA0AfybsyKjNmrYpIJV4R3BH+smlHMZ1XPpLD4PDIAl+69xbKwQwBbgnRrPkwuf lbLZufqX2GpMdN83Lkojgsnchg0Z8QJ94CUgr36AHd4a9LVGcYhXeWnnGGpUCfl0Dlua CA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qvhmeub4b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 02 Jun 2023 16:44:07 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 352Ft83k035097; Fri, 2 Jun 2023 16:44:06 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2169.outbound.protection.outlook.com [104.47.55.169]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qu8a8tfhj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 02 Jun 2023 16:44:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BcFDL1XLFfzJ9y2qzP78TbwY+B5FPz8ZJzOn5QEG7Y94+WPpNWPnmuZXHRW5HJKUJOTNQJjOkEta7VyJSzmHloknq2JgLl0Nu0KvOBV6UhVABI8SJOni+v+y1ncQdsb3WskuiKmvBRZgbAsuzuBoqALp1Csw6Pf1pvcZugl5g7IEvSWnG3bvrx1dvsD0czEFJGfpqAY5FxtT9xNa0Ck+wQF4QoDmYlru27YIOiWr2rqbOVGQXn5ARBGtd/bNi9B4LT0niURJQij422/jP94OARFhkuOnbmCGbPlthBVVqKnxD3hXS4V3qHigNFcfDySjQGBVO5/BpiPuZaxpxB2p2Q== 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=TQfgBwu1xoEK4/E05pXxX9e5fg1iH9uWSgSQhnopm88=; b=KhjqgEEf8PJWT29WxBupKJJX2pg8V8g4R0mEll4u5LrABaJQXYEeDjy9rhQwPGUaynDiDSfke8rSmn6vOYqFZYSNHy28hT8jI19CLdmW+hnfgStr/6avDCi4ByOQvXdKv9b7aoEmI5r/jTqd0d0AiBmbqk8YI6dJ/zZQsSnxFH+6xiL5d7BlSXVb7uWfJ0CWwm9cB/cXcRETxG9/o1CH497cv+dF3h6YQks9cU1ORcNxdGQkMAbCb+gdYrQBLh+XMgDiIwYX6uj35LVhUyi++KyhrWU/bDL5GsE7yAVSHeAQeO4ECzJtqcIniB3r3zUEQZovmmuz6LKYi5eUPP3c5Q== 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=TQfgBwu1xoEK4/E05pXxX9e5fg1iH9uWSgSQhnopm88=; b=SVIVTHMj/1iwDhIAWQtFYE+9MIF+Vj4cM01oX0wirv7XUSOe+BY9UR475+I3dRegdZMIrJxGIYt+mHgCoCaMiplqG3qKN1kwaNanuln3o8mkYl26J1fG+4838DLq07+o/ysdF1SwphYdyCx3R6OW3oQoj+TQEYkUwPb22kxDM40= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CH0PR10MB5289.namprd10.prod.outlook.com (2603:10b6:610:d8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.24; Fri, 2 Jun 2023 16:44:04 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::12d3:3f71:5b55:c342]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::12d3:3f71:5b55:c342%7]) with mapi id 15.20.6433.024; Fri, 2 Jun 2023 16:44:04 +0000 Message-ID: Date: Fri, 2 Jun 2023 09:44:00 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH 1/2] mm/hugetlb: Use a folio in copy_hugetlb_page_range() To: Peng Zhang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, willy@infradead.org, mike.kravetz@oracle.com Cc: muchun.song@linux.dev, vishal.moola@gmail.com, wangkefeng.wang@huawei.com, sunnanyong@huawei.com References: <20230602015408.376149-1-zhangpeng362@huawei.com> <20230602015408.376149-2-zhangpeng362@huawei.com> Content-Language: en-US From: Sidhartha Kumar In-Reply-To: <20230602015408.376149-2-zhangpeng362@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR03CA0033.namprd03.prod.outlook.com (2603:10b6:a02:a8::46) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|CH0PR10MB5289:EE_ X-MS-Office365-Filtering-Correlation-Id: 8da61f07-d421-4b3a-ded9-08db63889339 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s0fbquuevhMPXxdDigGL582dSw3VBIM8/LIxOzLR4hZ2qTTv9HpNvmtsRgCbF8Qk585o88DefvIJJpBlmMERlKBdvXbr+hMSA4itTlT7jc1bTWXCefxEH1EIzzBygkhRHBVf2r4B4Mt1VNx8dSZqi0a3D4TeygKAUi/2x3NEzMugxYml/PhMNutgsrt9w4fPpmJmHwd6fafuFRaHzbIxkHCojhtmsDAWZvvzYSRilX1ZyJYs0qUMul1rBlYt047u22yvRit+uvXjQ+aPlSsp4JFo4LlLZCVEf/Y5BjwxR9edB6g1KuA8djrtjlv7IfaEPOQBNdLREh4nxfBlZ6aciE32OnH5azxw8eFlXWrimP0aszTMN5GlMUHR70QesN3ci1tsu/GqeQb2HFAV5UgVVRQ1GmiBpp99xH9N17Vcy3T1pwfsMkxgqcDWcrSKfdVNOgxIY7CFf2aTDXtTFDozAeTqGlJCzrprVMbGlwrbz5jtCoKV3ymTS1Y6koe+XuPQcafkImRTdMNBlSoAygWPITBu+Xk3FQAyml29bkxrl8gs7UVKGGyPxq72KsBelv0qBtQtY7GOZ41z/39zBcvFWLsFmDIPXWfZrMbMD7HGyNoc6W6FWouHPtbdHNXs6IArGT59TpDMl3IqpBuV+llNfQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(346002)(376002)(136003)(366004)(451199021)(38100700002)(31686004)(86362001)(478600001)(66476007)(66946007)(66556008)(6636002)(31696002)(36756003)(6486002)(6666004)(4326008)(186003)(6506007)(6512007)(53546011)(2906002)(8936002)(8676002)(316002)(2616005)(5660300002)(44832011)(41300700001)(83380400001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?em9NcWhRSms1VGk1RWorU3c1d1BpTHowN2cxWExrcy95TnFBYkxmV0cyRU44?= =?utf-8?B?TXNzcnZGSGxoWmkxcmswQk9YVzM2WVI1ZlhYUTNkTzVRTkkyTVhHdVozT1cy?= =?utf-8?B?d0Y1SldSNmFQNjBaZEdldXNKbVFmakRCR1gwRENsOWRDb1MrNkRwTXJGM0Yx?= =?utf-8?B?UkJIdHRmeEorYVdKNGloN2lscE1hMC9kckRob1FtejdkTmFNQ3d6WVgyUWFy?= =?utf-8?B?VjhBVmdnUC9oUHVjOTk3TDBzYW94QzdhMlpyUEIzVXo0YkVxdlRZb3oxOUs3?= =?utf-8?B?TDVIQWtpYUYvVG5JSTR2K0dBTVJvRjZXeVIwcjdxUDRZcXRHN1ZBU0dESmRw?= =?utf-8?B?TFBXL2JvQUNFRXdTWFl3L3hBK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NRbHdyazJIRkdQS2dZTzIxZkd0UXpaQTZaS3lHS3QyQnJHZEVVcFEvZThz?= =?utf-8?B?NHRKR2pxSW5EejJMQzhJd0V2OG9jVk84Y0R5bGt3WDZ4QVlKalhHSzJUN0JZ?= =?utf-8?B?REtkWm94ZnAwVlVpdDdBSStRRlNnSGtMQlRDY3hnaXFzcElCZVNUbnNIcEdU?= =?utf-8?B?QzhQNlh5YUdsM25HbzhrM05RUjNCT0FpTGtOQTBpTTVkLzR4d2FwMVdRVWJB?= =?utf-8?B?ZGJpeC9zWUVtRU5aK0xEWXJvOGJLNFpzTWsyNnJWRzc3cmUxMFFQNjZiWlUr?= =?utf-8?B?OGdBUE5TV3g0T1VOOVZKV3k3VnBoUFk3amVCQ01ReFVvUEZ2UFhXd29TZ0VW?= =?utf-8?B?bWt5dkROdzYrVHF1Q2FmY2c3NGYwbkQyTlYxeHpPcEtxSSs1ak5BdjdhMTlJ?= =?utf-8?B?enVBd0YvQzhVQndLRXVJRmFFUm1GSnNIVHNJY21YOXp4NEVDTG85b2tyN0dq?= =?utf-8?B?QlI5TkpSeWl5czBqcThhaUtPaWJvMlJ3aForY09iUHNEZXlOdz09?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8da61f07-d421-4b3a-ded9-08db63889339 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2023 16:44:04.2236 (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: MKKGiohBaiZfFPp6l3TaFXug4R/8JeEwylV7J80HpmRXF/FUuhZbqjDESuwZp2aEombKzZJtDbSvBhu27oXHcSrdLAizTsQ1w33rcQeeD48= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5289 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-02_12,2023-06-02_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 spamscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2306020127 X-Proofpoint-ORIG-GUID: zBgm_pYb1JG6244NYcYLFvYpr4nuUUB6 X-Proofpoint-GUID: zBgm_pYb1JG6244NYcYLFvYpr4nuUUB6 X-Spam-Status: No, score=-2.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_H5,RCVD_IN_MSPIKE_WL,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 6/1/23 6:54 PM, Peng Zhang wrote: > From: ZhangPeng > > We can replace five implict calls to compound_head() with one by using > pte_folio. However, we still need to keep ptepage because we need to know > which page in the folio we are copying. > > Suggested-by: Matthew Wilcox (Oracle) > Signed-off-by: ZhangPeng > --- > mm/hugetlb.c | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index ea24718db4af..0b774dd3d57b 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -5017,6 +5017,7 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, > { > pte_t *src_pte, *dst_pte, entry; > struct page *ptepage; > + struct folio *pte_folio; > unsigned long addr; > bool cow = is_cow_mapping(src_vma->vm_flags); > struct hstate *h = hstate_vma(src_vma); > @@ -5116,7 +5117,8 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, > } else { > entry = huge_ptep_get(src_pte); > ptepage = pte_page(entry); > - get_page(ptepage); > + pte_folio = page_folio(ptepage); > + folio_get(pte_folio); > > /* > * Failing to duplicate the anon rmap is a rare case > @@ -5128,7 +5130,7 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, > * need to be without the pgtable locks since we could > * sleep during the process. > */ > - if (!PageAnon(ptepage)) { > + if (!folio_test_anon(pte_folio)) { > page_dup_file_rmap(ptepage, true); > } else if (page_try_dup_anon_rmap(ptepage, true, > src_vma)) { > @@ -5140,14 +5142,14 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, > /* Do not use reserve as it's private owned */ > new_folio = alloc_hugetlb_folio(dst_vma, addr, 1); > if (IS_ERR(new_folio)) { > - put_page(ptepage); > + folio_put(pte_folio); > ret = PTR_ERR(new_folio); > break; > } > ret = copy_user_large_folio(new_folio, > - page_folio(ptepage), > - addr, dst_vma); > - put_page(ptepage); > + pte_folio, > + addr, dst_vma); > + folio_put(pte_folio); > if (ret) { > folio_put(new_folio); > break; Reviewed-by Sidhartha Kumar