aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2017-09-05 09:33:41 -0400
committerTejun Heo <tj@kernel.org>2017-09-05 09:33:41 -0400
commit058fc47ee22c60c817c362ef6844d40d8ebb8140 (patch)
treeda0bf3dec31d4c30a5420930cd11a5c2cdc5e46b
parentc5a94a618e7ac86b20f53d947f68d7cee6a4c6bc (diff)
parent1ad0f0a7aa1bf3bd42dcd108a96713d255eacd9f (diff)
Merge branch 'for-4.13-fixes' into for-4.14
-rw-r--r--drivers/md/bitmap.c3
-rw-r--r--drivers/md/md.h4
-rw-r--r--drivers/md/raid5-ppl.c2
-rw-r--r--drivers/md/raid5.c4
-rw-r--r--include/linux/workqueue.h4
-rw-r--r--kernel/workqueue.c30
6 files changed, 36 insertions, 11 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index f4eace5ea184..40f3cd7eab0f 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -156,7 +156,8 @@ static int read_sb_page(struct mddev *mddev, loff_t offset,
156 156
157 rdev_for_each(rdev, mddev) { 157 rdev_for_each(rdev, mddev) {
158 if (! test_bit(In_sync, &rdev->flags) 158 if (! test_bit(In_sync, &rdev->flags)
159 || test_bit(Faulty, &rdev->flags)) 159 || test_bit(Faulty, &rdev->flags)
160 || test_bit(Bitmap_sync, &rdev->flags))
160 continue; 161 continue;
161 162
162 target = offset + index * (PAGE_SIZE/512); 163 target = offset + index * (PAGE_SIZE/512);
diff --git a/drivers/md/md.h b/drivers/md/md.h
index 991f0fe2dcc6..b50eb4ac1b82 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -134,7 +134,9 @@ enum flag_bits {
134 Faulty, /* device is known to have a fault */ 134 Faulty, /* device is known to have a fault */
135 In_sync, /* device is in_sync with rest of array */ 135 In_sync, /* device is in_sync with rest of array */
136 Bitmap_sync, /* ..actually, not quite In_sync. Need a 136 Bitmap_sync, /* ..actually, not quite In_sync. Need a
137 * bitmap-based recovery to get fully in sync 137 * bitmap-based recovery to get fully in sync.
138 * The bit is only meaningful before device
139 * has been passed to pers->hot_add_disk.
138 */ 140 */
139 WriteMostly, /* Avoid reading if at all possible */ 141 WriteMostly, /* Avoid reading if at all possible */
140 AutoDetected, /* added by auto-detect */ 142 AutoDetected, /* added by auto-detect */
diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c
index 77cce3573aa8..44ad5baf3206 100644
--- a/drivers/md/raid5-ppl.c
+++ b/drivers/md/raid5-ppl.c
@@ -1150,7 +1150,7 @@ int ppl_init_log(struct r5conf *conf)
1150 goto err; 1150 goto err;
1151 } 1151 }
1152 1152
1153 ppl_conf->bs = bioset_create(conf->raid_disks, 0, 0); 1153 ppl_conf->bs = bioset_create(conf->raid_disks, 0, BIOSET_NEED_BVECS);
1154 if (!ppl_conf->bs) { 1154 if (!ppl_conf->bs) {
1155 ret = -ENOMEM; 1155 ret = -ENOMEM;
1156 goto err; 1156 goto err;
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 2ceb338b094b..aeeb8d6854e2 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -7951,12 +7951,10 @@ static void end_reshape(struct r5conf *conf)
7951{ 7951{
7952 7952
7953 if (!test_bit(MD_RECOVERY_INTR, &conf->mddev->recovery)) { 7953 if (!test_bit(MD_RECOVERY_INTR, &conf->mddev->recovery)) {
7954 struct md_rdev *rdev;
7955 7954
7956 spin_lock_irq(&conf->device_lock); 7955 spin_lock_irq(&conf->device_lock);
7957 conf->previous_raid_disks = conf->raid_disks; 7956 conf->previous_raid_disks = conf->raid_disks;
7958 rdev_for_each(rdev, conf->mddev) 7957 md_finish_reshape(conf->mddev);
7959 rdev->data_offset = rdev->new_data_offset;
7960 smp_wmb(); 7958 smp_wmb();
7961 conf->reshape_progress = MaxSector; 7959 conf->reshape_progress = MaxSector;
7962 conf->mddev->reshape_position = MaxSector; 7960 conf->mddev->reshape_position = MaxSector;
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index c102ef65cb64..db6dc9dc0482 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -323,6 +323,7 @@ enum {
323 323
324 __WQ_DRAINING = 1 << 16, /* internal: workqueue is draining */ 324 __WQ_DRAINING = 1 << 16, /* internal: workqueue is draining */
325 __WQ_ORDERED = 1 << 17, /* internal: workqueue is ordered */ 325 __WQ_ORDERED = 1 << 17, /* internal: workqueue is ordered */
326 __WQ_ORDERED_EXPLICIT = 1 << 18, /* internal: alloc_ordered_workqueue() */
326 __WQ_LEGACY = 1 << 18, /* internal: create*_workqueue() */ 327 __WQ_LEGACY = 1 << 18, /* internal: create*_workqueue() */
327 328
328 WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */ 329 WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */
@@ -422,7 +423,8 @@ __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active,
422 * Pointer to the allocated workqueue on success, %NULL on failure. 423 * Pointer to the allocated workqueue on success, %NULL on failure.
423 */ 424 */
424#define alloc_ordered_workqueue(fmt, flags, args...) \ 425#define alloc_ordered_workqueue(fmt, flags, args...) \
425 alloc_workqueue(fmt, WQ_UNBOUND | __WQ_ORDERED | (flags), 1, ##args) 426 alloc_workqueue(fmt, WQ_UNBOUND | __WQ_ORDERED | \
427 __WQ_ORDERED_EXPLICIT | (flags), 1, ##args)
426 428
427#define create_workqueue(name) \ 429#define create_workqueue(name) \
428 alloc_workqueue("%s", __WQ_LEGACY | WQ_MEM_RECLAIM, 1, (name)) 430 alloc_workqueue("%s", __WQ_LEGACY | WQ_MEM_RECLAIM, 1, (name))
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 2d278b9a5469..a44ef675fd3a 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -3577,6 +3577,13 @@ static bool wq_calc_node_cpumask(const struct workqueue_attrs *attrs, int node,
3577 3577
3578 /* yeap, return possible CPUs in @node that @attrs wants */ 3578 /* yeap, return possible CPUs in @node that @attrs wants */
3579 cpumask_and(cpumask, attrs->cpumask, wq_numa_possible_cpumask[node]); 3579 cpumask_and(cpumask, attrs->cpumask, wq_numa_possible_cpumask[node]);
3580
3581 if (cpumask_empty(cpumask)) {
3582 pr_warn_once("WARNING: workqueue cpumask: online intersect > "
3583 "possible intersect\n");
3584 return false;
3585 }
3586
3580 return !cpumask_equal(cpumask, attrs->cpumask); 3587 return !cpumask_equal(cpumask, attrs->cpumask);
3581 3588
3582use_dfl: 3589use_dfl:
@@ -3744,8 +3751,12 @@ static int apply_workqueue_attrs_locked(struct workqueue_struct *wq,
3744 return -EINVAL; 3751 return -EINVAL;
3745 3752
3746 /* creating multiple pwqs breaks ordering guarantee */ 3753 /* creating multiple pwqs breaks ordering guarantee */
3747 if (WARN_ON((wq->flags & __WQ_ORDERED) && !list_empty(&wq->pwqs))) 3754 if (!list_empty(&wq->pwqs)) {
3748 return -EINVAL; 3755 if (WARN_ON(wq->flags & __WQ_ORDERED_EXPLICIT))
3756 return -EINVAL;
3757
3758 wq->flags &= ~__WQ_ORDERED;
3759 }
3749 3760
3750 ctx = apply_wqattrs_prepare(wq, attrs); 3761 ctx = apply_wqattrs_prepare(wq, attrs);
3751 if (!ctx) 3762 if (!ctx)
@@ -3929,6 +3940,16 @@ struct workqueue_struct *__alloc_workqueue_key(const char *fmt,
3929 struct workqueue_struct *wq; 3940 struct workqueue_struct *wq;
3930 struct pool_workqueue *pwq; 3941 struct pool_workqueue *pwq;
3931 3942
3943 /*
3944 * Unbound && max_active == 1 used to imply ordered, which is no
3945 * longer the case on NUMA machines due to per-node pools. While
3946 * alloc_ordered_workqueue() is the right way to create an ordered
3947 * workqueue, keep the previous behavior to avoid subtle breakages
3948 * on NUMA.
3949 */
3950 if ((flags & WQ_UNBOUND) && max_active == 1)
3951 flags |= __WQ_ORDERED;
3952
3932 /* see the comment above the definition of WQ_POWER_EFFICIENT */ 3953 /* see the comment above the definition of WQ_POWER_EFFICIENT */
3933 if ((flags & WQ_POWER_EFFICIENT) && wq_power_efficient) 3954 if ((flags & WQ_POWER_EFFICIENT) && wq_power_efficient)
3934 flags |= WQ_UNBOUND; 3955 flags |= WQ_UNBOUND;
@@ -4119,13 +4140,14 @@ void workqueue_set_max_active(struct workqueue_struct *wq, int max_active)
4119 struct pool_workqueue *pwq; 4140 struct pool_workqueue *pwq;
4120 4141
4121 /* disallow meddling with max_active for ordered workqueues */ 4142 /* disallow meddling with max_active for ordered workqueues */
4122 if (WARN_ON(wq->flags & __WQ_ORDERED)) 4143 if (WARN_ON(wq->flags & __WQ_ORDERED_EXPLICIT))
4123 return; 4144 return;
4124 4145
4125 max_active = wq_clamp_max_active(max_active, wq->flags, wq->name); 4146 max_active = wq_clamp_max_active(max_active, wq->flags, wq->name);
4126 4147
4127 mutex_lock(&wq->mutex); 4148 mutex_lock(&wq->mutex);
4128 4149
4150 wq->flags &= ~__WQ_ORDERED;
4129 wq->saved_max_active = max_active; 4151 wq->saved_max_active = max_active;
4130 4152
4131 for_each_pwq(pwq, wq) 4153 for_each_pwq(pwq, wq)
@@ -5253,7 +5275,7 @@ int workqueue_sysfs_register(struct workqueue_struct *wq)
5253 * attributes breaks ordering guarantee. Disallow exposing ordered 5275 * attributes breaks ordering guarantee. Disallow exposing ordered
5254 * workqueues. 5276 * workqueues.
5255 */ 5277 */
5256 if (WARN_ON(wq->flags & __WQ_ORDERED)) 5278 if (WARN_ON(wq->flags & __WQ_ORDERED_EXPLICIT))
5257 return -EINVAL; 5279 return -EINVAL;
5258 5280
5259 wq->wq_dev = wq_dev = kzalloc(sizeof(*wq_dev), GFP_KERNEL); 5281 wq->wq_dev = wq_dev = kzalloc(sizeof(*wq_dev), GFP_KERNEL);