From patchwork Thu Jan 26 22:27:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Kravetz X-Patchwork-Id: 13117845 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 87628C61DA7 for ; Thu, 26 Jan 2023 22:27:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A8CB66B0075; Thu, 26 Jan 2023 17:27:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A3BBD6B0078; Thu, 26 Jan 2023 17:27:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 840596B007B; Thu, 26 Jan 2023 17:27:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 6B1C76B0075 for ; Thu, 26 Jan 2023 17:27:54 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 438961609A5 for ; Thu, 26 Jan 2023 22:27:54 +0000 (UTC) X-FDA: 80398388868.26.6009C74 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf04.hostedemail.com (Postfix) with ESMTP id 9487E4001D for ; Thu, 26 Jan 2023 22:27:50 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=mrha1A0N; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tZSIY0X9; spf=pass (imf04.hostedemail.com: domain of mike.kravetz@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=mike.kravetz@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674772070; 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=tzIdewK6SfV/Cp2+h/gk4FjPJyI7o56RWPQRWULdKz4=; b=k/9szYBBJkPDpFHO8I9Z+DItZZCjpO9uIITezDa7nTdecu3wRoKVlY7m7/3uLO53HpV2wP Ry7ji9ZUhBKGFu6QkJGwC62zJo+4MBrm25iUQdszEgfTkjQu+a2ogV1/+SZcvBX8OizABq 0ib6GeqVYFuwm32Q2gzl8qGnW2YKQ7c= ARC-Authentication-Results: i=2; imf04.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=mrha1A0N; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tZSIY0X9; spf=pass (imf04.hostedemail.com: domain of mike.kravetz@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=mike.kravetz@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1674772070; a=rsa-sha256; cv=pass; b=XXh4kAgtSWdA1c6Tiak9hQKmIwTkuldwBWXXuSOefqaobLxmX7ByUNNEp6oLHHnqfBsIJr HozWf1pcBKfxkNRVY5F7OdfstfbDyWYlDCuFuAqnUTIeNmaiJJEVClbmr98t6/vY19xqSB e831F/ZpZvRyasetx5zrB2qiwQlM9fY= Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30QISwhE019405; Thu, 26 Jan 2023 22:27:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=tzIdewK6SfV/Cp2+h/gk4FjPJyI7o56RWPQRWULdKz4=; b=mrha1A0NQHx1UtIuZ/1fZGqmIXqvx2G6hfiDtbK0uitZP0pJFVgeLjczLbzuJK6iupKA ngSXQmZqcSakOT0QtKFkwTBrX7t+j/GzN9mTbFVm8F46bUECS/ya2GAAOzTBvLY9RJg6 LceRxZ9OrdxY6pLctqYddMlnAFFFkybj7+y1ba8soZgvHDXFsM7J8CGXfIMPayQamxP7 Att7Cr/D55Ajk8PDhnDnV/rq1NdhOwwYbhYi59uPDMx6hVB1qvBy4zXrVK4MO49JK4sG uM1gFDnrhNsgrbexQLFV7+y2o1BfeSz3+4ZsuJFe0LP9122vrVMwRhDzBTWVQqwNNRPj WQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n86u33mf5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Jan 2023 22:27:34 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30QLJJmA010591; Thu, 26 Jan 2023 22:27:33 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2168.outbound.protection.outlook.com [104.47.58.168]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3n86g8fm39-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Jan 2023 22:27:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DsO2MptoLJIskMQi+IPHu6vuSt+CXW0EBwKdpVsRrtR1xREutWdsj6eGwwdtvBTmi5onX9G0xTz1wZVI1becFwuFtnYOkrZXgQr1GO/VVZSkJ4GMGBP/d1cl7p82kfww8w6l9fVIls3gMcCaLh+f6xo+JGXj7yUxARGRDtL7s8DFmTk9U3vgSf4jDVfnFV71jdZznEnflz+ZWN43IK7YJb6lTNYm1n8iQRjEPCQnBCJbDnKMgiWLrQPMI8m1ly0dQNqNtVgm5C74EzMiQJ9OhF8yzezo7/JWrAeJ26e8oeSp3DvksOOkZm6Ge/0o4UHZSs9HRzv3cz+rVHJFXDmPpQ== 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=tzIdewK6SfV/Cp2+h/gk4FjPJyI7o56RWPQRWULdKz4=; b=DCWqMoVQjXSBEEF3aGMfdQXPeIaE//LsCSimd2SuD83dzHqQtoyb1xlWzJjdDYuDXubs33w0PvFxOam4ZOJYhzGbudAwnS7klBwuaUwaGHpkmhscJ4qcLjfD+5uwB4EzB2yhU7dk+LIzUBG6mjenMHycjt/y0Ru4UxwPk4J6n+4OVIl6J+xh6EqxOa3KAiRp9WkgfytQ5QzOu3fvzPeIYLCegx04wrxztTx2wHae5bC41oD1I9wupPwHKoRh4xgWVzoyNkiif/yKjsUtWdLSmwvue3h70LSkXgm5Q9GFA/Nj3eIsO12Rf9Qad6qJbnZ25zmcprzsFj3FDqBKdEZBAw== 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=tzIdewK6SfV/Cp2+h/gk4FjPJyI7o56RWPQRWULdKz4=; b=tZSIY0X9j3+AeBQI9MMaA09DszhizOiTuyaCOCIbieK0VzGuQ/3jQwvH4B/Kh1yMsbT82Ilbz+78PvOvLdBC6g5VW+DPpOrNPhyrYylo4P9RjKwVrIY5vtgCfSgO5KXQtx3Kwz44kPpXsZ/g40Q06bnxG/NFB/jsp+FcULc15wY= Received: from BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) by PH0PR10MB4616.namprd10.prod.outlook.com (2603:10b6:510:34::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22; Thu, 26 Jan 2023 22:27:32 +0000 Received: from BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::3a1:b634:7903:9d14]) by BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::3a1:b634:7903:9d14%9]) with mapi id 15.20.6043.022; Thu, 26 Jan 2023 22:27:31 +0000 From: Mike Kravetz To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Naoya Horiguchi , James Houghton , Peter Xu , David Hildenbrand , Michal Hocko , Yang Shi , Vishal Moola , Matthew Wilcox , Muchun Song , Andrew Morton , Mike Kravetz , stable@vger.kernel.org Subject: [PATCH 2/2] migrate: hugetlb: Check for hugetlb shared PMD in node migration Date: Thu, 26 Jan 2023 14:27:21 -0800 Message-Id: <20230126222721.222195-3-mike.kravetz@oracle.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230126222721.222195-1-mike.kravetz@oracle.com> References: <20230126222721.222195-1-mike.kravetz@oracle.com> X-ClientProxiedBy: MW2PR2101CA0015.namprd21.prod.outlook.com (2603:10b6:302:1::28) To BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR10MB4196:EE_|PH0PR10MB4616:EE_ X-MS-Office365-Filtering-Correlation-Id: de110378-14a0-4aa0-63e3-08daffec83be X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ss6E4bjf9To2W5p6ZaPFWewi/F1wp/BGgHJ06jB4KCZ9gUkWbtO/QzJI7NxsDTBTS7UbUU3eCkY2UFCxk05L5jkNPlMVZWKBEID3FR58brvyYKxAppiH0D2LfnLkENQZlbnN/P3hA34jUyK+yOxAH0cAahV4AF16VBdzBuS+WyXODbMraKgJS6RqRckZjdq7lGkRd8fAzonB2pZhcQQ+ZhIs5az+T+/YEzx9zK9XrueHAFcDoKVZ5O3UMppqXnSo84tPv7Zz7pJvIklJMRtnr5c1GAmyx0D4jcJg0SilBJQ+j0OdAghVQaNzCzYWzTUhPKUwFkaocTaadKsdUgCLnejBL6tOS7J0kj+ysY9IMfpgOD9J8lSoSwu0wAKhCQDtIb5rWETu0/IgzfyIoBFmR1DY1pYeAwg/bu1pfKAMFypPFQHGEEMgIG1tNDKc0M6oUBt32RX2pIY9QW+LFmASeBGfFii80mKbaDvpqL+BvBHCO9A8mqKqPhItmo/ZJgQ24sfjsVBK8A5Rij9jT+NNKd/9DCHVAxgntFnTU0nvwqxCyelzYLf/28F7IC4ZnuAlMzyvbYZAxHTidIP2rP/UUnMymPCRB1D8lTQACOQF6HWK0IcMyGsrBhiWll2E9+toM5OhGUrDqMC4nIHhElDsGA== 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:(13230025)(136003)(39860400002)(376002)(366004)(346002)(396003)(451199018)(186003)(54906003)(6512007)(26005)(6506007)(6666004)(478600001)(1076003)(36756003)(2616005)(83380400001)(86362001)(8676002)(66556008)(4326008)(66476007)(66946007)(7416002)(38100700002)(5660300002)(316002)(6486002)(2906002)(44832011)(8936002)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: x0SjNm/K/jsf3549BIUdyQbZ1/aa5ei2aYpDvwYrMulbryK3D4zg/uSAp08DbArlXs/BE1pZHfrghio0/nL4zgFvU13qgG+XkwljlHYCV0u8SA2pgwH6mL5g3i8aQejMB5mnG7DaOv8raVAb3icfp5jESXaywHmvbJf4uk9dqc66DB9lR9CIX5IQ+wi5TU4V6W1y6+J/BFzkckYmBtK2myYG8/bmkBB/Kt61TO/zFZU+p1xDrRKsvgJnSOvqJzxO8XcrOF4XGkB30fILQk3qbWENAZI3set/6YgwN/52j1Mi1gAl5haE11zVjsqI2IVZTOMcMIhiquS86KK+q1LU35x1D1+H8abaHBwiLFefUrH8K6NHONa/ywPFiM+P4BrG1F6DxxEEEv9uLghwvINEqIW5T71gb9Hw0rhKN4x+tjk3QbL8hD2KR8ruTs7myldLlzgDVb+AWtGu273xKARfUHsjLK7OX4s0hZ27InZwM1VX9Gpp8Ym3laud3QRho4e1w9TLIaYojmgKFsp91mrd0MI+Yg8qZbWbFS+XfnEPIV5PKFG7bmh08vjN41J8RvweD9Uzc1fe8qleefahl+zHcmepv4g42cneXXp/iInzCm6ihUZSGa7LoS9Ik2XZA/D0ifjlkzc8TzbW1BIcwCnQUOv7EYqB09j+/obUDdc3SfZo7TdKAsucr0jc4LisuN3pT6Md51fO49t938HVJwF7kUsHvzjuvkMzPY0pvZandprzR/2B8BU17xPO9NnV8V1IRtUsqyTD6zy0W6zMCXDeVBYkOR0J0w4pxVG3tY0OJ1qA7ttWxfwBTmKyXqqWXEuy/LHS/JQnDPQZJq23iHDI3hUinBQHFmVAVwAr6Grmatg9aWbRFOJ+OTQyk+hIOUCNPzeQY6b9xd5qZWPwSWKEckIc9emsPKv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pPqPfnJiN+YiDdFSI+U8fjVm5AdEbs7WkF+Xum1qKgS3/d+bck72EfiaOKVGyQpQ/KFFLefi+lXNgtE7vkDdOH2BUdmE8LesAT4bcUo4wWSbfoMAi2ChawK/0SI398Ui0KqyQ9iUqqZfjxlJXwbzcJuZXit1STs4daauvjb8PqkdTVG6l1YnquLuJBX0We+JG2FqB4b4lU8BIP6YiOQi3AfCueNFVgD/ZDvu4UGjaOdwTnZHq3vaH4HlcaTGL1eyij56/CK7W4/Zg3WvOjcBPHd+79R5Tz/HKUgiRkwZ0lGAPbHTEGsS+MKinm6lNbIgmEu7DA7oFVwYFl0vA76LPLIwgNw1BUtaInMxzBs9i0J1Rw+kdjyQZJFL/8X8Dj6m6V9R00nQLDnDdbZVXUHHwJ/Z8gihQHnl5+D11IGwlFDyBZGq91gETQNmB2m+DiKXg9qsCQA4CWt70+HA2V6kU3cyYA9vV+4QYapk3mm/UwosVV9d63r3IrwgZtzZgDmLLICSJuJRc9qD9h7pcQB9wFNMnZx9RHFFxRDPmDwzo3QWipIDQUw8aDfF7qcwH1JryqduaOfVrpzEZ2hE+VeUdmrFAGRbncn3THbY761EwnuGXrZzRk98yeQhAP/xGw3OuT9Q+SobXPXdYp+6UGsxDe0ZqsMZg/Oi1jgyfJFhS0IsK+W8oyhOClNEbRKSC2fTIAMtqHrF+idsWyzVhTPsBfXkUjjNTugl5JBbEM8Bcr8wbjPLqP7hdLJ7fkcBjLzmRJ4pXK/WbKes3rnn X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: de110378-14a0-4aa0-63e3-08daffec83be X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4196.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2023 22:27:31.5254 (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: wJ52ML4B2pOlIDfrC93SOWaFJLY7DhL2klszMnVBEmIHZu8FZcgVhV1N3cXOBuPLJWGEpfwM+P2nIxsxbw1H4w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4616 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-26_09,2023-01-26_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 mlxlogscore=811 adultscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301260209 X-Proofpoint-GUID: kxo3hd0rXT1RV0eFdQ_ulo4F0MmRqrxN X-Proofpoint-ORIG-GUID: kxo3hd0rXT1RV0eFdQ_ulo4F0MmRqrxN X-Stat-Signature: iy5hr8cw4pa6recw43o5pre6w1kg6tbs X-Rspam-User: X-Rspamd-Queue-Id: 9487E4001D X-Rspamd-Server: rspam06 X-HE-Tag: 1674772070-958238 X-HE-Meta: U2FsdGVkX18Vt1a1WYp/ohgK00nv+hl3kzFVe4K6SRn+RjV09N0TohZQFkVHZ987/H4Zy6XwjzKKzLglC+j+36IqEe0teAwh6ya8SFIrL7DovYe2VSH9R5WN8fupkoxlBP+7uhwjTpwutW+iUhcrEQzfa1n6O1COJQ6ErH5Vou2mp0doH6cwEKXLUYei6ayWq6ViqqqoTUYot+2LomBIsqNksVpqU1eE7mG0qmby//Zz5/SRJ0gV7vaTAGN8OKQY6XMc1M581PcsCQfx2WjA7bxnr6byfo1Wxh7s4Mvw0Bidz3dm/uoIRe2eeUTsIsDIAGskKvpCBiF2XtJD8GArA4tRKSYyo0T/n5EtNJ6+4eb8C/fmHTCVXPLRtjx2smbC4QMBwOdk/A1mvgn+Gr3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eId111vTRbyYgRK41+9cBKMyva7E= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: migrate_pages/mempolicy semantics state that CAP_SYS_NICE is required to move pages shared with another process to a different node. page_mapcount > 1 is being used to determine if a hugetlb page is shared. However, a hugetlb page will have a mapcount of 1 if mapped by multiple processes via a shared PMD. As a result, hugetlb pages shared by multiple processes and mapped with a shared PMD can be moved by a process without CAP_SYS_NICE. To fix, check for a shared PMD if mapcount is 1. If a shared PMD is found consider the page shared. Fixes: e2d8cf405525 ("migrate: add hugepage migration code to migrate_pages()") Cc: stable@vger.kernel.org Signed-off-by: Mike Kravetz Acked-by: David Hildenbrand --- mm/mempolicy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 85a34f1f3ab8..72142fbe7652 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -600,7 +600,8 @@ static int queue_pages_hugetlb(pte_t *pte, unsigned long hmask, /* With MPOL_MF_MOVE, we migrate only unshared hugepage. */ if (flags & (MPOL_MF_MOVE_ALL) || - (flags & MPOL_MF_MOVE && page_mapcount(page) == 1)) { + (flags & MPOL_MF_MOVE && page_mapcount(page) == 1 && + !hugetlb_pmd_shared(pte))) { if (isolate_hugetlb(page, qp->pagelist) && (flags & MPOL_MF_STRICT)) /*