Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp3783958ybk; Tue, 19 May 2020 12:53:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgkWiOq7rgm3tlP7bixsfjkTJk9p5zZGw41tq0ztjnW0S/hQsrMr2GRVdzi00l6m1d+Rdn X-Received: by 2002:a17:907:11cb:: with SMTP id va11mr791565ejb.515.1589917985155; Tue, 19 May 2020 12:53:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589917985; cv=none; d=google.com; s=arc-20160816; b=VoO71yjRbx3AFCbtaO7v/e3mQ2G/4+eb8drDcuGZlUUv4ouPogH4IChg6ozHBTV+1D FuzS2L9r1xPAVxCOyWP2lnggDkFRLvtJ7B5T5DmRUSVIQ8fOr2D8+iFzl85F36PVoSIW uhaFwtOh+O6BhXCyJWsINEo34Jyd+UKhcP2+qRC1EN6vOYV85U3Z1lP1oli0mmSlTP1U M8FdKjwyRB94y7dzmmUvZNlcixym6jIWbLKVjBnJqKNqOkKhGrLbHmP9RUky4ojfe129 72rvHIVSqNIEIrqAFoeCZnbpw4FgspdECfjPcwV41gGrCLPbJFFQNYqZ3uY1J+106Drf jdSA== 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=l1V3Tgw02jIXDbVJ9iD00NVCbfLIhXJCqqu7R58D3Ic=; b=JTcjWX99XAl1Aw9XFwMmVAUE52Ov387Mpn5KnGZQSvBv0KmJw+b1M6rZn3YQNCnJcA m56tL3ayLG7Opm8pnb62ZiWdEVYNz8Ei9xUCQtUNHR9B9YSWjH4ZAJGOi6qmHJlJZbxj fEnngXNQAmpRI5i1S7ER7hUfeaPjpHal9IIs3+vtXWN15/OwnxCcHtZegnX+DS6mfe1n Yn8y/pCj/zjjxTXOUx9XV5dO5HmOJnqbTf7+Mvqx8WKj082qlbqmxzMhH58Zw4Lztg8s WfS5UXFRaQt7/o7u1OsFXfbc43dd/scjRwdI1opoz4pAiNh/A1nDhPuQwDrNB1SYvy0B SeqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=hyGaM1Xt; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v21si483929ejx.356.2020.05.19.12.52.40; Tue, 19 May 2020 12:53:05 -0700 (PDT) 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=@ziepe.ca header.s=google header.b=hyGaM1Xt; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726783AbgESTuo (ORCPT + 99 others); Tue, 19 May 2020 15:50:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726059AbgESTun (ORCPT ); Tue, 19 May 2020 15:50:43 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 650FDC08C5C0 for ; Tue, 19 May 2020 12:50:42 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id c24so653944qtw.7 for ; Tue, 19 May 2020 12:50:42 -0700 (PDT) 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=l1V3Tgw02jIXDbVJ9iD00NVCbfLIhXJCqqu7R58D3Ic=; b=hyGaM1XtP9QcE4gMqttRjlKiSby43ALZhvaUIG1a8HKnQF+bmay6tolp4kdZvK+56D p1u1oAFduyBAF9zrTldnPdlWlY6zBI9z1PVy+50BBc1hWiSoXee3ylMEmngDCmARnEdK bMqVMPDifjogTsiAWgLrrma6FxDziVpivAhTydfNxU+jYDsskTwEkurXe7cti8cjv0NB CwtJuNl0fg+MHRx+zkm67jQvVatY6N87BEj60z2f6rzSJpC3Ay+t9RSLqnYNPER9fqP8 qBfkgE4g4zZs6eUpreiQEwNlBErJnP+3ipDt70Mwk3WihQ4ovLCECy53ex0aWXEZalOc nd+Q== 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=l1V3Tgw02jIXDbVJ9iD00NVCbfLIhXJCqqu7R58D3Ic=; b=SdJDdK6mcfbu0Zf6G6qGEdhIeshyEyQ8DfnWXQuEjjeuIQLVkXdrADbL6STvM6epdd 5CT5g3BRojS91FEQ/EaeaaeJbNXStazj9G86Vnfr+n3sqTDqVpk/jH2fSjHzpQOU0TXT 07qj+wg8TA0zogyBvB/AI3hWwCPgJUugvH9d5BB9jpRYQk7BAg0xtu4rlVpT30MaAtW0 27JZmUvMiClj/SFKXiX8mdgnQCeUASMjEVp5VDdqG+JFC5vYlu4OTBlaKysYjOYbBag9 16II2G09w0NL7MmpRb+oWaKJClW8KNzRT2ta1oN9hkYsTViu6HHgabg1BQdOglN1oAYe h6kw== X-Gm-Message-State: AOAM533OESe3QmwIzKOoNAESzAvcuRCkWAtVpai59MYeoiJbuQBueHlu mi+i6Xylni/GjKPJfgmGHYNFsw== X-Received: by 2002:ac8:2979:: with SMTP id z54mr1666184qtz.14.1589917841631; Tue, 19 May 2020 12:50:41 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id q17sm414087qkq.111.2020.05.19.12.50.41 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 May 2020 12:50:41 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1jb8G8-0007fQ-Lk; Tue, 19 May 2020 16:50:40 -0300 Date: Tue, 19 May 2020 16:50:40 -0300 From: Jason Gunthorpe To: Ralph Campbell Cc: linux-rdma@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Jerome Glisse , John Hubbard , Christoph Hellwig , Andrew Morton , Shuah Khan Subject: Re: [PATCH v2] mm/hmm/test: use xa_for_each_range instead of looping Message-ID: <20200519195040.GA29444@ziepe.ca> References: <20200516010424.2013-1-rcampbell@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200516010424.2013-1-rcampbell@nvidia.com> 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 Fri, May 15, 2020 at 06:04:24PM -0700, Ralph Campbell wrote: > The test driver uses an xa_array to store virtual to physical address > translations for a simulated hardware device. The MMU notifier > invalidation callback is used to keep the table consistent with the CPU > page table and is frequently called only for a page or two. However, if > the test process exits unexpectedly or is killed, the range can be > [0..ULONG_MAX] in which case calling xa_erase() for every possible PFN > results in CPU timeouts. > Use xa_for_each_range() to efficiently erase entries in the range. > > Signed-off-by: Ralph Campbell > --- > > This patch is based on Jason Gunthorpe's hmm tree and should be folded > into the ("mm/hmm/test: add selftest driver for HMM") patch once this > patch is reviewed, etc. > > v1 -> v2: > Use xa_for_each_range() instead of special casing [0..ULONG_MAX]. > > lib/test_hmm.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) I squashed this in Thanks, Jason