Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp622756lqm; Wed, 1 May 2024 10:29:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVwHlCvtHP63RV/FgYJGOpAXCytkIwYhlwIr1tQDRYcP3d+Rh8P5NEsKaxky+PpuT9Neet4yH9UZwNFDeOHIvGyAatAntKucQmDh3+4nw== X-Google-Smtp-Source: AGHT+IGFh0W6fDD2me83qU4Yd9sWoLlAjjWePVnRic92nbTolpD1GPCq+CWHJgHUurOyRZBx5qGp X-Received: by 2002:a50:cc96:0:b0:572:727f:d0db with SMTP id q22-20020a50cc96000000b00572727fd0dbmr1949067edi.15.1714584542025; Wed, 01 May 2024 10:29:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714584542; cv=pass; d=google.com; s=arc-20160816; b=eVgQ2YTMgt84cZteoqOPJDHgSRtd9wNRhMUoBoyLZnjmaB0tRlr1ce8wUkWdK59azy LVy6ynqBhUYqlvYq3CaoplryyA72P5/gnrQSmEKYHI5Yt7FZf4CAZkpuUBkcEtUyTJQp s/6yxtbWSeEOxrRKfBgtsWgWocXhfZO+L9vxM0iOf7ZmTQsiFP2wzLag5LxgGxr2rXZe tdtUhwFO5rIM9RYbxkZTkkEUnSgyRX87bFodit32GTJBKGhwpCvNDLf4GQu+nwX1ANDj d+wj//7COfmcxe8Nz/9T1Mcu6rfIeF6GH3Ft8c7W+oBR+z0dXlFFQpw3dQIXdMl7/KMP 5WDg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:sender:dkim-signature; bh=/z3qwZ2T0f1AcIzMY8k1DdsGurc58CRUSveN9mEOGBw=; fh=QOSoGwjs2AjY99vcVOqCdJgGvQQ7IK2cogigNh8NSGs=; b=XQW2whcIqWtXea6Ml03PGEzLiN6mBNSxH2A6hMrsEUBadDIgdTIr5RD07HIqr26MEL xZaPIvHGVyS7bugLN+ANGToNMb89kimPEUb81K1vCT1ZayKV+Acsy1xpDD/Dx+vyHqRr 6ggL5+wlMuMeDAKvC5OKSG9oTtBshSl/mHqHvACsr9u4EmFe4JJ+hwrwBJeEb4yCn8v6 ARxaDiGxl8ytJvOI3QF5Ocw0GY5acu8wXWx1BK50RfTIiseOl4vQgUF8lu/izMqR+emg 4sT3EY0Axi19f1F0fEmhMzccPOpByGabJEimzT1zWuUWUIMyAk8vwU44TrPpTnF6BL8f 2iJw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Kg1VHinU; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-165652-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165652-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s10-20020a056402520a00b0057268de719dsi5389057edd.226.2024.05.01.10.29.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 10:29:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165652-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Kg1VHinU; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-165652-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165652-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BC30B1F21F62 for ; Wed, 1 May 2024 17:29:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 936421B947; Wed, 1 May 2024 17:28:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Kg1VHinU" Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B40E18C22; Wed, 1 May 2024 17:28:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714584531; cv=none; b=Wyonh3asWBf14p1sNrHT90I9BsNEiDmrg79s9BLcq5R1uPeY0CE7/LzMNwWxq31d8dVSEmpWnpNePn0CaBipYC2B2usnDlib8UmgFDRIaqXyvvGJRtXnGzpQ2Xjw2VGRAVeo/Q0aKlj+xEDndDKG5DD7MFV7plLYmFxOkRFogFk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714584531; c=relaxed/simple; bh=+hjBT4f2fglD+v2rS4MciZgOO8UjEC7rc5M9uGPcJwE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bdQEKFXMps0ZYyzU2EspJMvtkq6oo0izoAHRMx5Rvh2SzkvbqOS5R1dNx+v8tqwzhOTan3pJdLkPy8+f16JO0fZ2mdxYtB3hS7suCr8wRuvbfA7z+xZ/2duH8/6j0qHDnOzMp+3NW10MGiDDiUFzZnziYloJMsZCS+WaN8mzJm8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Kg1VHinU; arc=none smtp.client-ip=209.85.210.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-6ed627829e6so8300543b3a.1; Wed, 01 May 2024 10:28:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714584530; x=1715189330; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=/z3qwZ2T0f1AcIzMY8k1DdsGurc58CRUSveN9mEOGBw=; b=Kg1VHinUK78MX+5aSthlCmKrAggOfU7/U4FxZfFKCgdBUiyNljhsbKy34xCH1ug6tK 5t2NaCA6qNK1oUVaRvY16BBRErJ3jtoxpjPGtBlO/9RFGYdM6+vUnKaUZyGE1loavbb3 PXiPDBJ4I6e5mREB7KMG9OC3Iaj6TB64cjOZoqzw4De9vLP/2reak3ascZTsT54UGWUw OiGbbUd2nNKUTLxWJb8sNm7YK23ZNCtmhw/OBPggH1lN4lhv3C5T2Tn49sqM2mYvrqEA LmdgcoZFtyjieb7/SFTVYG6gaxsdMTAwMAmTBC118Geg3S10pSAAAeyY0pw4061hm3m0 AnOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714584530; x=1715189330; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/z3qwZ2T0f1AcIzMY8k1DdsGurc58CRUSveN9mEOGBw=; b=A+7oJzrGOWd2zKfBJtANRkbS/2+l3cOBFWsZbbWHVBQ1t38PBDnHgNJ8PYUQy1H2E0 9/XlApdEovY3XVPOHbtIe2wBw4aQAvcAV91Faowo//EYWDRM+ClKZroEq1CI777fEILY BboBWyqrs6E1FqSk7oC4AIEgRkoCVzEti57yGzGbFPmmRFc6HKvtA9lZf2re3yKV7jne 3djzt7y8phJEucqbptUUi4134minfpJNWN+NkG+z7kHDn5SYD0XbvCooxS7wc1yFbCZo 6sKTKu6aP/Wjb/Fbkbw5PUVJ9cOm5YsP/m/CzMUHwAQsSbQ3MGzQuE61CNi/jAJbkkZi 12Gw== X-Forwarded-Encrypted: i=1; AJvYcCWlnySztmKvEOxFHHL8oGoO77taGv83oTsWTJyEwNZMzjRmCmENbfTjw4HfkEyttK6I7/zbASg2xc3UzrfCHo3jQe9O4wWsriE3WdGByjFSaK6Zg4FsJOh8f1+4zvg4t1MO0obIL+OhY/0Tew== X-Gm-Message-State: AOJu0YwjxRHT28j3kVPfDlUI86nKbpPPI4bSyfuIJWNVRNG0b9DJygNp Wl45D3kbseMRQPR4pVHxfNkbyC3IHdUMLkX+T94QtDk1UT9o/veT X-Received: by 2002:a05:6a00:4655:b0:6ea:dfbf:13d4 with SMTP id kp21-20020a056a00465500b006eadfbf13d4mr3353946pfb.18.1714584528767; Wed, 01 May 2024 10:28:48 -0700 (PDT) Received: from localhost (dhcp-141-239-159-203.hawaiiantel.net. [141.239.159.203]) by smtp.gmail.com with ESMTPSA id j16-20020a62b610000000b006f423ab373bsm1156887pff.126.2024.05.01.10.28.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 10:28:48 -0700 (PDT) Sender: Tejun Heo Date: Wed, 1 May 2024 07:28:47 -1000 From: Tejun Heo To: Kemeng Shi Cc: willy@infradead.org, akpm@linux-foundation.org, jack@suse.cz, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 09/10] writeback: factor out wb_dirty_exceeded to remove repeated code Message-ID: References: <20240429034738.138609-1-shikemeng@huaweicloud.com> <20240429034738.138609-10-shikemeng@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240429034738.138609-10-shikemeng@huaweicloud.com> On Mon, Apr 29, 2024 at 11:47:37AM +0800, Kemeng Shi wrote: > Factor out wb_dirty_exceeded to remove repeated code > > Signed-off-by: Kemeng Shi > --- > mm/page-writeback.c | 21 +++++++++++---------- > 1 file changed, 11 insertions(+), 10 deletions(-) > > diff --git a/mm/page-writeback.c b/mm/page-writeback.c > index 68ae4c90ce8b..26b638cc58c5 100644 > --- a/mm/page-writeback.c > +++ b/mm/page-writeback.c > @@ -140,6 +140,7 @@ struct dirty_throttle_control { > > unsigned long pos_ratio; > bool freerun; > + bool dirty_exceeded; Can you try making the function return bool? That or collect dtc setup into a single function which takes flags to initialize different parts? It can become pretty error-prone to keep partially storing results in the struct. Thanks. -- tejun