From patchwork Wed Dec 1 14:30:06 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: 12650503 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 46FE4C433F5 for ; Wed, 1 Dec 2021 17:58:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 87B596B0072; Wed, 1 Dec 2021 12:57:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 82A7F6B0073; Wed, 1 Dec 2021 12:57:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6563A6B007B; Wed, 1 Dec 2021 12:57:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0124.hostedemail.com [216.40.44.124]) by kanga.kvack.org (Postfix) with ESMTP id 54BC56B0072 for ; Wed, 1 Dec 2021 12:57:52 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 1C8751813B4EC for ; Wed, 1 Dec 2021 17:57:42 +0000 (UTC) X-FDA: 78869983164.20.70A29DC Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf10.hostedemail.com (Postfix) with ESMTP id 5AF186001987 for ; Wed, 1 Dec 2021 17:57: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 1B1E7UWF017207; Wed, 1 Dec 2021 14:30:53 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=BefKbS0wfGwngATHy2Ni0q1IDcgRp3hkh9demPj9Yn0=; b=IAh/MjWz+BKEo4IVo0JU48LTyVsEHTPBWPgbEe54bXd2XK7CMPDHaysn20plfZ2pX7TQ D66/z6ww8s7U3YrC+pXrxc3cHTD+7nZrM9BP8V74MMRFhOU8xF9H0Ks2D2bqKGvvwYxx /yymyVnpKvWKCFZiFwyurHKuMIlguTlNtvGS/ftFotU0qJIe5KIfPDNMk23GPs67Ibv7 mswZzh/JAQaEllrHQo4bswy0X58YcNl4wPM2kFBOcgIHfmF1DFHlF68WpX75A6zFnAOY 9Iiss3SOxt1J/F2mdbujExv+C+u5Fa2kBTk2sy/bm3Vbsg3KohnvRqeA8ayjq6kkpUhf iQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3cp7weh2w3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Dec 2021 14:30:49 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1B1EUNPP108922; Wed, 1 Dec 2021 14:30:40 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2104.outbound.protection.outlook.com [104.47.70.104]) by userp3020.oracle.com with ESMTP id 3cke4rv5ew-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Dec 2021 14:30:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eQt9BHbJzhLb+8k7IB1lsnDP0TfyCiH8pknCzoQy+CqsvGCgqbr4gXxr6AxnDjCQ/SI44WUJTCFGjy44LOceaG9kd5y8yljytJLoVGzeAYn73IvInMgb1nN6/W2jBWqwy7UinMaRfHaMGhvPodVKrhZEP8HbM//rIUL+E5jK6AwX6i511cQNBQcvEeKBcPXgtVJrEIA+G0/qv7L2V5Z6VDYcp6FVv4dkSxRt15KNQaE8utkGSbe9bwB4RM+Tj3H7qULRTd0YqOF4Z8Q6YXuQK64/IYmIx9HimX/hG5vIkDna/aC/YEUEIajyHKrzPhrlS3BCcxpVlBNq+t0AuZK1cw== 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=BefKbS0wfGwngATHy2Ni0q1IDcgRp3hkh9demPj9Yn0=; b=Grh9L5s8Gh4pA76Bt16+w+I5X3i1SwIBqrg9duRd5kDLY87jeD389HdSjNivXPcZmTAHxt5+PgjNgFKR50lVvIdVeaydGnZtfFzwQqiEKT6I/qsrOmb4ahB9M+3sFne5Aw8IYYyJe/InNuN0sn1RDLPHCnQ8df2qclLMnHUZmEzuC04He0CmYiaiDM+uSP7M50CGfPGerNhmAKn9+E7ha0GT+gM2LLPTEW2hAfMe/y2iA6EEFgbMebLp/TsAqZ0XWq2k+gJLyEygfvtA5I97XcvFBs/1ZwNEMvEuvNYmYepK/hE90sqy5OEMyJ0XVEFI7MRgFwg0CbP1xWgfbaXD5w== 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=BefKbS0wfGwngATHy2Ni0q1IDcgRp3hkh9demPj9Yn0=; b=MuQXBFpvKCmmtCGSp8p3gIvQYFxRgGYZQOoJahBz8PB7Ky0GmxUvtQD3HrRSexdY5lM+VUK4Tu7wmv1yMH1SyotmJSu6sOsK7T2NrL9dhWtCzaqVtvKDbXGLhRiEHKcVw0X/KNrbJs0Q1/wbi8qCKBL8MNnhNZ8QGF1l4EzjSx0= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SA2PR10MB4508.namprd10.prod.outlook.com (2603:10b6:806:11d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23; Wed, 1 Dec 2021 14:30:36 +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:36 +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 33/66] xtensa: Remove vma linked list walks Thread-Topic: [PATCH v4 33/66] xtensa: Remove vma linked list walks Thread-Index: AQHX5r/vRpDQ3tKIRkGBusNvbzhALA== Date: Wed, 1 Dec 2021 14:30:06 +0000 Message-ID: <20211201142918.921493-34-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: 6b5818bd-2c1e-46bc-91d8-08d9b4d72414 x-ms-traffictypediagnostic: SA2PR10MB4508: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 65mhI1r6nbuf+ch9mWmJ2mpcECsjaqTOX/iH3KfGwQkRpJru2D8YsMJz33pouZYyouuGaQxnQxYmmLEamiGYnZwprUbDRmC79OC8Q1M4iFbu5mlJlfr99cf9LP1JN0cBmNAVkahHlK/aER5bwiywK+A/AN9XtUIA/PsiLohO0iNSv57W0YLUVuGBwKt8+8lQMRDf3Ti780Wl22EGXQe8eBuIwy1TAJDjt+b/OWOYJJy/sAmZUdDtNb/xWLa08pXe4+anxiBu5ZCfRQwTT7qVAgXicrL+jI48IoyqCF3wG3+BFzzdkzptR3R4W8k25/R0WkjnYy9DirVcZZ3Lb29Puf/DAxensWNCZGtuUbX2kU72rbaaS7BqWXpooYD5yIXfkqSbnCeWJiM0Kwh6oLKK6EgUco8lDLxddfCerYYGiL4iX0BUVOTPQf445EcDVjyHMQB1Ck9A5zwNiBQe4ueof17VKyGjuVT6dTJ3e97QRU4CTGXdt4b+GXEKuPpRjjFNqAdIZ8TIR9Qjwcrnwzb1UyDtSlZ/iqKbzbIEJoVwFN58AgPgpEIveI4mv9ZPG1GMqK/FBsDAsBehyRpobRifg8ErahsTBRJPCgzZ2He8BlKtIKObRRSYNVaTrVqQmgO0ytjas8/x541wkiocb9/NfGpaAfcg4cMHkQKDIKsVvNB/nnSl2odvKx+iTF2Hpdo/hAnBf9Co+x3BExUF6ZcdCQ== 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)(186003)(26005)(7416002)(1076003)(2906002)(8936002)(54906003)(83380400001)(2616005)(38100700002)(71200400001)(66946007)(86362001)(66446008)(8676002)(6506007)(38070700005)(6512007)(6666004)(122000001)(508600001)(110136005)(6486002)(64756008)(66556008)(76116006)(91956017)(107886003)(316002)(5660300002)(44832011)(36756003)(4326008)(66476007);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?viwRToZjzwZ6/vWqJXY39hl?= =?iso-8859-1?q?vfEuw6S5uNk/vXs7KxUE14m3MDXrDhaisc1rWuzT3Ez5gcq+j25h9S7aoTcR?= =?iso-8859-1?q?a8sp1eHE4H2n7ZeNLS5SvqZ4S+jBCrJIYqhTE3E5kkjsh50wbYVZr8VSWl89?= =?iso-8859-1?q?3jpHF5Uz6L3uX6Acl5/bsM/+3nfMhyc2qdphskLJFsKyTkiIzeQ8klpbTrju?= =?iso-8859-1?q?/cSLnLmRxTXTDtlQ9Zi0Y9/ZGOUofWn5gY+EmuOeX9JIX99yH1loV8zMCBy/?= =?iso-8859-1?q?JufqR8wU95e/thzU+EbbM3pqfw9SH/j/bTz+hnqIjVaOqrVqDVOO290kRCZZ?= =?iso-8859-1?q?tO2k3vch8mlgRDpa61lX8Cm4eud0Inzmo2Xwrv41QDEcvlrzowf/Q4JIZ51p?= =?iso-8859-1?q?zZ6ndrw3au+xkrxD9GAFe0OtwfnltJdwn3NWPX+R76cjqMb+b8j5AAjkuh2r?= =?iso-8859-1?q?07EyAdbW8fbeaUP+zLgTJbYLmgPIL/DNUG4lVHnBirYzwKFNQBcPvFvbid46?= =?iso-8859-1?q?pSIA0UH7v1zAxBZUUzbX8Zqv6ru602GsKiiEoSONfNGo+B6sho/7SmYbIwx1?= =?iso-8859-1?q?x51n2OdUXH9STuQUkXEOLWzbch8B87mdbPbxxEtOgDitKL9Wb8kFCPTHAE0A?= =?iso-8859-1?q?0YAwKTkWM3AC5jvjBvY9AfosS7XU/4/gZZmcGukos8cB7SDUxKnkiyhnTQJY?= =?iso-8859-1?q?uhzRa2c6yW15rGHdwIkL/9YmyTOHAdN7Q91e+rtrg3hdiX9jbYfpGoMWbdEw?= =?iso-8859-1?q?Iqz3pT5FlgcZESAH0eXdN3k+qzSBFaMqROI40BRYDk/92ahoVcCjiaeeCwM7?= =?iso-8859-1?q?g4SLxiRXeZhEYPZjcLv2pR947/fT/5RdRsCUe3ODa6lE4hsExdvHo9hfF4Xe?= =?iso-8859-1?q?Ze6jcAtNg+zLt0MZvtavd4woAGgmEZWyBAGZU7bjUKYbFTvVAkcU39AEkPGW?= =?iso-8859-1?q?cG5a6hM8HhO2sejikMcGy8PREeyM1gP/4qNfq3vTctxTj6crLlrI8YIT/OMj?= =?iso-8859-1?q?gikmCO4iORyOMetKNXznqiU7p2ttDu2lqGnFmJAJUDJ8OWA8yAZjbOaPcJJd?= =?iso-8859-1?q?iC0bnx16D1ud8SN1apdoJ+yuKmD4s3mmVgmrFyfTab6YW8DISHkecUHo/Fru?= =?iso-8859-1?q?HKfWe79wpixxljOERo+U+QLtWt3lGciOCRBNTn8+z2Tu41aywoZwr8K+U31A?= =?iso-8859-1?q?PoItMc/edCLd0WZ3NkOupuni2MXURedPfsR+INpwnGbQMLudrl+wym2hBPGx?= =?iso-8859-1?q?298xpgs2lajxKQSG341iL8Y5aM3coCjsucRe8TAKLjyk/wR5RgFPXviGOxao?= =?iso-8859-1?q?5aypKA9CHJ++AX/N8/f8gjrmTy2kLZG9iWziSuR9NVcczeMsQW4Tj3KqSARK?= =?iso-8859-1?q?Ms9y2itbH9H7VYgpl9cQHNPhyqkAqTaQZPESCAW3c12yf0KTWeWRtMFpxN+h?= =?iso-8859-1?q?aAh7GU7dN77gDk3WPrKLtum+fUH6bf/JgVu4i3ofJQDkwYYichoSwFq2tL12?= =?iso-8859-1?q?VpA27EZWQOt4qiuNwO4yGycOLmcwpBcSx+CnKR72NN2E2DT76BdTRmVU0Viq?= =?iso-8859-1?q?NbKo1oQyxyHF3Z7ZjV2VmYP5n3BIWyPHPGON6OcUNj24/6gRSha/oMQYIp5J?= =?iso-8859-1?q?W5/7JOk5EFLmIJB2wLvAdw1jQTeDJcfU3YjnSEBsU2Q62zNsB7TKrAYbW/xo?= =?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: 6b5818bd-2c1e-46bc-91d8-08d9b4d72414 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Dec 2021 14:30:06.3464 (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: rpOsEkSRUUhM9Fv4bKhTR/4gVWo69+rKgg/Cb7UaQTkszm5D3Wx4odu8G6UiojylMdsMoQA/LHguM2ZFX2pIIA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4508 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10184 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=979 phishscore=0 suspectscore=0 spamscore=0 adultscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112010082 X-Proofpoint-ORIG-GUID: eBany2LKpqpzdc3Y3LAumz4WDa2cABHf X-Proofpoint-GUID: eBany2LKpqpzdc3Y3LAumz4WDa2cABHf X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 5AF186001987 X-Stat-Signature: s1p5iijhajuawnp46azczqkm8w7jzjun Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b="IAh/MjWz"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=MuQXBFpv; dmarc=pass (policy=none) header.from=oracle.com; spf=none (imf10.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: 1638381461-231832 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" Use the VMA iterator instead. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Liam R. Howlett --- arch/xtensa/kernel/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/xtensa/kernel/syscall.c b/arch/xtensa/kernel/syscall.c index 201356faa7e6..20ec9534e01f 100644 --- a/arch/xtensa/kernel/syscall.c +++ b/arch/xtensa/kernel/syscall.c @@ -58,6 +58,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) { struct vm_area_struct *vmm; + VMA_ITERATOR(vmi, mm, addr); if (flags & MAP_FIXED) { /* We do not accept a shared mapping if it would violate @@ -79,7 +80,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, else addr = PAGE_ALIGN(addr); - for (vmm = find_vma(current->mm, addr); ; vmm = vmm->vm_next) { + for_each_vma(vmi, vmm) { /* At this point: (!vmm || addr < vmm->vm_end). */ if (TASK_SIZE - len < addr) return -ENOMEM;