mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Tejun Heo <tj@kernel.org>
Cc: Jan Kara <jack@suse.cz>, Wu Fengguang <fengguang.wu@intel.com>,
	Greg Thelen <gthelen@google.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH linux-block/for-linus] writeback: fix possible underflow in write bandwidth calculation
Date: Mon, 23 Mar 2015 09:36:34 -0600	[thread overview]
Message-ID: <55103302.8090307@kernel.dk> (raw)
In-Reply-To: <20150323041848.GA8991@htj.duckdns.org>

On 03/22/2015 10:18 PM, Tejun Heo wrote:
>  From 1ebf33901ecc75d9496862dceb1ef0377980587c Mon Sep 17 00:00:00 2001
> From: Tejun Heo <tj@kernel.org>
> 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 <tj@kernel.org>
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: Jan Kara <jack@suse.cz>
> Cc: Wu Fengguang <fengguang.wu@intel.com>
> Cc: Greg Thelen <gthelen@google.com>
> Fixes: 2f800fbd777b ("writeback: fix dirtied pages accounting on redirty")
> Cc: stable@vger.kernel.org

Added for this round, thanks Tejun.

-- 
Jens Axboe


      reply	other threads:[~2015-03-23 15:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23  4:18 Tejun Heo
2015-03-23 15:36 ` Jens Axboe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55103302.8090307@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=fengguang.wu@intel.com \
    --cc=gthelen@google.com \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome