Skip to content

Commit dca28fb

Browse files
committed
Merge branch 'for-6.17/block' into for-next
* for-6.17/block: (38 commits) block: remove pktcdvd driver ublk: introduce and use ublk_set_canceling helper ublk: speed up ublk server exit handling zram: pass buffer offset to zcomp_available_show() block: zram: replace scnprintf() with sysfs_emit() in *_show() functions bcache: switch from pages to folios in read_super() virtio: blk/scsi: use block layer helpers to calculate num of queues scsi: use block layer helpers to calculate num of queues nvme-pci: use block layer helpers to calculate num of queues blk-mq: add number of queue calc helper lib/group_cpus: Let group_cpu_evenly() return the number of initialized masks ublk: cache-align struct ublk_io ublk: remove ubq checks from ublk_{get,put}_req_ref() ublk: optimize UBLK_IO_UNREGISTER_IO_BUF on daemon task ublk: optimize UBLK_IO_REGISTER_IO_BUF on daemon task ublk: return early if blk_should_fake_timeout() ublk: allow UBLK_IO_(UN)REGISTER_IO_BUF on any task ublk: don't take ublk_queue in ublk_unregister_io_buf() ublk: consolidate UBLK_IO_FLAG_{ACTIVE,OWNED_BY_SRV} checks ublk: remove task variable from __ublk_ch_uring_cmd() ...
2 parents b27917a + 1cea518 commit dca28fb

39 files changed

Lines changed: 1102 additions & 3950 deletions

Documentation/ABI/testing/debugfs-pktcdvd

Lines changed: 0 additions & 18 deletions
This file was deleted.

Documentation/ABI/testing/sysfs-class-pktcdvd

Lines changed: 0 additions & 97 deletions
This file was deleted.

Documentation/cdrom/packet-writing.rst

Lines changed: 0 additions & 139 deletions
This file was deleted.

Documentation/userspace-api/ioctl/ioctl-number.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ Code Seq# Include File Comments
220220
include/linux/falloc.h,
221221
linux/fs.h,
222222
'X' all fs/ocfs2/ocfs_fs.h conflict!
223-
'X' 01 linux/pktcdvd.h conflict!
224223
'Z' 14-15 drivers/message/fusion/mptctl.h
225224
'[' 00-3F linux/usb/tmc.h USB Test and Measurement Devices
226225

MAINTAINERS

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19700,13 +19700,6 @@ S: Supported
1970019700
F: Documentation/devicetree/bindings/input/pine64,pinephone-keyboard.yaml
1970119701
F: drivers/input/keyboard/pinephone-keyboard.c
1970219702

19703-
PKTCDVD DRIVER
19704-
19705-
S: Orphan
19706-
F: drivers/block/pktcdvd.c
19707-
F: include/linux/pktcdvd.h
19708-
F: include/uapi/linux/pktcdvd.h
19709-
1971019703
PLANTOWER PMS7003 AIR POLLUTION SENSOR DRIVER
1971119704
M: Tomasz Duszynski <[email protected]>
1971219705
S: Maintained

block/bio-integrity.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ int bio_integrity_add_page(struct bio *bio, struct page *page,
128128
if (bip->bip_vcnt > 0) {
129129
struct bio_vec *bv = &bip->bip_vec[bip->bip_vcnt - 1];
130130

131+
if (!zone_device_pages_have_same_pgmap(bv->bv_page, page))
132+
return 0;
133+
131134
if (bvec_try_merge_hw_page(q, bv, page, len, offset)) {
132135
bip->bip_iter.bi_size += len;
133136
return len;

block/bio.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -930,8 +930,6 @@ static bool bvec_try_merge_page(struct bio_vec *bv, struct page *page,
930930
return false;
931931
if (xen_domain() && !xen_biovec_phys_mergeable(bv, page))
932932
return false;
933-
if (!zone_device_pages_have_same_pgmap(bv->bv_page, page))
934-
return false;
935933

936934
if ((vec_end_addr & PAGE_MASK) != ((page_addr + off) & PAGE_MASK)) {
937935
if (IS_ENABLED(CONFIG_KMSAN))
@@ -982,6 +980,9 @@ void __bio_add_page(struct bio *bio, struct page *page,
982980
WARN_ON_ONCE(bio_flagged(bio, BIO_CLONED));
983981
WARN_ON_ONCE(bio_full(bio, len));
984982

983+
if (is_pci_p2pdma_page(page))
984+
bio->bi_opf |= REQ_P2PDMA | REQ_NOMERGE;
985+
985986
bvec_set_page(&bio->bi_io_vec[bio->bi_vcnt], page, len, off);
986987
bio->bi_iter.bi_size += len;
987988
bio->bi_vcnt++;
@@ -1022,11 +1023,16 @@ int bio_add_page(struct bio *bio, struct page *page,
10221023
if (bio->bi_iter.bi_size > UINT_MAX - len)
10231024
return 0;
10241025

1025-
if (bio->bi_vcnt > 0 &&
1026-
bvec_try_merge_page(&bio->bi_io_vec[bio->bi_vcnt - 1],
1027-
page, len, offset)) {
1028-
bio->bi_iter.bi_size += len;
1029-
return len;
1026+
if (bio->bi_vcnt > 0) {
1027+
struct bio_vec *bv = &bio->bi_io_vec[bio->bi_vcnt - 1];
1028+
1029+
if (!zone_device_pages_have_same_pgmap(bv->bv_page, page))
1030+
return 0;
1031+
1032+
if (bvec_try_merge_page(bv, page, len, offset)) {
1033+
bio->bi_iter.bi_size += len;
1034+
return len;
1035+
}
10301036
}
10311037

10321038
if (bio->bi_vcnt >= bio->bi_max_vecs)

block/blk-mq-cpumap.c

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,64 @@
1212
#include <linux/cpu.h>
1313
#include <linux/group_cpus.h>
1414
#include <linux/device/bus.h>
15+
#include <linux/sched/isolation.h>
1516

1617
#include "blk.h"
1718
#include "blk-mq.h"
1819

20+
static unsigned int blk_mq_num_queues(const struct cpumask *mask,
21+
unsigned int max_queues)
22+
{
23+
unsigned int num;
24+
25+
num = cpumask_weight(mask);
26+
return min_not_zero(num, max_queues);
27+
}
28+
29+
/**
30+
* blk_mq_num_possible_queues - Calc nr of queues for multiqueue devices
31+
* @max_queues: The maximum number of queues the hardware/driver
32+
* supports. If max_queues is 0, the argument is
33+
* ignored.
34+
*
35+
* Calculates the number of queues to be used for a multiqueue
36+
* device based on the number of possible CPUs.
37+
*/
38+
unsigned int blk_mq_num_possible_queues(unsigned int max_queues)
39+
{
40+
return blk_mq_num_queues(cpu_possible_mask, max_queues);
41+
}
42+
EXPORT_SYMBOL_GPL(blk_mq_num_possible_queues);
43+
44+
/**
45+
* blk_mq_num_online_queues - Calc nr of queues for multiqueue devices
46+
* @max_queues: The maximum number of queues the hardware/driver
47+
* supports. If max_queues is 0, the argument is
48+
* ignored.
49+
*
50+
* Calculates the number of queues to be used for a multiqueue
51+
* device based on the number of online CPUs.
52+
*/
53+
unsigned int blk_mq_num_online_queues(unsigned int max_queues)
54+
{
55+
return blk_mq_num_queues(cpu_online_mask, max_queues);
56+
}
57+
EXPORT_SYMBOL_GPL(blk_mq_num_online_queues);
58+
1959
void blk_mq_map_queues(struct blk_mq_queue_map *qmap)
2060
{
2161
const struct cpumask *masks;
22-
unsigned int queue, cpu;
62+
unsigned int queue, cpu, nr_masks;
2363

24-
masks = group_cpus_evenly(qmap->nr_queues);
64+
masks = group_cpus_evenly(qmap->nr_queues, &nr_masks);
2565
if (!masks) {
2666
for_each_possible_cpu(cpu)
2767
qmap->mq_map[cpu] = qmap->queue_offset;
2868
return;
2969
}
3070

3171
for (queue = 0; queue < qmap->nr_queues; queue++) {
32-
for_each_cpu(cpu, &masks[queue])
72+
for_each_cpu(cpu, &masks[queue % nr_masks])
3373
qmap->mq_map[cpu] = qmap->queue_offset + queue;
3474
}
3575
kfree(masks);

0 commit comments

Comments
 (0)