linux-stable/drivers/block
Julien Grall 6cc5683390 xen/blkfront: Handle non-indirect grant with 64KB pages
The minimal size of request in the block framework is always PAGE_SIZE.
It means that when 64KB guest is support, the request will at least be
64KB.

Although, if the backend doesn't support indirect descriptor (such as QDISK
in QEMU), a ring request is only able to accommodate 11 segments of 4KB
(i.e 44KB).

The current frontend is assuming that an I/O request will always fit in
a ring request. This is not true any more when using 64KB page
granularity and will therefore crash during boot.

On ARM64, the ABI is completely neutral to the page granularity used by
the domU. The guest has the choice between different page granularity
supported by the processors (for instance on ARM64: 4KB, 16KB, 64KB).
This can't be enforced by the hypervisor and therefore it's possible to
run guests using different page granularity.

So we can't mandate the block backend to support indirect descriptor
when the frontend is using 64KB page granularity and have to fix it
properly in the frontend.

The solution exposed below is based on modifying directly the frontend
guest rather than asking the block framework to support smaller size
(i.e < PAGE_SIZE). This is because the change is the block framework are
not trivial as everything seems to relying on a struct *page (see [1]).
Although, it may be possible that someone succeed to do it in the future
and we would therefore be able to use it.

Given that a block request may not fit in a single ring request, a
second request is introduced for the data that cannot fit in the first
one. This means that the second ring request should never be used on
Linux if the page size is smaller than 44KB.

To achieve the support of the extra ring request, the block queue size
is divided by two. Therefore, the ring will always contain enough space
to accommodate 2 ring requests. While this will reduce the overall
performance, it will make the implementation more contained. The way
forward to get better performance is to implement in the backend either
indirect descriptor or multiple grants ring.

Note that the parameters blk_queue_max_* helpers haven't been updated.
The block code will set the mimimum size supported and we may be able
to support directly any change in the block framework that lower down
the minimal size of a request.

[1] http://lists.xen.org/archives/html/xen-devel/2015-08/msg02200.html

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2016-01-04 12:21:25 -05:00
..
aoe Revert "block: remove artifical max_hw_sectors cap" 2015-08-18 13:21:13 -07:00
drbd drbd: fix error path during resize 2015-11-25 09:22:03 -07:00
mtip32xx mtip32xx: use formatting capability of kthread_create_on_node 2015-11-20 08:46:50 -07:00
paride mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM 2015-11-06 17:50:42 -08:00
rsxx block: change ->make_request_fn() and users to return a queue cookie 2015-11-07 10:40:46 -07:00
xen-blkback xen-blkback: clear PF_NOFREEZE for xen_blkif_schedule() 2016-01-04 12:21:24 -05:00
zram Merge branch 'for-4.4/io-poll' of git://git.kernel.dk/linux-block 2015-11-10 17:23:49 -08:00
amiflop.c block: drop owner assignment from platform_drivers 2014-10-20 16:20:18 +02:00
ataflop.c Merge branch 'for-3.16/core' of git://git.kernel.dk/linux-block into next 2014-06-02 09:29:34 -07:00
brd.c brd: Refuse improperly aligned discard requests 2015-11-11 09:36:56 -07:00
cciss.c cciss: correct the non-resettable board list 2015-05-31 11:14:34 -07:00
cciss.h
cciss_cmd.h
cciss_scsi.c scsi: Do not set cmd_per_lun to 1 in the host template 2015-05-31 18:06:28 -07:00
cciss_scsi.h
cpqarray.c genirq: Remove the deprecated 'IRQF_DISABLED' request_irq() flag entirely 2015-03-05 20:53:06 +01:00
cpqarray.h
cryptoloop.c
DAC960.c block: use pci_zalloc_consistent 2014-08-08 15:57:28 -07:00
DAC960.h
floppy.c block: add a bi_error field to struct bio 2015-07-29 08:55:15 -06:00
hd.c block: hd: remove deprecated IRQF_DISABLED 2014-10-01 08:16:07 -06:00
ida_cmd.h
ida_ioctl.h
Kconfig nvme: move to a new drivers/nvme/host directory 2015-10-09 10:40:37 -06:00
loop.c Merge branch 'for-4.4/core' into for-4.4/drivers 2015-10-09 10:40:29 -06:00
loop.h block: loop: support DIO & AIO 2015-09-23 11:01:16 -06:00
Makefile nvme: move to a new drivers/nvme/host directory 2015-10-09 10:40:37 -06:00
mg_disk.c block: drop owner assignment from platform_drivers 2014-10-20 16:20:18 +02:00
nbd.c signal: turn dequeue_signal_lock() into kernel_dequeue_signal() 2015-11-06 17:50:42 -08:00
null_blk.c null_blk: do not del gendisk with lightnvm 2015-11-19 15:15:56 -07:00
osdblk.c mm, page_alloc: distinguish between being unable to sleep, unwilling to sleep and avoiding waking kswapd 2015-11-06 17:50:42 -08:00
pktcdvd.c Merge branch 'for-4.4/io-poll' of git://git.kernel.dk/linux-block 2015-11-10 17:23:49 -08:00
ps3disk.c block: Kill bio_segments()/bi_vcnt usage 2013-11-23 22:33:51 -08:00
ps3vram.c block: change ->make_request_fn() and users to return a queue cookie 2015-11-07 10:40:46 -07:00
rbd.c rbd: remove duplicate calls to rbd_dev_mapping_clear() 2015-11-02 23:36:48 +01:00
rbd_types.h
skd_main.c block: have drivers use blk_queue_max_discard_sectors() 2015-07-17 08:41:53 -06:00
skd_s1120.h skd: fix formatting in skd_s1120.h 2013-11-08 09:10:30 -07:00
smart1,2.h
sunvdc.c sunvdc: reconnect ldc after vds service domain restarts 2014-12-11 18:52:45 -08:00
swim.c block: drop owner assignment from platform_drivers 2014-10-20 16:20:18 +02:00
swim3.c powerpc: Move Power Macintosh drivers to generic byteswappers 2015-03-23 14:29:40 +11:00
swim_asm.S
sx8.c sx8: use real time for the command seconds 2015-12-23 08:42:59 -07:00
umem.c block: change ->make_request_fn() and users to return a queue cookie 2015-11-07 10:40:46 -07:00
umem.h
virtio_blk.c blk-mq: fix racy updates of rq->errors 2015-10-01 10:10:55 +02:00
xen-blkfront.c xen/blkfront: Handle non-indirect grant with 64KB pages 2016-01-04 12:21:25 -05:00
xsysace.c block: systemace: Remove .owner field for driver 2014-08-21 20:37:54 -05:00
z2ram.c block: remove struct request buffer member 2014-04-15 14:03:02 -06:00