[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180406080714.GG8286@dhcp22.suse.cz>
Date: Fri, 6 Apr 2018 10:07:14 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Greg Thelen <gthelen@...gle.com>
Cc: Wang Long <wanglong19@...tuan.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Johannes Weiner <hannes@...xchg.org>,
Tejun Heo <tj@...nel.org>, npiggin@...il.com,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH] writeback: safer lock nesting
On Fri 06-04-18 01:03:24, Greg Thelen wrote:
[...]
> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index d4d04fee568a..d51bae5a53e2 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -746,10 +746,11 @@ int inode_congested(struct inode *inode, int cong_bits)
> if (inode && inode_to_wb_is_valid(inode)) {
> struct bdi_writeback *wb;
> bool locked, congested;
> + unsigned long flags;
>
> - wb = unlocked_inode_to_wb_begin(inode, &locked);
> + wb = unlocked_inode_to_wb_begin(inode, &locked, &flags);
Wouldn't it be better to have a cookie (struct) rather than 2 parameters
and let unlocked_inode_to_wb_end DTRT?
> congested = wb_congested(wb, cong_bits);
> - unlocked_inode_to_wb_end(inode, locked);
> + unlocked_inode_to_wb_end(inode, locked, flags);
> return congested;
> }
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists