Skip to content

Commit 561593a

Browse files
committed
Merge tag 'for-5.18/write-streams-2022-03-18' of git://git.kernel.dk/linux-block
Pull NVMe write streams removal from Jens Axboe: "This removes the write streams support in NVMe. No vendor ever really shipped working support for this, and they are not interested in supporting it. With the NVMe support gone, we have nothing in the tree that supports this. Remove passing around of the hints. The only discussion point in this patchset imho is the fact that the file specific write hint setting/getting fcntl helpers will now return -1/EINVAL like they did before we supported write hints. No known applications use these functions, I only know of one prototype that I help do for RocksDB, and that's not used. That said, with a change like this, it's always a bit controversial. Alternatively, we could just make them return 0 and pretend it worked. It's placement based hints after all" * tag 'for-5.18/write-streams-2022-03-18' of git://git.kernel.dk/linux-block: fs: remove fs.f_write_hint fs: remove kiocb.ki_hint block: remove the per-bio/request write hint nvme: remove support or stream based temperature hint
2 parents 9bf3fc5 + 7b12e49 commit 561593a

File tree

32 files changed

+10
-303
lines changed

32 files changed

+10
-303
lines changed

block/bio.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ void bio_init(struct bio *bio, struct block_device *bdev, struct bio_vec *table,
257257
bio->bi_opf = opf;
258258
bio->bi_flags = 0;
259259
bio->bi_ioprio = 0;
260-
bio->bi_write_hint = 0;
261260
bio->bi_status = 0;
262261
bio->bi_iter.bi_sector = 0;
263262
bio->bi_iter.bi_size = 0;
@@ -737,7 +736,6 @@ static int __bio_clone(struct bio *bio, struct bio *bio_src, gfp_t gfp)
737736
bio_flagged(bio_src, BIO_REMAPPED))
738737
bio_set_flag(bio, BIO_REMAPPED);
739738
bio->bi_ioprio = bio_src->bi_ioprio;
740-
bio->bi_write_hint = bio_src->bi_write_hint;
741739
bio->bi_iter = bio_src->bi_iter;
742740

743741
bio_clone_blkg_association(bio, bio_src);

block/blk-crypto-fallback.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ static struct bio *blk_crypto_fallback_clone_bio(struct bio *bio_src)
170170
bio_set_flag(bio, BIO_REMAPPED);
171171
bio->bi_opf = bio_src->bi_opf;
172172
bio->bi_ioprio = bio_src->bi_ioprio;
173-
bio->bi_write_hint = bio_src->bi_write_hint;
174173
bio->bi_iter.bi_sector = bio_src->bi_iter.bi_sector;
175174
bio->bi_iter.bi_size = bio_src->bi_iter.bi_size;
176175

block/blk-merge.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -754,13 +754,6 @@ static struct request *attempt_merge(struct request_queue *q,
754754
if (rq_data_dir(req) != rq_data_dir(next))
755755
return NULL;
756756

757-
/*
758-
* Don't allow merge of different write hints, or for a hint with
759-
* non-hint IO.
760-
*/
761-
if (req->write_hint != next->write_hint)
762-
return NULL;
763-
764757
if (req->ioprio != next->ioprio)
765758
return NULL;
766759

@@ -886,13 +879,6 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio)
886879
if (!bio_crypt_rq_ctx_compatible(rq, bio))
887880
return false;
888881

889-
/*
890-
* Don't allow merge of different write hints, or for a hint with
891-
* non-hint IO.
892-
*/
893-
if (rq->write_hint != bio->bi_write_hint)
894-
return false;
895-
896882
if (rq->ioprio != bio_prio(bio))
897883
return false;
898884

block/blk-mq-debugfs.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -183,35 +183,11 @@ static ssize_t queue_state_write(void *data, const char __user *buf,
183183
return count;
184184
}
185185

186-
static int queue_write_hint_show(void *data, struct seq_file *m)
187-
{
188-
struct request_queue *q = data;
189-
int i;
190-
191-
for (i = 0; i < BLK_MAX_WRITE_HINTS; i++)
192-
seq_printf(m, "hint%d: %llu\n", i, q->write_hints[i]);
193-
194-
return 0;
195-
}
196-
197-
static ssize_t queue_write_hint_store(void *data, const char __user *buf,
198-
size_t count, loff_t *ppos)
199-
{
200-
struct request_queue *q = data;
201-
int i;
202-
203-
for (i = 0; i < BLK_MAX_WRITE_HINTS; i++)
204-
q->write_hints[i] = 0;
205-
206-
return count;
207-
}
208-
209186
static const struct blk_mq_debugfs_attr blk_mq_debugfs_queue_attrs[] = {
210187
{ "poll_stat", 0400, queue_poll_stat_show },
211188
{ "requeue_list", 0400, .seq_ops = &queue_requeue_list_seq_ops },
212189
{ "pm_only", 0600, queue_pm_only_show, NULL },
213190
{ "state", 0600, queue_state_show, queue_state_write },
214-
{ "write_hints", 0600, queue_write_hint_show, queue_write_hint_store },
215191
{ "zone_wlock", 0400, queue_zone_wlock_show, NULL },
216192
{ },
217193
};

block/blk-mq.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2412,7 +2412,6 @@ static void blk_mq_bio_to_request(struct request *rq, struct bio *bio,
24122412
rq->cmd_flags |= REQ_FAILFAST_MASK;
24132413

24142414
rq->__sector = bio->bi_iter.bi_sector;
2415-
rq->write_hint = bio->bi_write_hint;
24162415
blk_rq_bio_prep(rq, bio, nr_segs);
24172416

24182417
/* This can't fail, since GFP_NOIO includes __GFP_DIRECT_RECLAIM. */

block/bounce.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ static struct bio *bounce_clone_bio(struct bio *bio_src)
169169
if (bio_flagged(bio_src, BIO_REMAPPED))
170170
bio_set_flag(bio, BIO_REMAPPED);
171171
bio->bi_ioprio = bio_src->bi_ioprio;
172-
bio->bi_write_hint = bio_src->bi_write_hint;
173172
bio->bi_iter.bi_sector = bio_src->bi_iter.bi_sector;
174173
bio->bi_iter.bi_size = bio_src->bi_iter.bi_size;
175174

block/fops.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ static ssize_t __blkdev_direct_IO_simple(struct kiocb *iocb,
8383
bio_init(&bio, bdev, vecs, nr_pages, dio_bio_write_op(iocb));
8484
}
8585
bio.bi_iter.bi_sector = pos >> SECTOR_SHIFT;
86-
bio.bi_write_hint = iocb->ki_hint;
8786
bio.bi_private = current;
8887
bio.bi_end_io = blkdev_bio_end_io_simple;
8988
bio.bi_ioprio = iocb->ki_ioprio;
@@ -225,7 +224,6 @@ static ssize_t __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
225224

226225
for (;;) {
227226
bio->bi_iter.bi_sector = pos >> SECTOR_SHIFT;
228-
bio->bi_write_hint = iocb->ki_hint;
229227
bio->bi_private = dio;
230228
bio->bi_end_io = blkdev_bio_end_io;
231229
bio->bi_ioprio = iocb->ki_ioprio;
@@ -327,7 +325,6 @@ static ssize_t __blkdev_direct_IO_async(struct kiocb *iocb,
327325
dio->flags = 0;
328326
dio->iocb = iocb;
329327
bio->bi_iter.bi_sector = pos >> SECTOR_SHIFT;
330-
bio->bi_write_hint = iocb->ki_hint;
331328
bio->bi_end_io = blkdev_bio_end_io_async;
332329
bio->bi_ioprio = iocb->ki_ioprio;
333330

drivers/md/raid1.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,8 +1136,6 @@ static void alloc_behind_master_bio(struct r1bio *r1_bio,
11361136
goto skip_copy;
11371137
}
11381138

1139-
behind_bio->bi_write_hint = bio->bi_write_hint;
1140-
11411139
while (i < vcnt && size) {
11421140
struct page *page;
11431141
int len = min_t(int, PAGE_SIZE, size);

drivers/md/raid5-ppl.c

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,6 @@ static void ppl_submit_iounit(struct ppl_io_unit *io)
466466
bio->bi_end_io = ppl_log_endio;
467467
bio->bi_iter.bi_sector = log->next_io_sector;
468468
bio_add_page(bio, io->header_page, PAGE_SIZE, 0);
469-
bio->bi_write_hint = ppl_conf->write_hint;
470469

471470
pr_debug("%s: log->current_io_sector: %llu\n", __func__,
472471
(unsigned long long)log->next_io_sector);
@@ -496,7 +495,6 @@ static void ppl_submit_iounit(struct ppl_io_unit *io)
496495
bio = bio_alloc_bioset(prev->bi_bdev, BIO_MAX_VECS,
497496
prev->bi_opf, GFP_NOIO,
498497
&ppl_conf->bs);
499-
bio->bi_write_hint = prev->bi_write_hint;
500498
bio->bi_iter.bi_sector = bio_end_sector(prev);
501499
bio_add_page(bio, sh->ppl_page, PAGE_SIZE, 0);
502500

@@ -1396,7 +1394,6 @@ int ppl_init_log(struct r5conf *conf)
13961394
atomic64_set(&ppl_conf->seq, 0);
13971395
INIT_LIST_HEAD(&ppl_conf->no_mem_stripes);
13981396
spin_lock_init(&ppl_conf->no_mem_stripes_lock);
1399-
ppl_conf->write_hint = RWH_WRITE_LIFE_NOT_SET;
14001397

14011398
if (!mddev->external) {
14021399
ppl_conf->signature = ~crc32c_le(~0, mddev->uuid, sizeof(mddev->uuid));
@@ -1495,25 +1492,13 @@ int ppl_modify_log(struct r5conf *conf, struct md_rdev *rdev, bool add)
14951492
static ssize_t
14961493
ppl_write_hint_show(struct mddev *mddev, char *buf)
14971494
{
1498-
size_t ret = 0;
1499-
struct r5conf *conf;
1500-
struct ppl_conf *ppl_conf = NULL;
1501-
1502-
spin_lock(&mddev->lock);
1503-
conf = mddev->private;
1504-
if (conf && raid5_has_ppl(conf))
1505-
ppl_conf = conf->log_private;
1506-
ret = sprintf(buf, "%d\n", ppl_conf ? ppl_conf->write_hint : 0);
1507-
spin_unlock(&mddev->lock);
1508-
1509-
return ret;
1495+
return sprintf(buf, "%d\n", 0);
15101496
}
15111497

15121498
static ssize_t
15131499
ppl_write_hint_store(struct mddev *mddev, const char *page, size_t len)
15141500
{
15151501
struct r5conf *conf;
1516-
struct ppl_conf *ppl_conf;
15171502
int err = 0;
15181503
unsigned short new;
15191504

@@ -1527,17 +1512,10 @@ ppl_write_hint_store(struct mddev *mddev, const char *page, size_t len)
15271512
return err;
15281513

15291514
conf = mddev->private;
1530-
if (!conf) {
1515+
if (!conf)
15311516
err = -ENODEV;
1532-
} else if (raid5_has_ppl(conf)) {
1533-
ppl_conf = conf->log_private;
1534-
if (!ppl_conf)
1535-
err = -EINVAL;
1536-
else
1537-
ppl_conf->write_hint = new;
1538-
} else {
1517+
else if (!raid5_has_ppl(conf) || !conf->log_private)
15391518
err = -EINVAL;
1540-
}
15411519

15421520
mddev_unlock(mddev);
15431521

drivers/md/raid5.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,9 +1211,6 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s)
12111211
bi->bi_io_vec[0].bv_len = RAID5_STRIPE_SIZE(conf);
12121212
bi->bi_io_vec[0].bv_offset = sh->dev[i].offset;
12131213
bi->bi_iter.bi_size = RAID5_STRIPE_SIZE(conf);
1214-
bi->bi_write_hint = sh->dev[i].write_hint;
1215-
if (!rrdev)
1216-
sh->dev[i].write_hint = RWH_WRITE_LIFE_NOT_SET;
12171214
/*
12181215
* If this is discard request, set bi_vcnt 0. We don't
12191216
* want to confuse SCSI because SCSI will replace payload
@@ -1264,8 +1261,6 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s)
12641261
rbi->bi_io_vec[0].bv_len = RAID5_STRIPE_SIZE(conf);
12651262
rbi->bi_io_vec[0].bv_offset = sh->dev[i].offset;
12661263
rbi->bi_iter.bi_size = RAID5_STRIPE_SIZE(conf);
1267-
rbi->bi_write_hint = sh->dev[i].write_hint;
1268-
sh->dev[i].write_hint = RWH_WRITE_LIFE_NOT_SET;
12691264
/*
12701265
* If this is discard request, set bi_vcnt 0. We don't
12711266
* want to confuse SCSI because SCSI will replace payload
@@ -3407,7 +3402,6 @@ static int add_stripe_bio(struct stripe_head *sh, struct bio *bi, int dd_idx,
34073402
(unsigned long long)sh->sector);
34083403

34093404
spin_lock_irq(&sh->stripe_lock);
3410-
sh->dev[dd_idx].write_hint = bi->bi_write_hint;
34113405
/* Don't allow new IO added to stripes in batch list */
34123406
if (sh->batch_head)
34133407
goto overlap;

0 commit comments

Comments
 (0)