Message ID | 20220202024137.2516438-66-Liam.Howlett@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 1C298C433F5 for <linux-mm@archiver.kernel.org>; Wed, 2 Feb 2022 02:43:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D839D8D00C7; Tue, 1 Feb 2022 21:43:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C7B1A8D00BE; Tue, 1 Feb 2022 21:43:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 795ED8D00C9; Tue, 1 Feb 2022 21:43:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0053.hostedemail.com [216.40.44.53]) by kanga.kvack.org (Postfix) with ESMTP id 3AEE88D00C7 for <linux-mm@kvack.org>; Tue, 1 Feb 2022 21:43:34 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id EDD24998BF for <linux-mm@kvack.org>; Wed, 2 Feb 2022 02:43:33 +0000 (UTC) X-FDA: 79096293906.10.314327C Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf08.hostedemail.com (Postfix) with ESMTP id 513A9160002 for <linux-mm@kvack.org>; Wed, 2 Feb 2022 02:43:33 +0000 (UTC) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 2120Mghb026641; Wed, 2 Feb 2022 02:43:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=EtFQih9WHTZJCiDj/1qdlcL9IV1NbnnAROwE/wgF5IU=; b=MuycpqHwfZIj8UFriFK1rzMoCEZtJyGTjtssD1lnwpzCK26zMVh3QTMbrWo0EhFLKsVF QjzlYsRFgiH697qG1rd1tjgeTMnXnvJBKnmIWx3DZg3ssjrjIwLZGeGOwkPttTE2OFB+ erBi1Z4zPUKRTpmZMrlZL+nNqaqMP3izSjRQmdGABvMHvFoTJDuH0tTKVt6K7nfVrY4+ 4AyY5KH4hWPV87qYqPJKux3GVQqS9Up+pvDqLvLuKYS/69/74RMRPIQAfwtvmBa4OUvO yAnNauXRgRb2hyGBYqp8MLxtPicucIn85fkyQjBzVumwm+DL9b2MV48W8GJdeW0wWkBY Qg== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dxj9vcu2d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 02 Feb 2022 02:43:32 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 2122ZPVa146749; Wed, 2 Feb 2022 02:43:31 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam07lp2042.outbound.protection.outlook.com [104.47.56.42]) by aserp3020.oracle.com with ESMTP id 3dvwd78wmn-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 02 Feb 2022 02:43:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jN9HoxTY9kB3WgorSeiF6sDNEVO+2Ium3cGaQl5pMSZMfyoXfpAwFuzSeo/wb9zQxgJHXb0BZ/SCCnhBRcxVchWHRzp/HpNLS8xd6MCjJ1qkTORS819SaMWpOM7unFfdOZnNaUpryIZ+b4ZfUbGszXPRc/vn8qNTQG3TltmHsEx2vSxRejTWgkl7r7E9hPTTNcyWoAJq/00Td0VwltqmCKw2ZCxCORezTuzebaFl57nTcwCBcAo4ygtywBuJeB7wAqd8nOVTX2NZsquRTIVAJ+Yytt+FEkhF4ZK29FI71Jf2Dm5BPdFx0c5RdBmom3ry11nn9epJW4xVXyJIHn9CYA== 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=EtFQih9WHTZJCiDj/1qdlcL9IV1NbnnAROwE/wgF5IU=; b=OGV1i3qVSEPbZoyAQTqdjbb9FvGZuQOQJXslfy9zvOBa8wlJ0ghXRJLO0rZk0p/LqWiZOxCgcxUYwlWtbLDiIDMeHNGZDCGWvzAWC52OF+MQSzicyQau9Yal83nJavzLYoF24MyeAJu+ZzFMSlD2MnYdZwkyj2kJEyvet1rieUZsMO9J1zDQk2zzxnLtmEUOSdMWKbjMLm1o58BV5PDEGOlcd8DWSd8KEJHQtoTX/vF8hWzKCL0TrBX5PZpSrd/tfT4MSsGda4liCI1jhXfGT5Qn6zYZsLypS+IngzUXHuqBHWagXdw43EF6DzHtemW+o1uq7d0DGQhTYfnOBpqZJw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=EtFQih9WHTZJCiDj/1qdlcL9IV1NbnnAROwE/wgF5IU=; b=xjdH7PqT39eUeOFBJj5xyXXfvwoTi072gY+ylkF488NFVq9S62yrswZbj5IMGN5rrL1QqnlA5lT1LnWo8r7Jrym9ZP0IckvFxANNtxoU4uqN1EyJaLQugaoSA5wnsoEtuRvqL2C/Nebks/kUtBNHklSkQSATERhKH435DIryEQI= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SA1PR10MB5865.namprd10.prod.outlook.com (2603:10b6:806:22b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.7; Wed, 2 Feb 2022 02:43:29 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::3857:3a25:3444:fdd3]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::3857:3a25:3444:fdd3%5]) with mapi id 15.20.4930.022; Wed, 2 Feb 2022 02:43:29 +0000 From: Liam Howlett <liam.howlett@oracle.com> To: "maple-tree@lists.infradead.org" <maple-tree@lists.infradead.org>, "linux-mm@kvack.org" <linux-mm@kvack.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Andrew Morton <akpm@linux-foundation.org> Subject: [PATCH v5 65/70] i915: Use the VMA iterator Thread-Topic: [PATCH v5 65/70] i915: Use the VMA iterator Thread-Index: AQHYF96CFZN7DS80u0eHsd19NJdXPg== Date: Wed, 2 Feb 2022 02:42:24 +0000 Message-ID: <20220202024137.2516438-66-Liam.Howlett@oracle.com> References: <20220202024137.2516438-1-Liam.Howlett@oracle.com> In-Reply-To: <20220202024137.2516438-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.34.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 758fd911-086f-4121-2fdd-08d9e5f5cbd1 x-ms-traffictypediagnostic: SA1PR10MB5865:EE_ x-microsoft-antispam-prvs: <SA1PR10MB586505DCBB1251787320DD5FFD279@SA1PR10MB5865.namprd10.prod.outlook.com> x-ms-oob-tlc-oobclassifiers: OLM:4714; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sZYoKpPFbBaX/Siqf+59kuuhSOPueWLFperqyHvNBhKiascc3OKv2j3G9a2gx4tTNuHoOXyorVukrhW2nDFIX3ztF6/eUvkxlWiwwaxbZIOiWOZS4usSlDkCbpeqXNeLaOZusgMcMfNFzq1AK5NgEnIz8ozGbulpdfTpnHj2D25oPllI42XvoX3pI7rUABrEdmoFCpvt034R97+MojTY4oiOu90wwwjr+7SFDYuwrTcM8FJFLGFCzWhSgvhmMH3TMm3Zdl2E0LpjBmRVlua7i1T9lVxygg3i7tWRYLrWgLRU+HEdG/cXiMkrQ6mXw71mmyAUS1XPRlJY02WK1cTb2CIoSHtUvNRxSBDD4kKZwb6B4UtMWZ4D4Co80bH25TWaaKPygqv3cj8hUBIt5ZB7k3rO+6h9su+dA1MMYfHH1aeaf7UEpEsWQZc/Wl95NvxtzthAvYLxhyHAcJKVkJvvJBE3OtCuyVj9QDYSKQFu93z/igIWBKDoYk4HvGJ4rLFFnqBxdz2JormJtveQFJBVW3z9sbbH4AhKKZcYi7txVXNBZaWzQKX7yaAew3hHu7gCcaMyHXIo3BtfgCHMhPmjhGJASosG7d/ocY1BI33OjsDTZlXxlN14fffWENMnVNsKiVqM46TLpvccTLUdom86X27nBKExsKxeX5CPjnw6/BAGcuEQw8KTAFL2ArchRjyvfnyvoNkp50mQ9XSFDHQW9Q== 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)(66476007)(5660300002)(36756003)(83380400001)(6666004)(508600001)(110136005)(186003)(6486002)(66446008)(26005)(316002)(38070700005)(64756008)(76116006)(66946007)(86362001)(44832011)(8936002)(122000001)(1076003)(2906002)(91956017)(6506007)(2616005)(8676002)(71200400001)(6512007)(66556008)(38100700002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?OSlXYJ1KS+F0SO/2LeHQxS6?= =?iso-8859-1?q?Dj7HDpE1utuaqTb/lgIvDZ+vxktWI2xM7LP4P7UvLI/FIRIRMsPuv9NPvvvN?= =?iso-8859-1?q?bT1Cua7wRChvbu9nHuYjoJStGc+CxcojLyEln4me1FpNN0z7FXSuZtysn1eq?= =?iso-8859-1?q?mjeNh3GOXk+DLCPT1th+q6KEJqYq2KmK+TfeL/3q7igIXBg0yHNxy++S+ula?= =?iso-8859-1?q?oniJcS/tytGLo8gqHxEztAgQjIgGnv8i+lEG10mb2kUC0V+CWmkOlYFJdb3p?= =?iso-8859-1?q?mV7eYKjZIwTKVwfV6/ZOoixtRbAZLTK5oAUbd2oMIZtNG3AnnZVBkT/vy4ie?= =?iso-8859-1?q?pcsEFiJ3rbVGRTUJXMKBz/moEswM7s8exvEpJF7RFp/IV1kr3AnYsczEubLF?= =?iso-8859-1?q?NuZvdXI+zmw4o7IrwsHWHQuj9yd4arXwec3llINZqBSePZ4l6zBTy33eozmk?= =?iso-8859-1?q?PR4/IUSjkabnNCNlqfFCkVU4HumFnBOJN4BNfK0c70HFkqsJOddaibFLxYBQ?= =?iso-8859-1?q?sw10va5anxt6dET2n9LOi6nTgMmyAGx8Hy4lBISOfvXoRUhrrlwfKS1z91Wd?= =?iso-8859-1?q?dn5Rks5lYUDRWaXAxIiacJKXZPQO/ajUcIOw9HgvnkOjibG9q7NpkaB5WMEY?= =?iso-8859-1?q?FpV1ykVRj6BHZ/G9X/Ggr/m09y5a1/AluUoRVxoUtasmWr0CfW1Kmx9Ywuxe?= =?iso-8859-1?q?/mApHoYJe0zbrs4OetpO6QWMyhHk5UV7HUQEWFtZvVpp1trilKKamVqcQvgo?= =?iso-8859-1?q?oMhbljNZIms5fYZiaLQdM9zq6Hu3VFlDURd05T+MDZKAIi6Zu9CzU6B/oSui?= =?iso-8859-1?q?tDb43mOvMsoIPq7EiZeLgY4BJTkMFQUGqJ9Uvc3qb7t0XOFMsDznv+zLaKS5?= =?iso-8859-1?q?rWtKp2vWHmhw6OSBKfw65SIaJ06W+sKmnMsZPnwzpkL0KdPsyOmO71JpzDj6?= =?iso-8859-1?q?rcpJnKbrJ8CzcmpE8Jv4YaxsNnBeouPzlAv8RyAO3T9jFKBo/0hZjxO3o0jb?= =?iso-8859-1?q?U8aQiMo4YpIwv2StJkcGKAE9rAqogXT07gby3QTE12x7GNWywxobK22ojUAN?= =?iso-8859-1?q?EZGbLy9YGnIX6hwAjjcmEvcQIObOmr3wYdhzZuu/NZjlVPZ4Zecs2M4SDBZb?= =?iso-8859-1?q?OKczpXqvhMxLQBALp73H+uWDuz77ZG51efm/7dXLqCIgZ9JnwAtKzMBA4XUw?= =?iso-8859-1?q?ycgbaXqnOOP6N8mfZh7nOT5naJ0jRM8ptiHVassPSZCeDAWVgwmmbbU8dj5q?= =?iso-8859-1?q?u9EkegkkYoKIYck19aX+Fwtvoc2BMVbBgWZn2gTpm8hxysz455AI7xD8d56V?= =?iso-8859-1?q?rDOjw4et0ExFDj1K3uwgt6xKTSoZiTBVEr8vJu3fAP5uSdGDZNFKN8Frpslj?= =?iso-8859-1?q?9lNxWwQ18G9u5yE2m0MN5ufmSCDz1K+3WToSaGb4bPCcZ36nKqdin6h0Ks8M?= =?iso-8859-1?q?1qtxURkovzLxOOekG+Q9UKHSuTeFMYBuMgtTi3/Dn72bIIrEyfqWGVLkvG4A?= =?iso-8859-1?q?u5R0enkMXlB+TciO9dz2K1QYOYqT6HTqRNe5uC2e9LwMPgPQmoQRlsj3Blfm?= =?iso-8859-1?q?VcgKjeceYu6cQj9Lvs2L6qMUN5OE+Zpvms2T7Q1V/K65cqS2mlXpwooqntR4?= =?iso-8859-1?q?kCoks0uBBw2U55Hl3Lvk4hdyPIodvhwRR1L7GvdQvdp5swYOqKbtTk7o9P9s?= =?iso-8859-1?q?=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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: 758fd911-086f-4121-2fdd-08d9e5f5cbd1 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2022 02:42:24.5787 (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: OLLdE8UIGWde6EZ/3bV3fSzJb64Ti14H4L5zcVWBUcO5nFdf2Z1oe4/9aV1vv+PByJsvpK4S3EBxBB3bEomKiQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB5865 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10245 signatures=673430 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 suspectscore=0 malwarescore=0 bulkscore=0 mlxscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2202020010 X-Proofpoint-ORIG-GUID: jEQi_RLCZGb2zdKBS21JEhoz3wyguP-y X-Proofpoint-GUID: jEQi_RLCZGb2zdKBS21JEhoz3wyguP-y X-Stat-Signature: uy6z5dx9t73us3bj4eufkunq6td1maxp X-Rspam-User: nil Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=MuycpqHw; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=xjdH7PqT; spf=none (imf08.hostedemail.com: domain of liam.howlett@oracle.com has no SPF policy when checking 205.220.177.32) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 513A9160002 X-HE-Tag: 1643769813-510336 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 |
Introducing the Maple Tree
|
expand
|
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c index 3cc01c30dd62..59ae919ee109 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c @@ -425,12 +425,11 @@ static const struct drm_i915_gem_object_ops i915_gem_userptr_ops = { static int probe_range(struct mm_struct *mm, unsigned long addr, unsigned long len) { - const unsigned long end = addr + len; + VMA_ITERATOR(vmi, mm, addr); struct vm_area_struct *vma; - int ret = -EFAULT; mmap_read_lock(mm); - for (vma = find_vma(mm, addr); vma; vma = vma->vm_next) { + for_each_vma_range(vmi, vma, addr + len) { /* Check for holes, note that we also update the addr below */ if (vma->vm_start > addr) break; @@ -438,16 +437,13 @@ probe_range(struct mm_struct *mm, unsigned long addr, unsigned long len) if (vma->vm_flags & (VM_PFNMAP | VM_MIXEDMAP)) break; - if (vma->vm_end >= end) { - ret = 0; - break; - } - addr = vma->vm_end; } mmap_read_unlock(mm); - return ret; + if (vma) + return -EFAULT; + return 0; } /*