From patchwork Thu May 11 16:55:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khalid Aziz X-Patchwork-Id: 13238198 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 29214C7EE22 for ; Thu, 11 May 2023 16:56:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A2B516B0072; Thu, 11 May 2023 12:56:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9DAF46B0074; Thu, 11 May 2023 12:56:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 855BC6B0075; Thu, 11 May 2023 12:56:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 7653D6B0072 for ; Thu, 11 May 2023 12:56:06 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 09D2480DB0 for ; Thu, 11 May 2023 16:56:06 +0000 (UTC) X-FDA: 80778576732.09.7B3E826 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf04.hostedemail.com (Postfix) with ESMTP id 7744C4000C for ; Thu, 11 May 2023 16:56:01 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=wZ6sU9TP; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=bcQ+GC4Q; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf04.hostedemail.com: domain of khalid.aziz@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=khalid.aziz@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1683824161; a=rsa-sha256; cv=pass; b=VZc7EwS5PYuh1rxJR+lv/wJr9JJSJhkIE/pw0GrlWs5OifLFdVEQWWDlKCceuEPE+WAt6q yak13wVNPWEr5teAPevm8bNlBfV/RUUFluwOqDudvfNgGdv+BjK9G/c2tXJRuD9WUHlCRV LCtFXbB85YceQr2WSSmM+1Q1G87m4uQ= ARC-Authentication-Results: i=2; imf04.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=wZ6sU9TP; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=bcQ+GC4Q; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf04.hostedemail.com: domain of khalid.aziz@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=khalid.aziz@oracle.com; 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=1683824161; 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: references:dkim-signature; bh=kyF58D5NbjAxslgZAu/gDp5+Ult0KlMoHtLNnm6xYdE=; b=w6/z1MNy7dZPa2w00SheSDzkn/B1L7Fe7zrmLdXrdfYX4HM2LZfvTiI5s2WxnxUDOa7k4G DjPwd4Yg47oeX+tw0rKJXvJWMUtQT5CVU+/SFgWepgebiyh0ABVLIGeJG8xedGQSWMSAKW wQS8ILQFjJ819ySIRCwlPqktlJ/9ZTw= Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34BDwwtD006607; Thu, 11 May 2023 16:55:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=kyF58D5NbjAxslgZAu/gDp5+Ult0KlMoHtLNnm6xYdE=; b=wZ6sU9TPM0nJXy14KUQEh5+c4x94pltU6oecx2gEG+tfj153cMHrf7cnsalhoWKo3o2g 7uLn5OW78QljTZ8oBQH9fvLwVvT8zR6PxkG1X9NPogE2o/sJ0QADhfmvZKOCjivLI7li C+L+1zY94KfERILo6iS6x1GDHGwgMr39QxA4R/rvBcdKBuvB0ozzuMb0RXiGQTGd9hi4 LaFcMHTmrgxyfjNyHDdqL/jezyMtZtSKUd3OZvCWHE1ZFI3EEbAw++USkVOOTlhC0rZG m2BU8OTqGrdGdvfo4hj+uvTRz0YOFiPR46ULApD1cCbqdIwdP/tnQgZOQoc5lAd50m19 rQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qf77dfr48-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 May 2023 16:55:46 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34BGTv9C014484; Thu, 11 May 2023 16:55:45 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2169.outbound.protection.outlook.com [104.47.55.169]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qf82yp6k5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 May 2023 16:55:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hXBnQgJdnl8zPXuEx80TBB74es4XKSIWvMn88VUdN38erzn1KWaEYKAix1uQiiQKaz/EztfyANXNAiNzE1Bu9H8GuqErJROlgKAi2CWuq453mq+H7hE3COTeU3s6VFQ4o+77C13FXu9rUzcBeFF2bzBp9EZxG5/TXotQfC0IX6Cpm47b8HdG/d69L+r+XyWvwO260CXvJtxyvVhvAV4FAAQ0IbLcw79nLMrALiczJW2GaDF8+aW2OMzFAbmQ0MSARbgLZlPx2uWX9rdaJhDeVEeYxALYTpnyY+a/hS7ez/kD/adxD00cCideXxPnkDJFAqKTJNZ7K/J1wL5jdN9zeQ== 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=kyF58D5NbjAxslgZAu/gDp5+Ult0KlMoHtLNnm6xYdE=; b=RQvJ9d0TIvKNF6QUZTzi3lo/oaPF4mrrA8iRIQBKVAchOQuHz9GK6Q+czsj4q5RrXPUIDGmhWvReJL/GvPxLOOCpYoNCVKb48p2vAPrio+NzH89G1Z0xR7PZG0oWcLHo5E1nlK8A4xO5e7feUDtP4MF0LrtHvzAxEha632UvwIm7vMDM8dBhHHvuYgU+n0dZu1W8p+J0dDdyK91wssVVX044PGWdbfN7ObRK5zjkxKKW+stnoeh87YdqJ9I/reRz65yIurOaGbsy5GKVZJLeapJtjNLeOrACNqGwFya2ftRm7easw9pf9JrnXXs/CAPqmhCp4pYB+JozaDLVZtG7sA== 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=kyF58D5NbjAxslgZAu/gDp5+Ult0KlMoHtLNnm6xYdE=; b=bcQ+GC4Q+R9SADsnSucsdCDExc3Q3V3ZqYr40SmovQodu8LXWI5ku9J5mB6ZWQR2v1HZvS/tAqyHD3EsuIOCe0HrQLzTHafVQY84shWqYchUVlY59ruwA74YGHGtaLQjsv5bCptI1LqIBRQcN6/aF7TZEu5rfTy9yPSz9EpgMT4= Received: from CH3PR10MB6810.namprd10.prod.outlook.com (2603:10b6:610:140::15) by BN0PR10MB5160.namprd10.prod.outlook.com (2603:10b6:408:115::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.22; Thu, 11 May 2023 16:55:43 +0000 Received: from CH3PR10MB6810.namprd10.prod.outlook.com ([fe80::ba49:e5dd:6a80:37ae]) by CH3PR10MB6810.namprd10.prod.outlook.com ([fe80::ba49:e5dd:6a80:37ae%6]) with mapi id 15.20.6387.018; Thu, 11 May 2023 16:55:43 +0000 From: Khalid Aziz To: akpm@linux-foundation.org Cc: Khalid Aziz , willy@infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Steve Sistare Subject: [PATCH] mm, compaction: Skip all pinned pages during scan Date: Thu, 11 May 2023 10:55:16 -0600 Message-Id: <20230511165516.77957-1-khalid.aziz@oracle.com> X-Mailer: git-send-email 2.37.2 X-ClientProxiedBy: SN4PR0501CA0035.namprd05.prod.outlook.com (2603:10b6:803:40::48) To CH3PR10MB6810.namprd10.prod.outlook.com (2603:10b6:610:140::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR10MB6810:EE_|BN0PR10MB5160:EE_ X-MS-Office365-Filtering-Correlation-Id: 866ae541-337a-4be6-b944-08db52408ed8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eY4LDAw5IzmpFIDNUrqrQSBGqQeAY4T7pN7TPQstp3TWjDYndNE+IK3ChN5a1aqXqxa3W95QqDrHMdFl/2Bjxc3CXXNR043eAxmXGB5uDId9+1IiLUXCYWizqdjFNsDMsROpBBAyerHlB/W69WNIMAzc2HzUkHWTvTTbFXGIwJN1S/XAtjCAW0u1ziUqQ5duXoEBKnEH0+rdg7RQE8PUZOVcQED3L1IUKhxeNuqVDzi1qW0RI9mDhvVebYvSJ6aqFgk2802brDvaCcGkW4IXpCVKNtqHijV+zSJK4heHMmpO0wnFHAkM07yUQX/jiDFO3mKkuMFh7DigT/kLEkJWyr51EjygLtGfwzgptjrCqnxjo9TM+Ga6rLIq4yla2L8GL+4rQ8nwx+N1wIHso7ynOqYsEUHiWtSsvbag5Zoh5YJ4CTxoeeWmvLP2aDT+zmbeb7LagyDsq4GasUTHfhoUtdIyXA4s4mC7Faz/++aOM1WeXpfcExoOsETg+SU6VWRg08R90l6lNffCvaWVfDXxzNSNLyqHYaqHc9KXSk4tX5IFM+Z7bMSw1BL2Yczzt36s X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH3PR10MB6810.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(346002)(376002)(136003)(366004)(39860400002)(451199021)(8676002)(5660300002)(44832011)(8936002)(66476007)(6916009)(66946007)(66556008)(4326008)(316002)(38100700002)(41300700001)(36756003)(86362001)(2906002)(2616005)(107886003)(6512007)(26005)(6506007)(186003)(1076003)(6666004)(6486002)(54906003)(83380400001)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tTVMZho6x5hGjHl8PHCNuVR7HyJEw4ctGDbP7l/fcxJeqSs8xN9bfV2qP5Sg+DcWqcj1cXmRRDDggRodd/P8ZOMtEjn0EcOc3ZaY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HT4d5cHcKGIb0AT+bJunLeQp+PYp0uTutAAcGVT1DDvyxkvyGF+nbL7IVutwrXvfAovy3yahAM8JVcgOi8TCmBoNinz8dyISPWHo2EytCO1xtxDKussLpgXCgwBVmadCv6133ASIbuIr419WviDvfahSK6OAxaI60x+XfxgcgVJDOUbdqvBX/Tmy1m7p9E16qYFeQsADa2dGmqKOCPWI4f5vwAUFcD0ZV4WeLVUDAK5nsIMvXFYMh7CJJsLpQltuGFk9r8ECVOfSoCZYpEuIV0o9w1TOLz37YrLDiFxUKfiAKSgK5UjJPU3w/YVl2J39 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 866ae541-337a-4be6-b944-08db52408ed8 X-MS-Exchange-CrossTenant-AuthSource: CH3PR10MB6810.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2023 16:55:43.3279 (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: S/V3k+gtnjqjP36jdoZiCrthY6LeIceED0Pzci9kottw5oFL84Bp0ZLZYEzxxJE81aV6IwGaUSzJ/5g35QSmAA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5160 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-11_13,2023-05-05_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=804 malwarescore=0 adultscore=0 mlxscore=0 bulkscore=0 suspectscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305110145 X-Proofpoint-ORIG-GUID: acmc4lioxqrfPwNd0lG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KCW4lBRCVbd1JtWrzD4ga+PlRPnBppfyclr7MOblnMbYY8jv2oGH0tI2MBQzPJ7dE+Zr6ftKZ6zZmW3UK lV2/rYEL mnu/cYETcfUUUR/1W4p2eeq464vLiU8yaG1E4NWHxY1nThnOqiZjiPIdnJ2RFuBaPbqnOfV65+a8Rkx7hgPej5yrv2+PGA/rzTUGoOWZ/LK30bzSdH0QFoIxBifULneDkvgk1/SXVtycE6lVY9Dr6QsKTupvZWlhdaVoaWKil4Lm7OQv8KbGosRfMHveoKtU4LSmLKYdMJ84Bnf79IuBEbt6tpdaFYdiC07HDOjaq0g7nqhL8ImMl/DSHKB79K11QkXohDkuYXzdvf+eXin6QyyX60HRELVZBdW606HPepHQO9Ji3Du1MP5YyeAc4X66qM5ha2RS0MMtv5Q1zxoTdNtMOkXYT8PPxsGJnWJDL0U4XUUmTo66YMQ90R0yOsCswA74r 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: Pinned pages can not be migrated. Currently as isolate_migratepages_block() scans pages for compaction, it skips any pinned anonymous pages. All pinned pages should be skipped and not just the anonymous pinned pages. This patch adds a check for pinned page by comparing its refcount with mapcount and accounts for possible extra refcounts. This was seen as a real issue on a customer workload where a large number of pages were pinned by vfio on the host and any attempts to allocate hugepages resulted in significant amount of cpu time spent in either direct compaction or in kcompatd scanning vfio pinned pages over and over again that can not be migrated. Signed-off-by: Khalid Aziz Suggested-by: Steve Sistare --- mm/compaction.c | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index 5a9501e0ae01..d1371fd75391 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -764,6 +764,32 @@ static bool too_many_isolated(pg_data_t *pgdat) return too_many; } +/* + * Check if this base page should be skipped from isolation because + * it is pinned. This function is called for regular pages only, and not + * for THP or hugetlbfs pages. This code is inspired by similar code + * in migrate_vma_check_page(), can_split_folio() and + * folio_migrate_mapping() + */ +static inline bool is_pinned_page(struct page *page) +{ + unsigned long extra_refs; + + /* anonymous page can have extra ref from page cache */ + if (page_mapping(page)) + extra_refs = 1 + page_has_private(page); + else + extra_refs = PageSwapCache(page) ? 1 : 0; + + /* + * This is an admittedly racy check but good enough to determine + * if a page should be isolated + */ + if ((page_count(page) - extra_refs) > page_mapcount(page)) + return true; + return false; +} + /** * isolate_migratepages_block() - isolate all migrate-able pages within * a single pageblock @@ -992,12 +1018,11 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, goto isolate_fail; /* - * Migration will fail if an anonymous page is pinned in memory, - * so avoid taking lru_lock and isolating it unnecessarily in an - * admittedly racy check. + * Migration will fail if a page is pinned in memory, + * so avoid taking lru_lock and isolating it unnecessarily */ mapping = page_mapping(page); - if (!mapping && (page_count(page) - 1) > total_mapcount(page)) + if (is_pinned_page(page)) goto isolate_fail_put; /*