From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail191.messagelabs.com (mail191.messagelabs.com [216.82.242.19]) by kanga.kvack.org (Postfix) with SMTP id E46276B004A for ; Thu, 18 Nov 2010 09:27:53 -0500 (EST) Message-ID: <4CE537BE.6090103@redhat.com> Date: Thu, 18 Nov 2010 09:27:10 -0500 From: Rik van Riel MIME-Version: 1.0 Subject: Re: [PATCH] writeback: prevent bandwidth calculation overflow References: <20101118065725.GB8458@localhost> In-Reply-To: <20101118065725.GB8458@localhost> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org To: Wu Fengguang Cc: Andrew Morton , Jan Kara , "Li, Shaohua" , Christoph Hellwig , Dave Chinner , Theodore Ts'o , Chris Mason , Peter Zijlstra , Mel Gorman , KOSAKI Motohiro , linux-mm , "linux-fsdevel@vger.kernel.org" , LKML List-ID: On 11/18/2010 01:57 AM, Wu Fengguang wrote: > On 32bit kernel, bdi->write_bandwidth can express at most 4GB/s. > > However the current calculation code can overflow when disk bandwidth > reaches 800MB/s. Fix it by using "long long" and swapping the order of > multiplication/division. And further, change its unit to pages/second > rather than bytes/second. That allows up to 16TB/s bandwidth in 32bit > kernel. > > Signed-off-by: Wu Fengguang Acked-by: Rik van Riel -- All rights reversed -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: email@kvack.org