Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932439AbbKYC5L (ORCPT ); Tue, 24 Nov 2015 21:57:11 -0500 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:53387 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932277AbbKYC5K (ORCPT ); Tue, 24 Nov 2015 21:57:10 -0500 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: iamjoonsoo.kim@lge.com X-Original-SENDERIP: 10.177.222.138 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Date: Wed, 25 Nov 2015 11:57:35 +0900 From: Joonsoo Kim To: Christoph Lameter Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] mm/vmstat: retrieve more accurate vmstat value Message-ID: <20151125025735.GC9563@js1304-P5Q-DELUXE> References: <1448346123-2699-1-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1426 Lines: 29 On Tue, Nov 24, 2015 at 09:36:09AM -0600, Christoph Lameter wrote: > On Tue, 24 Nov 2015, Joonsoo Kim wrote: > > > When I tested compaction in low memory condition, I found that > > my benchmark is stuck in congestion_wait() at shrink_inactive_list(). > > This stuck last for 1 sec and after then it can escape. More investigation > > shows that it is due to stale vmstat value. vmstat is updated every 1 sec > > so it is stuck for 1 sec. > > vmstat values are not designed to be accurate and are not guaranteed to be > accurate. Comparing to specific values should not be done. If you need an > accurate counter then please use another method of accounting like an > atomic. I think that maintaining duplicate counter to guarantee accuracy isn't reasonable solution. It would cause more overhead to the system. Although vmstat values aren't designed for accuracy, these are already used by some sensitive places so it is better to be more accurate. What this patch does is just adding current cpu's diff to global value when retrieving in order to get more accurate value and this would not be expensive. I think that it doesn't break any design principle of vmstat. Thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/