From: Stephen Rothwell <sfr@canb•auug.org.au>
To: Jens Axboe <axboe@kernel•dk>
Cc: linux-next@vger•kernel.org, linux-kernel@vger•kernel.org,
NeilBrown <neilb@suse•de>, Tejun Heo <tj@kernel•org>
Subject: linux-next: manual merge of the block tree with Linus' tree
Date: Thu, 4 Jun 2015 14:51:56 +1000 [thread overview]
Message-ID: <20150604145156.51c6924b@canb.auug.org.au> (raw)
[-- Attachment #1: Type: text/plain, Size: 4075 bytes --]
Hi Jens,
Today's linux-next merge of the block tree got a conflict in
mm/backing-dev.c between commit aad653a0bc09 ("block: discard
bdi_unregister() in favour of bdi_destroy()") from Linus' tree and
various commits from the block tree.
I fixed it up (I think - see below) and can carry the fix as necessary
(no action is required - though it may be worth while merging what you
had Linus merge and fixing up the conflicts yourself).
--
Cheers,
Stephen Rothwell sfr@canb•auug.org.au
diff --cc mm/backing-dev.c
index 000e7b3b9896,887d72a85b5e..000000000000
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@@ -387,49 -744,91 +744,75 @@@ int bdi_init(struct backing_dev_info *b
bdi->min_ratio = 0;
bdi->max_ratio = 100;
bdi->max_prop_frac = FPROP_FRAC_BASE;
- spin_lock_init(&bdi->wb_lock);
INIT_LIST_HEAD(&bdi->bdi_list);
- INIT_LIST_HEAD(&bdi->work_list);
+ init_waitqueue_head(&bdi->wb_waitq);
- bdi_wb_init(&bdi->wb, bdi);
+ err = wb_init(&bdi->wb, bdi, GFP_KERNEL);
+ if (err)
+ return err;
- for (i = 0; i < NR_BDI_STAT_ITEMS; i++) {
- err = percpu_counter_init(&bdi->bdi_stat[i], 0, GFP_KERNEL);
- if (err)
- goto err;
- }
+ bdi->wb_congested.state = 0;
+ bdi->wb.congested = &bdi->wb_congested;
- bdi->dirty_exceeded = 0;
+ cgwb_bdi_init(bdi);
+ return 0;
+ }
+ EXPORT_SYMBOL(bdi_init);
- bdi->bw_time_stamp = jiffies;
- bdi->written_stamp = 0;
+ int bdi_register(struct backing_dev_info *bdi, struct device *parent,
+ const char *fmt, ...)
+ {
+ va_list args;
+ struct device *dev;
- bdi->balanced_dirty_ratelimit = INIT_BW;
- bdi->dirty_ratelimit = INIT_BW;
- bdi->write_bandwidth = INIT_BW;
- bdi->avg_write_bandwidth = INIT_BW;
+ if (bdi->dev) /* The driver needs to use separate queues per device */
+ return 0;
- err = fprop_local_init_percpu(&bdi->completions, GFP_KERNEL);
+ va_start(args, fmt);
+ dev = device_create_vargs(bdi_class, parent, MKDEV(0, 0), bdi, fmt, args);
+ va_end(args);
+ if (IS_ERR(dev))
+ return PTR_ERR(dev);
- if (err) {
- err:
- while (i--)
- percpu_counter_destroy(&bdi->bdi_stat[i]);
- }
+ bdi->dev = dev;
- return err;
+ bdi_debug_register(bdi, dev_name(dev));
+ set_bit(WB_registered, &bdi->wb.state);
+
+ spin_lock_bh(&bdi_lock);
+ list_add_tail_rcu(&bdi->bdi_list, &bdi_list);
+ spin_unlock_bh(&bdi_lock);
+
+ trace_writeback_bdi_register(bdi);
+ return 0;
}
- EXPORT_SYMBOL(bdi_init);
+ EXPORT_SYMBOL(bdi_register);
- void bdi_destroy(struct backing_dev_info *bdi)
+ int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev)
{
- int i;
+ return bdi_register(bdi, NULL, "%u:%u", MAJOR(dev), MINOR(dev));
+ }
+ EXPORT_SYMBOL(bdi_register_dev);
- bdi_wb_shutdown(bdi);
- bdi_set_min_ratio(bdi, 0);
+ /*
+ * Remove bdi from bdi_list, and ensure that it is no longer visible
+ */
+ static void bdi_remove_from_list(struct backing_dev_info *bdi)
+ {
+ spin_lock_bh(&bdi_lock);
+ list_del_rcu(&bdi->bdi_list);
+ spin_unlock_bh(&bdi_lock);
- WARN_ON(!list_empty(&bdi->work_list));
- WARN_ON(delayed_work_pending(&bdi->wb.dwork));
+ synchronize_rcu_expedited();
+ }
+
-/*
- * Called when the device behind @bdi has been removed or ejected.
- *
- * We can't really do much here except for reducing the dirty ratio at
- * the moment. In the future we should be able to set a flag so that
- * the filesystem can handle errors at mark_inode_dirty time instead
- * of only at writeback time.
- */
-void bdi_unregister(struct backing_dev_info *bdi)
-{
- if (WARN_ON_ONCE(!bdi->dev))
- return;
-
- bdi_set_min_ratio(bdi, 0);
-}
-EXPORT_SYMBOL(bdi_unregister);
-
+ void bdi_destroy(struct backing_dev_info *bdi)
+ {
+ /* make sure nobody finds us on the bdi_list anymore */
+ bdi_remove_from_list(bdi);
+ wb_shutdown(&bdi->wb);
++ bdi_set_min_ratio(bdi, 0);
+ cgwb_bdi_destroy(bdi);
if (bdi->dev) {
bdi_debug_unregister(bdi);
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next reply other threads:[~2015-06-04 4:51 UTC|newest]
Thread overview: 122+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-04 4:51 Stephen Rothwell [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-05-05 3:25 linux-next: manual merge of the block tree with Linus' tree Stephen Rothwell
2025-05-05 13:15 ` Jens Axboe
2025-01-09 1:46 Stephen Rothwell
2025-01-10 15:02 ` Jens Axboe
2024-11-11 3:10 Stephen Rothwell
2024-11-11 15:14 ` Jens Axboe
2024-10-21 1:06 Stephen Rothwell
2024-10-21 16:52 ` Jens Axboe
2024-05-22 23:50 Stephen Rothwell
2024-05-23 13:04 ` Jens Axboe
2024-05-13 2:23 Stephen Rothwell
2024-05-13 23:50 ` Jens Axboe
2023-10-23 1:42 Stephen Rothwell
2023-06-26 3:04 Stephen Rothwell
2023-04-03 2:36 Stephen Rothwell
2022-11-21 2:46 Stephen Rothwell
2022-11-21 14:47 ` Jens Axboe
2022-04-20 2:31 Stephen Rothwell
2022-03-21 1:22 Stephen Rothwell
2021-11-25 23:38 Stephen Rothwell
2021-11-26 5:30 ` Christoph Hellwig
2021-11-01 1:36 Stephen Rothwell
2021-10-25 2:26 Stephen Rothwell
2021-08-17 5:25 Stephen Rothwell
2021-08-17 16:40 ` Tejun Heo
2021-08-17 16:50 ` Christoph Hellwig
2021-08-17 16:52 ` Tejun Heo
2021-08-09 4:29 Stephen Rothwell
2021-08-09 14:05 ` Jens Axboe
2020-12-14 3:56 Stephen Rothwell
2020-09-23 4:05 Stephen Rothwell
2020-01-28 0:38 Stephen Rothwell
2020-01-28 0:40 ` Jens Axboe
2019-04-15 3:06 Stephen Rothwell
2019-04-15 14:15 ` Jens Axboe
2019-04-15 3:00 Stephen Rothwell
2019-03-05 1:48 Stephen Rothwell
2018-11-16 2:19 Stephen Rothwell
2018-11-16 2:21 ` Jens Axboe
2017-09-04 3:09 Stephen Rothwell
2017-06-30 2:08 Stephen Rothwell
2017-06-26 2:44 Stephen Rothwell
2017-06-26 2:28 Stephen Rothwell
2017-06-23 3:06 Stephen Rothwell
2017-06-23 3:09 ` Jens Axboe
2017-06-23 3:24 ` Stephen Rothwell
2017-06-23 3:27 ` Jens Axboe
2017-06-23 3:33 ` Stephen Rothwell
2017-06-23 3:56 ` Jens Axboe
2017-06-23 3:29 ` Jens Axboe
2016-07-21 3:08 Stephen Rothwell
2016-07-08 3:07 Stephen Rothwell
2016-07-08 4:14 ` Stephen Rothwell
2016-07-08 14:11 ` Konrad Rzeszutek Wilk
2016-06-14 2:44 Stephen Rothwell
2016-05-03 4:25 Stephen Rothwell
2016-05-03 20:03 ` Jens Axboe
2016-03-07 3:12 Stephen Rothwell
2016-03-07 3:08 Stephen Rothwell
2016-03-01 0:25 Stephen Rothwell
2016-02-18 2:10 Stephen Rothwell
2016-01-13 2:07 Stephen Rothwell
2015-12-31 3:34 Stephen Rothwell
2016-01-21 22:46 ` Stephen Rothwell
2016-01-21 22:48 ` Jens Axboe
2015-12-14 1:36 Stephen Rothwell
2015-12-07 4:27 Stephen Rothwell
2015-12-07 4:16 Stephen Rothwell
2015-10-06 1:33 Stephen Rothwell
2015-08-27 2:36 Stephen Rothwell
2015-08-17 4:04 Stephen Rothwell
2015-06-04 4:36 Stephen Rothwell
2015-06-03 3:33 Stephen Rothwell
2015-06-03 3:28 Stephen Rothwell
2015-06-01 4:56 Stephen Rothwell
2015-06-01 14:31 ` Mike Snitzer
2015-04-13 4:58 Stephen Rothwell
2015-01-27 4:03 Stephen Rothwell
2014-03-17 3:55 Stephen Rothwell
2014-03-10 15:39 Mark Brown
2013-11-01 3:25 Stephen Rothwell
2013-09-25 3:11 Stephen Rothwell
2013-05-01 5:17 Stephen Rothwell
2013-03-26 2:05 Stephen Rothwell
2012-12-07 2:44 Stephen Rothwell
2012-10-31 2:04 Stephen Rothwell
2012-10-31 13:55 ` Ben Hutchings
2012-10-31 13:57 ` Jens Axboe
2012-11-01 10:04 ` Herton Ronaldo Krzesinski
2011-11-01 5:15 Stephen Rothwell
2011-11-01 8:09 ` Jens Axboe
2011-11-01 9:03 ` Stephen Rothwell
2011-05-19 1:34 Stephen Rothwell
2011-03-21 0:43 Stephen Rothwell
2011-03-21 9:48 ` Jens Axboe
2011-03-07 2:19 Stephen Rothwell
2011-03-07 6:36 ` Tejun Heo
2011-03-07 8:42 ` Jens Axboe
2011-03-07 10:41 ` Sedat Dilek
2011-03-07 10:47 ` Tejun Heo
2011-03-07 11:14 ` Sedat Dilek
2011-03-07 11:16 ` Jens Axboe
2011-03-07 11:25 ` Sedat Dilek
2011-03-07 11:26 ` Jens Axboe
2011-03-07 11:35 ` Sedat Dilek
2011-03-07 11:46 ` Jens Axboe
2011-03-07 12:26 ` Sedat Dilek
2011-03-07 11:42 ` Stephen Rothwell
2011-03-07 11:38 ` Stephen Rothwell
2010-09-16 2:04 Stephen Rothwell
2010-04-29 3:52 Stephen Rothwell
2010-04-29 7:33 ` Jens Axboe
2010-03-17 1:52 Stephen Rothwell
2010-03-17 2:03 ` Li Zefan
2010-02-25 3:10 Stephen Rothwell
2010-02-25 7:47 ` Jens Axboe
2010-02-25 23:11 ` Stephen Rothwell
2009-06-25 3:15 Stephen Rothwell
2009-06-25 3:30 ` Stephen Rothwell
2009-06-25 6:38 ` Jens Axboe
2009-06-25 7:42 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150604145156.51c6924b@canb.auug.org.au \
--to=sfr@canb$(echo .)auug.org.au \
--cc=axboe@kernel$(echo .)dk \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-next@vger$(echo .)kernel.org \
--cc=neilb@suse$(echo .)de \
--cc=tj@kernel$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox