Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3246147lfo; Sun, 22 May 2022 23:47:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJ8nBK7blIEi0O3Ox3ZlfFiU0qz78l9HpCZU3yez9BrNZmKfrcsfbUVH8dLxmbNxL6Ux88 X-Received: by 2002:a17:902:e881:b0:161:f67c:3478 with SMTP id w1-20020a170902e88100b00161f67c3478mr14315207plg.131.1653288439488; Sun, 22 May 2022 23:47:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1653288439; cv=pass; d=google.com; s=arc-20160816; b=gmavKcv+MwHL8wJpYYH4zppNmkP9JxsQzTGKsLUK/qg2KaO5GNIGsHRnG40lhOY0wN pvG56ok+Tv0jWjqlWpw0c8XZsGOocwRtu/yEydVHYYOU4aLOvmMJEz8Ioe6HjJSeLxWm U9kbs/AZA0j82ErLb7LnXUL3vCN9b1twoupmMa5lWgeg0gBlf4DVzoqV0vpJ9Tv6SUBj t2lNFXR3V/EqRdEfxPRlzBi2SgR+Gte7VD5DG1rXKir81GXlJ1nR1Nu4PQV7z8nHgAn8 B3lq19pucNjUnQUGTfbGZUqU0H2fHJaN73xxSWBQzJRZWa+uRiZowYju1KxTk28decgi maBg== 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=Ftbm2cTPH8riRfPhDmPLDHQroM9uKS9P2upzCLrqRbg=; b=osSM3ZHYVHriqoBOwp9RP31cWoUX5ivmS3k7mJkqnClr5vSIgG7G+KV8/iPn7Kkk2J tsl5qpvhLK2U5zOLS9OptV4YD8pA4+oBa5bzqNfX6Gqtf0XpIBpVrNiNTo8Y4x8ZKnBW ust1YUm14i2IoLrrU4DKUH5NHM5sFJX9V4AkWb3Y4vaNIwF8XHE7DnC8OvYKbylMF1t8 8gsixUSh6Bd6c/bvumlZ6zEPgB1Gmwh1+qTWiXCy1y0hj/CDZ1Np3ZLBIvnsMtuKPsRm H//NddrEChhI5Lf+H+DKeHgZf6dqIhV+jMAijsGkmjN7t0p7o5Q8qaqGnI3aYFdA9FDS iCsA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=uuySMR8v; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="k/ZyPtyY"; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q21-20020a170902c75500b00158205c7f9bsi8479800plq.46.2022.05.22.23.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 May 2022 23:47:19 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=uuySMR8v; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="k/ZyPtyY"; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2866B51312; Sun, 22 May 2022 23:17:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354103AbiETXck (ORCPT + 99 others); Fri, 20 May 2022 19:32:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347860AbiETXce (ORCPT ); Fri, 20 May 2022 19:32:34 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8900A19FF4E for ; Fri, 20 May 2022 16:32:33 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24KIb5wa022587; Fri, 20 May 2022 23:31:38 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=Ftbm2cTPH8riRfPhDmPLDHQroM9uKS9P2upzCLrqRbg=; b=uuySMR8vQKSSroib50LLD4kdap+OEdHQfecojvEMDzfpN4jSxHyPvl5L2Tk88Pf6eB4C 5x2vFWcrawXn91tQNEzOx61zpOoKxObpAVUbpsyvGP+2YmLgNLguSxEcnWa+Jch3IDFA IkvFFhlf/c8iw/4RFNRtvEGOxc4zcfcv+uajm5WE0A4Rj8xsiXTXNwCfI5YVap7x3k33 hbVZx5VCCb4/Q06SbOT2+gv9IkEUupwjkDrP2jRBn89i9TGNAWZIxRhFquN7PqACmDlD T43yOX7xiHHl6SkBUau/fdJGoJzTafdkKGhDPE7SaAmi3Ko81lOD1ljTkhBWYbYuGz5R Mw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3g24yu0bde-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 May 2022 23:31:37 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 24KNUANh040050; Fri, 20 May 2022 23:31:37 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam07lp2049.outbound.protection.outlook.com [104.47.56.49]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3g22v6suvt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 May 2022 23:31:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SzpZ78dRmeDpPll+acOVOlgel1O2OVTKhW4dzEXGob6AVF7HOVEFwH15wiW7d8n7n3pJVLgfzgvxVva/OsA0G+nUqEkpxw9zVb1qcAI3AVWMHZd4lVtTBOAirFa3S+TVi+afWFgVrAuRznQkpOVDvsTvJ3MQmFKRc7UyzPSugk+FvDir7U/cgGQ8mZixJUp7UxCpZa4qSbZhWjhGEP/mQZ7UHBk+6Ihfx1oZfvUPJPTmeFiaUQBdYLpRhYsoRF3Gz+0R11dfcqV+NwkvDe3+JX4mDTqz9KywBfF5vIzTt3huAUAJdaNBvssfGdfPBfSTjnh292fYZKX+tTf3qjRj3A== 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=Ftbm2cTPH8riRfPhDmPLDHQroM9uKS9P2upzCLrqRbg=; b=OE+uhTl8coIwtV3obNoM4zO6/feBR6qbJwK7+f6su6SL94jFGKCd7TmOiCkfifrHnPASELwqYaKPX+UpHyrs3PQkWY/GXd7Xttb9VXqGptHs2jarb5yCBjIAth0sB5UDy6ivfmqslxpYRJa4nRNOeI3key0Qo84MGUBtZlL22O8gIPwft2ijo142q0N+CSW0gbJYfX5EhN9CDH25+hXQ1DkCv/Sl+uMW+eVBHJxgwJPLXTLGmirzDnw2oWrBea3MrkY2rGgqvC472htbWIr+Qx6waRk24Gt0OyNqkyKF5o03Pp7B+M71z9r72UZLHuavjbHewjOLjl4GrFswuRzM9w== 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=Ftbm2cTPH8riRfPhDmPLDHQroM9uKS9P2upzCLrqRbg=; b=k/ZyPtyYfATj0b7LyzutwsEaE+3kiY1EC/RTiMPnMK9LCp9KZmLjCn6RaEXrjj13uieXzdndJkLZE1gNb9D92urRaYr1tEKYOUyx/7uCmC1p6xGITHsuO9bj6mA2LHXm0BGgHE9yDxIhL1J2koH5akBg7SkQnnAKJGheTKkE2Mc= Received: from DM6PR10MB4201.namprd10.prod.outlook.com (2603:10b6:5:216::10) by SN6PR10MB2895.namprd10.prod.outlook.com (2603:10b6:805:d9::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.16; Fri, 20 May 2022 23:31:34 +0000 Received: from DM6PR10MB4201.namprd10.prod.outlook.com ([fe80::e81e:38af:cb6e:59e5]) by DM6PR10MB4201.namprd10.prod.outlook.com ([fe80::e81e:38af:cb6e:59e5%4]) with mapi id 15.20.5273.017; Fri, 20 May 2022 23:31:34 +0000 Message-ID: Date: Fri, 20 May 2022 16:31:31 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [syzbot] WARNING in follow_hugetlb_page Content-Language: en-US To: John Hubbard , Minchan Kim Cc: Andrew Morton , syzbot , linux-kernel@vger.kernel.org, linux-mm@kvack.org, llvm@lists.linux.dev, nathan@kernel.org, ndesaulniers@google.com, syzkaller-bugs@googlegroups.com, trix@redhat.com, Matthew Wilcox , Stephen Rothwell , David Hildenbrand References: <00000000000077377c05dee75f63@google.com> <20220513102617.c464c4f566052838e911a3ec@linux-foundation.org> <75f09063-d184-7d44-17a1-ed04be5eb953@oracle.com> <20220513161910.d1b73583cdb2e33562aa86e5@linux-foundation.org> <4809b134-a37a-50b8-4c25-44548bc1048f@nvidia.com> <6d281052-485c-5e17-4f1c-ef5689831450@oracle.com> <0be9132d-a928-9ebe-a9cf-6d140b907d59@nvidia.com> From: Mike Kravetz In-Reply-To: <0be9132d-a928-9ebe-a9cf-6d140b907d59@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: CO2PR07CA0072.namprd07.prod.outlook.com (2603:10b6:100::40) To DM6PR10MB4201.namprd10.prod.outlook.com (2603:10b6:5:216::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 36250663-d691-41bb-2076-08da3ab8e099 X-MS-TrafficTypeDiagnostic: SN6PR10MB2895: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: hp6J8DUsR4ELaQehuPTIPH/DkPlribCfTdzSK0obBLkmD78U2LZWOrkkUh2fsFS0TUGo7hJDEJevKWJCsWGYc8nRZW/sJVoraG8nAK4y5MsSg46HQK0Wy9c4dyMKqsDZzDWlmlNMLfLbiTEsABa8RtbUZXojx1hqfmqG0+GmL5iE4aJbmv6s7YKlKTTd4gFWQiOL3a9i7+C7nnvbJ4MyelH++8k1S7tB2SxHjdhYQ0cUsZlAz7AnxImIkGsj0zn/fD0IqVA6KeM/XutMdUtWl/lEdQhB8x9gx8gWC7Zuv8PftuhCr2PnewdVwYDwk92HkRNPAk+Ae91Z0igFzTWG+1OZXRedkW5DAK6DHt4givkZjNKhoKv6X28PFDtv7zabaUcNW/wkGDe2IkUmaP0egek357vOuV3uEgFggE4aHZI4PnqbJ6nwYNgz7s1DUbGlzoWIMiJBO+6Yveumqn0g4Rov7Q4vn3w638EBIObyQrSFXPT2kV8s+dOLqEeMRNfs4egsPmq1QRTpqImOH0lC3vdLggQ7OMJbvrNGbLFFKw66BXr9Q+iRQjLUccZpPs4ulF0FoS/KlOqJHLdFHOmV9tGxmV2SlvxymA4pgBGwwzVMxptlRMTgYb/Lci9Dsi1x+KDAZk6IAMr5Vty/tgryhTNUhdK/fX8mwhFoZV+knb8q7OPt4sk5A53vniAeV74KmlanMgTmcfi0r3kj+KvIlJhDh5tI+F1JKC4ULcfT3g79qne7ipASVbXpw/tsXm20hLl29cRCvqy1QuD+09UwLg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB4201.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(36756003)(2906002)(6666004)(54906003)(508600001)(2616005)(8936002)(316002)(110136005)(6486002)(186003)(5660300002)(52116002)(7416002)(44832011)(31686004)(38350700002)(38100700002)(6512007)(31696002)(26005)(66556008)(6506007)(53546011)(66946007)(83380400001)(8676002)(4326008)(66476007)(86362001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QTN2d3ZZcmRERTc2QUhud0Jnb2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utf-8?B?NUtiVzN4MTVzam4yZDA1d1VFYnlpK21uYUQvVzRENDdxTFdJYjluT1pjcVFk?= =?utf-8?B?SVY3eDMxZ3c2Y0ZMNTgyajNmL0lXbHQ0OE9xLzVQc3B5clo4ZG44cjBvaFVn?= =?utf-8?B?Rm8vR1VoUkNMaDFrN1Z5bHp2MjdxTEFJYnBUOURaZDZ5Z3RaN3dLZ1hEQzZD?= =?utf-8?B?Q29JenA4RlBYQk45cTZONUJIbXRBbE5EYi9Qc2Q3UlVjNWFCV1RJQ3FzYkg0?= =?utf-8?B?SjAvWFpBeVpQYlRVbkNnOWZtdXNzeFU3T3F6amsyTWhGaTRxYm5ZOG01S0Vj?= =?utf-8?B?Q2JBRWZPU1RrdTZvZkpaM2xtTXJoamIvVzhyRW1WMWl0dnphYW1yZzc2WWRD?= =?utf-8?B?dzRyQUJiTGVmUzRVWnN1Q2dhVTRmamxtV3NPR05FTHR2bFNsZVk4eUVSSkdY?= =?utf-8?B?RnFMcGwvWU1RYURQb09IRnMzQW5uRWVYY0kyYzhYdGpEb2Nrd0xnS1J5UFAz?= =?utf-8?B?MFlnMXM4K3owSEh0eGQxQmhnSDBCZzFSRHFyQ2tZOWwvWHNIUHN3M3doVW1j?= =?utf-8?Q?gZMeMZx4JPlhi9hQ=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 36250663-d691-41bb-2076-08da3ab8e099 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4201.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2022 23:31:34.8027 (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: kE6xf/Ztjoj+3c3/Z1PF8tf1YdbzTbZvzzG6NYJVCPctRA0T5RnWlivjGfCpli3RATZhXuyfwfcIiyefVbKjag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR10MB2895 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486,18.0.874 definitions=2022-05-20_08:2022-05-20,2022-05-20 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 malwarescore=0 adultscore=0 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205200144 X-Proofpoint-GUID: JRKXwnVuCoKHZzsX8C-36vQJoajl0-Iw X-Proofpoint-ORIG-GUID: JRKXwnVuCoKHZzsX8C-36vQJoajl0-Iw X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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/20/22 15:56, John Hubbard wrote: > On 5/20/22 15:19, Minchan Kim wrote: >> The memory offline would be an issue so we shouldn't allow pinning of any >> pages in *movable zone*. >> >> Isn't alloc_contig_range just best effort? Then, it wouldn't be a big >> problem to allow pinning on those area. The matter is what target range >> on alloc_contig_range is backed by CMA or movable zone and usecases. >> >> IOW, movable zone should be never allowed. But CMA case, if pages >> are used by normal process memory instead of hugeTLB, we shouldn't >> allow longterm pinning since someone can claim those memory suddenly. >> However, we are fine to allow longterm pinning if the CMA memory >> already claimed and mapped at userspace(hugeTLB case IIUC). >> > > From Mike's comments and yours, plus a rather quick reading of some > CMA-related code in mm/hugetlb.c (free_gigantic_page(), alloc_gigantic_pages()), the following seems true: > > a) hugetlbfs can allocate pages *from* CMA, via cma_alloc() > > b) while hugetlbfs is using those CMA-allocated pages, it is debatable > whether those pages should be allowed to be long term pinned. That's > because there are two cases: > >     Case 1: pages are longterm pinned, then released, all while >             owned by hugetlbfs. No problem. > >     Case 2: pages are longterm pinned, but then hugetlbfs releases the >             pages entirely (via unmounting hugetlbfs, I presume). In >             this case, we now have CMA page that are long-term pinned, >             and that's the state we want to avoid. I do not think case 2 can happen. A hugetlb page can only be changed back to 'normal' (buddy) pages when ref count goes to zero. It should also be noted that hugetlb code sets up the CMA area from which hugetlb pages can be allocated. This area is never unreserved/freed. I do not think there is a reason to disallow long term pinning of hugetlb pages allocated from THE hugetlb CMA area. But, I wonder if it is possible for hugetlb pages to be allocated from another (non-hugetlb) area. For example if someone sets up a huge CMA area and hugetlb allocations spill over into that area. If this is possible (still need to research), then we would not want to long term pin such hugetlb pages. We can check this in the hugetlb code to determine if long term pinning is allowed. > > The reason it is debatable is that hugetlbfs is intended to be used > long term, itself. The expected use cases do not normally include a > lot of short term mounting and unmounting. > > And whichever way that debate goes, we need to allow it to be > fixable, by not tying "is pinnable" to "using gup/pup". The caller > has the context that is needed to make that policy decision, but > gup/pup does not. > > At this point, I think it's time to fix up the problems and restore > previous behavior, by choosing Case 1 behavior for now. And also > lifting the is_pinnable_page() checks up a level, as noted in my > other thread.  I can do that, unless someone sees a flaw in the > reasoning. Go for it. -- Mike Kravetz