Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp567109yba; Fri, 12 Apr 2019 09:05:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOVHdpfkH00htGSMK8IrXWPupCG9AXTsWBFV/Da2t7s/dHUIaNnG8bz2W2loU+/3rHc+Df X-Received: by 2002:a62:6a81:: with SMTP id f123mr57273927pfc.40.1555085123326; Fri, 12 Apr 2019 09:05:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555085123; cv=none; d=google.com; s=arc-20160816; b=hJz1QckZNv3CIiLtmwkc3qUnIHBkq4afS3z4JTHstADA0M6O9Wb82F+cJWMbtXKOd3 jU8X6ZnuR9ZXGdjLjZuMANK3CunStmmhuNO0iAFqJ/sdn0QeW5t2oZQ4bSLahlzGlviu PFkj4hMjf4aTmo/G1OP9EjQ96N8BiZlqjJ9D0+k9k7un8eaLBTeWSL8+6tUexAwBxH7S v88n2hHQeiSgEN/wuiLq7riqdoa0zCNixBTd48gm4J9l3ZpzW8vgackHusjyg7t8Utp9 ijT0z16R1FU+WaE4BlYu9OUn7L/ExpgKq1LH8oltWWyx/9j+1COBhu4stHUNCLOi/o32 UWCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=f7oBFBuUUMZqExdodvXw/5iH6kBXEmpotsiHCy+Jh8w=; b=dSLlsjMKiAtHM5jyM7H0AJiYSL5tWZxeYkgzlMRF9bL7cX1oyJBGfNDEEwr6A/FxaT 2DLr37hP24TqjlSlnDAPBtDS+aLjWuNmvNRj9qLJnHO1xZ6DOah9ejSARodPTkuiDQzO aw4O/GWlHgca3YvRZpTzkzY0k5lrm3hRMT2WB2NrSfoVqo5dTl0wkc2bdRPeuyvbGyj7 lc32IGVQTnWRFtgea68svHHDGJ+QCS7JX0rdpxNVmU2LgXxc9K5Iydvm6i9nCfVUJBHb uQeAp3ZxNom++JXb4t6UEUK0v9vTrvC4lDXZZupxpnDHf5FkQJydisw8OPM6BjuQ9BBd r6Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@vmware.com header.s=selector1 header.b=bofC0lsB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vmware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12si28199177plp.340.2019.04.12.09.05.07; Fri, 12 Apr 2019 09:05:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@vmware.com header.s=selector1 header.b=bofC0lsB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726953AbfDLQEZ (ORCPT + 99 others); Fri, 12 Apr 2019 12:04:25 -0400 Received: from mail-eopbgr800088.outbound.protection.outlook.com ([40.107.80.88]:24752 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726755AbfDLQEZ (ORCPT ); Fri, 12 Apr 2019 12:04:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f7oBFBuUUMZqExdodvXw/5iH6kBXEmpotsiHCy+Jh8w=; b=bofC0lsBadQ4QNmho8df4eXjXo5g9ynYsthu7xNM8egPh+P+vmjs8KPT2n5a7QXlDjtjBM6iCGHEP/Fm2IVISFtGKZKTUmnAgB6POk3KZ50NRgcW3xPtBQ1gJebZBDsfeI9NQLoxMFyTETJIAyzsgKCHRsnIO234ZjIlYH+j664= Received: from MN2PR05MB6141.namprd05.prod.outlook.com (20.178.241.217) by MN2PR05MB6030.namprd05.prod.outlook.com (20.178.241.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1813.9; Fri, 12 Apr 2019 16:04:19 +0000 Received: from MN2PR05MB6141.namprd05.prod.outlook.com ([fe80::91e:292d:e304:78ad]) by MN2PR05MB6141.namprd05.prod.outlook.com ([fe80::91e:292d:e304:78ad%7]) with mapi id 15.20.1792.009; Fri, 12 Apr 2019 16:04:19 +0000 From: Thomas Hellstrom To: "dri-devel@lists.freedesktop.org" , Linux-graphics-maintainer , "linux-kernel@vger.kernel.org" CC: Thomas Hellstrom , Andrew Morton , Matthew Wilcox , Will Deacon , Peter Zijlstra , Rik van Riel , Minchan Kim , Michal Hocko , Huang Ying , Souptick Joarder , =?utf-8?B?SsOpcsO0bWUgR2xpc3Nl?= , "linux-mm@kvack.org" Subject: [PATCH 2/9] mm: Add an apply_to_pfn_range interface Thread-Topic: [PATCH 2/9] mm: Add an apply_to_pfn_range interface Thread-Index: AQHU8UlivMPCX9sP50+Af9Zp3fb7Aw== Date: Fri, 12 Apr 2019 16:04:18 +0000 Message-ID: <20190412160338.64994-3-thellstrom@vmware.com> References: <20190412160338.64994-1-thellstrom@vmware.com> In-Reply-To: <20190412160338.64994-1-thellstrom@vmware.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VE1PR03CA0023.eurprd03.prod.outlook.com (2603:10a6:802:a0::35) To MN2PR05MB6141.namprd05.prod.outlook.com (2603:10b6:208:c7::25) authentication-results: spf=none (sender IP is ) smtp.mailfrom=thellstrom@vmware.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [155.4.205.35] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ceb25dd5-c65d-4956-ceb0-08d6bf6084cd x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(2017052603328)(7193020);SRVR:MN2PR05MB6030; x-ms-traffictypediagnostic: MN2PR05MB6030: x-ld-processed: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0,ExtAddr x-microsoft-antispam-prvs: x-forefront-prvs: 0005B05917 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(366004)(346002)(376002)(39860400002)(396003)(199004)(189003)(110136005)(25786009)(476003)(2616005)(71190400001)(6512007)(2906002)(186003)(486006)(316002)(54906003)(68736007)(1076003)(6486002)(6436002)(446003)(478600001)(3846002)(71200400001)(6116002)(11346002)(66574012)(99286004)(256004)(14444005)(14454004)(2501003)(8676002)(66066001)(7736002)(4326008)(6506007)(81166006)(36756003)(81156014)(386003)(97736004)(102836004)(50226002)(106356001)(52116002)(5660300002)(53936002)(8936002)(7416002)(305945005)(76176011)(26005)(86362001)(105586002);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR05MB6030;H:MN2PR05MB6141.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: WU9SNH03eeDNGq/ip+SsIVF7fIXqp/bqU5kKsIzAESgdo2W+c0dl6focC/dgDGwE1BVlnlwlF1D5VEXmjcAcYDiQdZUvijRDvsHRrIl9npPwhgGa5zeHs8KFv0M4oTO5AnL6mZYOgOjNYTelnxFvTx9uVrdFWP6qEvzdbD/ewQmNy4hDSViPT+/D8xlK86R+C4/DAGlV9plMJvihBfxl7OZ6tDd1S4CsHsKh7i1ENz0vuzFVKLilxBLsRufPbvBKW1khhSoMFimIbJzSIlvGlESadW4ac6FFOrxJECtDFe9IsWtGlbZmKdiANPe+8ar7/Xl3pFfsqCID64eynrtHTprnSSrz+bUN6ixNHDxmpuuTjhCAWLihB0o7ZmNLc2Scbz0N+Xvf0WbkQNmMMqZfZl7IwfRQU7FyI9XOeFKVq5I= Content-Type: text/plain; charset="utf-8" Content-ID: Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: ceb25dd5-c65d-4956-ceb0-08d6bf6084cd X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Apr 2019 16:04:19.0183 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR05MB6030 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org VGhpcyBpcyBiYXNpY2FsbHkgYXBwbHlfdG9fcGFnZV9yYW5nZSB3aXRoIGFkZGVkIGZ1bmN0aW9u YWxpdHk6DQpBbGxvY2F0aW5nIG1pc3NpbmcgcGFydHMgb2YgdGhlIHBhZ2UgdGFibGUgYmVjb21l cyBvcHRpb25hbCwgd2hpY2gNCm1lYW5zIHRoYXQgdGhlIGZ1bmN0aW9uIGNhbiBiZSBndWFyYW50 ZWVkIG5vdCB0byBlcnJvciBpZiBhbGxvY2F0aW9uDQppcyBkaXNhYmxlZC4gQWxzbyBwYXNzaW5n IG9mIHRoZSBjbG9zdXJlIHN0cnVjdCBhbmQgY2FsbGJhY2sgZnVuY3Rpb24NCmJlY29tZXMgZGlm ZmVyZW50IGFuZCBtb3JlIGluIGxpbmUgd2l0aCBob3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