Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6197036ybc; Wed, 27 Nov 2019 17:05:45 -0800 (PST) X-Google-Smtp-Source: APXvYqzPu0+dbLMZFaP4tjR6Z5/AuW+iRNwRfXSdlHp02RQtyKBg81eiJd7M6fyRPoggQ8SB3PX3 X-Received: by 2002:a17:906:814a:: with SMTP id z10mr31522399ejw.62.1574903145326; Wed, 27 Nov 2019 17:05:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574903145; cv=none; d=google.com; s=arc-20160816; b=E2ttdq+UIXrvThDeoEOIhXjpSm8i9kg2fNnh7EI69ivlfO8mPmzKi5To05hekxMhhy dcCdzlMMx2xFLKC2OrfVI8AazBuL/5/tL3S8i+WbIyf37gThf7faAEhOKtNIHEBmMBPp IEAG7UMBHB/My3iKFtL0S4QrVQmqrKoxoupyyz+4Mi5Q+bgwIFppODo8Z+UcMSHQ9ypm btgkEOsTrr9BluYwW+b5707AWo9eg4cyWkFr7IG8zxxVH/UkjCo0dabq58fS8LhLIJYr TuQMqxMwlizHcUTQjrmZwjpyG0bh1dlpqnqhDcPFdIMeTK4EOsfq3jQrlBIeJFazQ1sg a4hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=WZTGVqfjUHT6lg6oVajDKyjW9A3FYlijFB64Xmip38o=; b=n+A34iL3949MngopffaNuVG7ms8LWRTWSkvYCqhZRV6zLX/ZxlIE0Ge5w5zBZVmV4m flAoEYFGRAwFO7Sx3vh1WQo0JWavSntB6NYIb5qlajfmKi0ggkJas2oxkGXAc1e64JdA p14kH2MGyEAM/ZAx08iQY/5KBrsj/Le/2dkWU80+oZxe0nMty2NEksiET0r6xlsuY4LJ D+XpSPiM85isBaSUgP2+N+nP34EsQ6n7bvkrMKIIFEVIYYFKgtan5YCim6nH2Mu981j/ Nb81u4btvNzlgcY6MrgtJe4StFjb3jaS/G2NbPtlSPuVoWoan2geBgsaezliGPjOY11g qRfw== 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 cw16si12544679edb.37.2019.11.27.17.05.21; Wed, 27 Nov 2019 17:05:45 -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 S1727318AbfK1BDs (ORCPT + 99 others); Wed, 27 Nov 2019 20:03:48 -0500 Received: from mga06.intel.com ([134.134.136.31]:2536 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727071AbfK1BDs (ORCPT ); Wed, 27 Nov 2019 20:03:48 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Nov 2019 17:03:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,251,1571727600"; d="scan'208";a="217486814" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by fmsmga001.fm.intel.com with ESMTP; 27 Nov 2019 17:03:46 -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 2/2] mm/page_vma_mapped: page table boundary is already guaranteed Date: Thu, 28 Nov 2019 09:03:21 +0800 Message-Id: <20191128010321.21730-2-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191128010321.21730-1-richardw.yang@linux.intel.com> References: <20191128010321.21730-1-richardw.yang@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The check here is to guarantee pvmw->address iteration is limited in one page table boundary. To be specific, here the address range should be in one PMD_SIZE. If my understanding is correct, this check is already done in the above check: address >= __vma_address(page, vma) + PMD_SIZE The boundary check here seems not necessary. Signed-off-by: Wei Yang --- Test: more than 48 hours kernel build test shows this code is not touched. --- mm/page_vma_mapped.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/mm/page_vma_mapped.c b/mm/page_vma_mapped.c index 76e03650a3ab..25aada8a1271 100644 --- a/mm/page_vma_mapped.c +++ b/mm/page_vma_mapped.c @@ -163,7 +163,6 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) return not_found(pvmw); return true; } -restart: pgd = pgd_offset(mm, pvmw->address); if (!pgd_present(*pgd)) return false; @@ -225,17 +224,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) __vma_address(pvmw->page, pvmw->vma) + PMD_SIZE) return not_found(pvmw); - /* Did we cross page table boundary? */ - if (pvmw->address % PMD_SIZE == 0) { - pte_unmap(pvmw->pte); - if (pvmw->ptl) { - spin_unlock(pvmw->ptl); - pvmw->ptl = NULL; - } - goto restart; - } else { - pvmw->pte++; - } + pvmw->pte++; } while (pte_none(*pvmw->pte)); if (!pvmw->ptl) { -- 2.17.1