From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753109AbbCWPgi (ORCPT ); Mon, 23 Mar 2015 11:36:38 -0400 Received: from mail-ig0-f177.google.com ([209.85.213.177]:36176 "EHLO mail-ig0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752221AbbCWPgg (ORCPT ); Mon, 23 Mar 2015 11:36:36 -0400 Message-ID: <55103302.8090307@kernel.dk> Date: Mon, 23 Mar 2015 09:36:34 -0600 From: Jens Axboe User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Tejun Heo CC: Jan Kara , Wu Fengguang , Greg Thelen , linux-kernel@vger.kernel.org Subject: Re: [PATCH linux-block/for-linus] writeback: fix possible underflow in write bandwidth calculation References: <20150323041848.GA8991@htj.duckdns.org> In-Reply-To: <20150323041848.GA8991@htj.duckdns.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/22/2015 10:18 PM, Tejun Heo wrote: > From 1ebf33901ecc75d9496862dceb1ef0377980587c Mon Sep 17 00:00:00 2001 > From: Tejun Heo > Date: Mon, 23 Mar 2015 00:08:19 -0400 > > 2f800fbd777b ("writeback: fix dirtied pages accounting on redirty") > introduced account_page_redirty() which reverts stat updates for a > redirtied page, making BDI_DIRTIED no longer monotonically increasing. > > bdi_update_write_bandwidth() uses the delta in BDI_DIRTIED as the > basis for bandwidth calculation. While unlikely, since the above > patch, the newer value may be lower than the recorded past value and > underflow the bandwidth calculation leading to a wild result. > > Fix it by subtracing min of the old and new values when calculating > delta. AFAIK, there hasn't been any report of it happening but the > resulting erratic behavior would be non-critical and temporary, so > it's possible that the issue is happening without being reported. The > risk of the fix is very low, so tagged for -stable. > > Signed-off-by: Tejun Heo > Cc: Jens Axboe > Cc: Jan Kara > Cc: Wu Fengguang > Cc: Greg Thelen > Fixes: 2f800fbd777b ("writeback: fix dirtied pages accounting on redirty") > Cc: stable@vger.kernel.org Added for this round, thanks Tejun. -- Jens Axboe