From patchwork Wed Dec 1 14:30:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 12650519 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 02B33C433EF for ; Wed, 1 Dec 2021 18:03:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 655606B0072; Wed, 1 Dec 2021 13:02:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6039C6B0073; Wed, 1 Dec 2021 13:02:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 455E46B007B; Wed, 1 Dec 2021 13:02:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0038.hostedemail.com [216.40.44.38]) by kanga.kvack.org (Postfix) with ESMTP id 36B306B0072 for ; Wed, 1 Dec 2021 13:02:54 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id F39891816C8BD for ; Wed, 1 Dec 2021 18:02:43 +0000 (UTC) X-FDA: 78869995848.27.16EEFE9 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf26.hostedemail.com (Postfix) with ESMTP id C7ACC20019CF for ; Wed, 1 Dec 2021 18:02:41 +0000 (UTC) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1B1EAZeq017206; Wed, 1 Dec 2021 14:30:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=zHp13GAdLIg6NII8GzYxYVLaHJFP1+qrrCimtokMQik=; b=UDFVwPJjH6rrCTPW/JBO84B1FQxAFNf5eti/e9k4UMoH08WVyEOYVuuojAFERiQ77CAr 8Q340grkhCE1nxnt6SdDFJqDdiUWFC9GMiCIUhQZzuPNeLofaIFTE2+vkY3S8CkDY7qg 1tR6hHzcz/SHp0xSPinWta7RIghXwrdUJleYL+PM56V39s91757ZfS8Me/in8QLZe/rR 8McDJhvMU62Pdv0N7YR1tHeInsGAzRATqsxv0sBkl757yL6WwkayVc54X6VMuLbFee9l bzXQ9d2QyBSDmv5ePLKEvyHQYlPbKkTr1PYxlqViRFqXy8d3cUiloAtx3XY1PEwhVOFM VA== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3cp7weh2wj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Dec 2021 14:30:55 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1B1EBov3037539; Wed, 1 Dec 2021 14:30:43 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2171.outbound.protection.outlook.com [104.47.58.171]) by userp3030.oracle.com with ESMTP id 3ck9t1v6xx-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Dec 2021 14:30:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GYb11TZMWwH4qC3tbYmOkovrapPoFRgO2WFxfosaS7VnfQtXEA+4BzLE4jTv3Iis0YWa5ULLYboJRWzVayx8btYeM3jDt38zHl9GAnNdC2sM3aXe/3fKKy395GDShop/glM4gR/HXkgic1nzSg+CeB9UXZCmIrd8hWV6XGnZ61fsNbCF5r3srlhjFJOTrGvSI3nc8TOBQDjMEKosNuZCeGCBqJQ61dMRNk6TK81HAckNAYVpO9yCXlJq9d5bq586HcwQP1DEMIxX3Qw4Ux/HAu2MGkoHr8UYk67i3DQKu2iIQ/0XEcbPl/lDR/feCTs1eHi0hh0tcBezPKPVJx916A== 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=zHp13GAdLIg6NII8GzYxYVLaHJFP1+qrrCimtokMQik=; b=Qx0XUbrpDzQSU5tsfxBdJ4kKAX8OAd+zVfYv4efiqQvM3zBKkM+Q2LmdBCdwsE0wkQ4HihljMG49vwp1Zo5E/zZ/x8YT1MgaF6nEp2h7l88aC7BfEoN2+MSgV1E+4CPYii/otGDUQxyiXdGUlXaWmoY/NMWGbooW59ZoUNMCSxjzx8hxehG/V6l/5O9cJJgi/qPbthibcMmXfwjlxPCMhRweoj1DlIFAPXhuNSykse9Fjk7x5KCSqqgAS6b3uy3Mupa21Q0WHD2Y7cA4eonCIsJbPIkf6mernqhvqZGgHDJ1KUYFeuKUb1/I7aTqLuzc4NnxXseAWyo5y3nLyr8E4w== 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=zHp13GAdLIg6NII8GzYxYVLaHJFP1+qrrCimtokMQik=; b=o9COx2D8nB560o2fKBr+gyLVxeeQTUWDjhbfv3eKF2uXgGL9Or68LXWH932LHmVD8aWKwWi0hLWexBsqqURuP7/qwCmmocX5qBp7ZFo42n6a3ey8TAJ4DfjMjehdxULaHszHkBWAYPz0sqtyiXedTXB/4FT5inVwHBkWmfKC0J4= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SN6PR10MB3021.namprd10.prod.outlook.com (2603:10b6:805:cc::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11; Wed, 1 Dec 2021 14:30:40 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::c4d0:8291:84d:ac66]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::c4d0:8291:84d:ac66%7]) with mapi id 15.20.4734.027; Wed, 1 Dec 2021 14:30:40 +0000 From: Liam Howlett To: "maple-tree@lists.infradead.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Andrew Morton CC: Song Liu , Davidlohr Bueso , "Paul E . McKenney" , Matthew Wilcox , Laurent Dufour , David Rientjes , Axel Rasmussen , Suren Baghdasaryan , Vlastimil Babka , Rik van Riel , Peter Zijlstra , Michel Lespinasse , Jerome Glisse , Minchan Kim , Joel Fernandes , Rom Lemarchand , Liam Howlett Subject: [PATCH v4 53/66] mm/madvise: Use vma_find() instead of vma linked list Thread-Topic: [PATCH v4 53/66] mm/madvise: Use vma_find() instead of vma linked list Thread-Index: AQHX5r/0qPGeFGLrRky44W3b8b2jaA== Date: Wed, 1 Dec 2021 14:30:14 +0000 Message-ID: <20211201142918.921493-54-Liam.Howlett@oracle.com> References: <20211201142918.921493-1-Liam.Howlett@oracle.com> In-Reply-To: <20211201142918.921493-1-Liam.Howlett@oracle.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.30.2 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bc74e85a-620b-4119-80dd-08d9b4d7267e x-ms-traffictypediagnostic: SN6PR10MB3021: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1060; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: kzP8b8b+sRzPM1MM5VlxneEtLSo9nEhK07RQbFal7o22OT0h38rtK11gXALnUM3R2iMfK3lM3IiGhZbo06Jiwvx96LSgRWWruW45mcfHrkrXMqUzKd5A3XSU/zVdz8ArZ8vYtnqCowW/bUIZUMQN+84D4e6qX3ekycCgGFZ6wW2zVY8mzhqQYY25SPAPlLSbJF8GscsBJo/eL/Bf3oJYOR8PiGNyEX9unEAMXbrwcVW01Ki9yDkVpB0q1TyyDwoIeOBy5Kzyz3OuPoejfjXzeoVRohcE7n+xZeMb6ulNXJ8l1Vdbw2yrfLaBva0GjqUa4Q8GazLJ0L0KjB0TcO+LvGZXIXngbDWcTNJTVN+UfRq0kvmwvy1H5gl9ROCM3oYnYG6WEQoYdVnx/N6HkXcss2dqM89HNiErWVhC8nm6qSuFLnYJHfPOEClTOTOEEIcvw7xK0o3X/LICbo/b9Qsu4tYAvpKvv0RPGooC4QnrmcfUPlfjW1FFqME9mmjYsKQktJYyB11Bgm9QT/fWIRvxC1aFqGeE/P3yRrgpt0RtzBcJ9oFFOySseB0LY7zjfXvrEC90U7lau6n446H6fNA398gIIKTccC8wgFZVmK1cH934mlkSmNUesgeu1+OabxyzbpcwL5km57PRZDc7SvrhebRPGGCAdT+9ukmtlbOrKyNi2cObg4RvpTuPCba9YZyDjvWMWqNqEUprJiU7Lw4sdg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(66556008)(7416002)(38100700002)(107886003)(38070700005)(316002)(66446008)(76116006)(64756008)(66476007)(2616005)(122000001)(83380400001)(2906002)(6512007)(91956017)(508600001)(66946007)(71200400001)(8936002)(54906003)(186003)(86362001)(44832011)(4326008)(6486002)(6506007)(5660300002)(6666004)(36756003)(8676002)(110136005)(4744005)(26005)(1076003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?9yA1+9wgVY321QEuKx8LWJE?= =?iso-8859-1?q?0N1XjvP64tcakrf0uM2gAR3cDgO0VLmAd8Epchn2uv3OxuchzWOqi+ZAbiwI?= =?iso-8859-1?q?szG4l7sYTHs5BvGdNwB6T3+dsYewMfC1t7IFyTAaCHpgH1bRkMExTgnCPYro?= =?iso-8859-1?q?cSXVBH0eBNdP/ToF5cuxGU5LfkZ7FbSRoYZKFE0ZQMY5kNBWXp1OA1mA00Mn?= =?iso-8859-1?q?4XcOBrM6u4O9smQMPaIXbpuVdstYQqbiNv/thjsvyKBxj9iZSeKJYE4mzA9o?= =?iso-8859-1?q?EHZRtz9bEpe4nSK7w6XAPBJvdkYilBzXIV1HyalQp1HlkGO5ATdY8+cN6EGM?= =?iso-8859-1?q?Ww7Sre/tKdWNEP59ZZ53T8JX0S8IW/Am5OuGsWu/u8oPRlSxNw9cYnqpsZg0?= =?iso-8859-1?q?01xbQI3gl0wyKLkwDnwG8mX1N9P6YuZZv3IYgBYgW2S+GaSRWRFf1sFlpxHI?= =?iso-8859-1?q?cdpDhmAAo0KYEx0DwINMRB4Mq3hoHXgT5QCEPqoH5KlFrAeipalZF1e3aL0P?= =?iso-8859-1?q?hWyjE4tYssrbmJKf9B+VVkzzKnjBavGJBid4LNWi21HMzkyzQ6/T3uX9xsfJ?= =?iso-8859-1?q?VEtFy8v54qE4LWXf0jk0B9kpyaCIE+4qgyN+xvX/DBrCzAFixsOv3VmqArzw?= =?iso-8859-1?q?TVV98yoqw/wq8OIZJSr19rUuHMtEnfAwEZ9LUN/zRLKJ937nqz/AcdNtNTX8?= =?iso-8859-1?q?J4AbX65ncfpDZNHoBMiF6Kn2XUs83/ttwuFSUu7lmzo1Rw7NQqj3bKZxk5ss?= =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6Mnqv6r7FQ+VKtC0TnbVpkUkp45EO2cDXewwlFFkQMcXITB8?= =?iso-8859-1?q?=3D?= MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc74e85a-620b-4119-80dd-08d9b4d7267e X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Dec 2021 14:30:14.1709 (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: fsMtIt0sYJMIyoIIu85IPz2To2AVLjJYt1o5AqMYR8A0w/DwiPrvY1Jg+50QOt2GZOSgyX0Rss38Hb7B/2iMoQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR10MB3021 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10184 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 malwarescore=0 spamscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112010081 X-Proofpoint-ORIG-GUID: tY6XSLte00Ky_JtktO9i-SehHw-AZLUC X-Proofpoint-GUID: tY6XSLte00Ky_JtktO9i-SehHw-AZLUC X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: C7ACC20019CF X-Stat-Signature: 16oh9xnmaabr5omeptarbaaf66w5ttfw Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=UDFVwPJj; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=o9COx2D8; dmarc=pass (policy=none) header.from=oracle.com; spf=none (imf26.hostedemail.com: domain of liam.howlett@oracle.com has no SPF policy when checking 205.220.165.32) smtp.mailfrom=liam.howlett@oracle.com X-HE-Tag: 1638381761-487007 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: From: "Liam R. Howlett" Signed-off-by: Liam R. Howlett Acked-by: Vlastimil Babka --- mm/madvise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/madvise.c b/mm/madvise.c index 8c927202bbe6..cb6daa98e5b1 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -1209,7 +1209,7 @@ int do_madvise(struct mm_struct *mm, unsigned long start, size_t len_in, int beh if (start >= end) goto out; if (prev) - vma = prev->vm_next; + vma = find_vma(mm, prev->vm_end); else /* madvise_remove dropped mmap_lock */ vma = find_vma(mm, start); }