Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp4590966pja; Thu, 21 Nov 2019 22:26:31 -0800 (PST) X-Google-Smtp-Source: APXvYqyUivfuQ+ykcpPi9BZbHzu2fN+MbTPKZjsRtomdVFx1Hgj6WX0WYZVKhq+UOhz03UATlu7o X-Received: by 2002:a17:906:604e:: with SMTP id p14mr20066118ejj.257.1574403991309; Thu, 21 Nov 2019 22:26:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574403991; cv=none; d=google.com; s=arc-20160816; b=J6FH4m9gOCrRQY/vY0NH8dD27/n7UtMd2bH0P6G15w6SdMeRWfn4MXGQvcMBBFeg6Z gWD7ifiMubreT5wXOs8VsD6DIWjYqY6EWZk8d6txGUC1QeLFN9CBMKG4ejexDKzjiW4D RxTxHfKUekGizGTNQuyrJ+WvSPklhGl5tn9qop4UraHg8XPgRavP5KNGnH5GKG6XwD0r pypFrYCJ/KBkHviLrWBIKa/xweTWKjge7RRdD+cKd2mz5fCvFwBfnsPe6QA02vrTADQq YNa1SwA7qBGHLpb+aLt2Pyjcydsr79tI1IvlgKcGqdY+GPXRtZto+1dfwOlw6X7Bz7cm j0ZQ== 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=M7RK13KA/tl3WRepz1lb82QMnQuQ1b8eY6VQnf94JcA=; b=Myh8ecjv0N3mLYI8Z19Lj0iI3uQLB+ogIrNnfPd8PnsLJhrIYVtk0Zl/QWUT8/S4o4 9MLfO7mBByuswo3bBjweKKh6cCcW6Qu8HZr8o4CBoPGb5Hq8wIPMxfeRwkyZ2FDMG/GH oxfN1SpbdfsS4OANlD3kax9iur78JRUyJVVgAcqCY5HKnEgYTS9cqmrJ8myWe0nN0+Rq NEG4wIu3wOOMIUt3yxf4bLTHsqeB6XX561739hmcDhnSbjTbPDR8/deVrmVuPm1fSrUQ LZ7JXJ7PL+QsopYVw22S2nqeGJD4xVDQNmMovJUi5r0MmJLub9Aq5ZYcAxxFh41SYePG rtzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="L8VZRql/"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l27si1077070eji.208.2019.11.21.22.26.08; Thu, 21 Nov 2019 22:26:31 -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; dkim=pass header.i=@kernel.org header.s=default header.b="L8VZRql/"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728989AbfKVGVy (ORCPT + 99 others); Fri, 22 Nov 2019 01:21:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:57732 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728383AbfKVFwM (ORCPT ); Fri, 22 Nov 2019 00:52:12 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2513A2072E; Fri, 22 Nov 2019 05:52:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574401931; bh=Oj8oGygn/LIQ5/PgpE11S4gI61AYHg12G7VY130aoEA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L8VZRql/SICa/QwUCndg8KSHKdH0xDKQqFrlBvZsCK4QqdwR9g32y7P15q2jElEfa YszmUn/mVc6iNInYxh7PHib/BEhe/KnJtcs/68uZeFiSMQatMnFLgeeMhNIPyoAJs2 akJcASIp8VxkPixeGpry22JAtYALlKAUwGnK1jqw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Anthony Yznaga , Naoya Horiguchi , Vlastimil Babka , Matthew Wilcox , David Rientjes , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH AUTOSEL 4.19 157/219] tools/vm/page-types.c: fix "kpagecount returned fewer pages than expected" failures Date: Fri, 22 Nov 2019 00:48:09 -0500 Message-Id: <20191122054911.1750-150-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191122054911.1750-1-sashal@kernel.org> References: <20191122054911.1750-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anthony Yznaga [ Upstream commit b6fb87b8e3ff1ef6bcf68470f24a97c984554d5a ] Because kpagecount_read() fakes success if map counts are not being collected, clamp the page count passed to it by walk_pfn() to the pages value returned by the preceding call to kpageflags_read(). Link: http://lkml.kernel.org/r/1543962269-26116-1-git-send-email-anthony.yznaga@oracle.com Fixes: 7f1d23e60718 ("tools/vm/page-types.c: include shared map counts") Signed-off-by: Anthony Yznaga Reviewed-by: Naoya Horiguchi Cc: Vlastimil Babka Cc: Matthew Wilcox Cc: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- tools/vm/page-types.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/vm/page-types.c b/tools/vm/page-types.c index 37908a83ddc27..1ff3a6c0367b0 100644 --- a/tools/vm/page-types.c +++ b/tools/vm/page-types.c @@ -701,7 +701,7 @@ static void walk_pfn(unsigned long voffset, if (kpagecgroup_read(cgi, index, pages) != pages) fatal("kpagecgroup returned fewer pages than expected"); - if (kpagecount_read(cnt, index, batch) != pages) + if (kpagecount_read(cnt, index, pages) != pages) fatal("kpagecount returned fewer pages than expected"); for (i = 0; i < pages; i++) -- 2.20.1