lkml.org 
[lkml]   [2024]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 09/10] writeback: factor out wb_dirty_exceeded to remove repeated code
    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 <shikemeng@huaweicloud.com>
    > ---
    > 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

    \
     
     \ /
      Last update: 2024-05-27 18:11    [W:4.172 / U:0.048 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site