Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp7461420ybh; Thu, 8 Aug 2019 16:31:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMA+9p5AQ7azNnYnZ1zdiuf2GalrKF8jOoi7MOr0OYEr3FtZ85CoZtU+5yrjroswiOH4To X-Received: by 2002:a17:90a:db08:: with SMTP id g8mr6261829pjv.39.1565307109697; Thu, 08 Aug 2019 16:31:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565307109; cv=none; d=google.com; s=arc-20160816; b=OiKfpaJzG/d1IF+6QuLJgkkOYrmO5IS0xA74kD5T3pqLlYaD0cCj1gqkW60OZ2buOk BzrXwEMt0pZODRa8iPtn5qhdMB6xT3mTs9v8yMNM9vOkNoTfUvgTn1ItYF4RP+JnPEJV tMNWJnve2+mtXU2Uilk7r0LFGOIzcp8W7tXHbhj3x4jeiaShcDNf8Az2jIaub1+XPaMw UnRawCoCfa1ZV8EdexEUTq6VCjqQmmpPJyK1gP83TKyEJ3KhL6VeoHTn+z5LK2BMfmj/ c77IPY7ct397ldIbLuh1KqWZvZXopb7qw2dGEgLQXxNR7n1TZbyU9dzTvx3sl9yrK18W QnXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=JeEiCmZ1kkXlkjEvqYy9HdWxc7E1WmBQImLZC4SmHb4=; b=aOnhWu3xURgsi8KOnVUXrV55fxoqB/WkOjNQ/5iX+c0S2mr9n4xnJUjoNSqqIW03cu CTX6K0mKGe/SibVOBzmYF0wr16SB84bwyqWXaquejdng/5kAvyRWedeAJ+IZtCjHiFfY yKuV93mo7t1kT7GxBOrfpIU/G1B51WSO+oztOifMvXrbYVPsaoejhqvu16yl+PdrtIzi 86JJ0oQyGMaWLphiELgcQl0lmQ2JRQ2r0C2tQ4772bjabCUJaFbEFJUqqaK2j64v5mTG xhPCVgWHI8EI6x3fOR02dFzH46WnQa6cfZhHjiYir2EjbusPIdey7/GfevQ6zfxf3AfF y8rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=RQ1Ei+ek; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h98si48282418plb.206.2019.08.08.16.31.33; Thu, 08 Aug 2019 16:31:49 -0700 (PDT) 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=@nvidia.com header.s=n1 header.b=RQ1Ei+ek; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404425AbfHHXau (ORCPT + 99 others); Thu, 8 Aug 2019 19:30:50 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:17210 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733140AbfHHXat (ORCPT ); Thu, 8 Aug 2019 19:30:49 -0400 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 08 Aug 2019 16:30:50 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Thu, 08 Aug 2019 16:30:49 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Thu, 08 Aug 2019 16:30:49 -0700 Received: from [10.110.48.28] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 8 Aug 2019 23:30:48 +0000 Subject: Re: [Linux-kernel-mentees][PATCH v4 1/1] sgi-gru: Remove *pte_lookup functions From: John Hubbard To: Bharath Vedartham , , , CC: , , , , , , References: <1565290555-14126-1-git-send-email-linux.bhar@gmail.com> <1565290555-14126-2-git-send-email-linux.bhar@gmail.com> X-Nvconfidentiality: public Message-ID: <97a93739-783a-cf26-8384-a87c7d8bf75e@nvidia.com> Date: Thu, 8 Aug 2019 16:30:48 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1565307050; bh=JeEiCmZ1kkXlkjEvqYy9HdWxc7E1WmBQImLZC4SmHb4=; h=X-PGP-Universal:Subject:From:To:CC:References:X-Nvconfidentiality: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=RQ1Ei+ek/l7TS5OiIRwTFYtcyxSN9T9crP6QSv5UHXXIJAPAZC2aV4vTOVLtBo5Zs qH5R49FfIpBhuswLdJebx07f2s9YccCc3QuXdwYABh7ET1oOCDgc7ZXu5mwLTTstWb xOa02KE+GAVOGWGvFD0sVWCXxdmoLBJRwh+lJO60ITyZqc1MvDyNtE66gHpSkK1QWo YaJjFaXROyuyM1LFk09qlkvDpTRbR1gDXP8t/M4NtvKuJ9IIev7m9TTs+69QegZFTX 52aYem6gWNo5FLgl6tSn7PXKLxcmYPTs5T34l56Pd9kudaY4yi6ni7k3DDa89tFCnx oXzCq5m5h4P9w== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/8/19 4:21 PM, John Hubbard wrote: > On 8/8/19 11:55 AM, Bharath Vedartham wrote: > ... >> if (is_gru_paddr(paddr)) >> goto inval; >> - paddr = paddr & ~((1UL << ps) - 1); >> + paddr = paddr & ~((1UL << *pageshift) - 1); >> *gpa = uv_soc_phys_ram_to_gpa(paddr); >> - *pageshift = ps; > > Why are you no longer setting *pageshift? There are a couple of callers > that both use this variable. > > ...and once that's figured out, I can fix it up here and send it up with the next misc callsites series. I'm also inclined to make the commit log read more like this: sgi-gru: Remove *pte_lookup functions, convert to put_user_page*() For pages that were retained via get_user_pages*(), release those pages via the new put_user_page*() routines, instead of via put_page() or release_pages(). This is part a tree-wide conversion, as described in commit fc1d8e7cca2d ("mm: introduce put_user_page*(), placeholder versions"). As part of this conversion, the *pte_lookup functions can be removed and be easily replaced with get_user_pages_fast() functions. In the case of atomic lookup, __get_user_pages_fast() is used, because it does not fall back to the slow path: get_user_pages(). get_user_pages_fast(), on the other hand, first calls __get_user_pages_fast(), but then falls back to the slow path if __get_user_pages_fast() fails. Also: remove unnecessary CONFIG_HUGETLB ifdefs. thanks, -- John Hubbard NVIDIA