Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7824734ybl; Thu, 16 Jan 2020 06:16:04 -0800 (PST) X-Google-Smtp-Source: APXvYqxnukTCv3fyo4G9+x+hEKZbbetWozmwOtW/6LwUzr/zO8JPdwQGEJXui9Ovh8C8o/cIMGYX X-Received: by 2002:a05:6830:15a:: with SMTP id j26mr1971202otp.137.1579184164535; Thu, 16 Jan 2020 06:16:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579184164; cv=none; d=google.com; s=arc-20160816; b=tmde/j0jqks6lW4U/YJP7ZyiFtHqCilgGjPoBFQAAuSFVAeD6Qn5mn9Jh1LiCM9G2o azQgspvpR54eoIuIhtIE/0nPYpQxhdgc0z1OckIrlkKGyucENEp62JlQ7fZG0R4Lfqq+ oqeqfhvB8TBw2LXFY9VO9QkpA8rQ7qBIpuQakTIczlVaSzZKqoGE2zVyCRaCxYXJFPKY LV0GFm7l9QO/UjCuGPiOt0Hmj0NhtGzU6Y6FePzfffZGZUdtiu/tmiB1qFh9WmEBKnCz TflzTfHUaCXqy3EqQeuHVAGqCY+VeHruJEdAjfaPtucPMw/WAFSiGpne+EgSN9i0yp3O FdRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=520l2JLiKzJXg1t/Rg1LJ2QfApYXnB06j0gidqNWK58=; b=ZxKYJ5H0ijDsZ2CNhOzvITJhuFKnD80tziI3elSiZpZF8QjebRHG7cyGuPueWmMcc0 5iWis+NQoCArfOZsWvZY21XP2qliQH9ox/Ga0dKW1UC8SLo4fIigJT0zcInVJxRn0sA9 Kxm64skwD6MWO7JuwRUtCTfQwJ93XyfR3p0I76zWKhpTJ0hP1sWHEy+MUWJUiurPqPJ0 wR4so01KXVpGn3Kr1wtkrLXB+pQ92XMK5YA16jaYFE2QG2RD3gvCfT6dIRtJ6rA2gD2/ rrRpRKERdRk4+mRRlWRwr/L5XZIkq0Kosf5Sjp3ZuxT+8VmZSa8N9zg5P8+aHkNhCtt6 6uog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=ivJGbNrK; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m20si13449206otk.279.2020.01.16.06.15.51; Thu, 16 Jan 2020 06:16:04 -0800 (PST) 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=@ziepe.ca header.s=google header.b=ivJGbNrK; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726785AbgAPONO (ORCPT + 99 others); Thu, 16 Jan 2020 09:13:14 -0500 Received: from mail-qk1-f195.google.com ([209.85.222.195]:40745 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726370AbgAPONO (ORCPT ); Thu, 16 Jan 2020 09:13:14 -0500 Received: by mail-qk1-f195.google.com with SMTP id c17so19173943qkg.7 for ; Thu, 16 Jan 2020 06:13:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=520l2JLiKzJXg1t/Rg1LJ2QfApYXnB06j0gidqNWK58=; b=ivJGbNrKKevBAu3KtV1zpocVU5wd/m68yl62mnYvyvPVF8IJGvJlZNp6vb/jzePu1Y zf8xk9JI9hC4MEsK7uuZYFsrH+fHx1I+w4azdTlESYba+4xdP+X1qopzcrcWeiORTygz SRQ5jHvSLmjJWuX81TBQvRHo3mty6NG73RXCGWstN81R647lQsi0geld8aR51csMZoYE k26lxx/+qK8hSO8W6/k/oHOHdy19CbgyIzTDlz3U5sgcH+RiBy2c12LOHHlFDQQfKrSy ZGE3h8J8y6BhWBt2lQSPAieLjj/vaB6ptjZE6ZZjn8AuZtLua1uRakzC1Z0wv8sLyT+C d8mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=520l2JLiKzJXg1t/Rg1LJ2QfApYXnB06j0gidqNWK58=; b=n/TiSFMFJnUQmBCR7LbxjHWOY2JeyH7egnQXOFnzdZwt4xocGZ3Kj8QaQZsSSlTp5F xqtP4a5oB5cB82LePCNbIUqzsXiJh3gqRbjzJZgZkBC2OL8xWR8pXeaxWs7dnNfMjv4r AIyPQZz6Ut7KJ+QRH1qFBfA+YRt14palPtn/FtMuc+ZOijilXo2UvAgZGCzl9+Xk9lKp 1vCGxdlGATevHiyNLzBpWn8geNb6XhD6270k6bUxlBJpVVDs5E9GOJjvL/6f4jhyBuV9 jtShm0w8PXMJ8dBl6ys+DigEy+S4LNSkAZhfVuM3DiafHUQaxICJVlxNjdxpblJ8ReRy XpYQ== X-Gm-Message-State: APjAAAXY/zqorQu9k5QQtbRW5dxd7v6F9fYAD+u46qtJAF6nMP96oC5y 8aI5SQsTFOEOnT/v6P4YZHSrMA== X-Received: by 2002:a37:b402:: with SMTP id d2mr31920622qkf.195.1579183993212; Thu, 16 Jan 2020 06:13:13 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-68-57-212.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.57.212]) by smtp.gmail.com with ESMTPSA id h34sm11371081qtc.62.2020.01.16.06.13.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 Jan 2020 06:13:12 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1is5tX-00040h-V7; Thu, 16 Jan 2020 10:13:11 -0400 Date: Thu, 16 Jan 2020 10:13:11 -0400 From: Jason Gunthorpe To: Ralph Campbell Cc: "linux-rdma@vger.kernel.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "linux-kselftest@vger.kernel.org" , Jerome Glisse , John Hubbard , Christoph Hellwig , Andrew Morton , Shuah Khan Subject: Re: [PATCH v5 1/2] mm/mmu_notifier: make interval notifier updates safe Message-ID: <20200116141311.GB10759@ziepe.ca> References: <20191216195733.28353-1-rcampbell@nvidia.com> <20191216195733.28353-2-rcampbell@nvidia.com> <20200109194805.GK20978@mellanox.com> <73225ded-c22d-33f2-ebcb-b9e9aa95266b@nvidia.com> <20200109232548.GO20978@mellanox.com> <633a3dda-d4d7-1233-b290-53d36fb8fda1@nvidia.com> <20200114124523.GM20978@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 15, 2020 at 02:04:47PM -0800, Ralph Campbell wrote: > But I see your point if this sequence is done outside of the invalidate > callback. In that case, if the driver shrank the interval, an invalidate > callback for the right hand side could be missed before the insertion of > the new interval for the right hand side. > I'll explain this in the comments for nouveau_svmm_do_unmap() and > dmirror_do_unmap(). Yes, this is why I'm not sure this is a good API for the core to expose. Batch manipulations is a resonable thing, but it should be forced to work under safe conditions, ie while holding the required 'inv_begin' on the interval tree, and the batching APIs should assert this requirement. Jason