Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4692574ybi; Tue, 30 Jul 2019 06:33:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqySzYg740w98L0SuZ571cyqnGG5POUBqrWL9mM7MNKr6BTBd5caY1xil3XYModQ1NvuL6Lv X-Received: by 2002:a17:902:2b8a:: with SMTP id l10mr115034328plb.283.1564493590838; Tue, 30 Jul 2019 06:33:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564493590; cv=none; d=google.com; s=arc-20160816; b=KdIXmCT7lknnHs/EmqWTTwKz3rqB0YnPa3RUZ9rkAlmic4fsgL2aMV0YtBk9GgDp1O nYbfxGZYrBk/0LXtMGM3Mp5YXOeMh2s9X3/N1vZLOXRmYVC5PSoOvRtQ4oS+b7mcxA/l MmAivHlpA/UsaHncUI+lOsabR1xBYWHpteyHohOGZQgT0Wlcm4oOBUix2MJChkmk9NV3 Kz2z0eO0KPEAWH4HI3at7PQlvQMVsA7lzEVR14NQFxjOMgcdnKUnSl9XJxCb/GHwVL4J D0+jA565s4jWDssxLlsXnlA+hSZQdY+aKzL+GhMoyh4xsd24va01XbefBLiszf9JM159 nipg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lQ9XWeQmmP2B/eiMeXgVV4uJBU5pKgmRyH+iL8uHSEM=; b=AqjGun7u6v/005uZ6SGd2x2TFk9Qk8TyhGR6u4tMg7sgi8izitgU4nvEdMkAMPvMnN JnaV7l+YSU4w6eyS0+Tt0Crl9d0CgoSK8DuZPLRmerE8S0YsZVaLpXoGt4CC/k5Oe9Gh SARvaZFx5z8Xx+kyXFF4upR4ULbny2t7Fn4xrqdUselCPk3C8XzOLneNwb0Gq4b9Qvo0 SdSnUBDWsQSNbf21UH8pb7DNcHBQJVTEXr1mtqnzjpbwYCkQkDFaif7avIrSjg0S3AHx KPi5mvPK8fuS8A5E+eGw0gXxJN1EFEDHurxbD36Q9SjSDggZGGdElZEUAAvXkHxgDm8T d6ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=uq+lPiYK; 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 b11si25890838plz.307.2019.07.30.06.32.23; Tue, 30 Jul 2019 06:33:10 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=uq+lPiYK; 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 S1729644AbfG3Fwq (ORCPT + 99 others); Tue, 30 Jul 2019 01:52:46 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:46318 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729614AbfG3Fwl (ORCPT ); Tue, 30 Jul 2019 01:52:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=lQ9XWeQmmP2B/eiMeXgVV4uJBU5pKgmRyH+iL8uHSEM=; b=uq+lPiYKi3jyFWYRyJc2ZqGofZ AfLm7DwXmu4JT8EzoT14gmQsntskqRtuY8G1cnrd/LGbf8XPIjVfgOc8bb9ap9X0V7joXGNksytRi zALM22SNoQasN3BLoeBFR/vvCHaXwDoi9ZRyvE3+UeWsboS9MGuTqQ9l97jIiVzC7JdWxUgbDi94Y SNudo9geEIfISGK8/w858hjF3tJ5AFspbRUlnzqRM0O4lBbRAx36X7p2UDsP9spKDQweK0rlIxERO kDjVa7wlLGqVNCj2hmZofEs7SfZ+60OPJU4FjcxlQ7UvktaV6516z56wix5W6aeIElxYkE9PQKl+5 u8tqsQjg==; Received: from [195.167.85.94] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hsL3u-0001K2-4x; Tue, 30 Jul 2019 05:52:38 +0000 From: Christoph Hellwig To: =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Jason Gunthorpe , Ben Skeggs , Felix Kuehling Cc: Ralph Campbell , linux-mm@kvack.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/13] mm: remove the mask variable in hmm_vma_walk_hugetlb_entry Date: Tue, 30 Jul 2019 08:51:58 +0300 Message-Id: <20190730055203.28467-9-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190730055203.28467-1-hch@lst.de> References: <20190730055203.28467-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The pagewalk code already passes the value as the hmask parameter. Signed-off-by: Christoph Hellwig --- mm/hmm.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mm/hmm.c b/mm/hmm.c index f26d6abc4ed2..88b77a4a6a1e 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -771,19 +771,16 @@ static int hmm_vma_walk_hugetlb_entry(pte_t *pte, unsigned long hmask, struct mm_walk *walk) { #ifdef CONFIG_HUGETLB_PAGE - unsigned long addr = start, i, pfn, mask; + unsigned long addr = start, i, pfn; struct hmm_vma_walk *hmm_vma_walk = walk->private; struct hmm_range *range = hmm_vma_walk->range; struct vm_area_struct *vma = walk->vma; - struct hstate *h = hstate_vma(vma); uint64_t orig_pfn, cpu_flags; bool fault, write_fault; spinlock_t *ptl; pte_t entry; int ret = 0; - mask = huge_page_size(h) - 1; - ptl = huge_pte_lock(hstate_vma(vma), walk->mm, pte); entry = huge_ptep_get(pte); @@ -799,7 +796,7 @@ static int hmm_vma_walk_hugetlb_entry(pte_t *pte, unsigned long hmask, goto unlock; } - pfn = pte_pfn(entry) + ((start & mask) >> PAGE_SHIFT); + pfn = pte_pfn(entry) + ((start & hmask) >> PAGE_SHIFT); for (; addr < end; addr += PAGE_SIZE, i++, pfn++) range->pfns[i] = hmm_device_entry_from_pfn(range, pfn) | cpu_flags; -- 2.20.1