From patchwork Fri Apr 12 16:04:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 10898649 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E149517E6 for ; Fri, 12 Apr 2019 16:04:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C234128B8D for ; Fri, 12 Apr 2019 16:04:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B5CD228E9F; Fri, 12 Apr 2019 16:04:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DBE028B8D for ; Fri, 12 Apr 2019 16:04:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E032F6B000C; Fri, 12 Apr 2019 12:04:18 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D8B056B000D; Fri, 12 Apr 2019 12:04:18 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C06506B0010; Fri, 12 Apr 2019 12:04:18 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-yb1-f198.google.com (mail-yb1-f198.google.com [209.85.219.198]) by kanga.kvack.org (Postfix) with ESMTP id 96BB26B000C for ; Fri, 12 Apr 2019 12:04:18 -0400 (EDT) Received: by mail-yb1-f198.google.com with SMTP id y1so7219468ybg.1 for ; Fri, 12 Apr 2019 09:04:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:thread-topic :thread-index:date:message-id:accept-language:content-language :content-id:content-transfer-encoding:mime-version; bh=vgnWArSxwQhLLgYkE2RoE/6LouYrZUwbM/RoLT+FWmY=; b=IvFJGhqkbny+6U15lGC4yBUTb5ThJmex0xdeIb/o4WvG0sxyfiCdlnJ5HhZkwxxA1v bq1NTJ/z6sRvat+WkfpAECUTVATbJUuJzoMAMsF/8TX7dAWcqw65ha9v8AoSzYufZI69 wTIyQRio/V9qw0ciGehc+4HDCAN44qQrveNXpEThUOyWEUxDYV7Zxd9TqIDqivpU0sGE /kG0yC56wj9aqi9Gdq6e7dc5GRqtUSnIHxqsa5VlrUFIO9XenrIVEGbNHsd1nNBB1lYO 2aa8nbnVzzaWyhhqqkwAnr/TTBxj67jZy1A6252ovn8s5GNYL79KpHhhcdys66xMq0b+ vIzA== X-Gm-Message-State: APjAAAUgKiBVUwpnrcyTe2rVXyOZzJWEzO6SOU6+54x1x2lEdUUqGLmt 69bSb2AD4CZbSLfi05NmTnmGBwfTIz9h8OD18pkTHcOMZYeRhCkHJIumL43V6a+F9txPn0zKIR+ /bOAabhwSWScv/hsw6sAHneJoBMHsBhFHHoPpgsAnudDwFdSdGOwpAsRfqUGYnb/X7w== X-Received: by 2002:a25:2558:: with SMTP id l85mr46884677ybl.310.1555085058302; Fri, 12 Apr 2019 09:04:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8vCsW/yK89MNtuv9HLCAwomTlnNr0UnA4Gtt+BZvEKi17ac7dieJWtPXT6ECa8DDNikln X-Received: by 2002:a25:2558:: with SMTP id l85mr46884552ybl.310.1555085056984; Fri, 12 Apr 2019 09:04:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555085056; cv=none; d=google.com; s=arc-20160816; b=0ggoG4nIBcz59jC4A5Ua1CpzrAbZKxvllibRMUjGQwi5RwrDnYL9aJCYM9O/WottWR DB39CQb0Ulk5XhjCrLMbZySr/nJ5riVomim48yGo74ZSVBV17kqWoz0vGHKxc82aCWO4 NkizKwk+3blmJHjEQJIIiWZNwxuS8llSqYC6eeN2IXS7xCXSJCSPIxCKtDVQB7YZPYd2 i6iqzkkGSz++2KecU3pfKaOJlLTnbkFTPMrtgFCzVE8d0Ri3N3CRjKObuBBpoD2XArsP sXE8I0O70SOONpNbmDNFcgcJXHuMexAm9hIcStrH4worXU4nKRWwsAHDidfPCDzFfO2j Yefg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:content-transfer-encoding:content-id:content-language :accept-language:message-id:date:thread-index:thread-topic:subject :cc:to:from:dkim-signature; bh=vgnWArSxwQhLLgYkE2RoE/6LouYrZUwbM/RoLT+FWmY=; b=ABHWa+V9NpJ2CXWGuQQjGsjnreDHe4HgqM0foOTCLlhLZHC0M29dKFJIfbsnjY/WHa 2aYwj9Hpgk/+FnD3Qzy2sRorNwRb2rk8XKWPQVL1oJdwtUPamOcJdwcwdfDLE1lWnkoM m3rU6XPZFrnnyxP9K6bGZ9rxRisWnJry7+yqriRzs6XAvaC6h6YPCjdDe1og9r45QTj1 yFRUTqQ4tXBb04XFC7z6uo6vEf1FAgSpzBLwVFatvu7c6ZpUUBx/DVzoZcI7T8AgLO6L aEcnOHSx/CVhTnppJt1fG1rq4A0vJmW9GQpgeLvVp/35hJ+wQt3vLllbNEw6f0pSi03+ SzEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@vmware.com header.s=selector1 header.b=BOcmlxMv; spf=pass (google.com: domain of thellstrom@vmware.com designates 40.107.80.59 as permitted sender) smtp.mailfrom=thellstrom@vmware.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vmware.com Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-eopbgr800059.outbound.protection.outlook.com. [40.107.80.59]) by mx.google.com with ESMTPS id u200si14805429ywe.278.2019.04.12.09.04.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Apr 2019 09:04:16 -0700 (PDT) Received-SPF: pass (google.com: domain of thellstrom@vmware.com designates 40.107.80.59 as permitted sender) client-ip=40.107.80.59; Authentication-Results: mx.google.com; dkim=pass header.i=@vmware.com header.s=selector1 header.b=BOcmlxMv; spf=pass (google.com: domain of thellstrom@vmware.com designates 40.107.80.59 as permitted sender) smtp.mailfrom=thellstrom@vmware.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vmware.com 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=vgnWArSxwQhLLgYkE2RoE/6LouYrZUwbM/RoLT+FWmY=; b=BOcmlxMvep7RWImww0ecJCGq6dMNSdR5R7a/ZPTBw+r3PC+qnRw/UABwVB/K5bK2bw9m9JHAu+3TX9oq2bmmNTj9Ykm9l1RAsbqlP8snZEdu7VWdlCvZEyf+Eqeh/WJ2tolg83Q1bca8E0kqBxitdBVqj/uQtxF4FoE2sk3EBPY= 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:12 +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:12 +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?= , =?utf-8?q?Christian_?= =?utf-8?q?K=C3=B6nig?= , "linux-mm@kvack.org" Subject: [PATCH 0/9] Emulated coherent graphics memory Thread-Topic: [PATCH 0/9] Emulated coherent graphics memory Thread-Index: AQHU8UleNbKoVYDq/EerCSitVQ/anw== Date: Fri, 12 Apr 2019 16:04:12 +0000 Message-ID: <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: 56bff8ba-beac-471d-b3bf-08d6bf608107 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)(478600001)(3846002)(71200400001)(6116002)(66574012)(99286004)(256004)(14454004)(2501003)(8676002)(66066001)(7736002)(4326008)(6506007)(81166006)(36756003)(81156014)(386003)(97736004)(102836004)(50226002)(106356001)(52116002)(5660300002)(53936002)(8936002)(7416002)(305945005)(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: EbADsB/SZqrCxZVhJ+prczxvq9VaEMOGfN9utLbI4QmJK5cSVKg0LHFJzkw18/1mYWKNaddBwXvUP/9rbYMjsjOw0VBd3szW6GGQpnEHNEOvutDSEeqZYeS6RAgXejpFoMHgMVgejuzp/fg4iAneLDMD1MAbqLM5vY6OAMUTJhsP3a12YmhF/ON3HCz0EIg3k5aOD9enxO8dskYXRV+WiXWYuXOfWWGd0ns60AVsWcmwVe5jG37L5+CMD+cGw96H2JSix5/CfWtmpFYHRkfehNyoaP0JLIx5NrnV+0gqMYnm7ebepy+xNpLzpFxWRKnNFSAX7K7cKT4FcjYz40hefkf4dUAlK0gn2PYlOVrNCbJg9O3ceKu5uWDjh4USd5kOHI/pfgHIbHoKDYBXEb3E2QqRbKVxePFEm4cF0C9Mp7k= Content-ID: <36272A3DAAB4FB4BBAF76EAF8F3EEC79@namprd05.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56bff8ba-beac-471d-b3bf-08d6bf608107 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Apr 2019 16:04:12.7999 (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 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: X-Virus-Scanned: ClamAV using ClamSMTP Graphics APIs like OpenGL 4.4 and Vulkan require the graphics driver to provide coherent graphics memory, meaning that the GPU sees any content written to the coherent memory on the next GPU operation that touches that memory, and the CPU sees any content written by the GPU to that memory immediately after any fence object trailing the GPU operation has signaled. Paravirtual drivers that otherwise require explicit synchronization needs to do this by hooking up dirty tracking to pagefault handlers and buffer object validation. This is a first attempt to do that for the vmwgfx driver. The mm patches has been out for RFC. I think I have addressed all the feedback I got, except a possible softdirty breakage. But although the dirty-tracking and softdirty may write-protect PTEs both care about, that shouldn't really cause any operation interference. In particular since we use the hardware dirty PTE bits and softdirty uses other PTE bits. For the TTM changes they are hopefully in line with the long-term strategy of making helpers out of what's left of TTM. The code has been tested and excercised by a tailored version of mesa where we disable all explicit synchronization and assume graphics memory is coherent. The performance loss varies of course; a typical number is around 5%. Any feedback greatly appreciated. Cc: Andrew Morton Cc: Matthew Wilcox Cc: Will Deacon Cc: Peter Zijlstra Cc: Rik van Riel Cc: Minchan Kim Cc: Michal Hocko Cc: Huang Ying Cc: Souptick Joarder Cc: "Jérôme Glisse" Cc: "Christian König" Cc: linux-mm@kvack.org