Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6198085ybc; Wed, 27 Nov 2019 17:06:49 -0800 (PST) X-Google-Smtp-Source: APXvYqxEBF0wSPnsP99etCOgpBBaZ12oEUnw4YwFcKHOEPG+/nO3CXJ7phgQ0aept6LD5qqXK5Ex X-Received: by 2002:a05:6402:17c5:: with SMTP id s5mr30028893edy.276.1574903209709; Wed, 27 Nov 2019 17:06:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574903209; cv=none; d=google.com; s=arc-20160816; b=gE4gOei4D2ti8zP6YHzVtEvikAL5iOC/U37c+8w4+sn3d0xD15/uv5ti4kcVTglEei 50kkdnMXtfUJjKbyLZH4AO5QYOBHotM8AIEcMIhknkcuSKoF5MixKGTJSo0d6nZO2wEp KPcL5WTqgCVWCHZhQrvVSgxgKflCBwCjr6Zfa5uvKlFT41eLpUG1Tcnf4sEWZi8RChDa FgbeiNoh+vJs0s+TvB3yyflYix2GobP7iMq48sxE2anwjcCvG0eMLRS4KEzlwUp0jotc pabMldos+BiFvNkwPASyuiORZwG/KUi4vgo590R1rTOMw1Or4g1uFv000ublKI3h5hQf zflA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=12lZBpaeRrclKHSlPLm6lICdRGUp0y0ZWAiH8dQ2Uvw=; b=yQ68JM3n+Y3arJWGbzlFtJ4JEr1AcAWbgv9/ie3iqWCWZ7BhQv2nBem1CX//joFCmN zrKMaicXdwp/FUet2G8OnpMaI0iqJ9L2o8V2CIj4Yl+O4vwx+u57j5/W1GdP5oapkJ9P mUwn//wVjNjSPYygvqfQCBNilzVv96bqhDbYujQK67RSc+0mi9gbdpHzXgVPXcGYdI1a KqT1M5wqiLsNNYtXv5sqiLqqfhBiBhBzXLYRES62idtFOmoJiBY5X8bE/0U2hASZ+Xtj ypq2ObBJZWXrnb0ctGSzqlXgdAz8UgKYtEukZhsZxK2Dwbm9ANDaV27+baSl3PoNYR0f +lUg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5si10536848ejj.284.2019.11.27.17.06.25; Wed, 27 Nov 2019 17:06:49 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727191AbfK1BDr (ORCPT + 99 others); Wed, 27 Nov 2019 20:03:47 -0500 Received: from mga04.intel.com ([192.55.52.120]:27439 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727071AbfK1BDr (ORCPT ); Wed, 27 Nov 2019 20:03:47 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Nov 2019 17:03:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,251,1571727600"; d="scan'208";a="221159840" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by orsmga002.jf.intel.com with ESMTP; 27 Nov 2019 17:03:44 -0800 From: Wei Yang To: akpm@linux-foundation.org Cc: kirill.shutemov@linux.intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wei Yang Subject: [PATCH 1/2] mm/page_vma_mapped: use PMD_SIZE instead of calculating it Date: Thu, 28 Nov 2019 09:03:20 +0800 Message-Id: <20191128010321.21730-1-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At this point, we are sure page is PageTransHuge, which means hpage_nr_pages is HPAGE_PMD_NR. This is safe to use PMD_SIZE instead of calculating it. Signed-off-by: Wei Yang --- mm/page_vma_mapped.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_vma_mapped.c b/mm/page_vma_mapped.c index eff4b4520c8d..76e03650a3ab 100644 --- a/mm/page_vma_mapped.c +++ b/mm/page_vma_mapped.c @@ -223,7 +223,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) if (pvmw->address >= pvmw->vma->vm_end || pvmw->address >= __vma_address(pvmw->page, pvmw->vma) + - hpage_nr_pages(pvmw->page) * PAGE_SIZE) + PMD_SIZE) return not_found(pvmw); /* Did we cross page table boundary? */ if (pvmw->address % PMD_SIZE == 0) { -- 2.17.1