Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6501741ybi; Sun, 21 Jul 2019 19:36:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzu34br/ehElevAMM21XWTGy2YafM7XrxDYCCQlILtNG8h3QQiTPvE0rbvp7h47qvHR067I X-Received: by 2002:a17:902:2baa:: with SMTP id l39mr73575244plb.280.1563763011045; Sun, 21 Jul 2019 19:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563763011; cv=none; d=google.com; s=arc-20160816; b=Umxwtmk8A8HMEIWXb7OvuHtiNQIsy/0FtqyvnY4Er6CGX+8HIT8odG9PCFzGXWUStD yYRiFQ7xaKO3LYd3JbxWpP/jmJKC9S4mVVTMCoZxSUoM2NAO8JEUwXXrVvWajit5NT9Y A0jEsDQvgRvRiMpeNgcMGLPhhTrIag3tm+/lA0hoBAazBL+f7IS8Jhq2rEvSYxirIhKH dECx8ISeg83CxuSxKpEQH5+9VqjvSwEnK6hJJCfRlzaXbHfWM/Ii3ORkoCR25l45605z 4gA0dV93/BMBv5isnPcj11XvqXn96ExtEhHv7hsvEG0c7tppIPxUMoaSg6Fd6ui7rwIA RE0g== 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:from:references:cc:to:subject; bh=lO0pl2D/N0Wte9jFVwYyoxzkAS8kJOiDf/u2pevzBOk=; b=PBk72ZwoRuFegCXm/+sDHo3wbHeT1Gc9lt1Z13cc7WErw/3XuHSKAMhPzy3kqRHWDG Oa9g4mIzj3r1yrIjrrixAUN9XUnTUrM5Ctq8VNjGQyR1vSpcb8Jd9hdl3SAU94MBUs/e MoQ8WF2TbPhXeZ/rwUpdt4LG4zc4yocdSytQSsk0zuoJeKskVgNjYcxhSE61ciZ9ScFT +/8imwi/x14Xndxfqaq5I7KVSZ/B0t7RVbuFEkxFMD/e1eaM0MUEneNC7IvM/4xLvo23 3IXarqujH9HPzsOecm50o50UV5lTU/3j9YMBY4p2mSsNvTn01JJkYMMfoLH11VMgpsJX NtFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=axyva0Yh; 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 a6si8120110pla.259.2019.07.21.19.36.34; Sun, 21 Jul 2019 19:36:51 -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=axyva0Yh; 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 S1728612AbfGVCea (ORCPT + 99 others); Sun, 21 Jul 2019 22:34:30 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:7820 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726233AbfGVCe3 (ORCPT ); Sun, 21 Jul 2019 22:34:29 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Sun, 21 Jul 2019 19:34:29 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Sun, 21 Jul 2019 19:34:28 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Sun, 21 Jul 2019 19:34:28 -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; Mon, 22 Jul 2019 02:34:28 +0000 Subject: Re: [PATCH 2/3] sgi-gru: Remove CONFIG_HUGETLB_PAGE ifdef To: Bharath Vedartham , , , CC: , , , References: <1563724685-6540-1-git-send-email-linux.bhar@gmail.com> <1563724685-6540-3-git-send-email-linux.bhar@gmail.com> X-Nvconfidentiality: public From: John Hubbard Message-ID: <9b510a41-7ce1-b2b7-d3c6-f6f0305e10ea@nvidia.com> Date: Sun, 21 Jul 2019 19:34:28 -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: <1563724685-6540-3-git-send-email-linux.bhar@gmail.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1563762869; bh=lO0pl2D/N0Wte9jFVwYyoxzkAS8kJOiDf/u2pevzBOk=; h=X-PGP-Universal:Subject:To:CC:References:X-Nvconfidentiality:From: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=axyva0YhbvZrjjd+JQOH6Y0DYU+XPMlPGwyWbICHjIn8nCWjKrAIQ3Nsr0hDTUvze lpL0V66Z84aNd2j7r2POhsMZ2g1W48+3rACb7u5lKicDUcPiBANzVgq5NAtRPyyvQZ BUkmZyF21/eHaBhRt68KP6CCGVB1uS8F6y+BDQXas50Y73RFVq3LG1sx58q//56cNy Sc2nC9ndcjjoGO8WCMjjlXZg/qvs7+EtBUus/bAhoTTUC+tCeqTcrzFWd7g1xnM56+ VjK+Xo1XkfdYYKTryKiB7/hKeqOf8OxmNB0YT2qWjZy/AptRLILXHHj1tibyEoXiC+ 5igf5moViBH9g== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/21/19 8:58 AM, Bharath Vedartham wrote: > is_vm_hugetlb_page has checks for whether CONFIG_HUGETLB_PAGE is defined > or not. If CONFIG_HUGETLB_PAGE is not defined is_vm_hugetlb_page will > always return false. There is no need to have an uneccessary > CONFIG_HUGETLB_PAGE check in the code. >=20 > Cc: Ira Weiny > Cc: John Hubbard > Cc: J=C3=A9r=C3=B4me Glisse > Cc: Greg Kroah-Hartman > Cc: Dimitri Sivanich > Cc: Arnd Bergmann > Cc: linux-kernel@vger.kernel.org > Cc: linux-mm@kvack.org > Signed-off-by: Bharath Vedartham > --- > drivers/misc/sgi-gru/grufault.c | 11 +++-------- > 1 file changed, 3 insertions(+), 8 deletions(-) >=20 > diff --git a/drivers/misc/sgi-gru/grufault.c b/drivers/misc/sgi-gru/grufa= ult.c > index 61b3447..75108d2 100644 > --- a/drivers/misc/sgi-gru/grufault.c > +++ b/drivers/misc/sgi-gru/grufault.c > @@ -180,11 +180,8 @@ static int non_atomic_pte_lookup(struct vm_area_stru= ct *vma, > { > struct page *page; > =20 > -#ifdef CONFIG_HUGETLB_PAGE > *pageshift =3D is_vm_hugetlb_page(vma) ? HPAGE_SHIFT : PAGE_SHIFT; > -#else > - *pageshift =3D PAGE_SHIFT; > -#endif > + > if (get_user_pages(vaddr, 1, write ? FOLL_WRITE : 0, &page, NULL) <=3D = 0) > return -EFAULT; > *paddr =3D page_to_phys(page); > @@ -238,11 +235,9 @@ static int atomic_pte_lookup(struct vm_area_struct *= vma, unsigned long vaddr, > return 1; > =20 > *paddr =3D pte_pfn(pte) << PAGE_SHIFT; > -#ifdef CONFIG_HUGETLB_PAGE > + > *pageshift =3D is_vm_hugetlb_page(vma) ? HPAGE_SHIFT : PAGE_SHIFT; > -#else > - *pageshift =3D PAGE_SHIFT; > -#endif > + > return 0; > =20 > err: >=20 Looks like an accurate cleanup to me. Reviewed-by: John Hubbard thanks, --=20 John Hubbard NVIDIA