Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751678AbdIULwO (ORCPT ); Thu, 21 Sep 2017 07:52:14 -0400 Received: from mx2.suse.de ([195.135.220.15]:44069 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751387AbdIULwN (ORCPT ); Thu, 21 Sep 2017 07:52:13 -0400 Date: Thu, 21 Sep 2017 13:52:06 +0200 From: Jan Kara To: Yafang Shao Cc: jack@suse.cz, akpm@linux-foundation.org, hannes@cmpxchg.org, mhocko@suse.com, vdavydov.dev@gmail.com, jlayton@redhat.com, nborisov@suse.com, tytso@mit.edu, mawilcox@microsoft.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, mcgrof@kernel.org, keescook@chromium.org, wuqixuan@huawei.com Subject: Re: [PATCH v4] mm: introduce validity check on vm dirtiness settings Message-ID: <20170921115206.GB16731@quack2.suse.cz> References: <1506002392-11907-1-git-send-email-laoar.shao@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1506002392-11907-1-git-send-email-laoar.shao@gmail.com> 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 Content-Length: 884 Lines: 31 On Thu 21-09-17 21:59:52, Yafang Shao wrote: > we can find the logic in domain_dirty_limits() that > when dirty bg_thresh is bigger than dirty thresh, > bg_thresh will be set as thresh * 1 / 2. > if (bg_thresh >= thresh) > bg_thresh = thresh / 2; > > But actually we can set vm background dirtiness bigger than > vm dirtiness successfully. This behavior may mislead us. > We'd better do this validity check at the beginning. > > Signed-off-by: Yafang Shao Looks good. You can add: Reviewed-by: Jan Kara Just one nit below: > + > + /* needn't do validity check if the value is not different. */ > + if (ret == 0 && write && dirty_background_ratio != old_ratio) { Whitespace before the comment is broken. Generally I don't think the comment brings much so I'd just delete it. Honza -- Jan Kara SUSE Labs, CR