From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3D94C433E1 for ; Tue, 19 May 2020 19:50:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A8D8820758 for ; Tue, 19 May 2020 19:50:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="hyGaM1Xt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A8D8820758 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0C88680014; Tue, 19 May 2020 15:50:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 079DE900002; Tue, 19 May 2020 15:50:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ED32080014; Tue, 19 May 2020 15:50:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0091.hostedemail.com [216.40.44.91]) by kanga.kvack.org (Postfix) with ESMTP id D6026900002 for ; Tue, 19 May 2020 15:50:42 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 99C34180AD81F for ; Tue, 19 May 2020 19:50:42 +0000 (UTC) X-FDA: 76834511124.26.scent01_7a95117278509 X-HE-Tag: scent01_7a95117278509 X-Filterd-Recvd-Size: 4409 Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Tue, 19 May 2020 19:50:42 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id c24so653945qtw.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=rVqSkXvlqEkkd5W70h6FtFkkPaDdhjwg+odGYX4ykptDv7ipoHSGUWSo5gnlVYJ+4M /EOi9om02JiZHGwYEwnDZWRIoCrLB75H+Ac8+QdOB7JKaPKl3QL0Fnw7vEWnCclx9Wtg e74gKXYGMuHwb07OFizCkTp1pSjGvvhX3KYJEJ2X68mwOzI+6wvygt51NENF7Z1YN7oC CqaTOFH4OcOn89OjyzUyBBxOl6lgrBVcvzPTOybhnVhcPWAJrC1aynTn1TRqQ9FKChi5 ezBKzE5+rBIABuATpvf4BsfZrg7/97v7/ecYnoC/y4nwqPDmqaoKT2FFTqfnVm3JxTZN t1gw== X-Gm-Message-State: AOAM531MBJIxUaOU4MI4mnZDm3RuOAu2vGqhQsDpGs+CSyJWM3tOUX5k zqf/CImiBa5GP7ZslETkHwhWTw== X-Google-Smtp-Source: ABdhPJy6JaIffKHbVZ/MvpPZNVvqEHP/VC9PD5c8cyUebyj+n7SZYQ9s4TSklbNNVWZyIyp3I3uKAg== 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) 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: 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