Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp567808yba; Fri, 12 Apr 2019 09:06:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVdztoI8rOxYy+eaj/rDtnYs1+48YrM1TfQ2mH8oNF2iOyZItSsg+UGHTOxk41H9CkhNdV X-Received: by 2002:a62:19c3:: with SMTP id 186mr58684835pfz.172.1555085165727; Fri, 12 Apr 2019 09:06:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555085165; cv=none; d=google.com; s=arc-20160816; b=VBpKeHjo0AuTi0hJDB8ueXSOR4fiutJcw76a9KpqhyJo0apgNAZLPdjYssD6crEZav isYgI8kp7VX0xDSTug1jUa4P64IBws+WtT/+0cZ9C5MurvSODmPc+NoyTjZSrgDdszFE susza6qFGFDk7G5+UcXTG9VxnBKcUbhnCAP2d6Io7Qq1bN8Z2My+YYUz99RPEuS9zFV8 tUkTfjVfYbvVgeFopPKt5LRaYEtTxENcRzuQ701QHlv93WRn26WkvV6wybs+zbbLOycc SQC1pkh0EQbRLnWGaNv2qC65fuoGhBdcSINCzUmmxf2qZp5TrjtAIGYNItfo9588bLOj U2zA== 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=o4i+BVRIXQu6mJSctKZjR9MclCfL3FQVNkUbr6KqDqA=; b=JtJshkCx4OpHZdrWo0EqVGo0PbHQrrrsptW/dl2slXJeTSq89jexL9mO2OWTkZzYhR GvTSzMM645/2D/lfgY8EMPXEonHfLFcfPxWiUx6ZlEKfwSnxITJF8/sKllEYYkzp2Pf1 d4sOadj9OcmYxVoAbcI8sYGIKULJ1bEafNCqHBRmMjXxxyosb3qdaSSPxjEtNaX+NMLg wUqNqWWrAn0/N+cXszqycunf73YW8E8fSJ0ulk8rH5EDkuttjBfwG26h544dBCmAx1PV +4GPC4kpYPa+ZKSGvqAI0tjrbM/uzgcgaHcjhcVgPhxDVDnQznEZP7d10Quw5zlHCj3p x8gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@vmware.com header.s=selector1 header.b=CIJSk6r7; 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 l1si40341361pld.210.2019.04.12.09.05.49; Fri, 12 Apr 2019 09:06:05 -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=CIJSk6r7; 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 S1727027AbfDLQEb (ORCPT + 99 others); Fri, 12 Apr 2019 12:04:31 -0400 Received: from mail-eopbgr800078.outbound.protection.outlook.com ([40.107.80.78]:12000 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726755AbfDLQEa (ORCPT ); Fri, 12 Apr 2019 12:04:30 -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=o4i+BVRIXQu6mJSctKZjR9MclCfL3FQVNkUbr6KqDqA=; b=CIJSk6r7ypnJarK5geKyPePBEwqApmPLpnw0ux7A7fEL4Y3/4g3CXdWfjapEuZQRB8cR2OJdJ3yUsZCU0YbplqVCA68svuorDNBfO4QiWxZzJ1OVEERuqYWeUY8/OlevmD6EDsydtbIHbq3/OqPopRKnTCqHD14NgUEplqjrmN8= 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:22 +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:22 +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 3/9] mm: Add write-protect and clean utilities for address space ranges Thread-Topic: [PATCH 3/9] mm: Add write-protect and clean utilities for address space ranges Thread-Index: AQHU8UlkX7sd+TdVL0uJIJH8smlP/A== Date: Fri, 12 Apr 2019 16:04:22 +0000 Message-ID: <20190412160338.64994-4-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: 15093104-480a-49aa-1229-08d6bf60869f 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)(30864003)(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: wNMpkR0g230116DEQ6Y/lbCOetdjvjDCrSFu34J+ohOAhXQe6TMSHl6YTuc8VQwW1DHEdMH/650vwxfLrAEYnC/S6gRg2k5FOiKNOy6hgK/1iZmMZmgbL1lfSHDlwWhvDKRedJCHeOQLD1H1wqhkqFiz3eYgL99VhJKkw6QHELHfjVRg3xeimdY0Ry/BuBp6FiEJ4nDXdBVJSxA60u+uwqa6+QU2UbFyifuzR7kXfsrb1P/gIyi01XqOp7s/QSm8CSqFHgd5HxldwnB678qTSaDHicREk+WoRcaEfI3AF1Q9khBzQUieBpMKZuHeG322tyHZhCsB/bsdqxavZIrKRI3shNO1CQYPfapn/OPbMNQdt8M6OUI+A8k8JHFYoSNFCXzajqTOUfswhsuo/s4TY4pFLF6RimgMBYcnPXzWHDg= Content-Type: text/plain; charset="utf-8" Content-ID: <7B3AAA483854CE45A8AFED44B07CA651@namprd05.prod.outlook.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15093104-480a-49aa-1229-08d6bf60869f X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Apr 2019 16:04:22.1675 (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 QWRkIHR3byB1dGlsaXRpZXMgdG8gYSkgd3JpdGUtcHJvdGVjdCBhbmQgYikgY2xlYW4gYWxsIHB0 ZXMgcG9pbnRpbmcgaW50bw0KYSByYW5nZSBvZiBhbiBhZGRyZXNzIHNwYWNlDQpUaGUgdXRpbGl0 aWVzIGFyZSBpbnRlbmRlZCB0byBhaWQgaW4gdHJhY2tpbmcgZGlydHkgcGFnZXMgKGVpdGhlcg0K ZHJpdmVyLWFsbG9jYXRlZCBzeXN0ZW0gbWVtb3J5IG9yIHBjaSBkZXZpY2UgbWVtb3J5KS4NClRo ZSB3cml0ZS1wcm90ZWN0IHV0aWxpdHkgc2hvdWxkIGJlIHVzZWQgaW4gY29uanVuY3Rpb24gd2l0 aA0KcGFnZV9ta3dyaXRlKCkgYW5k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