From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754197AbcE3IFO (ORCPT ); Mon, 30 May 2016 04:05:14 -0400 Received: from mx2.suse.de ([195.135.220.15]:38224 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754013AbcE3IFL (ORCPT ); Mon, 30 May 2016 04:05:11 -0400 Date: Mon, 30 May 2016 10:05:07 +0200 From: Jan Kara To: Tejun Heo Cc: Jens Axboe , Jan Kara , Fengguang Wu , linux-kernel@vger.kernel.org, Miao Xie , kernel-team@fb.com Subject: Re: [PATCH block/for-4.7-fixes] writeback: use higher precision calculation in domain_dirty_limits() Message-ID: <20160530080507.GC3690@quack2.suse.cz> References: <57333E75.3080309@huawei.com> <5733D845.2030709@huawei.com> <20160512153234.GS4775@htj.duckdns.org> <20160527183446.GS23194@mtj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160527183446.GS23194@mtj.duckdns.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 27-05-16 14:34:46, Tejun Heo wrote: > As vm.dirty_[background_]bytes can't be applied verbatim to multiple > cgroup writeback domains, they get converted to percentages in > domain_dirty_limits() and applied the same way as > vm.dirty_[background]ratio. However, if the specified bytes is lower > than 1% of available memory, the calculated ratios become zero and the > writeback domain gets throttled constantly. > > Fix it by using per-PAGE_SIZE instead of percentage for ratio > calculations. Also, the updated DIV_ROUND_UP() usages now should > yield 1/4096 (0.0244%) as the minimum ratio as long as the specified > bytes are above zero. The patch looks good to me. You can add: Reviewed-by: Jan Kara Just one nit below: > @@ -386,26 +387,28 @@ static void domain_dirty_limits(struct dirty_throttle_control *dtc) > /* > * The byte settings can't be applied directly to memcg > * domains. Convert them to ratios by scaling against > - * globally available memory. > + * globally available memory. As the ratios are in > + * per-PAGE_SIZE, they can be obtained by dividing bytes by > + * pages. The comment would be more comprehensible to me is the last sentence was "... by dividing bytes by number of pages". Honza -- Jan Kara SUSE Labs, CR