From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6B8C3126DC for ; Tue, 14 Oct 2025 12:10:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760443847; cv=none; b=edAcSmBDRXks2g/+z+b/EJfSAA7nuDQ5iNjQ3mK4nuTee8TWD/UrNY1itwsXXpN8EDzX7Ma5wspp3bvDsGaW+keC+7L0AzIcuKB79J7LYv8OyInbPWu1+6B3g8iTB/coooK3TPD4aIIq4oyewm4I4bGE4ea2FCLdpqjG1DvjPc4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760443847; c=relaxed/simple; bh=J+pOFwFHc5MdTbyOWG6elVAn+TzaOGlfdoY3exz5yDA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=n8/E9cDJyAuj/rB/kUfL3EkdM+bTsGZEeizstslaQMu2wLObhPPKJPwIjK9mI+s77yDjD11Acc6+p9uzeoArGYWGMUL+iYJ+U3UuGGm0bM1EP+AkRz+hXCxEgHdjUksCmk/O7jT4hm9xQXu3RIDWYy7qF12BEuGdhYoBAWAF9dg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=j4EoRb05; arc=none smtp.client-ip=203.254.224.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="j4EoRb05" Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20251014121039epoutp035ccf5294f31ed79567fd2ff7ae681d9c~uWlg7ykIq0487904879epoutp03K for ; Tue, 14 Oct 2025 12:10:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20251014121039epoutp035ccf5294f31ed79567fd2ff7ae681d9c~uWlg7ykIq0487904879epoutp03K DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1760443839; bh=O2U42LWZMM8201UpxKxW6f/AsVjv4jB1OSfEppuAbYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j4EoRb052CyFlWparM6vJ+IGSCEWjIS6wVo+S87KDQqDA0Ocmw/12pWxJHIIh31zH Esi8h9OyxeOyR15xYVX5wm7qtnvdwsg04HJRPmJ/1moWx5u2peXU8xFWHwP0Tb4pM0 +fUQ0OawY0mVdzW1x06h3YX1hssKOUzItdHKdfpU= Received: from epsnrtp04.localdomain (unknown [182.195.42.156]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPS id 20251014121038epcas5p4685b828d668366916b45d174d16a3637~uWlgJt7Oo0610406104epcas5p4-; Tue, 14 Oct 2025 12:10:38 +0000 (GMT) Received: from epcas5p1.samsung.com (unknown [182.195.38.95]) by epsnrtp04.localdomain (Postfix) with ESMTP id 4cmCj93Ktwz6B9m6; Tue, 14 Oct 2025 12:10:37 +0000 (GMT) Received: from epsmtip1.samsung.com (unknown [182.195.34.30]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20251014121036epcas5p17c607955db032d076daa2e5cfecfe8ea~uWleqppMN1447514475epcas5p1j; Tue, 14 Oct 2025 12:10:36 +0000 (GMT) Received: from localhost.localdomain (unknown [107.99.41.245]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20251014121032epsmtip1fbff11e9fef5c6232ce81ec58fd0763b~uWlaFqXYA1256112561epsmtip1p; Tue, 14 Oct 2025 12:10:31 +0000 (GMT) From: Kundan Kumar To: jaegeuk@kernel.org, chao@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, miklos@szeredi.hu, agruenba@redhat.com, trondmy@kernel.org, anna@kernel.org, akpm@linux-foundation.org, willy@infradead.org, mcgrof@kernel.org, clm@meta.com, david@fromorbit.com, amir73il@gmail.com, axboe@kernel.dk, hch@lst.de, ritesh.list@gmail.com, djwong@kernel.org, dave@stgolabs.net, wangyufei@vivo.com Cc: linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, gfs2@lists.linux.dev, linux-nfs@vger.kernel.org, linux-mm@kvack.org, gost.dev@samsung.com, kundan.kumar@samsung.com, anuj20.g@samsung.com, vishak.g@samsung.com, joshi.k@samsung.com Subject: [PATCH v2 05/16] writeback: modify bdi_writeback search logic to search across all wb ctxs Date: Tue, 14 Oct 2025 17:38:34 +0530 Message-Id: <20251014120845.2361-6-kundan.kumar@samsung.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20251014120845.2361-1-kundan.kumar@samsung.com> Precedence: bulk X-Mailing-List: gfs2@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CMS-MailID: 20251014121036epcas5p17c607955db032d076daa2e5cfecfe8ea X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 105P cpgsPolicy: CPGSC10-542,Y X-CFilter-Loop: Reflected X-CMS-RootMailID: 20251014121036epcas5p17c607955db032d076daa2e5cfecfe8ea References: <20251014120845.2361-1-kundan.kumar@samsung.com> Since we have multiple cgwb per bdi, embedded in writeback_ctx now, we iterate over all of them to find the associated writeback. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- fs/fs-writeback.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 56c048e22f72..93f8ea340247 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -1090,7 +1090,8 @@ int cgroup_writeback_by_id(u64 bdi_id, int memcg_id, { struct backing_dev_info *bdi; struct cgroup_subsys_state *memcg_css; - struct bdi_writeback *wb; + struct bdi_writeback *wb = NULL; + struct bdi_writeback_ctx *bdi_wb_ctx; struct wb_writeback_work *work; unsigned long dirty; int ret; @@ -1114,7 +1115,11 @@ int cgroup_writeback_by_id(u64 bdi_id, int memcg_id, * And find the associated wb. If the wb isn't there already * there's nothing to flush, don't create one. */ - wb = wb_get_lookup(bdi->wb_ctx[0], memcg_css); + for_each_bdi_wb_ctx(bdi, bdi_wb_ctx) { + wb = wb_get_lookup(bdi_wb_ctx, memcg_css); + if (wb) + break; + } if (!wb) { ret = -ENOENT; goto out_css_put; -- 2.25.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5F6CCCD18D for ; Tue, 14 Oct 2025 12:10:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:References:MIME-Version:In-Reply-To:Message-Id:Date:To:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LUTneEOOfWsyiEWTnz/FirLxl3A1YP/zfWRfpn9twxM=; b=gvb89WACngyWwccHciSljEaVoZ KntD5AiRe2+gDEQq9OVSjIzxMliqYcNa+2lhS/9pU8JbScODK7Cdj6Ky6t+a2gUtrd5zZ6sajBbF6 tUJ2/Kg2J7urZz0KxduTTuV9ftSH8ioBYHMgrGufccFwaza1MK+7g5O2vV/MhTC7SmnY=; Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1v8drg-00023J-Mz; Tue, 14 Oct 2025 12:10:53 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1v8drf-000231-6l for linux-f2fs-devel@lists.sourceforge.net; Tue, 14 Oct 2025 12:10:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=References:Content-Type:Content-Transfer-Encoding: MIME-Version:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=O2U42LWZMM8201UpxKxW6f/AsVjv4jB1OSfEppuAbYw=; b=eii/jB5VrZiwby91v4MV8d7JQ2 TywyF+FmiU1dzuOiSR0NFWLIBmdTKaa1c36QrLW1W11rnHOjbgkGmuRmMT3OXC3RlQWABbZMxycgp fZyW4toxRuwqNuV5cGBm+W/ZSDaKU8g6NpZm6n0+1Olb9p7JfG93rtkVZnY02oSGamlQ=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=References:Content-Type:Content-Transfer-Encoding:MIME-Version: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=O2U42LWZMM8201UpxKxW6f/AsVjv4jB1OSfEppuAbYw=; b=RSwJZaxBpS4CsQ4loauuxCa6cz s2EV3q/UXIB2FfL2eQAL2HnEuTBIHebQlYLgjPVcviP67uJX9TmmIN3QQFHAw+YDzp5TWa0Lx2LqC 5z55WWQWWAwPplRlUxpnrwSjO9AQFs4YkXO4oZOMVCo0qSg0zEoQ89wIkrcwaUDb/XvY=; Received: from mailout1.samsung.com ([203.254.224.24]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1v8dre-0001Mc-VA for linux-f2fs-devel@lists.sourceforge.net; Tue, 14 Oct 2025 12:10:51 +0000 Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20251014121039epoutp01670e5450c5966b099372c0ac4f876f28~uWlg7xuTC1133811338epoutp01K for ; Tue, 14 Oct 2025 12:10:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20251014121039epoutp01670e5450c5966b099372c0ac4f876f28~uWlg7xuTC1133811338epoutp01K DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1760443839; bh=O2U42LWZMM8201UpxKxW6f/AsVjv4jB1OSfEppuAbYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j4EoRb052CyFlWparM6vJ+IGSCEWjIS6wVo+S87KDQqDA0Ocmw/12pWxJHIIh31zH Esi8h9OyxeOyR15xYVX5wm7qtnvdwsg04HJRPmJ/1moWx5u2peXU8xFWHwP0Tb4pM0 +fUQ0OawY0mVdzW1x06h3YX1hssKOUzItdHKdfpU= Received: from epsnrtp04.localdomain (unknown [182.195.42.156]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPS id 20251014121038epcas5p4685b828d668366916b45d174d16a3637~uWlgJt7Oo0610406104epcas5p4-; Tue, 14 Oct 2025 12:10:38 +0000 (GMT) Received: from epcas5p1.samsung.com (unknown [182.195.38.95]) by epsnrtp04.localdomain (Postfix) with ESMTP id 4cmCj93Ktwz6B9m6; Tue, 14 Oct 2025 12:10:37 +0000 (GMT) Received: from epsmtip1.samsung.com (unknown [182.195.34.30]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20251014121036epcas5p17c607955db032d076daa2e5cfecfe8ea~uWleqppMN1447514475epcas5p1j; Tue, 14 Oct 2025 12:10:36 +0000 (GMT) Received: from localhost.localdomain (unknown [107.99.41.245]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20251014121032epsmtip1fbff11e9fef5c6232ce81ec58fd0763b~uWlaFqXYA1256112561epsmtip1p; Tue, 14 Oct 2025 12:10:31 +0000 (GMT) From: Kundan Kumar To: jaegeuk@kernel.org, chao@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, miklos@szeredi.hu, agruenba@redhat.com, trondmy@kernel.org, anna@kernel.org, akpm@linux-foundation.org, willy@infradead.org, mcgrof@kernel.org, clm@meta.com, david@fromorbit.com, amir73il@gmail.com, axboe@kernel.dk, hch@lst.de, ritesh.list@gmail.com, djwong@kernel.org, dave@stgolabs.net, wangyufei@vivo.com Date: Tue, 14 Oct 2025 17:38:34 +0530 Message-Id: <20251014120845.2361-6-kundan.kumar@samsung.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20251014120845.2361-1-kundan.kumar@samsung.com> MIME-Version: 1.0 X-CMS-MailID: 20251014121036epcas5p17c607955db032d076daa2e5cfecfe8ea X-Msg-Generator: CA CMS-TYPE: 105P cpgsPolicy: CPGSC10-542,Y X-CFilter-Loop: Reflected X-CMS-RootMailID: 20251014121036epcas5p17c607955db032d076daa2e5cfecfe8ea References: <20251014120845.2361-1-kundan.kumar@samsung.com> X-Headers-End: 1v8dre-0001Mc-VA Subject: [f2fs-dev] [PATCH v2 05/16] writeback: modify bdi_writeback search logic to search across all wb ctxs X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-nfs@vger.kernel.org, gost.dev@samsung.com, anuj20.g@samsung.com, vishak.g@samsung.com, linux-f2fs-devel@lists.sourceforge.net, gfs2@lists.linux.dev, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, kundan.kumar@samsung.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Since we have multiple cgwb per bdi, embedded in writeback_ctx now, we iterate over all of them to find the associated writeback. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- fs/fs-writeback.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 56c048e22f72..93f8ea340247 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -1090,7 +1090,8 @@ int cgroup_writeback_by_id(u64 bdi_id, int memcg_id, { struct backing_dev_info *bdi; struct cgroup_subsys_state *memcg_css; - struct bdi_writeback *wb; + struct bdi_writeback *wb = NULL; + struct bdi_writeback_ctx *bdi_wb_ctx; struct wb_writeback_work *work; unsigned long dirty; int ret; @@ -1114,7 +1115,11 @@ int cgroup_writeback_by_id(u64 bdi_id, int memcg_id, * And find the associated wb. If the wb isn't there already * there's nothing to flush, don't create one. */ - wb = wb_get_lookup(bdi->wb_ctx[0], memcg_css); + for_each_bdi_wb_ctx(bdi, bdi_wb_ctx) { + wb = wb_get_lookup(bdi_wb_ctx, memcg_css); + if (wb) + break; + } if (!wb) { ret = -ENOENT; goto out_css_put; -- 2.25.1 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel