Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp863210pxb; Wed, 13 Jan 2021 18:41:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzSB14aUDhl6VG6JO39Fg+4vUSGMJQShExoaUWUKBH/DmVgrIMry5aZYWDafOC3znyLjlFq X-Received: by 2002:a17:906:2e82:: with SMTP id o2mr3777122eji.106.1610592102765; Wed, 13 Jan 2021 18:41:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610592102; cv=none; d=google.com; s=arc-20160816; b=Yz/3NPVunHgqa3Ay3ZvhrEZOCmyMdFpOUerlKqAcAl9eTjFl86rp96zgZwRwhKbFV1 pwsg9CpoJFcunRUfmTOBDG5Vd3qY55n8G1/xJuhNP96hVtzS37nX6zdBmOT+p9V42ijV Z9X4iBLpZJpIfvsUkANM4Qw20vd5JfJsY8xy3B3Mw1dbtGhHe7XBd3aDtqtPlS74VFvi JP0gxUY1eX3a+ajExZfJlKZD7dYTHDlM6zKqSP7bMHR3peDCPBnYt2BWrf6xmTLWLby5 ZwHmEXZ2dyS6lc3AHV6gSTj6E++tapgcY/iScqeEa9mfX6u59xODFDRaTmXGffJCs94q IBcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2mud6EOiQWTPZLSAaAQAKID8YRfEwmVBCdj5DWD16lE=; b=EyYRw4W6H03M0n26KHJDZYmlO/eu2x6o3mz1csSsebMp2HyHrFVQ6YuXXQVzfNxX3Z lPsYjQ51DvNBRAAg8AMGGzhKplsswbQDC5JK3yp/SHzSNH+XpJ4zOzA2Pr2fkUSK5v+p aItw+PwA1hoAa2y6BtjBBPLpzqHawgUemAc8CpHWJT2G/zvW+bZGc8UvsRxao9fyoFjl D0zVcP1QUN/xRRzwm44xgakJbo1h+Un1+6bwPl7uNNSqTmORhqpIq6sh179wNif5QiUv Egcqbwrmz2K51+nrtWneHyUZ1EPMK0ubqnvHhjPTIjBwGFL5BhDnF95JMkjFOKQEwS0R pHUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="LLeX7Yj/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x9si2016952eje.109.2021.01.13.18.41.19; Wed, 13 Jan 2021 18:41:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="LLeX7Yj/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727402AbhANChS (ORCPT + 99 others); Wed, 13 Jan 2021 21:37:18 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:39634 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726792AbhANChQ (ORCPT ); Wed, 13 Jan 2021 21:37:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610591749; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2mud6EOiQWTPZLSAaAQAKID8YRfEwmVBCdj5DWD16lE=; b=LLeX7Yj/6c+X+liywIL+uphzG/UdkNpIcCwEVSeZ/LApXCkIIYTQU0kr3ybDvcEekrFuqK Dhwlc3v2XwFWH9MfGK/V0Ts7GjtCcJwXL2DgT1hj3Jzzz37bgSaMInkAtatVHYOY3InJJO IQnfw9XkRTyn7NlrlvOyBTJ+xhjSNkM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-544-IOSZym_oN-CrdgfWwCkC-Q-1; Wed, 13 Jan 2021 21:35:45 -0500 X-MC-Unique: IOSZym_oN-CrdgfWwCkC-Q-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0C08FE758; Thu, 14 Jan 2021 02:35:42 +0000 (UTC) Received: from redhat.com (ovpn-112-31.rdu2.redhat.com [10.10.112.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E5ADE1001B2C; Thu, 14 Jan 2021 02:35:32 +0000 (UTC) Date: Wed, 13 Jan 2021 21:35:30 -0500 From: Jerome Glisse To: Jason Gunthorpe Cc: Andrea Arcangeli , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yu Zhao , Andy Lutomirski , Peter Xu , Pavel Emelyanov , Mike Kravetz , Mike Rapoport , Minchan Kim , Will Deacon , Peter Zijlstra , Linus Torvalds , Hugh Dickins , "Kirill A. Shutemov" , Matthew Wilcox , Oleg Nesterov , Jann Horn , Kees Cook , John Hubbard , Leon Romanovsky , Jan Kara , Kirill Tkhai Subject: Re: [PATCH 0/2] page_count can't be used to decide when wp_page_copy Message-ID: <20210114023530.GB535630@redhat.com> References: <20210107200402.31095-1-aarcange@redhat.com> <20210107202525.GD504133@ziepe.ca> <20210108133649.GE504133@ziepe.ca> <20210108181945.GF504133@ziepe.ca> <20210109004255.GG504133@ziepe.ca> <20210113215638.GA528828@redhat.com> <20210113233936.GE4605@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210113233936.GE4605@ziepe.ca> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 13, 2021 at 07:39:36PM -0400, Jason Gunthorpe wrote: > On Wed, Jan 13, 2021 at 04:56:38PM -0500, Jerome Glisse wrote: > > > is a broken model and the way GPU use GUP is less broken then RDMA. In > > GPU driver GUP contract with userspace is that the data the GPU can > > access is a snapshot of what the process memory was at the time you > > asked for the GUP. Process can start using different pages right after. > > There is no constant coherency contract (ie CPU and GPU can be working > > on different pages). > > Look at the habana labs "totally not a GPU" driver, it doesn't work > that way, GPU compute operations do want coherency. > > The mmu notifier hackery some of the other GPU drivers use to get > coherency requires putting the kernel between every single work > submission, and has all kinds of wonky issues and limitations - I > think it is net worse approach than GUP, honestly. Yes what GPU driver do today with GUP is wrong but it is only use for texture upload/download. So that is a very limited scope (amdkfd being an exception here). Yes also to the fact that waiting on GPU fence from mmu notifier callback is bad. We are thinking on how to solve this. But what do matter is that hardware is moving in right direction and we will no longer need GUP. So GUP is dying out in GPU driver. Cheers, J?r?me