* [RFC 0/1] writeback: add sysfs to config the number of writeback contexts
@ 2025-08-25 12:29 ` wangyufei
2025-08-25 12:29 ` [RFC 1/1] " wangyufei
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: wangyufei @ 2025-08-25 12:29 UTC (permalink / raw)
To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
Suren Baghdasaryan, Michal Hocko, Matthew Wilcox (Oracle),
Stephen Rothwell, wangyufei, open list,
open list:MEMORY MANAGEMENT - MISC, open list:PAGE CACHE
Cc: kundan.kumar, anuj20.g, hch, bernd, djwong, jack, linux-kernel,
linux-mm, linux-fsdevel, opensource.kernel
Hi everyone,
We've been interested in this patch about parallelizing writeback [1]
and have been following its discussion and development. Our testing in
several application scenarios on mobile devices has shown significant
performance improvements.
Currently, we're focusing on how the number of writeback contexts impacts
the performance on different filesystems and storage workloads. We noticed
the previous discussion about making the number of writeback contexts an
opt-in configuration to adapt to different filesystems [2]. Currently, it
can only be set via a sysfs interface at system initialization. We'd like
to discuss the possibility of supporting dynamic runtime configuration of
the number of writeback contexts.
We have developed a mechanism that allows the number of writeback contexts
to be configured at runtime via a sysfs interface. To configure, use:
echo <nr_wb_ctx> > /sys/class/bdi/<dev>/nwritebacks.
Our implementation supports *increasing* the number of writeback contexts.
This is achieved by dynamically allocating new writeback contexts and
replacing the existing bdi->wb_ctx_arr and bdi->nr_wb_ctx. But we have
not yet solved the problem of safely *reducing* the bdi->nr_wb_ctx.
Several challenges remain:
- How should we safely handle ongoing I/Os when contexts are removed?
- What is the correct way to migrate pending writeback tasks and related
resources to other writeback contexts?
- Should this be a per-device or global setting?
We're sharing this early implementation to gather feedback on:
1. Is runtime configurability of writeback contexts a worthwhile goal?
2. How should we handle synchronization and migration when dynamically
changing the bdi->nr_wb_ctx, particularly when removing the active
writeback contexts?
3. Any better tests to validate the stability of this approach?
We look forward to feedback and suggestions for further improvements.
[1] Parallelizing filesystem writeback :
https://lore.kernel.org/linux-fsdevel/20250529111504.89912-1-kundan.kumar@samsung.com/
[2] The discussion on configuration of the number of writeback contexts :
https://lore.kernel.org/linux-fsdevel/20250609040056.GA26101@lst.de/
wangyufei (1):
writeback: add sysfs to config the number of writeback contexts
include/linux/backing-dev.h | 3 ++
mm/backing-dev.c | 59 +++++++++++++++++++++++++++++++++++
mm/page-writeback.c | 61 +++++++++++++++++++++++++++++++++++++
3 files changed, 123 insertions(+)
--
2.39.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC 1/1] writeback: add sysfs to config the number of writeback contexts
2025-08-25 12:29 ` [RFC 0/1] writeback: add sysfs to config the number of writeback contexts wangyufei
@ 2025-08-25 12:29 ` wangyufei
2026-08-13 10:47 ` kernel test robot
2025-08-25 14:46 ` [RFC 0/1] " David Hildenbrand
2025-08-29 8:59 ` Kundan Kumar
2 siblings, 1 reply; 7+ messages in thread
From: wangyufei @ 2025-08-25 12:29 UTC (permalink / raw)
To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
Suren Baghdasaryan, Michal Hocko, Matthew Wilcox (Oracle),
Stephen Rothwell, wangyufei, open list,
open list:MEMORY MANAGEMENT - MISC, open list:PAGE CACHE
Cc: kundan.kumar, anuj20.g, hch, bernd, djwong, jack, linux-kernel,
linux-mm, linux-fsdevel, opensource.kernel
The number of writeback contexts is set to the number of CPUs by
default. To test the impact of the number of writeback contexts
on the writeback performance of filesystems, we introduce a sysfs
interface 'nwritebacks' for adjusting bdi->wb_ctx_arr in runtime.
However, only increasing the bdi->wb_ctx_arr is supported; support
for reducing it is still under development.
Signed-off-by: wangyufei <wangyufei@vivo.com>
---
include/linux/backing-dev.h | 3 ++
mm/backing-dev.c | 59 +++++++++++++++++++++++++++++++++++
mm/page-writeback.c | 61 +++++++++++++++++++++++++++++++++++++
3 files changed, 123 insertions(+)
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 30a812fbd..c59578c25 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -112,6 +112,7 @@ int bdi_set_max_ratio_no_scale(struct backing_dev_info *bdi, unsigned int max_ra
int bdi_set_min_bytes(struct backing_dev_info *bdi, u64 min_bytes);
int bdi_set_max_bytes(struct backing_dev_info *bdi, u64 max_bytes);
int bdi_set_strict_limit(struct backing_dev_info *bdi, unsigned int strict_limit);
+int bdi_set_nwritebacks(struct backing_dev_info *bdi, int nwritebacks);
/*
* Flags in backing_dev_info::capability
@@ -128,6 +129,8 @@ int bdi_set_strict_limit(struct backing_dev_info *bdi, unsigned int strict_limit
extern struct backing_dev_info noop_backing_dev_info;
int bdi_init(struct backing_dev_info *bdi);
+int bdi_wb_ctx_init(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx);
+void bdi_wb_ctx_exit(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx);
/**
* writeback_in_progress - determine whether there is writeback in progress
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index a5b44dd79..44b24c1e4 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -469,6 +469,34 @@ static ssize_t strict_limit_show(struct device *dev,
}
static DEVICE_ATTR_RW(strict_limit);
+static ssize_t nwritebacks_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ struct backing_dev_info *bdi = dev_get_drvdata(dev);
+
+ return sysfs_emit(buf, "%d\n", bdi->nr_wb_ctx);
+}
+
+static ssize_t nwritebacks_store(struct device *dev,
+ struct device_attribute *attr, const char *buf, size_t count)
+{
+ struct backing_dev_info *bdi = dev_get_drvdata(dev);
+ int nr;
+ ssize_t ret;
+
+ ret = kstrtoint(buf, 10, &nr);
+ if (ret < 0)
+ return ret;
+
+ ret = bdi_set_nwritebacks(bdi, nr);
+ if (!ret)
+ ret = count;
+
+ return ret;
+}
+static DEVICE_ATTR_RW(nwritebacks);
+
static struct attribute *bdi_dev_attrs[] = {
&dev_attr_read_ahead_kb.attr,
&dev_attr_min_ratio.attr,
@@ -479,6 +507,7 @@ static struct attribute *bdi_dev_attrs[] = {
&dev_attr_max_bytes.attr,
&dev_attr_stable_pages_required.attr,
&dev_attr_strict_limit.attr,
+ &dev_attr_nwritebacks.attr,
NULL,
};
ATTRIBUTE_GROUPS(bdi_dev);
@@ -1004,6 +1033,22 @@ static int __init cgwb_init(void)
}
subsys_initcall(cgwb_init);
+int bdi_wb_ctx_init(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx)
+{
+ int ret;
+
+ INIT_RADIX_TREE(&bdi_wb_ctx->cgwb_tree, GFP_ATOMIC);
+ mutex_init(&bdi->cgwb_release_mutex);
+ init_rwsem(&bdi_wb_ctx->wb_switch_rwsem);
+
+ 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;
+ }
+ return ret;
+}
+
#else /* CONFIG_CGROUP_WRITEBACK */
static int cgwb_bdi_init(struct backing_dev_info *bdi)
@@ -1292,3 +1337,17 @@ const char *bdi_dev_name(struct backing_dev_info *bdi)
return bdi->dev_name;
}
EXPORT_SYMBOL_GPL(bdi_dev_name);
+
+int bdi_wb_ctx_init(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx)
+{
+ return wb_init(&bdi_wb_ctx->wb, bdi_wb_ctx, bdi, GFP_KERNEL);
+}
+
+void bdi_wb_ctx_exit(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx)
+{
+ wb_shutdown(&bdi_wb_ctx->wb);
+ cgwb_bdi_unregister(bdi, bdi_wb_ctx);
+
+ WARN_ON_ONCE(test_bit(WB_registered, &bdi_wb_ctx->wb.state));
+ wb_exit(&bdi_wb_ctx->wb);
+}
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 6f283a777..87c77004b 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -740,6 +740,59 @@ static int __bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ra
return ret;
}
+static int __bdi_set_wb_ctx(struct backing_dev_info *bdi, int nwritebacks)
+{
+ struct bdi_writeback_ctx **new_ctx_arr, **old_ctx_arr;
+ int i, ret;
+
+ new_ctx_arr = kcalloc(nwritebacks, sizeof(struct bdi_writeback_ctx *), GFP_KERNEL);
+ if (!new_ctx_arr)
+ return -ENOMEM;
+
+ for (i = 0; i < min(bdi->nr_wb_ctx, nwritebacks); i++)
+ new_ctx_arr[i] = bdi->wb_ctx_arr[i];
+
+ for (i = bdi->nr_wb_ctx; i < nwritebacks; i++) {
+ new_ctx_arr[i] = (struct bdi_writeback_ctx *)
+ kzalloc(sizeof(struct bdi_writeback_ctx), GFP_KERNEL);
+ if (!new_ctx_arr[i]) {
+ pr_err("Failed to allocate %d", i);
+ while (--i >= bdi->nr_wb_ctx)
+ kfree(new_ctx_arr[i]);
+ kfree(new_ctx_arr);
+ return -ENOMEM;
+ }
+ INIT_LIST_HEAD(&new_ctx_arr[i]->wb_list);
+ init_waitqueue_head(&new_ctx_arr[i]->wb_waitq);
+ }
+
+ for (i = bdi->nr_wb_ctx; i < nwritebacks; i++) {
+ ret = bdi_wb_ctx_init(bdi, new_ctx_arr[i]);
+ if (ret) {
+ while (--i >= bdi->nr_wb_ctx) {
+ bdi_wb_ctx_exit(bdi, new_ctx_arr[i]);
+ kfree(new_ctx_arr[i]);
+ }
+ kfree(new_ctx_arr);
+ return ret;
+ }
+ list_add_tail_rcu(&new_ctx_arr[i]->wb.bdi_node, &new_ctx_arr[i]->wb_list);
+ set_bit(WB_registered, &new_ctx_arr[i]->wb.state);
+ }
+
+ // Make sure the initialization is done before assignment
+ smp_wmb();
+
+ old_ctx_arr = bdi->wb_ctx_arr;
+ spin_lock_bh(&bdi_lock);
+ bdi->wb_ctx_arr = new_ctx_arr;
+ bdi->nr_wb_ctx = nwritebacks;
+ spin_unlock_bh(&bdi_lock);
+
+ kfree(old_ctx_arr);
+ return 0;
+}
+
int bdi_set_min_ratio_no_scale(struct backing_dev_info *bdi, unsigned int min_ratio)
{
return __bdi_set_min_ratio(bdi, min_ratio);
@@ -818,6 +871,14 @@ int bdi_set_strict_limit(struct backing_dev_info *bdi, unsigned int strict_limit
return 0;
}
+int bdi_set_nwritebacks(struct backing_dev_info *bdi, int nwritebacks)
+{
+ if (nwritebacks < bdi->nr_wb_ctx)
+ return -EINVAL;
+
+ return __bdi_set_wb_ctx(bdi, nwritebacks);
+}
+
static unsigned long dirty_freerun_ceiling(unsigned long thresh,
unsigned long bg_thresh)
{
--
2.39.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [RFC 0/1] writeback: add sysfs to config the number of writeback contexts
2025-08-25 12:29 ` [RFC 0/1] writeback: add sysfs to config the number of writeback contexts wangyufei
2025-08-25 12:29 ` [RFC 1/1] " wangyufei
@ 2025-08-25 14:46 ` David Hildenbrand
2025-08-25 16:15 ` Matthew Wilcox
2025-08-29 8:59 ` Kundan Kumar
2 siblings, 1 reply; 7+ messages in thread
From: David Hildenbrand @ 2025-08-25 14:46 UTC (permalink / raw)
To: wangyufei, Andrew Morton, Lorenzo Stoakes, Liam R. Howlett,
Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
Matthew Wilcox (Oracle), Stephen Rothwell, open list,
open list:MEMORY MANAGEMENT - MISC, open list:PAGE CACHE
Cc: kundan.kumar, anuj20.g, hch, bernd, djwong, jack,
opensource.kernel
On 25.08.25 14:29, wangyufei wrote:
> Hi everyone,
>
> We've been interested in this patch about parallelizing writeback [1]
> and have been following its discussion and development. Our testing in
> several application scenarios on mobile devices has shown significant
> performance improvements.
>
> Currently, we're focusing on how the number of writeback contexts impacts
> the performance on different filesystems and storage workloads. We noticed
> the previous discussion about making the number of writeback contexts an
> opt-in configuration to adapt to different filesystems [2]. Currently, it
> can only be set via a sysfs interface at system initialization. We'd like
> to discuss the possibility of supporting dynamic runtime configuration of
> the number of writeback contexts.
>
> We have developed a mechanism that allows the number of writeback contexts
> to be configured at runtime via a sysfs interface. To configure, use:
> echo <nr_wb_ctx> > /sys/class/bdi/<dev>/nwritebacks.
What's the target use case for updating it dynamically?
If it's mostly for debugging/testing (find out what works, what
doesn't), it might better go into debugfs or just carried out of tree.
If it's about setting sane default based on specific filesystems, maybe
it could be optimized from within the kernel, without the need to expose
this to an admin?
--
Cheers
David / dhildenb
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC 0/1] writeback: add sysfs to config the number of writeback contexts
2025-08-25 14:46 ` [RFC 0/1] " David Hildenbrand
@ 2025-08-25 16:15 ` Matthew Wilcox
0 siblings, 0 replies; 7+ messages in thread
From: Matthew Wilcox @ 2025-08-25 16:15 UTC (permalink / raw)
To: David Hildenbrand
Cc: wangyufei, Andrew Morton, Lorenzo Stoakes, Liam R. Howlett,
Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
Stephen Rothwell, open list, open list:MEMORY MANAGEMENT - MISC,
open list:PAGE CACHE, kundan.kumar, anuj20.g, hch, bernd, djwong,
jack, opensource.kernel
On Mon, Aug 25, 2025 at 04:46:46PM +0200, David Hildenbrand wrote:
> On 25.08.25 14:29, wangyufei wrote:
> > Hi everyone,
> >
> > We've been interested in this patch about parallelizing writeback [1]
> > and have been following its discussion and development. Our testing in
> > several application scenarios on mobile devices has shown significant
> > performance improvements.
> >
> > Currently, we're focusing on how the number of writeback contexts impacts
> > the performance on different filesystems and storage workloads. We noticed
> > the previous discussion about making the number of writeback contexts an
> > opt-in configuration to adapt to different filesystems [2]. Currently, it
> > can only be set via a sysfs interface at system initialization. We'd like
> > to discuss the possibility of supporting dynamic runtime configuration of
> > the number of writeback contexts.
> >
> > We have developed a mechanism that allows the number of writeback contexts
> > to be configured at runtime via a sysfs interface. To configure, use:
> > echo <nr_wb_ctx> > /sys/class/bdi/<dev>/nwritebacks.
>
> What's the target use case for updating it dynamically?
>
> If it's mostly for debugging/testing (find out what works, what doesn't), it
> might better go into debugfs or just carried out of tree.
>
> If it's about setting sane default based on specific filesystems, maybe it
> could be optimized from within the kernel, without the need to expose this
> to an admin?
I was assuming that this patch is for people who are experimenting to
gather data more effectively. I'd NAK it being included, but it's good
to have it out on the list so other people don't have to reinvent it.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC 0/1] writeback: add sysfs to config the number of writeback contexts
2025-08-25 12:29 ` [RFC 0/1] writeback: add sysfs to config the number of writeback contexts wangyufei
2025-08-25 12:29 ` [RFC 1/1] " wangyufei
2025-08-25 14:46 ` [RFC 0/1] " David Hildenbrand
@ 2025-08-29 8:59 ` Kundan Kumar
2025-09-02 11:19 ` wangyufei
2 siblings, 1 reply; 7+ messages in thread
From: Kundan Kumar @ 2025-08-29 8:59 UTC (permalink / raw)
To: wangyufei, Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
Suren Baghdasaryan, Michal Hocko, Matthew Wilcox (Oracle),
Stephen Rothwell, open list, open list:MEMORY MANAGEMENT - MISC,
open list:PAGE CACHE
Cc: anuj20.g, hch, bernd, djwong, jack, opensource.kernel
On 8/25/2025 5:59 PM, wangyufei wrote:
> Hi everyone,
>
> We've been interested in this patch about parallelizing writeback [1]
> and have been following its discussion and development. Our testing in
> several application scenarios on mobile devices has shown significant
> performance improvements.
>
Hi,
Thanks for sharing this work.
Could you clarify a few details about your test setup?
- Which filesystem did you run these experiments on?
- What were the specifics of the workload (number of threads, block size,
I/O size)?
- If you are using fio, can you please share the fio command.
- How much RAM was available on the test system?
- Can you share the performance improvement numbers you observed?
That would help in understanding the impact of parallel writeback?
I made similar modifications to dynamically configure the number of
writeback threads in this experimental patch. Refer to patches 14 and 15:
https://lore.kernel.org/all/20250807045706.2848-1-kundan.kumar@samsung.com/
The key difference is that this change also enables a reduction in the
number of writeback threads.
Thanks,
Kundan
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC 0/1] writeback: add sysfs to config the number of writeback contexts
2025-08-29 8:59 ` Kundan Kumar
@ 2025-09-02 11:19 ` wangyufei
0 siblings, 0 replies; 7+ messages in thread
From: wangyufei @ 2025-09-02 11:19 UTC (permalink / raw)
To: Kundan Kumar, Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
Suren Baghdasaryan, Michal Hocko, Matthew Wilcox (Oracle),
Stephen Rothwell, open list, open list:MEMORY MANAGEMENT - MISC,
open list:PAGE CACHE
Cc: anuj20.g, hch, bernd, djwong, jack, opensource.kernel
On 8/29/2025 4:59 PM, Kundan Kumar wrote:
> On 8/25/2025 5:59 PM, wangyufei wrote:
>> Hi everyone,
>>
>> We've been interested in this patch about parallelizing writeback [1]
>> and have been following its discussion and development. Our testing in
>> several application scenarios on mobile devices has shown significant
>> performance improvements.
>>
> Hi,
>
> Thanks for sharing this work.
>
> Could you clarify a few details about your test setup?
>
> - Which filesystem did you run these experiments on?
> - What were the specifics of the workload (number of threads, block size,
> I/O size)?
> - If you are using fio, can you please share the fio command.
> - How much RAM was available on the test system?
> - Can you share the performance improvement numbers you observed?
>
> That would help in understanding the impact of parallel writeback?
Hi Kundan,
Most of the time we tested this patch on mobile devices. The test
platform setup is shown as below:
- filesystem:F2FS
- system config:
Number of CPUs = 8
System RAM = 11G
- workload & fio:We used the same fio command as mentioned in your patch
fio command line:
fio --directory=/mnt --name=test --bs=4k --iodepth=1024 --rw=randwrite
--ioengine=io_uring --time_based=1 -runtime=60 --numjobs=8 --size=450M
--direct=0 --eta-interval=1 --eta-newline=1 --group_reporting
- Performance gains:
Base F2FS :973 MiB/s
Parallel Writeback F2FS :1237 MiB/s (+27%)
>
> I made similar modifications to dynamically configure the number of
> writeback threads in this experimental patch. Refer to patches 14 and 15:
> https://lore.kernel.org/all/20250807045706.2848-1-kundan.kumar@samsung.com/
> The key difference is that this change also enables a reduction in the
> number of writeback threads.
Thanks for sharing the patch. I have a few questions:
- The current approach freezes the filesystem and reallocates all
writeback_ctx structures. Could this introduce latency? In some cases, I
think the existing bdi_writeback_ctx structures could be reused instead.
- Are there other use cases for dynamic thread tuning besides
initialization and testing?
- What methods are used to test the stability of this function?
Finally, I would like to ask if there are any problems to be solved or
optimization directions worth discussing for the parallelizing
filesystem writeback?
Thanks,
yufei
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC 1/1] writeback: add sysfs to config the number of writeback contexts
2025-08-25 12:29 ` [RFC 1/1] " wangyufei
@ 2026-08-13 10:47 ` kernel test robot
0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2026-08-13 10:47 UTC (permalink / raw)
To: wangyufei; +Cc: oe-kbuild-all
Hi wangyufei,
[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:
[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on linus/master v7.2-rc7 next-20260812]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/wangyufei/writeback-add-sysfs-to-config-the-number-of-writeback-contexts/20260813-143259
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/20250825122931.13037-2-wangyufei%40vivo.com
patch subject: [RFC 1/1] writeback: add sysfs to config the number of writeback contexts
config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20260813/202608131809.2ZEzONCi-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260813/202608131809.2ZEzONCi-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202608131809.2ZEzONCi-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
In file included from mm/filemap.c:33:
>> include/linux/backing-dev.h:118:58: warning: 'struct bdi_writeback_ctx' declared inside parameter list will not be visible outside of this definition or declaration
118 | int bdi_wb_ctx_init(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx);
| ^~~~~~~~~~~~~~~~~
include/linux/backing-dev.h:119:59: warning: 'struct bdi_writeback_ctx' declared inside parameter list will not be visible outside of this definition or declaration
119 | void bdi_wb_ctx_exit(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx);
| ^~~~~~~~~~~~~~~~~
--
In file included from mm/page-writeback.c:26:
>> include/linux/backing-dev.h:118:58: warning: 'struct bdi_writeback_ctx' declared inside parameter list will not be visible outside of this definition or declaration
118 | int bdi_wb_ctx_init(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx);
| ^~~~~~~~~~~~~~~~~
include/linux/backing-dev.h:119:59: warning: 'struct bdi_writeback_ctx' declared inside parameter list will not be visible outside of this definition or declaration
119 | void bdi_wb_ctx_exit(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx);
| ^~~~~~~~~~~~~~~~~
In file included from include/linux/kernel.h:27,
from mm/page-writeback.c:15:
mm/page-writeback.c: In function '__bdi_set_wb_ctx':
>> mm/page-writeback.c:734:32: error: 'struct backing_dev_info' has no member named 'nr_wb_ctx'
734 | for (i = 0; i < min(bdi->nr_wb_ctx, nwritebacks); i++)
| ^~
include/linux/minmax.h:92:20: note: in definition of macro '__careful_cmp_once'
92 | auto ux = (x); auto uy = (y); \
| ^
include/linux/minmax.h:105:25: note: in expansion of macro '__careful_cmp'
105 | #define min(x, y) __careful_cmp(min, x, y)
| ^~~~~~~~~~~~~
mm/page-writeback.c:734:25: note: in expansion of macro 'min'
734 | for (i = 0; i < min(bdi->nr_wb_ctx, nwritebacks); i++)
| ^~~
In file included from <command-line>:
>> include/linux/compiler.h:165:17: error: '__UNIQUE_ID_x__697' undeclared (first use in this function); did you mean '__UNIQUE_ID_y__698'?
165 | __PASTE(__UNIQUE_ID_, \
| ^~~~~~~~~~~~
include/linux/compiler_types.h:682:23: note: in definition of macro '__compiletime_assert'
682 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:702:9: note: in expansion of macro '_compiletime_assert'
702 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:40:37: note: in expansion of macro 'compiletime_assert'
40 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/minmax.h:93:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
93 | BUILD_BUG_ON_MSG(!__types_ok(ux, uy), \
| ^~~~~~~~~~~~~~~~
include/linux/minmax.h:49:25: note: in expansion of macro 'is_signed_type'
49 | #define __sign_use(ux) (is_signed_type(typeof(ux)) ? \
| ^~~~~~~~~~~~~~
include/linux/minmax.h:75:10: note: in expansion of macro '__sign_use'
75 | (__sign_use(ux) & __sign_use(uy))
| ^~~~~~~~~~
include/linux/minmax.h:93:27: note: in expansion of macro '__types_ok'
93 | BUILD_BUG_ON_MSG(!__types_ok(ux, uy), \
| ^~~~~~~~~~
include/linux/minmax.h:98:9: note: in expansion of macro '__careful_cmp_once'
98 | __careful_cmp_once(op, x, y, __UNIQUE_ID(x_), __UNIQUE_ID(y_))
| ^~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:16:23: note: in expansion of macro '___PASTE'
16 | #define __PASTE(a, b) ___PASTE(a, b)
| ^~~~~~~~
include/linux/compiler.h:165:9: note: in expansion of macro '__PASTE'
165 | __PASTE(__UNIQUE_ID_, \
| ^~~~~~~
include/linux/minmax.h:98:38: note: in expansion of macro '__UNIQUE_ID'
98 | __careful_cmp_once(op, x, y, __UNIQUE_ID(x_), __UNIQUE_ID(y_))
| ^~~~~~~~~~~
include/linux/minmax.h:105:25: note: in expansion of macro '__careful_cmp'
105 | #define min(x, y) __careful_cmp(min, x, y)
| ^~~~~~~~~~~~~
mm/page-writeback.c:734:25: note: in expansion of macro 'min'
734 | for (i = 0; i < min(bdi->nr_wb_ctx, nwritebacks); i++)
| ^~~
include/linux/compiler.h:165:17: note: each undeclared identifier is reported only once for each function it appears in
include/linux/compiler_types.h:682:23: note: in definition of macro '__compiletime_assert'
682 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:702:9: note: in expansion of macro '_compiletime_assert'
702 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:40:37: note: in expansion of macro 'compiletime_assert'
40 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/minmax.h:93:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
93 | BUILD_BUG_ON_MSG(!__types_ok(ux, uy), \
| ^~~~~~~~~~~~~~~~
include/linux/minmax.h:49:25: note: in expansion of macro 'is_signed_type'
49 | #define __sign_use(ux) (is_signed_type(typeof(ux)) ? \
| ^~~~~~~~~~~~~~
include/linux/minmax.h:75:10: note: in expansion of macro '__sign_use'
75 | (__sign_use(ux) & __sign_use(uy))
| ^~~~~~~~~~
include/linux/minmax.h:93:27: note: in expansion of macro '__types_ok'
93 | BUILD_BUG_ON_MSG(!__types_ok(ux, uy), \
| ^~~~~~~~~~
include/linux/minmax.h:98:9: note: in expansion of macro '__careful_cmp_once'
98 | __careful_cmp_once(op, x, y, __UNIQUE_ID(x_), __UNIQUE_ID(y_))
| ^~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:16:23: note: in expansion of macro '___PASTE'
16 | #define __PASTE(a, b) ___PASTE(a, b)
| ^~~~~~~~
include/linux/compiler.h:165:9: note: in expansion of macro '__PASTE'
165 | __PASTE(__UNIQUE_ID_, \
| ^~~~~~~
include/linux/minmax.h:98:38: note: in expansion of macro '__UNIQUE_ID'
98 | __careful_cmp_once(op, x, y, __UNIQUE_ID(x_), __UNIQUE_ID(y_))
| ^~~~~~~~~~~
include/linux/minmax.h:105:25: note: in expansion of macro '__careful_cmp'
105 | #define min(x, y) __careful_cmp(min, x, y)
| ^~~~~~~~~~~~~
mm/page-writeback.c:734:25: note: in expansion of macro 'min'
734 | for (i = 0; i < min(bdi->nr_wb_ctx, nwritebacks); i++)
| ^~~
>> mm/page-writeback.c:735:37: error: 'struct backing_dev_info' has no member named 'wb_ctx_arr'
735 | new_ctx_arr[i] = bdi->wb_ctx_arr[i];
| ^~
mm/page-writeback.c:737:21: error: 'struct backing_dev_info' has no member named 'nr_wb_ctx'
737 | for (i = bdi->nr_wb_ctx; i < nwritebacks; i++) {
| ^~
In file included from include/linux/workqueue.h:9,
from include/linux/srcu.h:21,
from include/linux/notifier.h:16,
from arch/powerpc/include/asm/uprobes.h:12,
from include/linux/uprobes.h:66,
from include/linux/mm_types.h:16,
from include/linux/mmzone.h:22,
from include/linux/gfp.h:7,
from include/linux/xarray.h:16,
from include/linux/list_lru.h:14,
from include/linux/fs/super_types.h:7,
from include/linux/fs/super.h:5,
from include/linux/fs.h:5,
from mm/page-writeback.c:19:
>> mm/page-writeback.c:739:40: error: invalid application of 'sizeof' to incomplete type 'struct bdi_writeback_ctx'
739 | kzalloc(sizeof(struct bdi_writeback_ctx), GFP_KERNEL);
| ^~~~~~
include/linux/alloc_tag.h:256:16: note: in definition of macro 'alloc_hooks_tag'
256 | typeof(_do_alloc) _res; \
| ^~~~~~~~~
include/linux/slab.h:1320:49: note: in expansion of macro 'alloc_hooks'
1320 | #define kzalloc(size, flags) alloc_hooks(kzalloc_noprof(size, flags))
| ^~~~~~~~~~~
include/linux/slab.h:1320:61: note: in expansion of macro 'kzalloc_noprof'
1320 | #define kzalloc(size, flags) alloc_hooks(kzalloc_noprof(size, flags))
| ^~~~~~~~~~~~~~
mm/page-writeback.c:739:25: note: in expansion of macro 'kzalloc'
739 | kzalloc(sizeof(struct bdi_writeback_ctx), GFP_KERNEL);
| ^~~~~~~
>> mm/page-writeback.c:739:40: error: invalid application of 'sizeof' to incomplete type 'struct bdi_writeback_ctx'
739 | kzalloc(sizeof(struct bdi_writeback_ctx), GFP_KERNEL);
| ^~~~~~
include/linux/alloc_tag.h:260:24: note: in definition of macro 'alloc_hooks_tag'
260 | _res = _do_alloc; \
| ^~~~~~~~~
include/linux/slab.h:1320:49: note: in expansion of macro 'alloc_hooks'
1320 | #define kzalloc(size, flags) alloc_hooks(kzalloc_noprof(size, flags))
| ^~~~~~~~~~~
include/linux/slab.h:1320:61: note: in expansion of macro 'kzalloc_noprof'
1320 | #define kzalloc(size, flags) alloc_hooks(kzalloc_noprof(size, flags))
| ^~~~~~~~~~~~~~
mm/page-writeback.c:739:25: note: in expansion of macro 'kzalloc'
739 | kzalloc(sizeof(struct bdi_writeback_ctx), GFP_KERNEL);
| ^~~~~~~
>> mm/page-writeback.c:739:40: error: invalid application of 'sizeof' to incomplete type 'struct bdi_writeback_ctx'
739 | kzalloc(sizeof(struct bdi_writeback_ctx), GFP_KERNEL);
| ^~~~~~
include/linux/alloc_tag.h:263:24: note: in definition of macro 'alloc_hooks_tag'
263 | _res = _do_alloc; \
| ^~~~~~~~~
include/linux/slab.h:1320:49: note: in expansion of macro 'alloc_hooks'
1320 | #define kzalloc(size, flags) alloc_hooks(kzalloc_noprof(size, flags))
| ^~~~~~~~~~~
include/linux/slab.h:1320:61: note: in expansion of macro 'kzalloc_noprof'
1320 | #define kzalloc(size, flags) alloc_hooks(kzalloc_noprof(size, flags))
| ^~~~~~~~~~~~~~
mm/page-writeback.c:739:25: note: in expansion of macro 'kzalloc'
739 | kzalloc(sizeof(struct bdi_writeback_ctx), GFP_KERNEL);
| ^~~~~~~
>> mm/page-writeback.c:738:34: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
738 | new_ctx_arr[i] = (struct bdi_writeback_ctx *)
| ^
mm/page-writeback.c:742:42: error: 'struct backing_dev_info' has no member named 'nr_wb_ctx'
742 | while (--i >= bdi->nr_wb_ctx)
| ^~
>> mm/page-writeback.c:747:47: error: invalid use of undefined type 'struct bdi_writeback_ctx'
747 | INIT_LIST_HEAD(&new_ctx_arr[i]->wb_list);
| ^~
In file included from include/linux/swait.h:8,
from include/linux/completion.h:12,
from include/linux/shrinker.h:8,
from include/linux/list_lru.h:13:
mm/page-writeback.c:748:52: error: invalid use of undefined type 'struct bdi_writeback_ctx'
748 | init_waitqueue_head(&new_ctx_arr[i]->wb_waitq);
| ^~
include/linux/wait.h:68:40: note: in definition of macro 'init_waitqueue_head'
68 | __init_waitqueue_head((wq_head), #wq_head, &__key); \
| ^~~~~~~
mm/page-writeback.c:751:21: error: 'struct backing_dev_info' has no member named 'nr_wb_ctx'
751 | for (i = bdi->nr_wb_ctx; i < nwritebacks; i++) {
| ^~
>> mm/page-writeback.c:752:55: error: passing argument 2 of 'bdi_wb_ctx_init' from incompatible pointer type [-Wincompatible-pointer-types]
752 | ret = bdi_wb_ctx_init(bdi, new_ctx_arr[i]);
| ~~~~~~~~~~~^~~
| |
| struct bdi_writeback_ctx *
include/linux/backing-dev.h:118:77: note: expected 'struct bdi_writeback_ctx *' but argument is of type 'struct bdi_writeback_ctx *'
118 | int bdi_wb_ctx_init(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
mm/page-writeback.c:754:42: error: 'struct backing_dev_info' has no member named 'nr_wb_ctx'
754 | while (--i >= bdi->nr_wb_ctx) {
| ^~
>> mm/page-writeback.c:755:65: error: passing argument 2 of 'bdi_wb_ctx_exit' from incompatible pointer type [-Wincompatible-pointer-types]
755 | bdi_wb_ctx_exit(bdi, new_ctx_arr[i]);
| ~~~~~~~~~~~^~~
| |
| struct bdi_writeback_ctx *
include/linux/backing-dev.h:119:78: note: expected 'struct bdi_writeback_ctx *' but argument is of type 'struct bdi_writeback_ctx *'
119 | void bdi_wb_ctx_exit(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
mm/page-writeback.c:761:50: error: invalid use of undefined type 'struct bdi_writeback_ctx'
761 | list_add_tail_rcu(&new_ctx_arr[i]->wb.bdi_node, &new_ctx_arr[i]->wb_list);
| ^~
mm/page-writeback.c:761:80: error: invalid use of undefined type 'struct bdi_writeback_ctx'
761 | list_add_tail_rcu(&new_ctx_arr[i]->wb.bdi_node, &new_ctx_arr[i]->wb_list);
| ^~
mm/page-writeback.c:762:55: error: invalid use of undefined type 'struct bdi_writeback_ctx'
762 | set_bit(WB_registered, &new_ctx_arr[i]->wb.state);
| ^~
mm/page-writeback.c:768:26: error: 'struct backing_dev_info' has no member named 'wb_ctx_arr'
768 | old_ctx_arr = bdi->wb_ctx_arr;
| ^~
mm/page-writeback.c:770:12: error: 'struct backing_dev_info' has no member named 'wb_ctx_arr'
770 | bdi->wb_ctx_arr = new_ctx_arr;
| ^~
mm/page-writeback.c:771:12: error: 'struct backing_dev_info' has no member named 'nr_wb_ctx'
771 | bdi->nr_wb_ctx = nwritebacks;
| ^~
mm/page-writeback.c: In function 'bdi_set_nwritebacks':
mm/page-writeback.c:858:30: error: 'struct backing_dev_info' has no member named 'nr_wb_ctx'
858 | if (nwritebacks < bdi->nr_wb_ctx)
| ^~
--
In file included from mm/backing-dev.c:7:
>> include/linux/backing-dev.h:118:58: warning: 'struct bdi_writeback_ctx' declared inside parameter list will not be visible outside of this definition or declaration
118 | int bdi_wb_ctx_init(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx);
| ^~~~~~~~~~~~~~~~~
include/linux/backing-dev.h:119:59: warning: 'struct bdi_writeback_ctx' declared inside parameter list will not be visible outside of this definition or declaration
119 | void bdi_wb_ctx_exit(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx);
| ^~~~~~~~~~~~~~~~~
mm/backing-dev.c: In function 'nwritebacks_show':
>> mm/backing-dev.c:465:43: error: 'struct backing_dev_info' has no member named 'nr_wb_ctx'
465 | return sysfs_emit(buf, "%d\n", bdi->nr_wb_ctx);
| ^~
mm/backing-dev.c: At top level:
>> mm/backing-dev.c:1015:58: warning: 'struct bdi_writeback_ctx' declared inside parameter list will not be visible outside of this definition or declaration
1015 | int bdi_wb_ctx_init(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx)
| ^~~~~~~~~~~~~~~~~
>> mm/backing-dev.c:1015:5: error: conflicting types for 'bdi_wb_ctx_init'; have 'int(struct backing_dev_info *, struct bdi_writeback_ctx *)'
1015 | int bdi_wb_ctx_init(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx)
| ^~~~~~~~~~~~~~~
include/linux/backing-dev.h:118:5: note: previous declaration of 'bdi_wb_ctx_init' with type 'int(struct backing_dev_info *, struct bdi_writeback_ctx *)'
118 | int bdi_wb_ctx_init(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx);
| ^~~~~~~~~~~~~~~
In file included from include/linux/fs.h:16,
from include/linux/highmem.h:5,
from include/linux/bvec.h:10,
from include/linux/blk_types.h:10,
from include/linux/blkdev.h:9,
from mm/backing-dev.c:3:
mm/backing-dev.c: In function 'bdi_wb_ctx_init':
>> mm/backing-dev.c:1019:36: error: invalid use of undefined type 'struct bdi_writeback_ctx'
1019 | INIT_RADIX_TREE(&bdi_wb_ctx->cgwb_tree, GFP_ATOMIC);
| ^~
include/linux/radix-tree.h:84:51: note: in definition of macro 'INIT_RADIX_TREE'
84 | #define INIT_RADIX_TREE(root, mask) xa_init_flags(root, mask)
| ^~~~
In file included from include/linux/mm_types.h:13,
from include/linux/mmzone.h:22,
from include/linux/gfp.h:7,
from include/linux/xarray.h:16,
from include/linux/list_lru.h:14,
from include/linux/fs/super_types.h:7,
from include/linux/fs/super.h:5,
from include/linux/fs.h:5:
mm/backing-dev.c:1021:31: error: invalid use of undefined type 'struct bdi_writeback_ctx'
1021 | init_rwsem(&bdi_wb_ctx->wb_switch_rwsem);
| ^~
include/linux/rwsem.h:123:23: note: in definition of macro 'init_rwsem'
123 | __init_rwsem((sem), #sem, &__key); \
| ^~~
mm/backing-dev.c:1023:34: error: invalid use of undefined type 'struct bdi_writeback_ctx'
1023 | ret = wb_init(&bdi_wb_ctx->wb, bdi_wb_ctx, bdi, GFP_KERNEL);
| ^~
>> mm/backing-dev.c:1023:40: error: passing argument 2 of 'wb_init' from incompatible pointer type [-Wincompatible-pointer-types]
1023 | ret = wb_init(&bdi_wb_ctx->wb, bdi_wb_ctx, bdi, GFP_KERNEL);
| ^~~~~~~~~~
| |
| struct bdi_writeback_ctx *
mm/backing-dev.c:544:71: note: expected 'struct backing_dev_info *' but argument is of type 'struct bdi_writeback_ctx *'
544 | static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi,
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
>> mm/backing-dev.c:1023:52: error: passing argument 3 of 'wb_init' makes integer from pointer without a cast [-Wint-conversion]
1023 | ret = wb_init(&bdi_wb_ctx->wb, bdi_wb_ctx, bdi, GFP_KERNEL);
| ^~~
| |
| struct backing_dev_info *
mm/backing-dev.c:545:26: note: expected 'gfp_t' {aka 'unsigned int'} but argument is of type 'struct backing_dev_info *'
545 | gfp_t gfp)
| ~~~~~~^~~
>> mm/backing-dev.c:1023:15: error: too many arguments to function 'wb_init'; expected 3, have 4
1023 | ret = wb_init(&bdi_wb_ctx->wb, bdi_wb_ctx, bdi, GFP_KERNEL);
| ^~~~~~~
mm/backing-dev.c:544:12: note: declared here
544 | static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi,
| ^~~~~~~
mm/backing-dev.c:1025:27: error: invalid use of undefined type 'struct bdi_writeback_ctx'
1025 | bdi_wb_ctx->wb.memcg_css = &root_mem_cgroup->css;
| ^~
mm/backing-dev.c:1026:27: error: invalid use of undefined type 'struct bdi_writeback_ctx'
1026 | bdi_wb_ctx->wb.blkcg_css = blkcg_root_css;
| ^~
mm/backing-dev.c: At top level:
mm/backing-dev.c:1270:58: warning: 'struct bdi_writeback_ctx' declared inside parameter list will not be visible outside of this definition or declaration
1270 | int bdi_wb_ctx_init(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx)
| ^~~~~~~~~~~~~~~~~
mm/backing-dev.c:1270:5: error: conflicting types for 'bdi_wb_ctx_init'; have 'int(struct backing_dev_info *, struct bdi_writeback_ctx *)'
1270 | int bdi_wb_ctx_init(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx)
| ^~~~~~~~~~~~~~~
include/linux/backing-dev.h:118:5: note: previous declaration of 'bdi_wb_ctx_init' with type 'int(struct backing_dev_info *, struct bdi_writeback_ctx *)'
118 | int bdi_wb_ctx_init(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx);
| ^~~~~~~~~~~~~~~
mm/backing-dev.c: In function 'bdi_wb_ctx_init':
mm/backing-dev.c:1272:35: error: invalid use of undefined type 'struct bdi_writeback_ctx'
1272 | return wb_init(&bdi_wb_ctx->wb, bdi_wb_ctx, bdi, GFP_KERNEL);
| ^~
mm/backing-dev.c:1272:41: error: passing argument 2 of 'wb_init' from incompatible pointer type [-Wincompatible-pointer-types]
1272 | return wb_init(&bdi_wb_ctx->wb, bdi_wb_ctx, bdi, GFP_KERNEL);
| ^~~~~~~~~~
| |
| struct bdi_writeback_ctx *
mm/backing-dev.c:544:71: note: expected 'struct backing_dev_info *' but argument is of type 'struct bdi_writeback_ctx *'
544 | static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi,
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
mm/backing-dev.c:1272:53: error: passing argument 3 of 'wb_init' makes integer from pointer without a cast [-Wint-conversion]
1272 | return wb_init(&bdi_wb_ctx->wb, bdi_wb_ctx, bdi, GFP_KERNEL);
| ^~~
| |
| struct backing_dev_info *
mm/backing-dev.c:545:26: note: expected 'gfp_t' {aka 'unsigned int'} but argument is of type 'struct backing_dev_info *'
545 | gfp_t gfp)
| ~~~~~~^~~
mm/backing-dev.c:1272:16: error: too many arguments to function 'wb_init'; expected 3, have 4
1272 | return wb_init(&bdi_wb_ctx->wb, bdi_wb_ctx, bdi, GFP_KERNEL);
| ^~~~~~~
mm/backing-dev.c:544:12: note: declared here
544 | static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi,
| ^~~~~~~
mm/backing-dev.c: At top level:
mm/backing-dev.c:1275:59: warning: 'struct bdi_writeback_ctx' declared inside parameter list will not be visible outside of this definition or declaration
1275 | void bdi_wb_ctx_exit(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx)
| ^~~~~~~~~~~~~~~~~
>> mm/backing-dev.c:1275:6: error: conflicting types for 'bdi_wb_ctx_exit'; have 'void(struct backing_dev_info *, struct bdi_writeback_ctx *)'
1275 | void bdi_wb_ctx_exit(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx)
| ^~~~~~~~~~~~~~~
include/linux/backing-dev.h:119:6: note: previous declaration of 'bdi_wb_ctx_exit' with type 'void(struct backing_dev_info *, struct bdi_writeback_ctx *)'
119 | void bdi_wb_ctx_exit(struct backing_dev_info *bdi, struct bdi_writeback_ctx *bdi_wb_ctx);
| ^~~~~~~~~~~~~~~
mm/backing-dev.c: In function 'bdi_wb_ctx_exit':
mm/backing-dev.c:1277:32: error: invalid use of undefined type 'struct bdi_writeback_ctx'
1277 | wb_shutdown(&bdi_wb_ctx->wb);
| ^~
>> mm/backing-dev.c:1278:9: error: too many arguments to function 'cgwb_bdi_unregister'; expected 1, have 2
1278 | cgwb_bdi_unregister(bdi, bdi_wb_ctx);
| ^~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~
mm/backing-dev.c:881:13: note: declared here
881 | static void cgwb_bdi_unregister(struct backing_dev_info *bdi)
| ^~~~~~~~~~~~~~~~~~~
In file included from arch/powerpc/include/asm/bug.h:116,
from include/linux/bug.h:5,
from include/linux/instrumented.h:10,
from include/asm-generic/bitops/instrumented-atomic.h:14,
from arch/powerpc/include/asm/bitops.h:321,
from include/linux/bitops.h:67,
from include/linux/bitmap.h:8,
from include/linux/nodemask.h:91,
from include/linux/list_lru.h:12:
mm/backing-dev.c:1280:57: error: invalid use of undefined type 'struct bdi_writeback_ctx'
1280 | WARN_ON_ONCE(test_bit(WB_registered, &bdi_wb_ctx->wb.state));
| ^~
include/asm-generic/bug.h:120:32: note: in definition of macro 'WARN_ON_ONCE'
120 | int __ret_warn_on = !!(condition); \
| ^~~~~~~~~
include/linux/bitops.h:60:41: note: in expansion of macro 'bitop'
60 | #define test_bit(nr, addr) bitop(_test_bit, nr, addr)
| ^~~~~
mm/backing-dev.c:1280:22: note: in expansion of macro 'test_bit'
1280 | WARN_ON_ONCE(test_bit(WB_registered, &bdi_wb_ctx->wb.state));
| ^~~~~~~~
mm/backing-dev.c:1280:57: error: invalid use of undefined type 'struct bdi_writeback_ctx'
1280 | WARN_ON_ONCE(test_bit(WB_registered, &bdi_wb_ctx->wb.state));
| ^~
include/asm-generic/bug.h:120:32: note: in definition of macro 'WARN_ON_ONCE'
120 | int __ret_warn_on = !!(condition); \
| ^~~~~~~~~
include/linux/bitops.h:60:41: note: in expansion of macro 'bitop'
60 | #define test_bit(nr, addr) bitop(_test_bit, nr, addr)
| ^~~~~
mm/backing-dev.c:1280:22: note: in expansion of macro 'test_bit'
1280 | WARN_ON_ONCE(test_bit(WB_registered, &bdi_wb_ctx->wb.state));
| ^~~~~~~~
mm/backing-dev.c:1280:57: error: invalid use of undefined type 'struct bdi_writeback_ctx'
1280 | WARN_ON_ONCE(test_bit(WB_registered, &bdi_wb_ctx->wb.state));
| ^~
include/asm-generic/bug.h:120:32: note: in definition of macro 'WARN_ON_ONCE'
120 | int __ret_warn_on = !!(condition); \
| ^~~~~~~~~
include/linux/bitops.h:60:41: note: in expansion of macro 'bitop'
60 | #define test_bit(nr, addr) bitop(_test_bit, nr, addr)
| ^~~~~
mm/backing-dev.c:1280:22: note: in expansion of macro 'test_bit'
1280 | WARN_ON_ONCE(test_bit(WB_registered, &bdi_wb_ctx->wb.state));
| ^~~~~~~~
mm/backing-dev.c:1280:57: error: invalid use of undefined type 'struct bdi_writeback_ctx'
1280 | WARN_ON_ONCE(test_bit(WB_registered, &bdi_wb_ctx->wb.state));
| ^~
include/asm-generic/bug.h:120:32: note: in definition of macro 'WARN_ON_ONCE'
120 | int __ret_warn_on = !!(condition); \
| ^~~~~~~~~
include/linux/bitops.h:60:41: note: in expansion of macro 'bitop'
60 | #define test_bit(nr, addr) bitop(_test_bit, nr, addr)
| ^~~~~
mm/backing-dev.c:1280:22: note: in expansion of macro 'test_bit'
1280 | WARN_ON_ONCE(test_bit(WB_registered, &bdi_wb_ctx->wb.state));
| ^~~~~~~~
mm/backing-dev.c:1280:57: error: invalid use of undefined type 'struct bdi_writeback_ctx'
1280 | WARN_ON_ONCE(test_bit(WB_registered, &bdi_wb_ctx->wb.state));
| ^~
include/asm-generic/bug.h:120:32: note: in definition of macro 'WARN_ON_ONCE'
120 | int __ret_warn_on = !!(condition); \
| ^~~~~~~~~
include/linux/bitops.h:60:41: note: in expansion of macro 'bitop'
60 | #define test_bit(nr, addr) bitop(_test_bit, nr, addr)
| ^~~~~
mm/backing-dev.c:1280:22: note: in expansion of macro 'test_bit'
1280 | WARN_ON_ONCE(test_bit(WB_registered, &bdi_wb_ctx->wb.state));
| ^~~~~~~~
mm/backing-dev.c:1281:28: error: invalid use of undefined type 'struct bdi_writeback_ctx'
1281 | wb_exit(&bdi_wb_ctx->wb);
| ^~
vim +734 mm/page-writeback.c
724
725 static int __bdi_set_wb_ctx(struct backing_dev_info *bdi, int nwritebacks)
726 {
727 struct bdi_writeback_ctx **new_ctx_arr, **old_ctx_arr;
728 int i, ret;
729
730 new_ctx_arr = kcalloc(nwritebacks, sizeof(struct bdi_writeback_ctx *), GFP_KERNEL);
731 if (!new_ctx_arr)
732 return -ENOMEM;
733
> 734 for (i = 0; i < min(bdi->nr_wb_ctx, nwritebacks); i++)
> 735 new_ctx_arr[i] = bdi->wb_ctx_arr[i];
736
737 for (i = bdi->nr_wb_ctx; i < nwritebacks; i++) {
> 738 new_ctx_arr[i] = (struct bdi_writeback_ctx *)
> 739 kzalloc(sizeof(struct bdi_writeback_ctx), GFP_KERNEL);
740 if (!new_ctx_arr[i]) {
741 pr_err("Failed to allocate %d", i);
742 while (--i >= bdi->nr_wb_ctx)
743 kfree(new_ctx_arr[i]);
744 kfree(new_ctx_arr);
745 return -ENOMEM;
746 }
> 747 INIT_LIST_HEAD(&new_ctx_arr[i]->wb_list);
748 init_waitqueue_head(&new_ctx_arr[i]->wb_waitq);
749 }
750
751 for (i = bdi->nr_wb_ctx; i < nwritebacks; i++) {
> 752 ret = bdi_wb_ctx_init(bdi, new_ctx_arr[i]);
753 if (ret) {
754 while (--i >= bdi->nr_wb_ctx) {
> 755 bdi_wb_ctx_exit(bdi, new_ctx_arr[i]);
756 kfree(new_ctx_arr[i]);
757 }
758 kfree(new_ctx_arr);
759 return ret;
760 }
761 list_add_tail_rcu(&new_ctx_arr[i]->wb.bdi_node, &new_ctx_arr[i]->wb_list);
762 set_bit(WB_registered, &new_ctx_arr[i]->wb.state);
763 }
764
765 // Make sure the initialization is done before assignment
766 smp_wmb();
767
768 old_ctx_arr = bdi->wb_ctx_arr;
769 spin_lock_bh(&bdi_lock);
770 bdi->wb_ctx_arr = new_ctx_arr;
771 bdi->nr_wb_ctx = nwritebacks;
772 spin_unlock_bh(&bdi_lock);
773
774 kfree(old_ctx_arr);
775 return 0;
776 }
777
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-08-13 10:49 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20250825123009epcas5p1573496e2cad2f58d22036493e5af03be@epcas5p1.samsung.com>
2025-08-25 12:29 ` [RFC 0/1] writeback: add sysfs to config the number of writeback contexts wangyufei
2025-08-25 12:29 ` [RFC 1/1] " wangyufei
2026-08-13 10:47 ` kernel test robot
2025-08-25 14:46 ` [RFC 0/1] " David Hildenbrand
2025-08-25 16:15 ` Matthew Wilcox
2025-08-29 8:59 ` Kundan Kumar
2025-09-02 11:19 ` wangyufei
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.