Message ID | 20231006032012.296473-2-mike.kravetz@oracle.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 C41BAE92FDD for <linux-mm@archiver.kernel.org>; Fri, 6 Oct 2023 03:21:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5612F8D00C5; Thu, 5 Oct 2023 23:21:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4EF3794000A; Thu, 5 Oct 2023 23:21:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2EDB78D00C5; Thu, 5 Oct 2023 23:21:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 1C4428D0028 for <linux-mm@kvack.org>; Thu, 5 Oct 2023 23:21:11 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id EB8B0A00FB for <linux-mm@kvack.org>; Fri, 6 Oct 2023 03:21:10 +0000 (UTC) X-FDA: 81313585500.01.E16CDB0 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf28.hostedemail.com (Postfix) with ESMTP id B2149C0008 for <linux-mm@kvack.org>; Fri, 6 Oct 2023 03:21:07 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=ErFHN6DH; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=ohwveF5C; spf=pass (imf28.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=1696562467; 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=yWCzkeiwrw7E7zmdYoM/+u9CKp7c2Frl8b8zefaOlJQ=; b=r/0XBZguC5snxLfdNdID1oHjfvwQwc5XfV9qJ0wrxCQw7rGm4FsauFLuDSRvuyqkq9G6SS S1Bk3AEzv1SW5LeEMFZffjIggnFkESFjvbcDQJoAEp2f1IcyBi+JH32DY6VdkuiBkuzzPn nV7s8/CBKf/F8T7Nqm3kkSHI+8NoX+k= ARC-Authentication-Results: i=2; imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=ErFHN6DH; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=ohwveF5C; spf=pass (imf28.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=1696562467; a=rsa-sha256; cv=pass; b=AJPq9znA6LEExDJ3PZnaHolnFnxdYN4kUF8CUejoNIqWoDKMarIk2/PXdbTFrXylcAtT0i 1+MZQRGYXqkGd+dS6xT/ni5wQxipHiz7TpnpZCvNcwCMNEaEhIhqN8nHAayaQxvfM53Lvd fCTl7s6THFpAevjWYHwN1FE3YXygfPE= Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3962NikX027817; Fri, 6 Oct 2023 03:20:26 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-2023-03-30; bh=yWCzkeiwrw7E7zmdYoM/+u9CKp7c2Frl8b8zefaOlJQ=; b=ErFHN6DH0CjI6WYkViznXYwspj5E/1iK1/JG7CMCJSucvkNz9wK9UyJEFMrCY+4fiuuL Ibbe/UTZUeX7E+569HmhlarZVdIQpOkEMQO6QCl58L34lVNSMQZ1hB+yYJCq3pXWvpe9 oXca5mWOTqCSmxWsRUY2CStXf+BlM6gedwGJ3GpA0vx8qyD2LKCus48kweTiLAjAfvsP 51ISE6oamM9U1JMP9SuIYVqYKUJRLug82hAqIBv4hgcsSdX98XgPyotk8O9zPkRCjDaG +YF6WmX8mnfG7A6ksC5FKchS5Zr8924XtVi1abMWa9BQb4lBErcEp0edAYlgn2LkctbJ vA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3tea3ejyap-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 06 Oct 2023 03:20:26 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 39632iwP002972; Fri, 6 Oct 2023 03:20:25 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3tea49ypp5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 06 Oct 2023 03:20:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PbkGBnMM+Mi7zIqYiY7Xgvtuv4FDZi7ODEOURs8bnLQVqxR0RJ1zSdS52vfVLWVdvY9HPvi9lEHMzN/woUsbjmvtlTJ6Gy4NxUT9BTqQ0rxr3QJwIWpQ33OU8qT5V6dlo1wmXK9tQwlvhCpexVAszjOoYqbay9ORoLKRows0kqzWjrJeKLMG6rONe5YYO/ISxsJp9pBdnp3J9hiwaAG1T2u9BsaBdQ2qlwcX6GiWBgvO8o8ilACf5/H55nhFE8fity8lOfsg/oOMOMvDLaTRtv18m5516gbxq4x3O4mA1nkCx0d1Xn8GyBOEtMbTUklgAh85XQoMGVfVmTHkvT6Zgw== 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=yWCzkeiwrw7E7zmdYoM/+u9CKp7c2Frl8b8zefaOlJQ=; b=HUPBR9wqfB1vK2Th9vsFP8bh0/lZrn4qoEikGjIFp+JQrplDQGdtKk9CklR4U+xSAV8xnVBtjzEFQZ8fiBLZRGQYLBzMAYU3De2ar+zOJahZoLwhSz1xgYoTu8o497wj9GfbF/rBsduAdPO9K6c97YNwt6Z7B2byyw/CVxskeM8TtWRIjaBfxZODWQWNWgEw/TwIJmFFKM+3+cKo+48jyQeydcdhb3igIFzCnzRU/JKqsrlOKzZVAtM5MipXKd2ludOaEoMebUbq2JUdvNFXOlp0+Aqn1WaDnkPOHJ/b3XSFg1Ds6HIKfKxOnjZz/UovkBHPOeeYqPa5abuNMZhd1w== 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=yWCzkeiwrw7E7zmdYoM/+u9CKp7c2Frl8b8zefaOlJQ=; b=ohwveF5CBGp9RVww7j17AGxt9fv4bbeH7xY8TTTaK89Opd+SezQXyFkMtDS215cUvD/6v5sLTooflYvhnBSBLc1Ad47qoe6H+tiR4tH3cPWlOw045CQGfzxftbquH/W0cvZhtRksdb5z4V8+9rTb4+0XO5j3OVpdi4Ac++LRqWk= Received: from BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) by SA1PR10MB6615.namprd10.prod.outlook.com (2603:10b6:806:2b8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.38; Fri, 6 Oct 2023 03:20:23 +0000 Received: from BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::59f7:ec45:eb41:d8c2]) by BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::59f7:ec45:eb41:d8c2%6]) with mapi id 15.20.6838.033; Fri, 6 Oct 2023 03:20:23 +0000 From: Mike Kravetz <mike.kravetz@oracle.com> To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Muchun Song <songmuchun@bytedance.com>, Joao Martins <joao.m.martins@oracle.com>, Konrad Dybcio <konradybcio@kernel.org>, Oscar Salvador <osalvador@suse.de>, David Hildenbrand <david@redhat.com>, Miaohe Lin <linmiaohe@huawei.com>, David Rientjes <rientjes@google.com>, Anshuman Khandual <anshuman.khandual@arm.com>, Naoya Horiguchi <naoya.horiguchi@linux.dev>, Barry Song <21cnbao@gmail.com>, Michal Hocko <mhocko@suse.com>, Matthew Wilcox <willy@infradead.org>, Xiongchun Duan <duanxiongchun@bytedance.com>, Andrew Morton <akpm@linux-foundation.org>, Mike Kravetz <mike.kravetz@oracle.com>, James Houghton <jthoughton@google.com> Subject: [PATCH v7 1/8] hugetlb: optimize update_and_free_pages_bulk to avoid lock cycles Date: Thu, 5 Oct 2023 20:20:03 -0700 Message-ID: <20231006032012.296473-2-mike.kravetz@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231006032012.296473-1-mike.kravetz@oracle.com> References: <20231006032012.296473-1-mike.kravetz@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MW4PR04CA0244.namprd04.prod.outlook.com (2603:10b6:303:88::9) To BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR10MB4196:EE_|SA1PR10MB6615:EE_ X-MS-Office365-Filtering-Correlation-Id: 808d10d8-a751-44ac-a47a-08dbc61b2d44 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LU+MksQPgRH3m8lI3fLDSEeT5cpAQ+EFJD4GTQJSVnwr9I9d4R0qVytU9SvZ/AMM7HPESkJdhY6WsLqviHR2/XMK5aHxncrohde0iGSCY7PlQbHftfhStsUENBa7mAXPUiFyx+T1y7b5xF4RHb7gyZFDh9RDXkbi8ZG6DbbXQ6jw1TPrQD4tkKRO3bjVrwyD1cvyXftB3zWU/aWZCyULtMuP/jbXR9H4R84FL4Y151ihmk+UOFEyU41/QKuqExgYWOGx8EtLFS6muM62wDCeiZ0GtydoD2/P1yTWkXDb5bnuV1CPRfrf06G399PWoujfziX+lcVX4nsGvq1uRYip/kZLKS9+2QpUAsrdqd1g0uG7LdsLPepuCPpGUX9MEb6IwwE31TIlg8z0hZDa4Zk5TwKs7qCUl2bpXmZm/tKFbPn+NdOvgSLFok36s6pU6wkIFbNl7nRPlsmJdYRsqgjbuNPck47Snptb8sJcvPzkY7ua7S/XgSlz/6jT08rpVfHF4orqIDIyqAPcDib9puEWVh0wihMQPZBZdqutJ+nijpd5r8avEApYoik1SnhKU/+j 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:(13230031)(396003)(366004)(376002)(39860400002)(346002)(136003)(230922051799003)(64100799003)(186009)(451199024)(1800799009)(316002)(54906003)(66946007)(66476007)(66556008)(41300700001)(1076003)(2616005)(86362001)(6512007)(6506007)(26005)(6666004)(36756003)(6486002)(478600001)(38100700002)(83380400001)(44832011)(15650500001)(7416002)(2906002)(4326008)(8936002)(8676002)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gbX9EgG9E4uTEYIUU4irzj3U4mcv18aknhvQRsTG1OwPH6wK47J1UPj53mvMm/w8AHqPY4TMbS7nPgpIVFBST9nclezWgXJiXr1ni4J8VGbgcSSOKQOnQJNYBRguidTc0qlHpCYuM/64Vb/wIWubnPCBNNqTZMyA6KB2qsQ+y2g6Rxjfb9PG2sN0kbwbuMZAhADInsJrZqXTswz1SYIQ/tbegY7Ker/X8ptvrf8kAxnJYpIn05vYURLbK5UalsPB5i+cUb4D9fm9Safw3I0eYyX9sL1ucHT5kAlTYglAKfPAqpn9jpXUmOT9AlptrpZxU2FQOKKZlEB/SHDhBjqmBPorEORwf/4kofjJcoQi/yzvK1RYnLNanF8Z7R/6Bd77I9TJT4ikCvJ19/jE/sCvdj5dM6q6fdoc+GWoDbE+bnDJ1XnSGJouWkaYZ54PT3rSj3bHYMrQeNgpPnvgqU1d5JUY3EpjUAMet5YkPYbcVYAqvWdQCiVgxAt420V9uQpqukQhiJO28y/xRv+dZCxxX71bHkWlu6mF7pow6t39bGnwAKztKtwHbUNid+7LB3g5sbeDuZxX1qW0TdQAYf2+Pfevg+IW1dvKEtqj0UPVk7dXtv3JbLQ6d76e6yNb948Qm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DeO+epevNrAWlqBSa9Udb5rL+A/t1c/sz7WD6fw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 808d10d8-a751-44ac-a47a-08dbc61b2d44 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4196.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2023 03:20:23.0321 (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: n4Xi6UUWRCzUVqX1FUSsq2KaKY1S3DqeIy7x7kBgHg65Rgli3b/mU6HsuPgK9sgTWNkhZhE0MWEW2G5zrUW5tw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB6615 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-05_18,2023-10-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310060024 X-Proofpoint-ORIG-GUID: NrqZk-iaAy5Mme0Hx-MT1mRc6TmxSkx- X-Proofpoint-GUID: NrqZk-iaAy5Mme0Hx-MT1mRc6TmxSkx- X-Rspamd-Queue-Id: B2149C0008 X-Rspam-User: X-Stat-Signature: wk6nrp1trnutk5ww9pzzn8ahnnte9pp5 X-Rspamd-Server: rspam01 X-HE-Tag: 1696562467-822292 X-HE-Meta: U2FsdGVkX1/qCAhNuqDt2ExmsEcwdQMSmoIx1R2cnmAVK1R3BBajiCnNzOt61I+a64/qJDfSF5w7z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2S+mfY8/FUbNZzRpk9ljhoYogQnykB/SfXPB6Ki1xJJNkPk0k4e8h1GI1evXukSFea3/X9shqnWbJGATdQhIQiqiSHxpDfepKjYndTav2xysCF6RnX4TsxyCGRMpC8xN56UlYWc56Zy9uVHWTZcwU7cKA4lJj3lDAeZ1alnLg6787l6OV+m3bIJ7hbgT9IeMWkhrrrxkUKvr4uTXEQdvxnQlmrI2dSSh8iyxqJIjPw61A43XRU3xJd3MJro6dTpEwSwh/EuoSYEVOrhtBHjA9YXQ2nVa/vz+8BBH+vJrUlerYvIumqqGoyCIoGmuLun+hUxAIFWgV+74FXgrd0Vw8sioNeLWjrc023RnrzXxw0xErzRmJn3s8CcFDlxek5+3VbTy2XVxfXxCtu 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: <linux-mm.kvack.org> |
Series |
Batch hugetlb vmemmap modification operations
|
expand
|
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index c1171801a3ba..d7679d37d072 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1830,7 +1830,46 @@ static void update_and_free_hugetlb_folio(struct hstate *h, struct folio *folio, static void update_and_free_pages_bulk(struct hstate *h, struct list_head *list) { struct folio *folio, *t_folio; + bool clear_dtor = false; + /* + * First allocate required vmemmmap (if necessary) for all folios on + * list. If vmemmap can not be allocated, we can not free folio to + * lower level allocator, so add back as hugetlb surplus page. + * add_hugetlb_folio() removes the page from THIS list. + * Use clear_dtor to note if vmemmap was successfully allocated for + * ANY page on the list. + */ + list_for_each_entry_safe(folio, t_folio, list, lru) { + if (folio_test_hugetlb_vmemmap_optimized(folio)) { + if (hugetlb_vmemmap_restore(h, &folio->page)) { + spin_lock_irq(&hugetlb_lock); + add_hugetlb_folio(h, folio, true); + spin_unlock_irq(&hugetlb_lock); + } else + clear_dtor = true; + } + } + + /* + * If vmemmmap allocation was performed on any folio above, take lock + * to clear destructor of all folios on list. This avoids the need to + * lock/unlock for each individual folio. + * The assumption is vmemmap allocation was performed on all or none + * of the folios on the list. This is true expect in VERY rare cases. + */ + if (clear_dtor) { + spin_lock_irq(&hugetlb_lock); + list_for_each_entry(folio, list, lru) + __clear_hugetlb_destructor(h, folio); + spin_unlock_irq(&hugetlb_lock); + } + + /* + * Free folios back to low level allocators. vmemmap and destructors + * were taken care of above, so update_and_free_hugetlb_folio will + * not need to take hugetlb lock. + */ list_for_each_entry_safe(folio, t_folio, list, lru) { update_and_free_hugetlb_folio(h, folio, false); cond_resched();