From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (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 90ED53126CF for ; Tue, 14 Oct 2025 12:10:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760443838; cv=none; b=n0LWGHlmyfoe1PiOC03sFdP43tDSZxmX36rd1C7+lLJdjiLhdcalGV/BJ3f06q5qUH3t/sGZQPiLRVR4PY/m3+9Wq/sx+LITrevG3XqvQfuSSf9OY2iKhY0CpQ5wJPdZQk8qhkepwECWZROqYW91W2CjcxqPjC246zKGPFdST9U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760443838; c=relaxed/simple; bh=4ORzJnEQGYKZ9ZxMzHBMT5zCM8yCtm2WkXJN2Nefab8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=AfWIwTwXvR1pfb12HR0VCPCpmx/cuExAaIM1ZVhieQubJFLEhgiZ7SE1kxrtlQDnSlpr3XEWr/sf2MW0sYgMLLPIwAOXUdpifzMje4evc602lzCkLpmqPueiBp57a0yhb4qzz4vyb8Evj5RhDHi/E2OWlIwgVhm9liQmqAYAc/w= 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=ThcGvJtD; arc=none smtp.client-ip=203.254.224.34 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="ThcGvJtD" Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20251014121028epoutp04965090884b1d41ef7ffc1c637974a9bd~uWlW1hyyh0942109421epoutp04B for ; Tue, 14 Oct 2025 12:10:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20251014121028epoutp04965090884b1d41ef7ffc1c637974a9bd~uWlW1hyyh0942109421epoutp04B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1760443828; bh=7Fpri/DmmIz0lhNfmDYWM4M9dqrldIQivF7NvztYdbQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ThcGvJtDjMZOIP5h5Rwuk+Tgmz1tWjYMn1kCPySidm5U6ktLxw/wJlnGFhn2OKj5q T5/A2RWR+c5cI7n2Uq954TnJU6r3k5/eX3HkXfraM4fdC59SCj3Cqr1Vqgf/KUrjnq jsUwUrc9gm7BZvfZ4zO8CA3lHIscLOzTXdt3kHPg= Received: from epsnrtp01.localdomain (unknown [182.195.42.153]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPS id 20251014121027epcas5p2be9b795d75fcf8516e4e7d26e5044fca~uWlWT01iz1631916319epcas5p2m; Tue, 14 Oct 2025 12:10:27 +0000 (GMT) Received: from epcas5p3.samsung.com (unknown [182.195.38.91]) by epsnrtp01.localdomain (Postfix) with ESMTP id 4cmChy70jsz6B9m6; Tue, 14 Oct 2025 12:10:26 +0000 (GMT) Received: from epsmtip1.samsung.com (unknown [182.195.34.30]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20251014121026epcas5p1aecefead887a6b4b6745cca0519d1092~uWlU6QPmR0760907609epcas5p18; Tue, 14 Oct 2025 12:10:26 +0000 (GMT) Received: from localhost.localdomain (unknown [107.99.41.245]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20251014121021epsmtip1a54fa06a954b7223466d190130d994e5~uWlP9AoTA1188911889epsmtip1i; Tue, 14 Oct 2025 12:10:20 +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 03/16] writeback: link bdi_writeback to its corresponding bdi_writeback_ctx Date: Tue, 14 Oct 2025 17:38:32 +0530 Message-Id: <20251014120845.2361-4-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: 20251014121026epcas5p1aecefead887a6b4b6745cca0519d1092 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: 20251014121026epcas5p1aecefead887a6b4b6745cca0519d1092 References: <20251014120845.2361-1-kundan.kumar@samsung.com> Introduce a bdi_writeback_ctx field in bdi_writeback. This helps in fetching the writeback context from the bdi_writeback. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- mm/backing-dev.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 47196d326e16..754f2f6c6d7c 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -513,15 +513,16 @@ static void wb_update_bandwidth_workfn(struct work_struct *work) */ #define INIT_BW (100 << (20 - PAGE_SHIFT)) -static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi, - gfp_t gfp) +static int wb_init(struct bdi_writeback *wb, + struct bdi_writeback_ctx *bdi_wb_ctx, + struct backing_dev_info *bdi, gfp_t gfp) { int err; memset(wb, 0, sizeof(*wb)); wb->bdi = bdi; - wb->bdi_wb_ctx = bdi->wb_ctx[0]; + wb->bdi_wb_ctx = bdi_wb_ctx; wb->last_old_flush = jiffies; INIT_LIST_HEAD(&wb->b_dirty); INIT_LIST_HEAD(&wb->b_io); @@ -698,7 +699,7 @@ static int cgwb_create(struct backing_dev_info *bdi, goto out_put; } - ret = wb_init(wb, bdi, gfp); + ret = wb_init(wb, bdi_wb_ctx, bdi, gfp); if (ret) goto err_free; @@ -843,7 +844,7 @@ static int cgwb_bdi_init(struct backing_dev_info *bdi) mutex_init(&bdi->cgwb_release_mutex); init_rwsem(&bdi_wb_ctx->wb_switch_rwsem); - ret = wb_init(&bdi_wb_ctx->wb, bdi, GFP_KERNEL); + ret = wb_init(&bdi_wb_ctx->wb, bdi_wb_ctx, bdi, GFP_KERNEL); if (!ret) { bdi_wb_ctx->wb.memcg_css = &root_mem_cgroup->css; bdi_wb_ctx->wb.blkcg_css = blkcg_root_css; @@ -1000,7 +1001,7 @@ static int cgwb_bdi_init(struct backing_dev_info *bdi) for_each_bdi_wb_ctx(bdi, bdi_wb_ctx) { int ret; - ret = wb_init(&bdi_wb_ctx->wb, bdi, GFP_KERNEL); + ret = wb_init(&bdi_wb_ctx->wb, bdi_wb_ctx, bdi, GFP_KERNEL); if (ret) return ret; } -- 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 915E3CCD184 for ; Tue, 14 Oct 2025 12:10:42 +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=fB0a82qLGhOBRbGmw78zzI4J0U1n9misWh5CiSrSeCo=; b=fIk5gHarpIDWZWXqlMqAPsUpOJ DZJiATZSRZUmT5iSaJ3AqqvWl7lAc2YEoE/6x5VxgENR+gkkXOQZB/RprnP6clUZ9CkTcj3Cnfds5 wjbjTWAoeoSGnV51oJ+EWVkWzIriWEFpmSDbHJhCQ85ewQd7wqlddkkhMvq0qtS9ei3Q=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1v8drV-0007At-AY; Tue, 14 Oct 2025 12:10:41 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1v8drU-0007Al-5a for linux-f2fs-devel@lists.sourceforge.net; Tue, 14 Oct 2025 12:10:40 +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=7Fpri/DmmIz0lhNfmDYWM4M9dqrldIQivF7NvztYdbQ=; b=XIjIY8apTt291zYUpRHJ8WZVGq EyW2QT4XyAujCIjCyE7AFUzAML5KzSvyX7cIFBfd2QkTUta/iLu2aTd+YqOMcSL9SQUtiO0R4JV6T ObZEcNuzTqF3ijyUvGgF3rdKQDdIR74lFm4bja8TyCleCfqIB8TEBw0bFfFCErzgl05I=; 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=7Fpri/DmmIz0lhNfmDYWM4M9dqrldIQivF7NvztYdbQ=; b=YOvtjbZJED/Io9ws1l4qCFT/Hg AIxVnSTMWM9+HRtd/1GU1unKFJxVIT/teKj5mGYKubEK10GjRHXkjx1zDUboppWhli5FCiOb+VYE5 f7+/ke27Ztb/p5p/KuJeOJB3WltbZKSbEWqA1GvV3NVGQoSnCuWo1BFG/1dqCL8Xge1k=; Received: from mailout3.samsung.com ([203.254.224.33]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1v8drR-0001M0-Ic for linux-f2fs-devel@lists.sourceforge.net; Tue, 14 Oct 2025 12:10:40 +0000 Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20251014121028epoutp032183b9255d045f4040415de8ed7143a7~uWlW72fxK0487904879epoutp03- for ; Tue, 14 Oct 2025 12:10:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20251014121028epoutp032183b9255d045f4040415de8ed7143a7~uWlW72fxK0487904879epoutp03- DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1760443828; bh=7Fpri/DmmIz0lhNfmDYWM4M9dqrldIQivF7NvztYdbQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ThcGvJtDjMZOIP5h5Rwuk+Tgmz1tWjYMn1kCPySidm5U6ktLxw/wJlnGFhn2OKj5q T5/A2RWR+c5cI7n2Uq954TnJU6r3k5/eX3HkXfraM4fdC59SCj3Cqr1Vqgf/KUrjnq jsUwUrc9gm7BZvfZ4zO8CA3lHIscLOzTXdt3kHPg= Received: from epsnrtp01.localdomain (unknown [182.195.42.153]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPS id 20251014121027epcas5p2be9b795d75fcf8516e4e7d26e5044fca~uWlWT01iz1631916319epcas5p2m; Tue, 14 Oct 2025 12:10:27 +0000 (GMT) Received: from epcas5p3.samsung.com (unknown [182.195.38.91]) by epsnrtp01.localdomain (Postfix) with ESMTP id 4cmChy70jsz6B9m6; Tue, 14 Oct 2025 12:10:26 +0000 (GMT) Received: from epsmtip1.samsung.com (unknown [182.195.34.30]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20251014121026epcas5p1aecefead887a6b4b6745cca0519d1092~uWlU6QPmR0760907609epcas5p18; Tue, 14 Oct 2025 12:10:26 +0000 (GMT) Received: from localhost.localdomain (unknown [107.99.41.245]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20251014121021epsmtip1a54fa06a954b7223466d190130d994e5~uWlP9AoTA1188911889epsmtip1i; Tue, 14 Oct 2025 12:10:20 +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:32 +0530 Message-Id: <20251014120845.2361-4-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: 20251014121026epcas5p1aecefead887a6b4b6745cca0519d1092 X-Msg-Generator: CA CMS-TYPE: 105P cpgsPolicy: CPGSC10-542,Y X-CFilter-Loop: Reflected X-CMS-RootMailID: 20251014121026epcas5p1aecefead887a6b4b6745cca0519d1092 References: <20251014120845.2361-1-kundan.kumar@samsung.com> X-Headers-End: 1v8drR-0001M0-Ic Subject: [f2fs-dev] [PATCH v2 03/16] writeback: link bdi_writeback to its corresponding bdi_writeback_ctx 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 Introduce a bdi_writeback_ctx field in bdi_writeback. This helps in fetching the writeback context from the bdi_writeback. Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta --- mm/backing-dev.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 47196d326e16..754f2f6c6d7c 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -513,15 +513,16 @@ static void wb_update_bandwidth_workfn(struct work_struct *work) */ #define INIT_BW (100 << (20 - PAGE_SHIFT)) -static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi, - gfp_t gfp) +static int wb_init(struct bdi_writeback *wb, + struct bdi_writeback_ctx *bdi_wb_ctx, + struct backing_dev_info *bdi, gfp_t gfp) { int err; memset(wb, 0, sizeof(*wb)); wb->bdi = bdi; - wb->bdi_wb_ctx = bdi->wb_ctx[0]; + wb->bdi_wb_ctx = bdi_wb_ctx; wb->last_old_flush = jiffies; INIT_LIST_HEAD(&wb->b_dirty); INIT_LIST_HEAD(&wb->b_io); @@ -698,7 +699,7 @@ static int cgwb_create(struct backing_dev_info *bdi, goto out_put; } - ret = wb_init(wb, bdi, gfp); + ret = wb_init(wb, bdi_wb_ctx, bdi, gfp); if (ret) goto err_free; @@ -843,7 +844,7 @@ static int cgwb_bdi_init(struct backing_dev_info *bdi) mutex_init(&bdi->cgwb_release_mutex); init_rwsem(&bdi_wb_ctx->wb_switch_rwsem); - ret = wb_init(&bdi_wb_ctx->wb, bdi, GFP_KERNEL); + ret = wb_init(&bdi_wb_ctx->wb, bdi_wb_ctx, bdi, GFP_KERNEL); if (!ret) { bdi_wb_ctx->wb.memcg_css = &root_mem_cgroup->css; bdi_wb_ctx->wb.blkcg_css = blkcg_root_css; @@ -1000,7 +1001,7 @@ static int cgwb_bdi_init(struct backing_dev_info *bdi) for_each_bdi_wb_ctx(bdi, bdi_wb_ctx) { int ret; - ret = wb_init(&bdi_wb_ctx->wb, bdi, GFP_KERNEL); + ret = wb_init(&bdi_wb_ctx->wb, bdi_wb_ctx, bdi, GFP_KERNEL); if (ret) return ret; } -- 2.25.1 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel