* Re: [PATCH v4] mmc: sdio: check the buffer address for sdio API
From: Jens Axboe @ 2017-02-14 16:18 UTC (permalink / raw)
To: Ulf Hansson, Shawn Lin
Cc: linux-mmc@vger.kernel.org, Russell King, Christoph Hellwig,
linux-block
In-Reply-To: <CAPDyKFqS+OgmweTySyer422TfkWZrXMrQeuiymQ0HjqiZAdJzg@mail.gmail.com>
On 02/14/2017 02:17 AM, Ulf Hansson wrote:
> +Russell, Jens, Christoph, linux-block (asking for help in review)
>
> On 7 February 2017 at 01:54, Shawn Lin <shawn.lin@rock-chips.com> wrote:
>> It's fine if the host driver use PIO mode to transfer the
>> vmalloc area buffer but not for DMA mode. The sdio APIs haven't
>> provide the capability to tell the caller whether it will use DMA
>> to finish the IO transfer or not, so don't give the randomly
>> insmoded sdio function driver the possibility to break the kernel.
>> Also the APIs shouldn't take the liberty to do a copy for these
>> cases and just kick out these requests should be enough.
>>
>> This issue is observed by doing insmod a downloaded wifi module
>> driver and the kernel panic right away. Unfortunately we don't have
>> the source code but adding this patch that it proves that the module
>> driver was passing on a vmalloc area buffer for sdio APIs.
>>
>> It could very easy to be reproduced by writing a simple function
>> module driver and insmod it, and panic log looks like:
>>
>> unsigned u8 __aligned(32) buf[PAGE_SIZE];
>>
>> static int wifi_probe(struct sdio_func *func, const struct
>> sdio_device_id *id)
>> {
>> sdio_claim_host(func);
>> sdio_enable_func(func);
>> sdio_memcpy_toio(func, 0x0, buf, 0x200);
>> }
>>
>> [ 236.748210] wifi_probe: buf = 0xffffff8000a40b80
>> [ 236.748258] swiotlb_tbl_map_single: orig_addr = 0xfffffffff8c40b80,
>> tlb_addr = 0xf7eae000 //I added log here
>> [ 236.748276] Unable to handle kernel paging request at virtual address
>> fffffffff8c40b80
>> [ 236.776486] pgd = ffffffc0b3417000
>> [ 236.776789] [fffffffff8c40b80] *pgd=00000000b3427003,
>> *pud=00000000b3427003, *pmd=0000000000000000
>> [ 236.777601] Internal error: Oops: 96000005 [#1] PREEMPT SMP
>> [ 236.778093] Modules linked in: drvtst(O+)
>> [ 236.778463] CPU: 0 PID: 1918 Comm: insmod Tainted: G O
>> 4.4.36 #25
>> [ 236.779096] Hardware name: Rockchip RK3399 Evaluation Board v3 edp
>> (Android) (DT)
>> [ 236.779753] task: ffffffc0e3db0c40 ti: ffffffc0b342c000 task.ti:
>> ffffffc0b342c000
>> [ 236.780418] PC is at __memcpy+0x100/0x180
>> [ 236.780777] LR is at swiotlb_tbl_map_single+0x254/0x274
>> [ 236.781237] pc : [<ffffff80083579c0>] lr : [<ffffff800837cf70>]
>> ...
>>
>> [ 236.941392] f460: 3d20726464615f67 6666666666783020
>> [ 236.941826] [<ffffff80083579c0>] __memcpy+0x100/0x180
>> [ 236.942274] [<ffffff800837dc18>] swiotlb_map_sg_attrs+0xa8/0x170
>> [ 236.942810] [<ffffff800809359c>] __swiotlb_map_sg_attrs+0x24/0x8c
>> [ 236.943353] [<ffffff800871113c>]
>> dw_mci_pre_dma_transfer.isra.16+0xf0/0x11c
>> [ 236.943967] [<ffffff80087129cc>] __dw_mci_start_request+0x17c/0x4d0
>> [ 236.944520] [<ffffff80087132e0>] dw_mci_request+0xb8/0xf0
>> [ 236.945002] [<ffffff80086f8b44>] __mmc_start_request+0x9c/0xc0
>> [ 236.945520] [<ffffff80087ae0e8>]
>> mmc_start_request.part.17+0x100/0x11c
>> [ 236.946097] [<ffffff80086f9c74>] mmc_wait_for_req+0x78/0x1a8
>> [ 236.946600] [<ffffff800870421c>] mmc_io_rw_extended+0x27c/0x2fc
>> [ 236.947124] [<ffffff8008705800>] sdio_io_rw_ext_helper+0x1e4/0x238
>> [ 236.947670] [<ffffff8008705954>] sdio_memcpy_toio+0x24/0x2c
>> [ 236.948169] [<ffffff8000a40108>] wifi_probe+0xa8/0x198 [drvtst]
>> [ 236.948708] [<ffffff8008704734>] sdio_bus_probe+0xb0/0x140
>> [ 236.949195] [<ffffff80084bfd6c>] driver_probe_device+0x118/0x2b0
>> [ 236.949724] [<ffffff80084bff68>] __driver_attach+0x64/0x90
>> [ 236.950212] [<ffffff80084bee18>] bus_for_each_dev+0x80/0xb0
>> [ 236.950706] [<ffffff80084bf8ac>] driver_attach+0x20/0x28
>> [ 236.951176] [<ffffff80084bf45c>] bus_add_driver+0xe8/0x1ec
>> [ 236.951661] [<ffffff80084c0afc>] driver_register+0x98/0xe4
>> [ 236.952147] [<ffffff8008704580>] sdio_register_driver+0x24/0x2c
>> [ 236.952675] [<ffffff8000a40228>] wifi_sdio_init+0x30/0x68 [drvtst]
>> [ 236.953241] [<ffffff8000a4400c>] wifi_drv_init+0xc/0x38 [drvtst]
>> [ 236.953789] [<ffffff8008082ba4>] do_one_initcall+0x17c/0x198
>> [ 236.954293] [<ffffff800815e564>] do_init_module+0x60/0x1b8
>> [ 236.954779] [<ffffff80081150f0>] load_module+0x1660/0x1a50
>> [ 236.955264] [<ffffff800811562c>] SyS_init_module+0x14c/0x180
>> [ 236.955765] [<ffffff80080826f0>] el0_svc_naked+0x24/0x28
>>
>> So the kernel crash since the vmalloc area buffer, on-stack buffer or
>> the on-module buffer aren't physical continuous and swiotlb couldn't find
>> the correct mapping address in fact. Anyway, don't give the chance to panic
>> kernel by using sdio APIs.
>>
>> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
>>
>> ---
>>
>> Changes in v4:
>> - fix build warning by gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
>>
>> Changes in v3:
>> - fix build issue reported by Kbuild Robot
>>
>> Changes in v2:
>> - add new function to check the addr of vmalloc/module/stack
>>
>> drivers/mmc/core/sdio_io.c | 16 +++++++++++++++-
>> 1 file changed, 15 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/core/sdio_io.c b/drivers/mmc/core/sdio_io.c
>> index 406e5f0..4df7c6f 100644
>> --- a/drivers/mmc/core/sdio_io.c
>> +++ b/drivers/mmc/core/sdio_io.c
>> @@ -10,6 +10,7 @@
>> */
>>
>> #include <linux/export.h>
>> +#include <linux/mm.h>
>> #include <linux/mmc/host.h>
>> #include <linux/mmc/card.h>
>> #include <linux/mmc/sdio.h>
>> @@ -298,6 +299,19 @@ unsigned int sdio_align_size(struct sdio_func *func, unsigned int sz)
>> }
>> EXPORT_SYMBOL_GPL(sdio_align_size);
>>
>> +static int sdio_io_addr_sanity_check(void *buf)
>> +{
>> +#if defined(CONFIG_MODULES) && defined(MODULES_VADDR)
>> + unsigned long addr = (unsigned long)buf;
>> +
>> + if ((addr >= MODULES_VADDR && addr < MODULES_END) ||
>> + object_is_on_stack(buf))
>> + return 1;
>> +#endif
>> + return (is_vmalloc_addr(buf) || object_is_on_stack(buf));
>> +
>> +}
>> +
>> /* Split an arbitrarily sized data transfer into several
>> * IO_RW_EXTENDED commands. */
>> static int sdio_io_rw_ext_helper(struct sdio_func *func, int write,
>> @@ -307,7 +321,7 @@ static int sdio_io_rw_ext_helper(struct sdio_func *func, int write,
>> unsigned max_blocks;
>> int ret;
>>
>> - if (!func || (func->num > 7))
>> + if (!func || (func->num > 7) || sdio_io_addr_sanity_check(buf))
>> return -EINVAL;
>>
>> /* Do the bulk of the transfer using block mode (if supported). */
>> --
>> 1.9.1
>>
>>
>
> I somewhat understand the issue you are trying to solve when
> validating the buffer for DMA. However, I don't know what a proper fix
> should be. Especially since I have seen nothing similar in the kernel
> so far.
>
> Therefore I have looped in Russell King, Jens Axboe, Christoph Hellwig
> and linux-block to ask for help in reviewing this. Hopefully we can
> get some advise here.
>
> To give some more background to the folkz above, the SDIO func API
> (part of the MMC subsystem) is intended to be used by for example WLAN
> drivers, which may be built as kernel modules. Part of SDIO func API
> is about writing/reading buffers to/from an SDIO card. That may
> involve doing DMA transactions, depending on what the corresponding
> MMC/SDIO host controller/driver supports.
The current situation seems like a bit of a mess. Why don't you have two
entry points, one for DMA and one for PIO. If the caller doesn't know if
he can use DMA, he'd better call the PIO variant. Either that, or audit
all callers and ensure they do the right thing wrt having a dma capable
buffer.
A check for can-do-dma should be restricted to size/alignment
constraints based on the hardware, not try and catch all weird cases of
whether or not that buffer is on the stack, heap, etc.
--
Jens Axboe
^ permalink raw reply
* Re: [PATCH v1 1/5] block: introduce bio_clone_bioset_partial()
From: Christoph Hellwig @ 2017-02-14 16:01 UTC (permalink / raw)
To: Ming Lei
Cc: Christoph Hellwig, Shaohua Li, Jens Axboe,
Linux Kernel Mailing List,
open list:SOFTWARE RAID (Multiple Disks) SUPPORT, linux-block,
NeilBrown
In-Reply-To: <CACVXFVNN3Gtm4Ut5KCmx8REbMYnh3Y2+sAZPto7F40fvGyZ=zw@mail.gmail.com>
On Tue, Feb 14, 2017 at 09:04:26AM +0800, Ming Lei wrote:
> On Mon, Feb 13, 2017 at 9:46 PM, Christoph Hellwig <hch@infradead.org> wrote:
> > On Fri, Feb 10, 2017 at 06:56:13PM +0800, Ming Lei wrote:
> >> md still need bio clone(not the fast version) for behind write,
> >> and it is more efficient to use bio_clone_bioset_partial().
> >>
> >> The idea is simple and just copy the bvecs range specified from
> >> parameters.
> >
> > Given how few users bio_clone_bioset has I wonder if we shouldn't
> > simply add the two new arguments to it instead of adding another
> > indirection.
>
> For md write-behind, looks we have to provide the two arguments,
> could you explain a bit how we can do that by adding another indirection?
I meant to just pass the additional arguments that
bio_clone_bioset_partial has to bio_clone_bioset.
^ permalink raw reply
* Re: [PATCH v2 5/5] md: fast clone bio in bio_clone_mddev()
From: Christoph Hellwig @ 2017-02-14 16:01 UTC (permalink / raw)
To: Ming Lei
Cc: Shaohua Li, Jens Axboe, linux-kernel, linux-raid, linux-block,
Christoph Hellwig, NeilBrown
In-Reply-To: <1487086143-10255-6-git-send-email-tom.leiming@gmail.com>
On Tue, Feb 14, 2017 at 11:29:03PM +0800, Ming Lei wrote:
> Firstly bio_clone_mddev() is used in raid normal I/O and isn't
> in resync I/O path.
>
> Secondly all the direct access to bvec table in raid happens on
> resync I/O except for write behind of raid1, in which we still
> use bio_clone() for allocating new bvec table.
>
> So this patch replaces bio_clone() with bio_clone_fast()
> in bio_clone_mddev().
>
> Also kill bio_clone_mddev() and call bio_clone_fast() directly, as
> suggested by Christoph Hellwig.
>
> Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Looks fine,
Reviewed-by: Christoph Hellwig <hch@lst.de>
Btw, can you also tack on another patch to kill bio_alloc_mddev
to be consistent?
^ permalink raw reply
* RE: Boot regression (was "Re: [PATCH] genhd: Do not hold event lock when scheduling workqueue elements")
From: Dexuan Cui @ 2017-02-14 15:54 UTC (permalink / raw)
To: hch@lst.de
Cc: Jens Axboe, Bart Van Assche, hare@suse.com, hare@suse.de,
Martin K. Petersen, linux-kernel@vger.kernel.org,
linux-block@vger.kernel.org, jth@kernel.org, Nick Meier,
Alex Ng (LIS), Long Li, Adrian Suhov (Cloudbase Solutions SRL),
Chris Valean (Cloudbase Solutions SRL)
In-Reply-To: <20170214145101.GA21427@lst.de>
[-- Attachment #1: Type: text/plain, Size: 2451 bytes --]
> From: hch@lst.de [mailto:hch@lst.de]
> Sent: Tuesday, February 14, 2017 22:51
> To: Dexuan Cui <decui@microsoft.com>
> Cc: hch@lst.de; Jens Axboe <axboe@kernel.dk>; Bart Van Assche
> <Bart.VanAssche@sandisk.com>; hare@suse.com; hare@suse.de; Martin K.
> Petersen <martin.petersen@oracle.com>; linux-kernel@vger.kernel.org;
> linux-block@vger.kernel.org; jth@kernel.org; Nick Meier
> <Nick.Meier@microsoft.com>; Alex Ng (LIS) <alexng@microsoft.com>; Long Li
> <longli@microsoft.com>; Adrian Suhov (Cloudbase Solutions SRL) <v-
> adsuho@microsoft.com>; Chris Valean (Cloudbase Solutions SRL) <v-
> chvale@microsoft.com>
> Subject: Re: Boot regression (was "Re: [PATCH] genhd: Do not hold event lock
> when scheduling workqueue elements")
>
> On Tue, Feb 14, 2017 at 02:46:41PM +0000, Dexuan Cui wrote:
> > > From: hch@lst.de [mailto:hch@lst.de]
> > > Sent: Tuesday, February 14, 2017 22:29
> > > To: Dexuan Cui <decui@microsoft.com>
> > > Subject: Re: Boot regression (was "Re: [PATCH] genhd: Do not hold event
> lock
> > > when scheduling workqueue elements")
> > >
> > > Ok, thanks for testing. Can you try the patch below? It fixes a
> > > clear problem which was partially papered over before the commit
> > > you bisected to, although it can't explain why blk-mq still works.
> >
> > Still bad luck. :-(
> >
> > BTW, I'm using the first "bad" commit (scsi: allocate scsi_cmnd structures
> as
> > part of struct request) + the 2 patches you provided today.
> >
> > I suppose I don't need to test the 2 patches on the latest linux-next repo.
>
> I'd love a test on that repo actually. We had a few other for sense
> handling since then I think.
I tested today's linux-next (next-20170214) + the 2 patches just now and got
a weird result:
sometimes the VM stills hung with a new calltrace (BUG: spinlock bad
magic) , but sometimes the VM did boot up despite the new calltrace!
Attached is the log of a "good" boot.
It looks we have a memory corruption issue somewhere...
Actually previously I saw the "BUG: spinlock bad magic" message once, but I
couldn't repro it later, so I didn't mention it to you.
The good news is that now I can repro the "spinlock bad magic" message
every time.
I tried to dig into this by enabling Kernel hacking -> Memory debugging,
but didn't find anything abnormal.
Is it possible that the SCSI layer passes a wrong memory address?
Thanks,
-- Dexuan
[-- Attachment #2: dmesg.log --]
[-- Type: application/octet-stream, Size: 31337 bytes --]
[ 0.000000] Linux version 4.10.0-rc8-next-20170214+ (root@decui-u1604) (gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2.1) ) #1 SMP Tue Feb 14 23:10:48 CST 2017
[ 0.000000] Command line: BOOT_IMAGE=/boot/hv/bzImage root=UUID=f07ac67a-0109-4738-a388-100218d2c5d2 ro ignore_loglevel scsi_mod.use_blk_mq=N
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format.
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000e0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000003ffeffff] usable
[ 0.000000] BIOS-e820: [mem 0x000000003fff0000-0x000000003fffefff] ACPI data
[ 0.000000] BIOS-e820: [mem 0x000000003ffff000-0x000000003fffffff] ACPI NVS
[ 0.000000] debug: ignoring loglevel setting.
[ 0.000000] NX (Execute Disable) protection: active
[ 0.000000] SMBIOS 2.3 present.
[ 0.000000] DMI: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS 090006 04/28/2016
[ 0.000000] Hypervisor detected: Microsoft HyperV
[ 0.000000] HyperV: features 0x2e7f, hints 0xc2c
[ 0.000000] Hyper-V Host Build:14393-10.0-0-0.576
[ 0.000000] HyperV: LAPIC Timer Frequency: 0xc3500
[ 0.000000] tsc: Marking TSC unstable due to running on Hyper-V
[ 0.000000] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[ 0.000000] e820: remove [mem 0x000a0000-0x000fffff] usable
[ 0.000000] e820: last_pfn = 0x3fff0 max_arch_pfn = 0x400000000
[ 0.000000] MTRR default type: uncachable
[ 0.000000] MTRR fixed ranges enabled:
[ 0.000000] 00000-9FFFF write-back
[ 0.000000] A0000-DFFFF uncachable
[ 0.000000] E0000-FFFFF write-back
[ 0.000000] MTRR variable ranges enabled:
[ 0.000000] 0 base 00000000000 mask FFF00000000 write-back
[ 0.000000] 1 disabled
[ 0.000000] 2 disabled
[ 0.000000] 3 disabled
[ 0.000000] 4 disabled
[ 0.000000] 5 disabled
[ 0.000000] 6 disabled
[ 0.000000] 7 disabled
[ 0.000000] x86/PAT: Configuration [0-7]: WB WC UC- UC WB WC UC- WT
[ 0.000000] found SMP MP-table at [mem 0x000ff780-0x000ff78f] mapped at [ffff9539400ff780]
[ 0.000000] Scanning 1 areas for low memory corruption
[ 0.000000] Base memory trampoline at [ffff953940099000] 99000 size 24576
[ 0.000000] BRK [0x0e91c000, 0x0e91cfff] PGTABLE
[ 0.000000] BRK [0x0e91d000, 0x0e91dfff] PGTABLE
[ 0.000000] BRK [0x0e91e000, 0x0e91efff] PGTABLE
[ 0.000000] BRK [0x0e91f000, 0x0e91ffff] PGTABLE
[ 0.000000] BRK [0x0e920000, 0x0e920fff] PGTABLE
[ 0.000000] RAMDISK: [mem 0x2fde8000-0x33eebfff]
[ 0.000000] ACPI: Early table checksum verification disabled
[ 0.000000] ACPI: RSDP 0x00000000000F56F0 000014 (v00 ACPIAM)
[ 0.000000] ACPI: RSDT 0x000000003FFF0000 000040 (v01 VRTUAL MICROSFT 04001628 MSFT 00000097)
[ 0.000000] ACPI: FACP 0x000000003FFF0200 000081 (v02 VRTUAL MICROSFT 04001628 MSFT 00000097)
[ 0.000000] ACPI: DSDT 0x000000003FFF1724 0033BE (v01 MSFTVM MSFTVM02 00000002 INTL 02002026)
[ 0.000000] ACPI: FACS 0x000000003FFFF000 000040
[ 0.000000] ACPI: WAET 0x000000003FFF1480 000028 (v01 VRTUAL MICROSFT 04001628 MSFT 00000097)
[ 0.000000] ACPI: SLIC 0x000000003FFF14C0 000176 (v01 VRTUAL MICROSFT 04001628 MSFT 00000097)
[ 0.000000] ACPI: OEM0 0x000000003FFF16C0 000064 (v01 VRTUAL MICROSFT 04001628 MSFT 00000097)
[ 0.000000] ACPI: SRAT 0x000000003FFF0600 0000E0 (v02 VRTUAL MICROSFT 00000001 MSFT 00000001)
[ 0.000000] ACPI: APIC 0x000000003FFF0300 000252 (v01 VRTUAL MICROSFT 04001628 MSFT 00000097)
[ 0.000000] ACPI: OEMB 0x000000003FFFF040 000064 (v01 VRTUAL MICROSFT 04001628 MSFT 00000097)
[ 0.000000] ACPI: Local APIC address 0xfee00000
[ 0.000000] SRAT: PXM 0 -> APIC 0x00 -> Node 0
[ 0.000000] ACPI: SRAT: Node 0 PXM 0 [mem 0x00000000-0x3fffffff] hotplug
[ 0.000000] ACPI: SRAT: Node 0 PXM 0 [mem 0x40200000-0xf7ffffff] hotplug
[ 0.000000] ACPI: SRAT: Node 0 PXM 0 [mem 0x100000000-0xfdfffffff] hotplug
[ 0.000000] ACPI: SRAT: Node 0 PXM 0 [mem 0x1000000000-0xffffffffff] hotplug
[ 0.000000] NODE_DATA(0) allocated [mem 0x3ffec000-0x3ffeffff]
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000000001000-0x0000000000ffffff]
[ 0.000000] DMA32 [mem 0x0000000001000000-0x000000003ffeffff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000001000-0x000000000009efff]
[ 0.000000] node 0: [mem 0x0000000000100000-0x000000003ffeffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000001000-0x000000003ffeffff]
[ 0.000000] On node 0 totalpages: 262030
[ 0.000000] DMA zone: 64 pages used for memmap
[ 0.000000] DMA zone: 21 pages reserved
[ 0.000000] DMA zone: 3998 pages, LIFO batch:0
[ 0.000000] DMA32 zone: 4032 pages used for memmap
[ 0.000000] DMA32 zone: 258032 pages, LIFO batch:31
[ 0.000000] ACPI: PM-Timer IO Port: 0x408
[ 0.000000] ACPI: Local APIC address 0xfee00000
[ 0.000000] ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])
[ 0.000000] IOAPIC[0]: apic_id 0, version 17, address 0xfec00000, GSI 0-23
[ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[ 0.000000] ACPI: IRQ0 used by override.
[ 0.000000] ACPI: IRQ9 used by override.
[ 0.000000] Using ACPI (MADT) for SMP configuration information
[ 0.000000] smpboot: Allowing 64 CPUs, 63 hotplug CPUs
[ 0.000000] e820: [mem 0x40000000-0xffffffff] available for PCI devices
[ 0.000000] Booting paravirtualized kernel on bare hardware
[ 0.000000] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645519600211568 ns
[ 0.000000] setup_percpu: NR_CPUS:256 nr_cpumask_bits:256 nr_cpu_ids:64 nr_node_ids:1
[ 0.000000] percpu: Embedded 37 pages/cpu @ffff95397d600000 s112328 r8192 d31032 u262144
[ 0.000000] pcpu-alloc: s112328 r8192 d31032 u262144 alloc=1*2097152
[ 0.000000] pcpu-alloc: [0] 00 01 02 03 04 05 06 07 [0] 08 09 10 11 12 13 14 15
[ 0.000000] pcpu-alloc: [0] 16 17 18 19 20 21 22 23 [0] 24 25 26 27 28 29 30 31
[ 0.000000] pcpu-alloc: [0] 32 33 34 35 36 37 38 39 [0] 40 41 42 43 44 45 46 47
[ 0.000000] pcpu-alloc: [0] 48 49 50 51 52 53 54 55 [0] 56 57 58 59 60 61 62 63
[ 0.000000] Built 1 zonelists in Node order, mobility grouping on. Total pages: 257913
[ 0.000000] Policy zone: DMA32
[ 0.000000] Kernel command line: BOOT_IMAGE=/boot/hv/bzImage root=UUID=f07ac67a-0109-4738-a388-100218d2c5d2 ro ignore_loglevel scsi_mod.use_blk_mq=N
[ 0.000000] log_buf_len individual max cpu contribution: 4096 bytes
[ 0.000000] log_buf_len total cpu_extra contributions: 258048 bytes
[ 0.000000] log_buf_len min size: 262144 bytes
[ 0.000000] log_buf_len: 524288 bytes
[ 0.000000] early log buf free: 254580(97%)
[ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.000000] Memory: 863304K/1048120K available (6896K kernel code, 1440K rwdata, 2784K rodata, 1304K init, 10644K bss, 184816K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=64, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] Build-time adjustment of leaf fanout to 64.
[ 0.000000] RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=64.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=64
[ 0.000000] NR_IRQS:16640 nr_irqs:936 16
[ 0.000000] Offload RCU callbacks from all CPUs
[ 0.000000] Offload RCU callbacks from CPUs: 0-63.
[ 0.000000] Console: colour VGA+ 80x25
[ 0.000000] console [tty0] enabled
[ 0.000000] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
[ 0.000000] ... MAX_LOCKDEP_SUBCLASSES: 8
[ 0.000000] ... MAX_LOCK_DEPTH: 48
[ 0.000000] ... MAX_LOCKDEP_KEYS: 8191
[ 0.000000] ... CLASSHASH_SIZE: 4096
[ 0.000000] ... MAX_LOCKDEP_ENTRIES: 32768
[ 0.000000] ... MAX_LOCKDEP_CHAINS: 65536
[ 0.000000] ... CHAINHASH_SIZE: 32768
[ 0.000000] memory used by lock dependency info: 8127 kB
[ 0.000000] per task-struct memory footprint: 1920 bytes
[ 0.000000] tsc: Fast TSC calibration failed
[ 0.012000] tsc: Unable to calibrate against PIT
[ 0.016000] tsc: using PMTIMER reference calibration
[ 0.016000] tsc: Detected 2600.008 MHz processor
[ 0.016000] Calibrating delay loop (skipped), value calculated using timer frequency.. 5200.01 BogoMIPS (lpj=10400032)
[ 0.016000] pid_max: default: 65536 minimum: 512
[ 0.020112] ACPI: Core revision 20170119
[ 0.025555] ACPI: 1 ACPI AML tables successfully acquired and loaded
[ 0.026775] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
[ 0.028419] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
[ 0.030051] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.030981] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.032912] CPU: Physical Processor ID: 0
[ 0.033859] mce: CPU supports 1 MCE banks
[ 0.034848] Last level iTLB entries: 4KB 512, 2MB 8, 4MB 8
[ 0.036046] Last level dTLB entries: 4KB 512, 2MB 0, 4MB 0, 1GB 4
[ 0.054815] ftrace: allocating 24941 entries in 98 pages
[ 0.069829] smpboot: Max logical packages: 64
[ 0.072084] Switched APIC routing to physical flat.
[ 0.072963] clocksource: hyperv_clocksource_tsc_page: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
[ 0.111150] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[ 0.112225] smpboot: CPU0: Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz (family: 0x6, model: 0x3e, stepping: 0x4)
[ 0.113384] Performance Events: unsupported p6 CPU model 62 no PMU driver, software events only.
[ 0.116871] NMI watchdog: disabled (cpu0): hardware events not enabled
[ 0.117812] NMI watchdog: Shutting down hard lockup detector on all cpus
[ 0.118714] smp: Bringing up secondary CPUs ...
[ 0.119568] smp: Brought up 1 node, 1 CPU
[ 0.120023] smpboot: Total of 1 processors activated (5200.01 BogoMIPS)
[ 0.129001] devtmpfs: initialized
[ 0.130063] x86/mm: Memory block size: 128MB
[ 0.136138] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.137510] pinctrl core: initialized pinctrl subsystem
[ 0.138840] NET: Registered protocol family 16
[ 0.144098] cpuidle: using governor ladder
[ 0.148010] cpuidle: using governor menu
[ 0.148845] PCCT header not found.
[ 0.149763] ACPI: bus type PCI registered
[ 0.152433] PCI: Using configuration type 1 for base access
[ 0.158484] HugeTLB registered 1 GB page size, pre-allocated 0 pages
[ 0.160011] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[ 0.162411] ACPI: Added _OSI(Module Device)
[ 0.164009] ACPI: Added _OSI(Processor Device)
[ 0.164843] ACPI: Added _OSI(3.0 _SCP Extensions)
[ 0.165672] ACPI: Added _OSI(Processor Aggregator Device)
[ 0.176058] ACPI: Interpreter enabled
[ 0.176988] ACPI: (supports S0 S5)
[ 0.177811] ACPI: Using IOAPIC for interrupt routing
[ 0.178691] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[ 0.205665] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
[ 0.206736] acpi PNP0A03:00: _OSC: OS supports [Segments MSI]
[ 0.207608] acpi PNP0A03:00: _OSC failed (AE_NOT_FOUND); disabling ASPM
[ 0.208181] PCI host bridge to bus 0000:00
[ 0.209050] pci_bus 0000:00: root bus resource [mem 0xfe0000000-0xfffffffff window]
[ 0.209979] pci_bus 0000:00: root bus resource [io 0x0000-0x0cf7 window]
[ 0.210833] pci_bus 0000:00: root bus resource [io 0x0d00-0xffff window]
[ 0.212009] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff window]
[ 0.212945] pci_bus 0000:00: root bus resource [mem 0xf8000000-0xfffbffff window]
[ 0.213875] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 0.215031] pci 0000:00:00.0: [8086:7192] type 00 class 0x060000
[ 0.220504] pci 0000:00:07.0: [8086:7110] type 00 class 0x060100
[ 0.225876] pci 0000:00:07.1: [8086:7111] type 00 class 0x010180
[ 0.230354] pci 0000:00:07.1: reg 0x20: [io 0xffa0-0xffaf]
[ 0.232661] pci 0000:00:07.1: legacy IDE quirk: reg 0x10: [io 0x01f0-0x01f7]
[ 0.234841] pci 0000:00:07.1: legacy IDE quirk: reg 0x14: [io 0x03f6]
[ 0.235712] pci 0000:00:07.1: legacy IDE quirk: reg 0x18: [io 0x0170-0x0177]
[ 0.236010] pci 0000:00:07.1: legacy IDE quirk: reg 0x1c: [io 0x0376]
[ 0.239084] pci 0000:00:07.3: [8086:7113] type 00 class 0x068000
[ 0.240088] * Found PM-Timer Bug on the chipset. Due to workarounds for a bug,
* this clock source is slow. Consider trying other clock sources
[ 0.245925] pci 0000:00:07.3: quirk: [io 0x0400-0x043f] claimed by PIIX4 ACPI
[ 0.248454] pci 0000:00:08.0: [1414:5353] type 00 class 0x030000
[ 0.250097] pci 0000:00:08.0: reg 0x10: [mem 0xf8000000-0xfbffffff]
[ 0.269769] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 7 9 10 *11 12 14 15)
[ 0.271040] ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
[ 0.272376] ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
[ 0.273715] ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
[ 0.274964] ACPI: Enabled 1 GPEs in block 00 to 0F
[ 0.277122] pci 0000:00:08.0: vgaarb: setting as boot VGA device
[ 0.277911] pci 0000:00:08.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none
[ 0.278775] pci 0000:00:08.0: vgaarb: bridge control possible
[ 0.279559] vgaarb: loaded
[ 0.280170] SCSI subsystem initialized
[ 0.281217] libata version 3.00 loaded.
[ 0.284051] PCI: Using ACPI for IRQ routing
[ 0.286144] PCI: pci_cache_line_size set to 64 bytes
[ 0.287653] e820: reserve RAM buffer [mem 0x0009fc00-0x0009ffff]
[ 0.288023] e820: reserve RAM buffer [mem 0x3fff0000-0x3fffffff]
[ 0.289406] clocksource: Switched to clocksource hyperv_clocksource_tsc_page
[ 0.342146] VFS: Disk quotas dquot_6.6.0
[ 0.343311] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 0.345144] pnp: PnP ACPI init
[ 0.346201] pnp 00:00: Plug and Play ACPI device, IDs PNP0b00 (active)
[ 0.347171] pnp 00:01: Plug and Play ACPI device, IDs PNP0303 PNP030b (active)
[ 0.348231] pnp 00:02: Plug and Play ACPI device, IDs PNP0f03 PNP0f13 (active)
[ 0.350505] pnp 00:03: [dma 0 disabled]
[ 0.351389] pnp 00:03: Plug and Play ACPI device, IDs PNP0501 (active)
[ 0.353580] pnp 00:04: [dma 0 disabled]
[ 0.354429] pnp 00:04: Plug and Play ACPI device, IDs PNP0501 (active)
[ 0.356734] pnp 00:05: [dma 2]
[ 0.357670] pnp 00:05: Plug and Play ACPI device, IDs PNP0700 (active)
[ 0.358706] system 00:06: [io 0x01e0-0x01ef] has been reserved
[ 0.359537] system 00:06: [io 0x0160-0x016f] has been reserved
[ 0.360393] system 00:06: [io 0x0278-0x027f] has been reserved
[ 0.361216] system 00:06: [io 0x0378-0x037f] has been reserved
[ 0.362032] system 00:06: [io 0x0678-0x067f] has been reserved
[ 0.362848] system 00:06: [io 0x0778-0x077f] has been reserved
[ 0.363661] system 00:06: [io 0x04d0-0x04d1] has been reserved
[ 0.364519] system 00:06: Plug and Play ACPI device, IDs PNP0c02 (active)
[ 0.365670] system 00:07: [io 0x0400-0x043f] has been reserved
[ 0.366579] system 00:07: [io 0x0370-0x0371] has been reserved
[ 0.367403] system 00:07: [io 0x0440-0x044f] has been reserved
[ 0.368261] system 00:07: [mem 0xfec00000-0xfec00fff] could not be reserved
[ 0.369087] system 00:07: [mem 0xfee00000-0xfee00fff] has been reserved
[ 0.369875] system 00:07: Plug and Play ACPI device, IDs PNP0c02 (active)
[ 0.370930] system 00:08: [mem 0x00000000-0x0009ffff] could not be reserved
[ 0.371843] system 00:08: [mem 0x000c0000-0x000dffff] could not be reserved
[ 0.374012] system 00:08: [mem 0x000e0000-0x000fffff] could not be reserved
[ 0.374858] system 00:08: [mem 0x00100000-0xf7ffffff] could not be reserved
[ 0.375703] system 00:08: [mem 0xfffc0000-0xffffffff] has been reserved
[ 0.376579] system 00:08: Plug and Play ACPI device, IDs PNP0c01 (active)
[ 0.379161] pnp: PnP ACPI: found 9 devices
[ 0.387621] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns
[ 0.388618] pci_bus 0000:00: resource 4 [mem 0xfe0000000-0xfffffffff window]
[ 0.389456] pci_bus 0000:00: resource 5 [io 0x0000-0x0cf7 window]
[ 0.390281] pci_bus 0000:00: resource 6 [io 0x0d00-0xffff window]
[ 0.391105] pci_bus 0000:00: resource 7 [mem 0x000a0000-0x000bffff window]
[ 0.391931] pci_bus 0000:00: resource 8 [mem 0xf8000000-0xfffbffff window]
[ 0.392959] NET: Registered protocol family 2
[ 0.394453] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.395457] TCP bind hash table entries: 8192 (order: 7, 524288 bytes)
[ 0.396936] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.398239] UDP hash table entries: 512 (order: 4, 81920 bytes)
[ 0.399295] UDP-Lite hash table entries: 512 (order: 4, 81920 bytes)
[ 0.400881] NET: Registered protocol family 1
[ 0.401792] pci 0000:00:00.0: Limiting direct PCI/PCI transfers
[ 0.403210] pci 0000:00:08.0: Video device with shadowed ROM at [mem 0x000c0000-0x000dffff]
[ 0.404276] PCI: CLS 0 bytes, default 64
[ 0.405282] Unpacking initramfs...
[ 1.706148] Freeing initrd memory: 66576K
[ 1.706919] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[ 1.707234] software IO TLB [mem 0x39600000-0x3d600000] (64MB) mapped at [ffff953979600000-ffff95397d5fffff]
[ 1.707690] RAPL PMU: API unit is 2^-32 Joules, 3 fixed counters, 10737418240 ms ovfl timer
[ 1.708045] RAPL PMU: hw unit of domain pp0-core 2^-0 Joules
[ 1.708358] RAPL PMU: hw unit of domain package 2^-0 Joules
[ 1.708669] RAPL PMU: hw unit of domain dram 2^-0 Joules
[ 1.709048] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x257a4365b0e, max_idle_ns: 440795224253 ns
[ 1.709427] Scanning for low memory corruption every 60 seconds
[ 1.710395] futex hash table entries: 16384 (order: 9, 2097152 bytes)
[ 1.711254] audit: initializing netlink subsys (disabled)
[ 1.711684] cryptomgr_test (31) used greatest stack depth: 14528 bytes left
[ 1.712237] Initialise system trusted keyrings
[ 1.712598] audit: type=2000 audit(1487085689.712:1): state=initialized audit_enabled=0 res=1
[ 1.713063] workingset: timestamp_bits=40 max_order=18 bucket_order=0
[ 1.714737] zbud: loaded
[ 1.715782] SGI XFS with security attributes, no debug enabled
[ 1.718151] Key type asymmetric registered
[ 1.718518] Asymmetric key parser 'x509' registered
[ 1.718887] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[ 1.719379] io scheduler noop registered
[ 1.719720] io scheduler deadline registered (default)
[ 1.720518] io scheduler cfq registered
[ 1.720877] io scheduler mq-deadline registered
[ 1.721393] GHES: HEST is not enabled!
[ 1.721770] Serial: 8250/16550 driver, 32 ports, IRQ sharing enabled
[ 1.769785] 00:03: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[ 1.818962] 00:04: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A
[ 1.820459] Linux agpgart interface v0.103
[ 1.820970] ata_piix 0000:00:07.1: version 2.13
[ 1.821431] ata_piix 0000:00:07.1: Hyper-V Virtual Machine detected, ATA device ignore set
[ 1.823794] scsi host0: ata_piix
[ 1.824253] scsi host1: ata_piix
[ 1.824589] ata1: PATA max UDMA/33 cmd 0x1f0 ctl 0x3f6 bmdma 0xffa0 irq 14
[ 1.824922] ata2: PATA max UDMA/33 cmd 0x170 ctl 0x376 bmdma 0xffa8 irq 15
[ 1.825372] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f03:PS2M] at 0x60,0x64 irq 1,12
[ 1.828787] serio: i8042 KBD port at 0x60,0x64 irq 1
[ 1.829127] serio: i8042 AUX port at 0x60,0x64 irq 12
[ 1.830457] rtc_cmos 00:00: RTC can wake from S4
[ 1.852390] rtc_cmos 00:00: rtc core: registered rtc_cmos as rtc0
[ 1.853241] rtc_cmos 00:00: alarms up to one month, 114 bytes nvram
[ 1.853629] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.854189] NET: Registered protocol family 10
[ 1.855119] Segment Routing with IPv6
[ 1.855495] NET: Registered protocol family 17
[ 1.855813] Key type dns_resolver registered
[ 1.856411] registered taskstats version 1
[ 1.857175] Loading compiled-in X.509 certificates
[ 1.857529] zswap: loaded using pool lzo/zbud
[ 1.858415] rtc_cmos 00:00: setting system clock to 2017-02-14 15:21:30 UTC (1487085690)
[ 1.858766] BIOS EDD facility v0.16 2004-Jun-25, 0 devices found
[ 1.859087] EDD information not available.
[ 2.093148] ata1.01: NODEV after polling detection
[ 2.143359] ata1.00: host indicates ignore ATA devices, ignored
[ 2.144884] Freeing unused kernel memory: 1304K
[ 2.145283] Write protecting the kernel read-only data: 12288k
[ 2.146252] Freeing unused kernel memory: 1280K
[ 2.148804] Freeing unused kernel memory: 1312K
[ 2.150963] mount (67) used greatest stack depth: 14512 bytes left
[ 2.152646] exe (70) used greatest stack depth: 14504 bytes left
[ 2.155475] exe (73) used greatest stack depth: 14064 bytes left
[ 2.163564] random: udevadm: uninitialized urandom read (16 bytes read)
[ 2.163978] random: udevadm: uninitialized urandom read (16 bytes read)
[ 2.164923] random: systemd-udevd: uninitialized urandom read (16 bytes read)
[ 2.165384] random: systemd-udevd: uninitialized urandom read (16 bytes read)
[ 2.165716] random: systemd-udevd: uninitialized urandom read (16 bytes read)
[ 2.166047] random: systemd-udevd: uninitialized urandom read (16 bytes read)
[ 2.171533] random: udevadm: uninitialized urandom read (16 bytes read)
[ 2.171994] random: udevadm: uninitialized urandom read (16 bytes read)
[ 2.172758] random: udevadm: uninitialized urandom read (16 bytes read)
[ 2.173192] random: udevadm: uninitialized urandom read (16 bytes read)
[ 2.235888] udevadm (84) used greatest stack depth: 13904 bytes left
[ 2.279298] hv_vmbus: Vmbus version:4.0
[ 2.291556] hv_vmbus: registering driver hyperv_fb
[ 2.301275] hyperv_fb: Screen resolution: 1152x864, Color depth: 32
[ 2.310220] Console: switching to colour frame buffer device 144x54
[ 2.342210] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
[ 2.454348] hidraw: raw HID events driver (C) Jiri Kosina
[ 2.455357] hv_vmbus: registering driver hid_hyperv
[ 2.456632] hv_vmbus: registering driver hyperv_keyboard
[ 2.459289] hv_utils: Registering HyperV Utility Driver
[ 2.459346] hv_vmbus: registering driver hv_util
[ 2.468340] hv_vmbus: registering driver hv_netvsc
[ 2.472734] hv_vmbus: registering driver hv_storvsc
[ 2.477142] input: Microsoft Vmbus HID-compliant Mouse as /devices/0006:045E:0621.0001/input/input3
[ 2.477250] hid 0006:045E:0621.0001: input: <UNKNOWN> HID v0.01 Mouse [Microsoft Vmbus HID-compliant Mouse] on
[ 2.478576] hv_utils: Heartbeat IC version 3.0
[ 2.524966] scsi host2: storvsc_host_t
[ 2.525973] scsi 2:0:0:0: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 5
[ 2.527299] sd 2:0:0:0: Attached scsi generic sg0 type 0
[ 2.531966] hv_utils: cannot register PTP clock: 0
[ 2.532187] hv_utils: Shutdown IC version 3.0
[ 2.532790] hv_utils: TimeSync IC version 4.0
[ 2.534166] sd 2:0:0:0: [sda] 83886080 512-byte logical blocks: (42.9 GB/40.0 GiB)
[ 2.534244] sd 2:0:0:0: [sda] 4096-byte physical blocks
[ 2.534394] sd 2:0:0:0: [sda] Write Protect is off
[ 2.534448] sd 2:0:0:0: [sda] Mode Sense: 0f 00 00 00
[ 2.534952] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 2.552432] sda: sda1 sda2 < sda5 >
[ 2.566464] sd 2:0:0:0: [sda] Attached SCSI disk
[ 2.570541] random: fast init done
[ 2.582194] scsi host3: storvsc_host_t
[ 2.584084] hv_utils: VSS IC version 5.0
[ 2.593413] scsi 3:0:0:0: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 5
[ 2.618615] sd 3:0:0:0: Attached scsi generic sg1 type 0
[ 2.623955] sd 3:0:0:0: [sdb] 266338304 512-byte logical blocks: (136 GB/127 GiB)
[ 2.625517] sd 3:0:0:0: [sdb] 4096-byte physical blocks
[ 2.627181] sd 3:0:0:0: [sdb] Write Protect is off
[ 2.628748] sd 3:0:0:0: [sdb] Mode Sense: 0f 00 00 00
[ 2.630468] sd 3:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 2.634044] sdb: sdb1
[ 2.643154] sd 3:0:0:0: [sdb] Attached SCSI disk
[ 2.704593] systemd-udevd (96) used greatest stack depth: 13392 bytes left
[ 2.706902] systemd-udevd (90) used greatest stack depth: 12816 bytes left
[ 2.787475] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[ 2.804051] psmouse serio1: trackpoint: failed to get extended button data
[ 3.004174] systemd[1]: systemd 229 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN)
[ 3.007863] systemd[1]: Detected virtualization microsoft.
[ 3.010207] systemd[1]: Detected architecture x86-64.
[ 3.017969] systemd[1]: Set hostname to <decui-u1604>.
[ 3.239480] systemd[1]: Listening on Journal Audit Socket.
[ 3.240013] systemd[1]: Reached target Encrypted Volumes.
[ 3.248937] systemd[1]: Created slice User and Session Slice.
[ 3.253336] systemd[1]: Created slice System Slice.
[ 3.257596] systemd[1]: Listening on Device-mapper event daemon FIFOs.
[ 3.261790] systemd[1]: Listening on LVM2 poll daemon socket.
[ 3.731378] EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro
[ 3.798352] systemd-journald[212]: Received request to flush runtime journal from PID 1
[ 4.406082] hv_vmbus: registering driver hv_pci
[ 4.518904] piix4_smbus 0000:00:07.3: SMBus base address uninitialized - upgrade BIOS or use force_addr=0xaddr
[ 4.599516] ACPI: \: failed to evaluate _DSM (0x1001)
[ 4.601025] hv_pci 2d985bf6-6e3e-453e-bca5-7e5f5930df64: PCI host bridge to bus bca5:00
[ 4.668864] pci_bus bca5:00: root bus resource [mem 0xfe0000000-0xfe07fffff window]
[ 4.732549] pci bca5:00:02.0: [15b3:1004] type 00 class 0x020000
[ 4.742880] pci bca5:00:02.0: reg 0x18: [mem 0xfe0000000-0xfe07fffff 64bit pref]
[ 4.804954] AVX version of gcm_enc/dec engaged.
[ 4.805602] AES CTR mode by8 optimization enabled
[ 4.926729] pci bca5:00:02.0: BAR 2: assigned [mem 0xfe0000000-0xfe07fffff 64bit pref]
[ 5.055412] alg: No test for pcbc(aes) (pcbc-aes-aesni)
[ 5.526597] random: crng init done
[ 5.573076] hv_vmbus: registering driver hv_balloon
[ 5.666867] hv_balloon: Using Dynamic Memory protocol version 2.0
[ 6.182094] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 6.208794] sd 2:0:0:0: [storvsc] Sense Key : Illegal Request [current]
[ 6.209447] sd 2:0:0:0: [storvsc] Add. Sense: Invalid command operation code
[ 6.210043] sd 3:0:0:0: [storvsc] Sense Key : Illegal Request [current]
[ 6.210618] sd 3:0:0:0: [storvsc] Add. Sense: Invalid command operation code
[ 6.212272] sd 2:0:0:0: [storvsc] Sense Key : Illegal Request [current]
[ 6.212897] sd 2:0:0:0: [storvsc] Add. Sense: Invalid command operation code
[ 6.213474] sd 3:0:0:0: [storvsc] Sense Key : Illegal Request [current]
[ 6.214051] sd 3:0:0:0: [storvsc] Add. Sense: Invalid command operation code
[ 6.358405] XFS (sdb1): Mounting V5 Filesystem
[ 6.404478] XFS (sdb1): Ending clean mount
[ 7.535174] BUG: spinlock bad magic on CPU#0, swapper/0/0
[ 7.536807] lock: host_ts+0x30/0xffffffffffffe1a0 [hv_utils], .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
[ 7.538436] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.10.0-rc8-next-20170214+ #1
[ 7.539142] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS 090006 04/28/2016
[ 7.539142] Call Trace:
[ 7.539142] <IRQ>
[ 7.539142] dump_stack+0x63/0x82
[ 7.539142] spin_dump+0x78/0xc0
[ 7.539142] do_raw_spin_lock+0xfd/0x160
[ 7.539142] _raw_spin_lock_irqsave+0x4c/0x60
[ 7.539142] ? timesync_onchannelcallback+0x153/0x220 [hv_utils]
[ 7.539142] timesync_onchannelcallback+0x153/0x220 [hv_utils]
[ 7.539142] vmbus_on_event+0x101/0x170 [hv_vmbus]
[ 7.539142] tasklet_action+0x118/0x130
[ 7.539142] __do_softirq+0x10a/0x2da
[ 7.539142] irq_exit+0xf3/0x100
[ 7.539142] hyperv_vector_handler+0x39/0x50
[ 7.539142] hyperv_callback_vector+0x93/0xa0
[ 7.539142] RIP: 0010:native_safe_halt+0x6/0x10
[ 7.539142] RSP: 0018:ffffffff81c03e08 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff0c
[ 7.539142] RAX: 0000000000000000 RBX: ffffffff81c14500 RCX: 0000000000000000
[ 7.539142] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
[ 7.539142] RBP: ffffffff81c03e08 R08: 0100000000000000 R09: 0000000000000000
[ 7.539142] R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
[ 7.539142] R13: ffffffff81c14500 R14: 0000000000000000 R15: 0000000000000000
[ 7.539142] </IRQ>
[ 7.539142] default_idle+0x1e/0xd0
[ 7.539142] arch_cpu_idle+0xf/0x20
[ 7.539142] default_idle_call+0x23/0x30
[ 7.539142] do_idle+0x179/0x1c0
[ 7.539142] cpu_startup_entry+0x62/0x70
[ 7.539142] rest_init+0xb3/0xc0
[ 7.539142] start_kernel+0x45e/0x46b
[ 7.539142] ? early_idt_handler_array+0x120/0x120
[ 7.539142] x86_64_start_reservations+0x24/0x26
[ 7.539142] x86_64_start_kernel+0x134/0x141
[ 7.539142] start_cpu+0x14/0x14
[ 7.704113] psmouse serio1: trackpoint: IBM TrackPoint firmware: 0x01, buttons: 0/0
[ 7.711357] input: TPPS/2 IBM TrackPoint as /devices/platform/i8042/serio1/input/input2
[ 7.723446] input: AT Translated Set 2 keyboard as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00/device:07/VMBUS:01/d34b2567-b9b6-42b9-8778-0a4ec0b955bf/serio2/input/input4
[ 53.756564] hv_balloon: INFO_TYPE_MAX_PAGE_CNT = 262144
[ 58.336111] hv_utils: KVP IC version 4.0
^ permalink raw reply
* Re: [PATCH BUGFIX] block: make elevator_get robust against cross blk/blk-mq choice
From: Paolo Valente @ 2017-02-14 15:48 UTC (permalink / raw)
To: Jens Axboe
Cc: Omar Sandoval, Tejun Heo, linux-block, Linux-Kernal, Ulf Hansson,
Linus Walleij, broonie
In-Reply-To: <dfad6983-c800-4ff1-002c-d586a9289054@kernel.dk>
> Il giorno 14 feb 2017, alle ore 16:16, Jens Axboe <axboe@kernel.dk> ha =
scritto:
>=20
> On 02/14/2017 01:14 AM, Paolo Valente wrote:
>>=20
>>> Il giorno 14 feb 2017, alle ore 00:10, Jens Axboe <axboe@kernel.dk> =
ha scritto:
>>>=20
>>> On 02/13/2017 03:28 PM, Jens Axboe wrote:
>>>> On 02/13/2017 03:09 PM, Omar Sandoval wrote:
>>>>> On Mon, Feb 13, 2017 at 10:01:07PM +0100, Paolo Valente wrote:
>>>>>> If, at boot, a legacy I/O scheduler is chosen for a device using =
blk-mq,
>>>>>> or, viceversa, a blk-mq scheduler is chosen for a device using =
blk, then
>>>>>> that scheduler is set and initialized without any check, driving =
the
>>>>>> system into an inconsistent state. This commit addresses this =
issue by
>>>>>> letting elevator_get fail for these wrong cross choices.
>>>>>>=20
>>>>>> Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
>>>>>> ---
>>>>>> block/elevator.c | 26 ++++++++++++++++++--------
>>>>>> 1 file changed, 18 insertions(+), 8 deletions(-)
>>>>>=20
>>>>> Hey, Paolo,
>>>>>=20
>>>>> How exactly are you triggering this? In __elevator_change(), we do =
check
>>>>> for mq or not mq:
>>>>>=20
>>>>> if (!e->uses_mq && q->mq_ops) {
>>>>> elevator_put(e);
>>>>> return -EINVAL;
>>>>> }
>>>>> if (e->uses_mq && !q->mq_ops) {
>>>>> elevator_put(e);
>>>>> return -EINVAL;
>>>>> }
>>>>>=20
>>>>> We don't ever appear to call elevator_init() with a specific =
scheduler
>>>>> name, and for the default we switch off of q->mq_ops and use the
>>>>> defaults from Kconfig:
>>>>>=20
>>>>> if (q->mq_ops && q->nr_hw_queues =3D=3D 1)
>>>>> e =3D elevator_get(CONFIG_DEFAULT_SQ_IOSCHED, false);
>>>>> else if (q->mq_ops)
>>>>> e =3D elevator_get(CONFIG_DEFAULT_MQ_IOSCHED, false);
>>>>> else
>>>>> e =3D elevator_get(CONFIG_DEFAULT_IOSCHED, false);
>>>>>=20
>>>>> if (!e) {
>>>>> printk(KERN_ERR
>>>>> "Default I/O scheduler not found. " \
>>>>> "Using noop/none.\n");
>>>>> e =3D elevator_get("noop", false);
>>>>> }
>>>>>=20
>>>>> So I guess this could happen if someone manually changed those =
Kconfig
>>>>> options, but I don't see what other case would make this happen, =
could
>>>>> you please explain?
>>>>=20
>>>> Was wondering the same - is it using the 'elevator=3D' boot =
parameter?
>>>> Didn't look at that path just now, but that's the only one I could
>>>> think of. If it is, I'd much prefer only using 'chosen_elevator' =
for
>>>> the non-mq stuff, and the fix should be just that instead.
>>>>=20
>>>> So instead of:
>>>>=20
>>>> if (!e && *chosen_elevator) {
>>>>=20
>>>> do
>>>>=20
>>>> if (!e && !q->mq_ops && && *chosen_elevator) {
>>>=20
>>> Confirmed, that's what it seems to be, and here's a real diff of the
>>> above example that works for me:
>>>=20
>>> diff --git a/block/elevator.c b/block/elevator.c
>>> index 27ff1ed5a6fa..699d10f71a2c 100644
>>> --- a/block/elevator.c
>>> +++ b/block/elevator.c
>>> @@ -207,11 +207,12 @@ int elevator_init(struct request_queue *q, =
char *name)
>>> }
>>>=20
>>> /*
>>> - * Use the default elevator specified by config boot param or
>>> - * config option. Don't try to load modules as we could be =
running
>>> - * off async and request_module() isn't allowed from async.
>>> + * Use the default elevator specified by config boot param for
>>> + * non-mq devices, or by config option.
>>=20
>> I don't fully get this choice: being able to change the default I/O
>> scheduler through the command line has been rather useful for me,
>> saving me a lot of recompilations, and such a feature seems =
widespread
>> among (at least power) users. However, mine is of course just an
>> opinion, and I may be missing the main point also in this case.
>=20
> The problem with the elevator=3D boot parameter is that it applies =
across
> everything, which makes very little sense, since it's a per device
> setting. In retrospect, it was a mistake to add this parameter, and I
> don't want to continue down that path with blk-mq.
>=20
ok, thanks
> Why aren't you just using online switching through syses?
To change the scheduler from the very beginning at boot. Which maybe
can be done through udev rules as well, I'm just too ignorant.
Thanks,
Paolo
> For normal
> users, typically this would be done through udev rules.
>=20
> --=20
> Jens Axboe
^ permalink raw reply
* Re: [PATCH v2 0/5] md: use bio_clone_fast()
From: Jens Axboe @ 2017-02-14 15:31 UTC (permalink / raw)
To: Ming Lei, Shaohua Li, linux-kernel, linux-raid, linux-block,
Christoph Hellwig, NeilBrown
In-Reply-To: <1487086143-10255-1-git-send-email-tom.leiming@gmail.com>
On 02/14/2017 08:28 AM, Ming Lei wrote:
> Hi,
>
> This patches replaces bio_clone() with bio_fast_clone() in
> bio_clone_mddev() because:
>
> 1) bio_clone_mddev() is used in raid normal I/O and isn't in
> resync I/O path, and all the direct access to bvec table in
> raid happens on resync I/O only except for write behind of raid1.
> Write behind is treated specially, so the replacement is safe.
>
> 2) for write behind, bio_clone() is kept, but this patchset
> introduces bio_clone_bioset_partial() to just clone one specific
> bvecs range instead of whole table. Then write behind is improved
> too.
You can add my reviewed-by to the first patch. Shaohua, I'm fine
with you carrying this in the md tree, that would be the easiest
way forward.
--
Jens Axboe
^ permalink raw reply
* [PATCH v2 4/5] md: remove unnecessary check on mddev
From: Ming Lei @ 2017-02-14 15:29 UTC (permalink / raw)
To: Shaohua Li, Jens Axboe, linux-kernel, linux-raid, linux-block,
Christoph Hellwig, NeilBrown
Cc: Ming Lei
In-Reply-To: <1487086143-10255-1-git-send-email-tom.leiming@gmail.com>
mddev is never NULL and neither is ->bio_set, so
remove the check.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
drivers/md/md.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index b5e2adf3493b..6cd96fde2a67 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -193,9 +193,6 @@ EXPORT_SYMBOL_GPL(bio_alloc_mddev);
struct bio *bio_clone_mddev(struct bio *bio, gfp_t gfp_mask,
struct mddev *mddev)
{
- if (!mddev || !mddev->bio_set)
- return bio_clone(bio, gfp_mask);
-
return bio_clone_bioset(bio, gfp_mask, mddev->bio_set);
}
EXPORT_SYMBOL_GPL(bio_clone_mddev);
--
2.7.4
^ permalink raw reply related
* [PATCH v2 5/5] md: fast clone bio in bio_clone_mddev()
From: Ming Lei @ 2017-02-14 15:29 UTC (permalink / raw)
To: Shaohua Li, Jens Axboe, linux-kernel, linux-raid, linux-block,
Christoph Hellwig, NeilBrown
Cc: Ming Lei
In-Reply-To: <1487086143-10255-1-git-send-email-tom.leiming@gmail.com>
Firstly bio_clone_mddev() is used in raid normal I/O and isn't
in resync I/O path.
Secondly all the direct access to bvec table in raid happens on
resync I/O except for write behind of raid1, in which we still
use bio_clone() for allocating new bvec table.
So this patch replaces bio_clone() with bio_clone_fast()
in bio_clone_mddev().
Also kill bio_clone_mddev() and call bio_clone_fast() directly, as
suggested by Christoph Hellwig.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
drivers/md/faulty.c | 2 +-
drivers/md/md.c | 7 -------
drivers/md/md.h | 2 --
drivers/md/raid1.c | 10 ++++++----
drivers/md/raid10.c | 11 +++++------
drivers/md/raid5.c | 4 ++--
6 files changed, 14 insertions(+), 22 deletions(-)
diff --git a/drivers/md/faulty.c b/drivers/md/faulty.c
index 685aa2d77e25..b0536cfd8e17 100644
--- a/drivers/md/faulty.c
+++ b/drivers/md/faulty.c
@@ -214,7 +214,7 @@ static void faulty_make_request(struct mddev *mddev, struct bio *bio)
}
}
if (failit) {
- struct bio *b = bio_clone_mddev(bio, GFP_NOIO, mddev);
+ struct bio *b = bio_clone_fast(bio, GFP_NOIO, mddev->bio_set);
b->bi_bdev = conf->rdev->bdev;
b->bi_private = bio;
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 6cd96fde2a67..985374f20e2e 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -190,13 +190,6 @@ struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs,
}
EXPORT_SYMBOL_GPL(bio_alloc_mddev);
-struct bio *bio_clone_mddev(struct bio *bio, gfp_t gfp_mask,
- struct mddev *mddev)
-{
- return bio_clone_bioset(bio, gfp_mask, mddev->bio_set);
-}
-EXPORT_SYMBOL_GPL(bio_clone_mddev);
-
/*
* We have a system wide 'event count' that is incremented
* on any 'interesting' event, and readers of /proc/mdstat
diff --git a/drivers/md/md.h b/drivers/md/md.h
index 2a514036a83d..a86ad62079de 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -673,8 +673,6 @@ extern void md_rdev_clear(struct md_rdev *rdev);
extern void mddev_suspend(struct mddev *mddev);
extern void mddev_resume(struct mddev *mddev);
-extern struct bio *bio_clone_mddev(struct bio *bio, gfp_t gfp_mask,
- struct mddev *mddev);
extern struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs,
struct mddev *mddev);
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index b7548e0a9eca..85f309836fd7 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1108,7 +1108,7 @@ static void raid1_read_request(struct mddev *mddev, struct bio *bio,
r1_bio->read_disk = rdisk;
r1_bio->start_next_window = 0;
- read_bio = bio_clone_mddev(bio, GFP_NOIO, mddev);
+ read_bio = bio_clone_fast(bio, GFP_NOIO, mddev->bio_set);
bio_trim(read_bio, r1_bio->sector - bio->bi_iter.bi_sector,
max_sectors);
@@ -1372,7 +1372,7 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
}
if (!mbio) {
- mbio = bio_clone_mddev(bio, GFP_NOIO, mddev);
+ mbio = bio_clone_fast(bio, GFP_NOIO, mddev->bio_set);
bio_trim(mbio, offset, max_sectors);
}
@@ -2283,7 +2283,8 @@ static int narrow_write_error(struct r1bio *r1_bio, int i)
wbio->bi_vcnt = vcnt;
} else {
- wbio = bio_clone_mddev(r1_bio->master_bio, GFP_NOIO, mddev);
+ wbio = bio_clone_fast(r1_bio->master_bio, GFP_NOIO,
+ mddev->bio_set);
}
bio_set_op_attrs(wbio, REQ_OP_WRITE, 0);
@@ -2421,7 +2422,8 @@ static void handle_read_error(struct r1conf *conf, struct r1bio *r1_bio)
const unsigned long do_sync
= r1_bio->master_bio->bi_opf & REQ_SYNC;
r1_bio->read_disk = disk;
- bio = bio_clone_mddev(r1_bio->master_bio, GFP_NOIO, mddev);
+ bio = bio_clone_fast(r1_bio->master_bio, GFP_NOIO,
+ mddev->bio_set);
bio_trim(bio, r1_bio->sector - bio->bi_iter.bi_sector,
max_sectors);
r1_bio->bios[r1_bio->read_disk] = bio;
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 6bc5c2a85160..063c43d83b72 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1132,7 +1132,7 @@ static void raid10_read_request(struct mddev *mddev, struct bio *bio,
}
slot = r10_bio->read_slot;
- read_bio = bio_clone_mddev(bio, GFP_NOIO, mddev);
+ read_bio = bio_clone_fast(bio, GFP_NOIO, mddev->bio_set);
bio_trim(read_bio, r10_bio->sector - bio->bi_iter.bi_sector,
max_sectors);
@@ -1406,7 +1406,7 @@ static void raid10_write_request(struct mddev *mddev, struct bio *bio,
int d = r10_bio->devs[i].devnum;
if (r10_bio->devs[i].bio) {
struct md_rdev *rdev = conf->mirrors[d].rdev;
- mbio = bio_clone_mddev(bio, GFP_NOIO, mddev);
+ mbio = bio_clone_fast(bio, GFP_NOIO, mddev->bio_set);
bio_trim(mbio, r10_bio->sector - bio->bi_iter.bi_sector,
max_sectors);
r10_bio->devs[i].bio = mbio;
@@ -1457,7 +1457,7 @@ static void raid10_write_request(struct mddev *mddev, struct bio *bio,
smp_mb();
rdev = conf->mirrors[d].rdev;
}
- mbio = bio_clone_mddev(bio, GFP_NOIO, mddev);
+ mbio = bio_clone_fast(bio, GFP_NOIO, mddev->bio_set);
bio_trim(mbio, r10_bio->sector - bio->bi_iter.bi_sector,
max_sectors);
r10_bio->devs[i].repl_bio = mbio;
@@ -2565,7 +2565,7 @@ static int narrow_write_error(struct r10bio *r10_bio, int i)
if (sectors > sect_to_write)
sectors = sect_to_write;
/* Write at 'sector' for 'sectors' */
- wbio = bio_clone_mddev(bio, GFP_NOIO, mddev);
+ wbio = bio_clone_fast(bio, GFP_NOIO, mddev->bio_set);
bio_trim(wbio, sector - bio->bi_iter.bi_sector, sectors);
wsector = r10_bio->devs[i].addr + (sector - r10_bio->sector);
wbio->bi_iter.bi_sector = wsector +
@@ -2641,8 +2641,7 @@ static void handle_read_error(struct mddev *mddev, struct r10bio *r10_bio)
mdname(mddev),
bdevname(rdev->bdev, b),
(unsigned long long)r10_bio->sector);
- bio = bio_clone_mddev(r10_bio->master_bio,
- GFP_NOIO, mddev);
+ bio = bio_clone_fast(r10_bio->master_bio, GFP_NOIO, mddev->bio_set);
bio_trim(bio, r10_bio->sector - bio->bi_iter.bi_sector, max_sectors);
r10_bio->devs[slot].bio = bio;
r10_bio->devs[slot].rdev = rdev;
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index a1b41184e850..c16d09614cf6 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -5056,9 +5056,9 @@ static int raid5_read_one_chunk(struct mddev *mddev, struct bio *raid_bio)
return 0;
}
/*
- * use bio_clone_mddev to make a copy of the bio
+ * use bio_clone_fast to make a copy of the bio
*/
- align_bi = bio_clone_mddev(raid_bio, GFP_NOIO, mddev);
+ align_bi = bio_clone_fast(raid_bio, GFP_NOIO, mddev->bio_set);
if (!align_bi)
return 0;
/*
--
2.7.4
^ permalink raw reply related
* [PATCH v2 3/5] md/raid1: use bio_clone_bioset_partial() in case of write behind
From: Ming Lei @ 2017-02-14 15:29 UTC (permalink / raw)
To: Shaohua Li, Jens Axboe, linux-kernel, linux-raid, linux-block,
Christoph Hellwig, NeilBrown
Cc: Ming Lei
In-Reply-To: <1487086143-10255-1-git-send-email-tom.leiming@gmail.com>
Write behind need to replace pages in bio's bvecs, and we have
to clone a fresh bio with new bvec table, so use the introduced
bio_clone_bioset_partial() for it.
For other bio_clone_mddev() cases, we will use fast clone since
they don't need to touch bvec table.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
drivers/md/raid1.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 830ff2b20346..b7548e0a9eca 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1341,13 +1341,12 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
first_clone = 1;
for (i = 0; i < disks; i++) {
- struct bio *mbio;
+ struct bio *mbio = NULL;
+ sector_t offset;
if (!r1_bio->bios[i])
continue;
- mbio = bio_clone_mddev(bio, GFP_NOIO, mddev);
- bio_trim(mbio, r1_bio->sector - bio->bi_iter.bi_sector,
- max_sectors);
+ offset = r1_bio->sector - bio->bi_iter.bi_sector;
if (first_clone) {
/* do behind I/O ?
@@ -1357,8 +1356,13 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
if (bitmap &&
(atomic_read(&bitmap->behind_writes)
< mddev->bitmap_info.max_write_behind) &&
- !waitqueue_active(&bitmap->behind_wait))
+ !waitqueue_active(&bitmap->behind_wait)) {
+ mbio = bio_clone_bioset_partial(bio, GFP_NOIO,
+ mddev->bio_set,
+ offset,
+ max_sectors);
alloc_behind_pages(mbio, r1_bio);
+ }
bitmap_startwrite(bitmap, r1_bio->sector,
r1_bio->sectors,
@@ -1366,6 +1370,12 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
&r1_bio->state));
first_clone = 0;
}
+
+ if (!mbio) {
+ mbio = bio_clone_mddev(bio, GFP_NOIO, mddev);
+ bio_trim(mbio, offset, max_sectors);
+ }
+
if (r1_bio->behind_bvecs) {
struct bio_vec *bvec;
int j;
--
2.7.4
^ permalink raw reply related
* [PATCH v2 2/5] md: fail if mddev->bio_set can't be created
From: Ming Lei @ 2017-02-14 15:29 UTC (permalink / raw)
To: Shaohua Li, Jens Axboe, linux-kernel, linux-raid, linux-block,
Christoph Hellwig, NeilBrown
Cc: Ming Lei
In-Reply-To: <1487086143-10255-1-git-send-email-tom.leiming@gmail.com>
The current behaviour is to fall back to allocate
bio from 'fs_bio_set', that isn't a correct way
because it might cause deadlock.
So this patch simply return failure if mddev->bio_set
can't be created.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
drivers/md/md.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 7e9a495e4160..b5e2adf3493b 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5228,8 +5228,11 @@ int md_run(struct mddev *mddev)
sysfs_notify_dirent_safe(rdev->sysfs_state);
}
- if (mddev->bio_set == NULL)
+ if (mddev->bio_set == NULL) {
mddev->bio_set = bioset_create(BIO_POOL_SIZE, 0);
+ if (!mddev->bio_set)
+ return -ENOMEM;
+ }
spin_lock(&pers_lock);
pers = find_pers(mddev->level, mddev->clevel);
--
2.7.4
^ permalink raw reply related
* [PATCH v2 1/5] block: introduce bio_clone_bioset_partial()
From: Ming Lei @ 2017-02-14 15:28 UTC (permalink / raw)
To: Shaohua Li, Jens Axboe, linux-kernel, linux-raid, linux-block,
Christoph Hellwig, NeilBrown
Cc: Ming Lei
In-Reply-To: <1487086143-10255-1-git-send-email-tom.leiming@gmail.com>
md still need bio clone(not the fast version) for behind write,
and it is more efficient to use bio_clone_bioset_partial().
The idea is simple and just copy the bvecs range specified from
parameters.
Reviewed-by: Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
block/bio.c | 61 +++++++++++++++++++++++++++++++++++++++++------------
include/linux/bio.h | 11 ++++++++--
2 files changed, 57 insertions(+), 15 deletions(-)
diff --git a/block/bio.c b/block/bio.c
index 4b564d0c3e29..5eec5e08417f 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -625,21 +625,20 @@ struct bio *bio_clone_fast(struct bio *bio, gfp_t gfp_mask, struct bio_set *bs)
}
EXPORT_SYMBOL(bio_clone_fast);
-/**
- * bio_clone_bioset - clone a bio
- * @bio_src: bio to clone
- * @gfp_mask: allocation priority
- * @bs: bio_set to allocate from
- *
- * Clone bio. Caller will own the returned bio, but not the actual data it
- * points to. Reference count of returned bio will be one.
- */
-struct bio *bio_clone_bioset(struct bio *bio_src, gfp_t gfp_mask,
- struct bio_set *bs)
+static struct bio *__bio_clone_bioset(struct bio *bio_src, gfp_t gfp_mask,
+ struct bio_set *bs, int offset,
+ int size)
{
struct bvec_iter iter;
struct bio_vec bv;
struct bio *bio;
+ struct bvec_iter iter_src = bio_src->bi_iter;
+
+ /* for supporting partial clone */
+ if (offset || size != bio_src->bi_iter.bi_size) {
+ bio_advance_iter(bio_src, &iter_src, offset);
+ iter_src.bi_size = size;
+ }
/*
* Pre immutable biovecs, __bio_clone() used to just do a memcpy from
@@ -663,7 +662,8 @@ struct bio *bio_clone_bioset(struct bio *bio_src, gfp_t gfp_mask,
* __bio_clone_fast() anyways.
*/
- bio = bio_alloc_bioset(gfp_mask, bio_segments(bio_src), bs);
+ bio = bio_alloc_bioset(gfp_mask, __bio_segments(bio_src,
+ &iter_src), bs);
if (!bio)
return NULL;
bio->bi_bdev = bio_src->bi_bdev;
@@ -680,7 +680,7 @@ struct bio *bio_clone_bioset(struct bio *bio_src, gfp_t gfp_mask,
bio->bi_io_vec[bio->bi_vcnt++] = bio_src->bi_io_vec[0];
break;
default:
- bio_for_each_segment(bv, bio_src, iter)
+ __bio_for_each_segment(bv, bio_src, iter, iter_src)
bio->bi_io_vec[bio->bi_vcnt++] = bv;
break;
}
@@ -699,9 +699,44 @@ struct bio *bio_clone_bioset(struct bio *bio_src, gfp_t gfp_mask,
return bio;
}
+
+/**
+ * bio_clone_bioset - clone a bio
+ * @bio_src: bio to clone
+ * @gfp_mask: allocation priority
+ * @bs: bio_set to allocate from
+ *
+ * Clone bio. Caller will own the returned bio, but not the actual data it
+ * points to. Reference count of returned bio will be one.
+ */
+struct bio *bio_clone_bioset(struct bio *bio_src, gfp_t gfp_mask,
+ struct bio_set *bs)
+{
+ return __bio_clone_bioset(bio_src, gfp_mask, bs, 0,
+ bio_src->bi_iter.bi_size);
+}
EXPORT_SYMBOL(bio_clone_bioset);
/**
+ * bio_clone_bioset_partial - clone a partial bio
+ * @bio_src: bio to clone
+ * @gfp_mask: allocation priority
+ * @bs: bio_set to allocate from
+ * @offset: cloned starting from the offset
+ * @size: size for the cloned bio
+ *
+ * Clone bio. Caller will own the returned bio, but not the actual data it
+ * points to. Reference count of returned bio will be one.
+ */
+struct bio *bio_clone_bioset_partial(struct bio *bio_src, gfp_t gfp_mask,
+ struct bio_set *bs, int offset,
+ int size)
+{
+ return __bio_clone_bioset(bio_src, gfp_mask, bs, offset, size);
+}
+EXPORT_SYMBOL(bio_clone_bioset_partial);
+
+/**
* bio_add_pc_page - attempt to add page to bio
* @q: the target queue
* @bio: destination bio
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 7cf8a6c70a3f..8e521194f6fc 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -183,7 +183,7 @@ static inline void bio_advance_iter(struct bio *bio, struct bvec_iter *iter,
#define bio_iter_last(bvec, iter) ((iter).bi_size == (bvec).bv_len)
-static inline unsigned bio_segments(struct bio *bio)
+static inline unsigned __bio_segments(struct bio *bio, struct bvec_iter *bvec)
{
unsigned segs = 0;
struct bio_vec bv;
@@ -205,12 +205,17 @@ static inline unsigned bio_segments(struct bio *bio)
break;
}
- bio_for_each_segment(bv, bio, iter)
+ __bio_for_each_segment(bv, bio, iter, *bvec)
segs++;
return segs;
}
+static inline unsigned bio_segments(struct bio *bio)
+{
+ return __bio_segments(bio, &bio->bi_iter);
+}
+
/*
* get a reference to a bio, so it won't disappear. the intended use is
* something like:
@@ -384,6 +389,8 @@ extern void bio_put(struct bio *);
extern void __bio_clone_fast(struct bio *, struct bio *);
extern struct bio *bio_clone_fast(struct bio *, gfp_t, struct bio_set *);
extern struct bio *bio_clone_bioset(struct bio *, gfp_t, struct bio_set *bs);
+extern struct bio *bio_clone_bioset_partial(struct bio *, gfp_t,
+ struct bio_set *, int, int);
extern struct bio_set *fs_bio_set;
--
2.7.4
^ permalink raw reply related
* [PATCH v2 0/5] md: use bio_clone_fast()
From: Ming Lei @ 2017-02-14 15:28 UTC (permalink / raw)
To: Shaohua Li, Jens Axboe, linux-kernel, linux-raid, linux-block,
Christoph Hellwig, NeilBrown
Cc: Ming Lei
Hi,
This patches replaces bio_clone() with bio_fast_clone() in
bio_clone_mddev() because:
1) bio_clone_mddev() is used in raid normal I/O and isn't in
resync I/O path, and all the direct access to bvec table in
raid happens on resync I/O only except for write behind of raid1.
Write behind is treated specially, so the replacement is safe.
2) for write behind, bio_clone() is kept, but this patchset
introduces bio_clone_bioset_partial() to just clone one specific
bvecs range instead of whole table. Then write behind is improved
too.
V2:
1) move 3rd patch into 2nd one
2) kill bio_clone_mddev() and use bio_clone_fast() directly
3) define local variable 'offset' as sector_t in raid1_write_request()
V1:
1) don't introduce bio_clone_slow_mddev_partial()
2) return failure if mddev->bio_set can't be created
3) remove check in bio_clone_mddev() as suggested by
Christoph Hellwig.
4) rename bio_clone_mddev() as bio_clone_fast_mddev()
Ming Lei (5):
block: introduce bio_clone_bioset_partial()
md: fail if mddev->bio_set can't be created
md/raid1: use bio_clone_bioset_partial() in case of write behind
md: remove unnecessary check on mddev
md: fast clone bio in bio_clone_mddev()
block/bio.c | 61 +++++++++++++++++++++++++++++++++++++++++------------
drivers/md/faulty.c | 2 +-
drivers/md/md.c | 15 ++++---------
drivers/md/md.h | 2 --
drivers/md/raid1.c | 28 +++++++++++++++++-------
drivers/md/raid10.c | 11 +++++-----
drivers/md/raid5.c | 4 ++--
include/linux/bio.h | 11 ++++++++--
8 files changed, 89 insertions(+), 45 deletions(-)
--
2.7.4
^ permalink raw reply
* Re: [PATCH BUGFIX] block: make elevator_get robust against cross blk/blk-mq choice
From: Jens Axboe @ 2017-02-14 15:16 UTC (permalink / raw)
To: Paolo Valente
Cc: Omar Sandoval, Tejun Heo, linux-block, Linux-Kernal, Ulf Hansson,
Linus Walleij, broonie
In-Reply-To: <AEB325FC-ED18-4927-A794-6FA915D55F75@linaro.org>
On 02/14/2017 01:14 AM, Paolo Valente wrote:
>
>> Il giorno 14 feb 2017, alle ore 00:10, Jens Axboe <axboe@kernel.dk> ha scritto:
>>
>> On 02/13/2017 03:28 PM, Jens Axboe wrote:
>>> On 02/13/2017 03:09 PM, Omar Sandoval wrote:
>>>> On Mon, Feb 13, 2017 at 10:01:07PM +0100, Paolo Valente wrote:
>>>>> If, at boot, a legacy I/O scheduler is chosen for a device using blk-mq,
>>>>> or, viceversa, a blk-mq scheduler is chosen for a device using blk, then
>>>>> that scheduler is set and initialized without any check, driving the
>>>>> system into an inconsistent state. This commit addresses this issue by
>>>>> letting elevator_get fail for these wrong cross choices.
>>>>>
>>>>> Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
>>>>> ---
>>>>> block/elevator.c | 26 ++++++++++++++++++--------
>>>>> 1 file changed, 18 insertions(+), 8 deletions(-)
>>>>
>>>> Hey, Paolo,
>>>>
>>>> How exactly are you triggering this? In __elevator_change(), we do check
>>>> for mq or not mq:
>>>>
>>>> if (!e->uses_mq && q->mq_ops) {
>>>> elevator_put(e);
>>>> return -EINVAL;
>>>> }
>>>> if (e->uses_mq && !q->mq_ops) {
>>>> elevator_put(e);
>>>> return -EINVAL;
>>>> }
>>>>
>>>> We don't ever appear to call elevator_init() with a specific scheduler
>>>> name, and for the default we switch off of q->mq_ops and use the
>>>> defaults from Kconfig:
>>>>
>>>> if (q->mq_ops && q->nr_hw_queues == 1)
>>>> e = elevator_get(CONFIG_DEFAULT_SQ_IOSCHED, false);
>>>> else if (q->mq_ops)
>>>> e = elevator_get(CONFIG_DEFAULT_MQ_IOSCHED, false);
>>>> else
>>>> e = elevator_get(CONFIG_DEFAULT_IOSCHED, false);
>>>>
>>>> if (!e) {
>>>> printk(KERN_ERR
>>>> "Default I/O scheduler not found. " \
>>>> "Using noop/none.\n");
>>>> e = elevator_get("noop", false);
>>>> }
>>>>
>>>> So I guess this could happen if someone manually changed those Kconfig
>>>> options, but I don't see what other case would make this happen, could
>>>> you please explain?
>>>
>>> Was wondering the same - is it using the 'elevator=' boot parameter?
>>> Didn't look at that path just now, but that's the only one I could
>>> think of. If it is, I'd much prefer only using 'chosen_elevator' for
>>> the non-mq stuff, and the fix should be just that instead.
>>>
>>> So instead of:
>>>
>>> if (!e && *chosen_elevator) {
>>>
>>> do
>>>
>>> if (!e && !q->mq_ops && && *chosen_elevator) {
>>
>> Confirmed, that's what it seems to be, and here's a real diff of the
>> above example that works for me:
>>
>> diff --git a/block/elevator.c b/block/elevator.c
>> index 27ff1ed5a6fa..699d10f71a2c 100644
>> --- a/block/elevator.c
>> +++ b/block/elevator.c
>> @@ -207,11 +207,12 @@ int elevator_init(struct request_queue *q, char *name)
>> }
>>
>> /*
>> - * Use the default elevator specified by config boot param or
>> - * config option. Don't try to load modules as we could be running
>> - * off async and request_module() isn't allowed from async.
>> + * Use the default elevator specified by config boot param for
>> + * non-mq devices, or by config option.
>
> I don't fully get this choice: being able to change the default I/O
> scheduler through the command line has been rather useful for me,
> saving me a lot of recompilations, and such a feature seems widespread
> among (at least power) users. However, mine is of course just an
> opinion, and I may be missing the main point also in this case.
The problem with the elevator= boot parameter is that it applies across
everything, which makes very little sense, since it's a per device
setting. In retrospect, it was a mistake to add this parameter, and I
don't want to continue down that path with blk-mq.
Why aren't you just using online switching through sysfs? For normal
users, typically this would be done through udev rules.
--
Jens Axboe
^ permalink raw reply
* Re: [PATCH BUGFIX] block: make elevator_get robust against cross blk/blk-mq choice
From: Jens Axboe @ 2017-02-14 15:13 UTC (permalink / raw)
To: Hannes Reinecke, Omar Sandoval, Paolo Valente
Cc: Tejun Heo, linux-block, linux-kernel, ulf.hansson, linus.walleij,
broonie
In-Reply-To: <d6e69d7b-dc69-90ec-0130-dc774fd4da2a@suse.de>
On 02/13/2017 11:58 PM, Hannes Reinecke wrote:
> On 02/13/2017 11:28 PM, Jens Axboe wrote:
>> On 02/13/2017 03:09 PM, Omar Sandoval wrote:
>>> On Mon, Feb 13, 2017 at 10:01:07PM +0100, Paolo Valente wrote:
>>>> If, at boot, a legacy I/O scheduler is chosen for a device using blk-mq,
>>>> or, viceversa, a blk-mq scheduler is chosen for a device using blk, then
>>>> that scheduler is set and initialized without any check, driving the
>>>> system into an inconsistent state. This commit addresses this issue by
>>>> letting elevator_get fail for these wrong cross choices.
>>>>
>>>> Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
>>>> ---
>>>> block/elevator.c | 26 ++++++++++++++++++--------
>>>> 1 file changed, 18 insertions(+), 8 deletions(-)
>>>
>>> Hey, Paolo,
>>>
>>> How exactly are you triggering this? In __elevator_change(), we do check
>>> for mq or not mq:
>>>
>>> if (!e->uses_mq && q->mq_ops) {
>>> elevator_put(e);
>>> return -EINVAL;
>>> }
>>> if (e->uses_mq && !q->mq_ops) {
>>> elevator_put(e);
>>> return -EINVAL;
>>> }
>>>
>>> We don't ever appear to call elevator_init() with a specific scheduler
>>> name, and for the default we switch off of q->mq_ops and use the
>>> defaults from Kconfig:
>>>
>>> if (q->mq_ops && q->nr_hw_queues == 1)
>>> e = elevator_get(CONFIG_DEFAULT_SQ_IOSCHED, false);
>>> else if (q->mq_ops)
>>> e = elevator_get(CONFIG_DEFAULT_MQ_IOSCHED, false);
>>> else
>>> e = elevator_get(CONFIG_DEFAULT_IOSCHED, false);
>>>
>>> if (!e) {
>>> printk(KERN_ERR
>>> "Default I/O scheduler not found. " \
>>> "Using noop/none.\n");
>>> e = elevator_get("noop", false);
>>> }
>>>
>>> So I guess this could happen if someone manually changed those Kconfig
>>> options, but I don't see what other case would make this happen, could
>>> you please explain?
>>
>> Was wondering the same - is it using the 'elevator=' boot parameter?
>> Didn't look at that path just now, but that's the only one I could
>> think of. If it is, I'd much prefer only using 'chosen_elevator' for
>> the non-mq stuff, and the fix should be just that instead.
>>
> [ .. ]
> While we're at the topic:
>
> Can't we use the same names for legacy and mq scheduler?
> It's quite an unnecessary complication to have
> 'noop', 'deadline', and 'cfq' for legacy, but 'none' and 'mq-deadline'
> for mq. If we could use 'noop' and 'deadline' for mq, too, the existing
> settings or udev rules will continue to work and we wouldn't get any
> annoying and pointless warnings here...
I'm fine with potentially renaming mq-deadline to deadline, but I don't
want to mix up none and noop. One is an actual scheduler, the other is
not.
--
Jens Axboe
^ permalink raw reply
* Re: Boot regression (was "Re: [PATCH] genhd: Do not hold event lock when scheduling workqueue elements")
From: hch @ 2017-02-14 14:51 UTC (permalink / raw)
To: Dexuan Cui
Cc: hch@lst.de, Jens Axboe, Bart Van Assche, hare@suse.com,
hare@suse.de, Martin K. Petersen, linux-kernel@vger.kernel.org,
linux-block@vger.kernel.org, jth@kernel.org, Nick Meier,
Alex Ng (LIS), Long Li, Adrian Suhov (Cloudbase Solutions SRL),
Chris Valean (Cloudbase Solutions SRL)
In-Reply-To: <MWHPR03MB2669CCE370BC22E648A468F6BF580@MWHPR03MB2669.namprd03.prod.outlook.com>
On Tue, Feb 14, 2017 at 02:46:41PM +0000, Dexuan Cui wrote:
> > From: hch@lst.de [mailto:hch@lst.de]
> > Sent: Tuesday, February 14, 2017 22:29
> > To: Dexuan Cui <decui@microsoft.com>
> > Subject: Re: Boot regression (was "Re: [PATCH] genhd: Do not hold event lock
> > when scheduling workqueue elements")
> >
> > Ok, thanks for testing. Can you try the patch below? It fixes a
> > clear problem which was partially papered over before the commit
> > you bisected to, although it can't explain why blk-mq still works.
>
> Still bad luck. :-(
>
> BTW, I'm using the first "bad" commit (scsi: allocate scsi_cmnd structures as
> part of struct request) + the 2 patches you provided today.
>
> I suppose I don't need to test the 2 patches on the latest linux-next repo.
I'd love a test on that repo actually. We had a few other for sense
handling since then I think.
^ permalink raw reply
* RE: Boot regression (was "Re: [PATCH] genhd: Do not hold event lock when scheduling workqueue elements")
From: Dexuan Cui @ 2017-02-14 14:46 UTC (permalink / raw)
To: hch@lst.de
Cc: Jens Axboe, Bart Van Assche, hare@suse.com, hare@suse.de,
Martin K. Petersen, linux-kernel@vger.kernel.org,
linux-block@vger.kernel.org, jth@kernel.org, Nick Meier,
Alex Ng (LIS), Long Li, Adrian Suhov (Cloudbase Solutions SRL),
Chris Valean (Cloudbase Solutions SRL)
In-Reply-To: <20170214142837.GB20706@lst.de>
> From: hch@lst.de [mailto:hch@lst.de]
> Sent: Tuesday, February 14, 2017 22:29
> To: Dexuan Cui <decui@microsoft.com>
> Subject: Re: Boot regression (was "Re: [PATCH] genhd: Do not hold event l=
ock
> when scheduling workqueue elements")
>=20
> Ok, thanks for testing. Can you try the patch below? It fixes a
> clear problem which was partially papered over before the commit
> you bisected to, although it can't explain why blk-mq still works.
Still bad luck. :-(
BTW, I'm using the first "bad" commit (scsi: allocate scsi_cmnd structures =
as
part of struct request) + the 2 patches you provided today.
I suppose I don't need to test the 2 patches on the latest linux-next repo.
Thanks,
-- Dexuan
^ permalink raw reply
* Re: Boot regression (was "Re: [PATCH] genhd: Do not hold event lock when scheduling workqueue elements")
From: hch @ 2017-02-14 14:28 UTC (permalink / raw)
To: Dexuan Cui
Cc: hch@lst.de, Jens Axboe, Bart Van Assche, hare@suse.com,
hare@suse.de, Martin K. Petersen, linux-kernel@vger.kernel.org,
linux-block@vger.kernel.org, jth@kernel.org, Nick Meier,
Alex Ng (LIS), Long Li, Adrian Suhov (Cloudbase Solutions SRL),
Chris Valean (Cloudbase Solutions SRL)
In-Reply-To: <MWHPR03MB2669C439014CD20B21ED3A69BF580@MWHPR03MB2669.namprd03.prod.outlook.com>
[-- Attachment #1: Type: text/plain, Size: 199 bytes --]
Ok, thanks for testing. Can you try the patch below? It fixes a
clear problem which was partially papered over before the commit
you bisected to, although it can't explain why blk-mq still works.
[-- Attachment #2: 0001-scsi-always-zero-sshdr-in-scsi_normalize_sense.patch --]
[-- Type: text/x-patch, Size: 999 bytes --]
>From e4a66856fa2d92c0298000de658365f31bea60cd Mon Sep 17 00:00:00 2001
From: Christoph Hellwig <hch@lst.de>
Date: Tue, 14 Feb 2017 15:08:39 +0100
Subject: scsi: always zero sshdr in scsi_normalize_sense
This gives us a clear state even if a command didn't return sense data.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/scsi/scsi_common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/scsi_common.c b/drivers/scsi/scsi_common.c
index b1383a71400e..a75673bb82b3 100644
--- a/drivers/scsi/scsi_common.c
+++ b/drivers/scsi/scsi_common.c
@@ -137,11 +137,11 @@ EXPORT_SYMBOL(int_to_scsilun);
bool scsi_normalize_sense(const u8 *sense_buffer, int sb_len,
struct scsi_sense_hdr *sshdr)
{
+ memset(sshdr, 0, sizeof(struct scsi_sense_hdr));
+
if (!sense_buffer || !sb_len)
return false;
- memset(sshdr, 0, sizeof(struct scsi_sense_hdr));
-
sshdr->response_code = (sense_buffer[0] & 0x7f);
if (!scsi_sense_valid(sshdr))
--
2.11.0
^ permalink raw reply related
* RE: Boot regression (was "Re: [PATCH] genhd: Do not hold event lock when scheduling workqueue elements")
From: Dexuan Cui @ 2017-02-14 14:17 UTC (permalink / raw)
To: hch@lst.de
Cc: Jens Axboe, Bart Van Assche, hare@suse.com, hare@suse.de,
Martin K. Petersen, linux-kernel@vger.kernel.org,
linux-block@vger.kernel.org, jth@kernel.org, Nick Meier,
Alex Ng (LIS), Long Li, Adrian Suhov (Cloudbase Solutions SRL),
Chris Valean (Cloudbase Solutions SRL)
In-Reply-To: <20170214134736.GA19620@lst.de>
[-- Attachment #1: Type: text/plain, Size: 1107 bytes --]
> From: hch@lst.de [mailto:hch@lst.de]
>
> Hi Dexuan,
>
> can you try the hack below for now? I disable the TUR call from
> sd_check_events, which I think your VM is hanging on. The checks
> it does on the sense data look a bit fishy, but so far I've not
> identified a possible root cause.
>
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index 40b4038c019e..1502e87c2be9 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -1457,9 +1457,13 @@ static unsigned int sd_check_events(struct
> gendisk *disk, unsigned int clearing)
> retval = -ENODEV;
>
> if (scsi_block_when_processing_errors(sdp)) {
> +#if 0
> sshdr = kzalloc(sizeof(*sshdr), GFP_KERNEL);
> retval = scsi_test_unit_ready(sdp, SD_TIMEOUT,
> SD_MAX_RETRIES,
> sshdr);
> +#else
> + retval = 0;
> +#endif
> }
>
> /* failed to execute TUR, assume media not present */
Unluckily, the issue is still there.
Please see the attachment for the new log.
It looks somewhere we're still sending the cmd "Test Unit Ready", which
somehow hangs.
Thanks,
-- Dexuan
[-- Attachment #2: putty.log --]
[-- Type: application/octet-stream, Size: 30844 bytes --]
[ 0.000000] Linux version 4.10.0-rc5+ (root@decui-u1604) (gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2.1) ) #19 SMP Tue Feb 14 21:59:36 CST 2017
[ 0.000000] Command line: BOOT_IMAGE=/boot/hv/bzImage root=UUID=f07ac67a-0109-4738-a388-100218d2c5d2 ro ignore_loglevel scsi_mod.use_blk_mq=N scsi_mod.scsi_logging_level=0xFFFF console=ttyS0
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format.
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000e0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000003ffeffff] usable
[ 0.000000] BIOS-e820: [mem 0x000000003fff0000-0x000000003fffefff] ACPI data
[ 0.000000] BIOS-e820: [mem 0x000000003ffff000-0x000000003fffffff] ACPI NVS
[ 0.000000] debug: ignoring loglevel setting.
[ 0.000000] NX (Execute Disable) protection: active
[ 0.000000] SMBIOS 2.3 present.
[ 0.000000] DMI: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS 090006 04/28/2016
[ 0.000000] Hypervisor detected: Microsoft HyperV
[ 0.000000] HyperV: features 0x2e7f, hints 0xc2c
[ 0.000000] HyperV: LAPIC Timer Frequency: 0xc3500
[ 0.000000] clocksource: hyperv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
[ 0.000000] tsc: Marking TSC unstable due to running on Hyper-V
[ 0.000000] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[ 0.000000] e820: remove [mem 0x000a0000-0x000fffff] usable
[ 0.000000] e820: last_pfn = 0x3fff0 max_arch_pfn = 0x400000000
[ 0.000000] MTRR default type: uncachable
[ 0.000000] MTRR fixed ranges enabled:
[ 0.000000] 00000-9FFFF write-back
[ 0.000000] A0000-DFFFF uncachable
[ 0.000000] E0000-FFFFF write-back
[ 0.000000] MTRR variable ranges enabled:
[ 0.000000] 0 base 00000000000 mask FFF00000000 write-back
[ 0.000000] 1 disabled
[ 0.000000] 2 disabled
[ 0.000000] 3 disabled
[ 0.000000] 4 disabled
[ 0.000000] 5 disabled
[ 0.000000] 6 disabled
[ 0.000000] 7 disabled
[ 0.000000] x86/PAT: Configuration [0-7]: WB WC UC- UC WB WC UC- WT
[ 0.000000] found SMP MP-table at [mem 0x000ff780-0x000ff78f] mapped at [ffff8800000ff780]
[ 0.000000] Scanning 1 areas for low memory corruption
[ 0.000000] Base memory trampoline at [ffff880000099000] 99000 size 24576
[ 0.000000] BRK [0x0fb97000, 0x0fb97fff] PGTABLE
[ 0.000000] BRK [0x0fb98000, 0x0fb98fff] PGTABLE
[ 0.000000] BRK [0x0fb99000, 0x0fb99fff] PGTABLE
[ 0.000000] BRK [0x0fb9a000, 0x0fb9afff] PGTABLE
[ 0.000000] BRK [0x0fb9b000, 0x0fb9bfff] PGTABLE
[ 0.000000] BRK [0x0fb9c000, 0x0fb9cfff] PGTABLE
[ 0.000000] BRK [0x0fb9d000, 0x0fb9dfff] PGTABLE
[ 0.000000] BRK [0x0fb9e000, 0x0fb9efff] PGTABLE
[ 0.000000] BRK [0x0fb9f000, 0x0fb9ffff] PGTABLE
[ 0.000000] BRK [0x0fba0000, 0x0fba0fff] PGTABLE
[ 0.000000] BRK [0x0fba1000, 0x0fba1fff] PGTABLE
[ 0.000000] BRK [0x0fba2000, 0x0fba2fff] PGTABLE
[ 0.000000] RAMDISK: [mem 0x2df40000-0x32f97fff]
[ 0.000000] ACPI: Early table checksum verification disabled
[ 0.000000] ACPI: RSDP 0x00000000000F56F0 000014 (v00 ACPIAM)
[ 0.000000] ACPI: RSDT 0x000000003FFF0000 000040 (v01 VRTUAL MICROSFT 04001628 MSFT 00000097)
[ 0.000000] ACPI: FACP 0x000000003FFF0200 000081 (v02 VRTUAL MICROSFT 04001628 MSFT 00000097)
[ 0.000000] ACPI: DSDT 0x000000003FFF1724 0033BE (v01 MSFTVM MSFTVM02 00000002 INTL 02002026)
[ 0.000000] ACPI: FACS 0x000000003FFFF000 000040
[ 0.000000] ACPI: WAET 0x000000003FFF1480 000028 (v01 VRTUAL MICROSFT 04001628 MSFT 00000097)
[ 0.000000] ACPI: SLIC 0x000000003FFF14C0 000176 (v01 VRTUAL MICROSFT 04001628 MSFT 00000097)
[ 0.000000] ACPI: OEM0 0x000000003FFF16C0 000064 (v01 VRTUAL MICROSFT 04001628 MSFT 00000097)
[ 0.000000] ACPI: SRAT 0x000000003FFF0600 0000E0 (v02 VRTUAL MICROSFT 00000001 MSFT 00000001)
[ 0.000000] ACPI: APIC 0x000000003FFF0300 000252 (v01 VRTUAL MICROSFT 04001628 MSFT 00000097)
[ 0.000000] ACPI: OEMB 0x000000003FFFF040 000064 (v01 VRTUAL MICROSFT 04001628 MSFT 00000097)
[ 0.000000] ACPI: Local APIC address 0xfee00000
[ 0.000000] SRAT: PXM 0 -> APIC 0x00 -> Node 0
[ 0.000000] No NUMA configuration found
[ 0.000000] Faking a node at [mem 0x0000000000000000-0x000000003ffeffff]
[ 0.000000] NODE_DATA(0) allocated [mem 0x3ffec000-0x3ffeffff]
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000000001000-0x0000000000ffffff]
[ 0.000000] DMA32 [mem 0x0000000001000000-0x000000003ffeffff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000001000-0x000000000009efff]
[ 0.000000] node 0: [mem 0x0000000000100000-0x000000003ffeffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000001000-0x000000003ffeffff]
[ 0.000000] On node 0 totalpages: 262030
[ 0.000000] DMA zone: 64 pages used for memmap
[ 0.000000] DMA zone: 21 pages reserved
[ 0.000000] DMA zone: 3998 pages, LIFO batch:0
[ 0.000000] DMA32 zone: 4032 pages used for memmap
[ 0.000000] DMA32 zone: 258032 pages, LIFO batch:31
[ 0.000000] kasan: KernelAddressSanitizer initialized
[ 0.000000] ACPI: PM-Timer IO Port: 0x408
[ 0.000000] ACPI: Local APIC address 0xfee00000
[ 0.000000] ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])
[ 0.000000] IOAPIC[0]: apic_id 0, version 17, address 0xfec00000, GSI 0-23
[ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[ 0.000000] ACPI: IRQ0 used by override.
[ 0.000000] ACPI: IRQ9 used by override.
[ 0.000000] Using ACPI (MADT) for SMP configuration information
[ 0.000000] smpboot: Allowing 64 CPUs, 63 hotplug CPUs
[ 0.000000] e820: [mem 0x40000000-0xffffffff] available for PCI devices
[ 0.000000] Booting paravirtualized kernel on bare hardware
[ 0.000000] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645519600211568 ns
[ 0.000000] setup_percpu: NR_CPUS:256 nr_cpumask_bits:256 nr_cpu_ids:64 nr_node_ids:1
[ 0.000000] percpu: Embedded 44 pages/cpu @ffff880035600000 s141000 r8192 d31032 u262144
[ 0.000000] pcpu-alloc: s141000 r8192 d31032 u262144 alloc=1*2097152
[ 0.000000] pcpu-alloc: [0] 00 01 02 03 04 05 06 07 [0] 08 09 10 11 12 13 14 15
[ 0.000000] pcpu-alloc: [0] 16 17 18 19 20 21 22 23 [0] 24 25 26 27 28 29 30 31
[ 0.000000] pcpu-alloc: [0] 32 33 34 35 36 37 38 39 [0] 40 41 42 43 44 45 46 47
[ 0.000000] pcpu-alloc: [0] 48 49 50 51 52 53 54 55 [0] 56 57 58 59 60 61 62 63
[ 0.000000] Built 1 zonelists in Node order, mobility grouping on. Total pages: 257913
[ 0.000000] Policy zone: DMA32
[ 0.000000] Kernel command line: BOOT_IMAGE=/boot/hv/bzImage root=UUID=f07ac67a-0109-4738-a388-100218d2c5d2 ro ignore_loglevel scsi_mod.use_blk_mq=N scsi_mod.scsi_logging_level=0xFFFF console=ttyS0
[ 0.000000] log_buf_len individual max cpu contribution: 4096 bytes
[ 0.000000] log_buf_len total cpu_extra contributions: 258048 bytes
[ 0.000000] log_buf_len min size: 262144 bytes
[ 0.000000] log_buf_len: 524288 bytes
[ 0.000000] early log buf free: 254188(96%)
[ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.000000] Memory: 753612K/1048120K available (11344K kernel code, 4373K rwdata, 5032K rodata, 1684K init, 20112K bss, 294508K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=64, Nodes=1
[ 0.000000] kmemleak: Kernel memory leak detector disabled
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] Build-time adjustment of leaf fanout to 64.
[ 0.000000] RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=64.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=64
[ 0.000000] NR_IRQS:16640 nr_irqs:936 16
[ 0.000000] Offload RCU callbacks from all CPUs
[ 0.000000] Offload RCU callbacks from CPUs: 0-63.
[ 0.000000] Console: colour VGA+ 80x25
[ 0.000000] console [ttyS0] enabled
[ 0.000000] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
[ 0.000000] ... MAX_LOCKDEP_SUBCLASSES: 8
[ 0.000000] ... MAX_LOCK_DEPTH: 48
[ 0.000000] ... MAX_LOCKDEP_KEYS: 8191
[ 0.000000] ... CLASSHASH_SIZE: 4096
[ 0.000000] ... MAX_LOCKDEP_ENTRIES: 32768
[ 0.000000] ... MAX_LOCKDEP_CHAINS: 65536
[ 0.000000] ... CHAINHASH_SIZE: 32768
[ 0.000000] memory used by lock dependency info: 8127 kB
[ 0.000000] per task-struct memory footprint: 1920 bytes
[ 0.000000] ODEBUG: selftest passed
[ 0.000000] kmemleak: Early log buffer exceeded (3603), please increase DEBUG_KMEMLEAK_EARLY_LOG_SIZE
[ 0.000000] tsc: Fast TSC calibration failed
[ 0.000000] tsc: Unable to calibrate against PIT
[ 0.000000] tsc: using PMTIMER reference calibration
[ 0.000000] tsc: Detected 2599.976 MHz processor
[ 0.020055] Calibrating delay loop (skipped), value calculated using timer frequency.. 5199.95 BogoMIPS (lpj=10399904)
[ 0.024022] pid_max: default: 65536 minimum: 512
[ 0.028042] ACPI: Core revision 20160930
[ 0.114692] ACPI: 1 ACPI AML tables successfully acquired and loaded
[ 0.116880] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
[ 0.124139] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
[ 0.128041] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.131405] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.134762] CPU: Physical Processor ID: 0
[ 0.136038] mce: CPU supports 1 MCE banks
[ 0.138513] numa_add_cpu cpu 0 node 0: mask now 0
[ 0.140026] Last level iTLB entries: 4KB 512, 2MB 8, 4MB 8
[ 0.144021] Last level dTLB entries: 4KB 512, 2MB 0, 4MB 0, 1GB 4
[ 0.155218] ftrace: allocating 24846 entries in 98 pages
[ 0.176630] smpboot: Max logical packages: 64
[ 0.180051] Switched APIC routing to physical flat.
[ 0.201586] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[ 0.204119] smpboot: CPU0: Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz (family: 0x6, model: 0x3e, stepping: 0x4)
[ 0.212134] Performance Events: unsupported p6 CPU model 62 no PMU driver, software events only.
[ 0.228062] NMI watchdog: disabled (cpu0): hardware events not enabled
[ 0.232013] NMI watchdog: Shutting down hard lockup detector on all cpus
[ 0.237097] smp: Bringing up secondary CPUs ...
[ 0.240012] smp: Brought up 1 node, 1 CPU
[ 0.244008] smpboot: Total of 1 processors activated (5199.95 BogoMIPS)
[ 0.252594] devtmpfs: initialized
[ 0.265081] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.273529] pinctrl core: initialized pinctrl subsystem
[ 0.280352] NET: Registered protocol family 16
[ 0.294722] cpuidle: using governor ladder
[ 0.296049] cpuidle: using governor menu
[ 0.300034] PCCT header not found.
[ 0.308069] ACPI: bus type PCI registered
[ 0.318683] PCI: Using configuration type 1 for base access
[ 0.373385] HugeTLB registered 1 GB page size, pre-allocated 0 pages
[ 0.376043] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[ 0.397268] ACPI: Added _OSI(Module Device)
[ 0.400032] ACPI: Added _OSI(Processor Device)
[ 0.404036] ACPI: Added _OSI(3.0 _SCP Extensions)
[ 0.408047] ACPI: Added _OSI(Processor Aggregator Device)
[ 0.710343] ACPI: Interpreter enabled
[ 0.716104] ACPI: (supports S0 S5)
[ 0.720013] ACPI: Using IOAPIC for interrupt routing
[ 0.725063] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[ 1.167715] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
[ 1.168109] acpi PNP0A03:00: _OSC: OS supports [Segments MSI]
[ 1.172367] acpi PNP0A03:00: _OSC failed (AE_NOT_FOUND); disabling ASPM
[ 1.179245] PCI host bridge to bus 0000:00
[ 1.180095] pci_bus 0000:00: root bus resource [mem 0xfe0000000-0xfffffffff window]
[ 1.184093] pci_bus 0000:00: root bus resource [io 0x0000-0x0cf7 window]
[ 1.188098] pci_bus 0000:00: root bus resource [io 0x0d00-0xffff window]
[ 1.192094] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff window]
[ 1.196095] pci_bus 0000:00: root bus resource [mem 0xf8000000-0xfffbffff window]
[ 1.200097] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 1.204483] pci 0000:00:00.0: [8086:7192] type 00 class 0x060000
[ 1.217123] pci 0000:00:07.0: [8086:7110] type 00 class 0x060100
[ 1.231554] pci 0000:00:07.1: [8086:7111] type 00 class 0x010180
[ 1.234213] pci 0000:00:07.1: reg 0x20: [io 0xffa0-0xffaf]
[ 1.237776] pci 0000:00:07.1: legacy IDE quirk: reg 0x10: [io 0x01f0-0x01f7]
[ 1.240053] pci 0000:00:07.1: legacy IDE quirk: reg 0x14: [io 0x03f6]
[ 1.244050] pci 0000:00:07.1: legacy IDE quirk: reg 0x18: [io 0x0170-0x0177]
[ 1.248050] pci 0000:00:07.1: legacy IDE quirk: reg 0x1c: [io 0x0376]
[ 1.256759] pci 0000:00:07.3: [8086:7113] type 00 class 0x068000
[ 1.260133] * Found PM-Timer Bug on the chipset. Due to workarounds for a bug,
[ 1.260133] * this clock source is slow. Consider trying other clock sources
[ 1.271103] pci 0000:00:07.3: quirk: [io 0x0400-0x043f] claimed by PIIX4 ACPI
[ 1.278776] pci 0000:00:08.0: [1414:5353] type 00 class 0x030000
[ 1.280837] pci 0000:00:08.0: reg 0x10: [mem 0xf8000000-0xfbffffff]
[ 1.508378] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 7 9 10 *11 12 14 15)
[ 1.518295] ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
[ 1.528000] ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
[ 1.536581] ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
[ 1.545094] ACPI: Enabled 1 GPEs in block 00 to 0F
[ 1.574583] pci 0000:00:08.0: vgaarb: setting as boot VGA device
[ 1.576000] pci 0000:00:08.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none
[ 1.576054] pci 0000:00:08.0: vgaarb: bridge control possible
[ 1.580026] vgaarb: loaded
[ 1.590264] SCSI subsystem initialized
[ 1.594244] libata version 3.00 loaded.
[ 1.598341] PCI: Using ACPI for IRQ routing
[ 1.600031] PCI: pci_cache_line_size set to 64 bytes
[ 1.604446] e820: reserve RAM buffer [mem 0x0009fc00-0x0009ffff]
[ 1.608096] e820: reserve RAM buffer [mem 0x3fff0000-0x3fffffff]
[ 1.622412] clocksource: Switched to clocksource hyperv_clocksource
[ 2.168473] VFS: Disk quotas dquot_6.6.0
[ 2.199833] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 2.253611] pnp: PnP ACPI init
[ 2.279244] pnp 00:00: Plug and Play ACPI device, IDs PNP0b00 (active)
[ 2.338261] pnp 00:01: Plug and Play ACPI device, IDs PNP0303 PNP030b (active)
[ 2.400822] pnp 00:02: Plug and Play ACPI device, IDs PNP0f03 PNP0f13 (active)
[ 2.474722] pnp 00:03: [dma 0 disabled]
[ 2.504970] pnp 00:03: Plug and Play ACPI device, IDs PNP0501 (active)
[ 2.564879] pnp 00:04: [dma 0 disabled]
[ 2.596261] pnp 00:04: Plug and Play ACPI device, IDs PNP0501 (active)
[ 2.668895] pnp 00:05: [dma 2]
[ 2.695958] pnp 00:05: Plug and Play ACPI device, IDs PNP0700 (active)
[ 2.751456] system 00:06: [io 0x01e0-0x01ef] has been reserved
[ 2.810396] system 00:06: [io 0x0160-0x016f] has been reserved
[ 2.859177] system 00:06: [io 0x0278-0x027f] has been reserved
[ 2.947247] system 00:06: [io 0x0378-0x037f] has been reserved
[ 2.997167] system 00:06: [io 0x0678-0x067f] has been reserved
[ 3.050518] system 00:06: [io 0x0778-0x077f] has been reserved
[ 3.104468] system 00:06: [io 0x04d0-0x04d1] has been reserved
[ 3.156259] system 00:06: Plug and Play ACPI device, IDs PNP0c02 (active)
[ 3.228073] system 00:07: [io 0x0400-0x043f] has been reserved
[ 3.309146] system 00:07: [io 0x0370-0x0371] has been reserved
[ 3.363529] system 00:07: [io 0x0440-0x044f] has been reserved
[ 3.417407] system 00:07: [mem 0xfec00000-0xfec00fff] could not be reserved
[ 3.470965] system 00:07: [mem 0xfee00000-0xfee00fff] has been reserved
[ 3.535816] system 00:07: Plug and Play ACPI device, IDs PNP0c02 (active)
[ 3.601401] system 00:08: [mem 0x00000000-0x0009ffff] could not be reserved
[ 3.661929] system 00:08: [mem 0x000c0000-0x000dffff] could not be reserved
[ 3.724843] system 00:08: [mem 0x000e0000-0x000fffff] could not be reserved
[ 3.784780] system 00:08: [mem 0x00100000-0xf7ffffff] could not be reserved
[ 3.836794] system 00:08: [mem 0xfffc0000-0xffffffff] has been reserved
[ 3.896305] system 00:08: Plug and Play ACPI device, IDs PNP0c01 (active)
[ 3.959068] pnp: PnP ACPI: found 9 devices
[ 4.059377] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns
[ 4.138966] pci_bus 0000:00: resource 4 [mem 0xfe0000000-0xfffffffff window]
[ 4.203613] pci_bus 0000:00: resource 5 [io 0x0000-0x0cf7 window]
[ 4.266754] pci_bus 0000:00: resource 6 [io 0x0d00-0xffff window]
[ 4.323857] pci_bus 0000:00: resource 7 [mem 0x000a0000-0x000bffff window]
[ 4.384073] pci_bus 0000:00: resource 8 [mem 0xf8000000-0xfffbffff window]
[ 4.446382] NET: Registered protocol family 2
[ 4.492042] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[ 4.550963] TCP bind hash table entries: 8192 (order: 7, 524288 bytes)
[ 4.606990] TCP: Hash tables configured (established 8192 bind 8192)
[ 4.653913] UDP hash table entries: 512 (order: 4, 81920 bytes)
[ 4.700511] UDP-Lite hash table entries: 512 (order: 4, 81920 bytes)
[ 4.764170] NET: Registered protocol family 1
[ 4.803997] pci 0000:00:00.0: Limiting direct PCI/PCI transfers
[ 4.851800] pci 0000:00:08.0: Video device with shadowed ROM at [mem 0x000c0000-0x000dffff]
[ 4.916349] PCI: CLS 0 bytes, default 64
[ 4.954665] Unpacking initramfs...
[ 7.910742] debug: unmapping init [mem 0xffff88002df40000-0xffff880032f97fff]
[ 7.939507] RAPL PMU: API unit is 2^-32 Joules, 3 fixed counters, 10737418240 ms ovfl timer
[ 7.967877] RAPL PMU: hw unit of domain pp0-core 2^-0 Joules
[ 7.989087] RAPL PMU: hw unit of domain package 2^-0 Joules
[ 8.009919] RAPL PMU: hw unit of domain dram 2^-0 Joules
[ 8.026505] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x257a25906f7, max_idle_ns: 440795319676 ns
[ 8.060648] Scanning for low memory corruption every 60 seconds
[ 8.084129] cryptomgr_test (31) used greatest stack depth: 29344 bytes left
[ 8.119463] futex hash table entries: 16384 (order: 9, 2097152 bytes)
[ 8.142358] audit: initializing netlink subsys (disabled)
[ 8.170015] audit: type=2000 audit(1487081368.160:1): initialized
[ 8.194098] Initialise system trusted keyrings
[ 8.209823] workingset: timestamp_bits=40 max_order=18 bucket_order=0
[ 8.393750] zbud: loaded
[ 8.442056] SGI XFS with security attributes, no debug enabled
[ 8.502466] cryptomgr_test (43) used greatest stack depth: 29120 bytes left
[ 8.529500] cryptomgr_test (50) used greatest stack depth: 28616 bytes left
[ 8.564780] Key type asymmetric registered
[ 8.578682] Asymmetric key parser 'x509' registered
[ 8.605328] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[ 8.665619] random: fast init done
[ 8.691699] io scheduler noop registered
[ 8.725785] io scheduler deadline registered (default)
[ 8.774396] io scheduler cfq registered
[ 8.808405] io scheduler mq-deadline registered
[ 8.878316] GHES: HEST is not enabled!
[ 8.913808] Serial: 8250/16550 driver, 32 ports, IRQ sharing enabled
[ 9.116686] 00:03: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[ 9.340733] 00:04: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A
[ 9.459918] Linux agpgart interface v0.103
[ 9.507683] ata_piix 0000:00:07.1: version 2.13
[ 9.546712] ata_piix 0000:00:07.1: Hyper-V Virtual Machine detected, ATA device ignore set
[ 9.680172] scsi host0: scsi_eh_0: sleeping
[ 9.715531] scsi host0: ata_piix
[ 9.749703] scsi host1: scsi_eh_1: sleeping
[ 9.791021] scsi host1: ata_piix
[ 9.821329] ata1: PATA max UDMA/33 cmd 0x1f0 ctl 0x3f6 bmdma 0xffa0 irq 14
[ 9.889581] ata2: PATA max UDMA/33 cmd 0x170 ctl 0x376 bmdma 0xffa8 irq 15
[ 9.990112] scsi host0: Waking error handler thread
[ 10.032269] scsi host0: scsi_eh_0: waking up 1/0/0
[ 10.073002] scsi host1: Waking error handler thread
[ 10.120455] scsi host1: scsi_eh_1: waking up 1/0/0
[ 10.172770] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f03:PS2M] at 0x60,0x64 irq 1,12
[ 10.252613] serio: i8042 KBD port at 0x60,0x64 irq 1
[ 10.293633] serio: i8042 AUX port at 0x60,0x64 irq 12
[ 10.346090] scsi host1: waking up host to restart
[ 10.386705] scsi host1: scsi_eh_1: sleeping
[ 10.681782] rtc_cmos 00:00: RTC can wake from S4
[ 10.745372] rtc_cmos 00:00: rtc core: registered rtc_cmos as rtc0
[ 10.797256] rtc_cmos 00:00: alarms up to one month, 114 bytes nvram
[ 10.851660] ata1.01: NODEV after polling detection
[ 11.003810] ledtrig-cpu: registered to indicate activity on CPUs
[ 11.073799] NET: Registered protocol family 10
[ 11.140588] ata1.00: host indicates ignore ATA devices, ignored
[ 11.190937] scsi host0: waking up host to restart
[ 11.251567] scsi host0: scsi_eh_0: sleeping
[ 11.295553] Segment Routing with IPv6
[ 11.332968] NET: Registered protocol family 17
[ 11.365656] Key type dns_resolver registered
[ 11.404429] registered taskstats version 1
[ 11.439716] Loading compiled-in X.509 certificates
[ 11.487244] zswap: loaded using pool lzo/zbud
[ 11.600878] rtc_cmos 00:00: setting system clock to 2017-02-14 14:09:35 UTC (1487081375)
[ 11.704000] BIOS EDD facility v0.16 2004-Jun-25, 0 devices found
[ 11.754153] EDD information not available.
[ 11.813499] debug: unmapping init [mem 0xffffffffa0647000-0xffffffffa07ebfff]
[ 11.868404] Write protecting the kernel read-only data: 18432k
[ 11.912489] debug: unmapping init [mem 0xffff88000db18000-0xffff88000dbfffff]
[ 12.008150] debug: unmapping init [mem 0xffff88000e0ea000-0xffff88000e1fffff]
[ 12.105000] mount (68) used greatest stack depth: 28480 bytes left
Loading, please wait...
[ 12.268549] all_generic_ide (78) used greatest stack depth: 27944 bytes left
starting version 229
[ 13.184271] udevadm (85) used greatest stack depth: 27936 bytes left
[ 13.314046] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
[ 13.342220] clocksource: hyperv_clocksource_tsc_page: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
[ 13.533454] clocksource: Switched to clocksource hyperv_clocksource_tsc_page
[ 13.559246] hv_vmbus: Hyper-V Host Build:14393-10.0-0-0.576; Vmbus version:4.0
[ 13.677005] hv_vmbus: registering driver hyperv_fb
[ 13.764010] hv_utils: Registering HyperV Utility Driver
[ 13.805837] hv_vmbus: registering driver hv_util
[ 13.842200] psmouse serio1: trackpoint: failed to get extended button data
[ 13.903246] hv_vmbus: registering driver hyperv_keyboard
[ 13.956938] hidraw: raw HID events driver (C) Jiri Kosina
[ 14.006668] hv_vmbus: registering driver hv_storvsc
[ 14.052442] hyperv_fb: Screen resolution: 1152x864, Color depth: 32
[ 14.112021] hv_vmbus: registering driver hid_hyperv
[ 14.190750] Console: switching to colour frame buffer device 144x54
[ 14.281549] scsi host2: scsi_eh_2: sleeping
[ 14.363114] scsi host2: storvsc_host_t
[ 14.413729] hv_vmbus: registering driver hv_netvsc
[ 14.500991] scsi 2:0:0:0: scsi scan: INQUIRY pass 1 length 36
[ 14.552852] scsi 2:0:0:0: tag#0 Send: scmd 0xffff880019ff9448
[ 14.612510] scsi 2:0:0:0: tag#0 CDB: Inquiry 12 00 00 00 24 00
[ 14.660636] scsi 2:0:0:0: tag#0 Done: SUCCESS Result: hostbyte=DID_OK driverbyte=DRIVER_OK
[ 14.735249] scsi 2:0:0:0: tag#0 CDB: Inquiry 12 00 00 00 24 00
[ 14.739191] scsi 2:0:0:0: tag#0 scsi host busy 1 failed 0
[ 14.739191] scsi 2:0:0:0: Notifying upper driver of completion (result 0)
[ 14.739191] scsi 2:0:0:0: scsi scan: INQUIRY successful with code 0x0
[ 14.964062] scsi 2:0:0:0: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 5
[ 15.038762] scsi 2:0:0:0: tag#0 Send: scmd 0xffff880019ffd5e8
[ 15.089616] scsi 2:0:0:0: tag#0 CDB: Inquiry 12 01 00 00 ff 00
[ 15.137673] scsi 2:0:0:0: tag#0 Done: SUCCESS Result: hostbyte=DID_OK driverbyte=DRIVER_OK
[ 15.207744] scsi 2:0:0:0: tag#0 CDB: Inquiry 12 01 00 00 ff 00
[ 15.255839] scsi 2:0:0:0: tag#0 scsi host busy 1 failed 0
[ 15.304291] scsi 2:0:0:0: Notifying upper driver of completion (result 0)
[ 15.362157] scsi 2:0:0:0: tag#0 Send: scmd 0xffff880019ffa708
[ 15.413281] scsi 2:0:0:0: tag#0 CDB: Inquiry 12 01 83 00 ff 00
[ 15.460944] scsi 2:0:0:0: tag#0 Done: SUCCESS Result: hostbyte=DID_OK driverbyte=DRIVER_OK
[ 15.518901] scsi 2:0:0:0: tag#0 CDB: Inquiry 12 01 83 00 ff 00
[ 15.570146] scsi 2:0:0:0: tag#0 scsi host busy 1 failed 0
[ 15.618008] scsi 2:0:0:0: Notifying upper driver of completion (result 0)
[ 15.678847] sd 2:0:0:0: tag#0 Send: scmd 0xffff880019ffb068
[ 15.723329] sd 2:0:0:0: tag#0 CDB: Test Unit Ready 00 00 00 00 00 00
[ 15.775429] sd 2:0:0:0: sg_alloc: dev=0
[ 15.809186] sd 2:0:0:0: Attached scsi generic sg0 type 0
[ 15.884302] input: Microsoft Vmbus HID-compliant Mouse as /devices/0006:045E:0621.0001/input/input3
[ 15.976010] hid-generic 0006:045E:0621.0001: input: <UNKNOWN> HID v0.01 Mouse [Microsoft Vmbus HID-compliant Mouse] on
[ 16.198080] hv_utils: Using TimeSync version 4.0
[ 18.949416] psmouse serio1: trackpoint: IBM TrackPoint firmware: 0x01, buttons: 0/0
[ 19.013187] input: TPPS/2 IBM TrackPoint as /devices/platform/i8042/serio1/input/input2
[ 19.088795] input: AT Translated Set 2 keyboard as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00/device:07/VMBUS:01/d34b2567-b9b6-42b9-8778-0a4ec0b955bf/serio2/input/input4
[ 46.048170] sd 2:0:0:0: tag#0 Done: TIMEOUT_ERROR Result: hostbyte=DID_OK driverbyte=DRIVER_OK
[ 46.052054] sd 2:0:0:0: tag#0 CDB: Test Unit Ready 00 00 00 00 00 00
[ 46.052054] sd 2:0:0:0: tag#0 scsi host busy 1 failed 0
[ 78.816191] sd 2:0:0:0: tag#0 Done: TIMEOUT_ERROR Result: hostbyte=DID_OK driverbyte=DRIVER_OK
[ 78.820056] sd 2:0:0:0: tag#0 CDB: Test Unit Ready 00 00 00 00 00 00
[ 78.820056] sd 2:0:0:0: tag#0 scsi host busy 1 failed 0
[ 111.584194] sd 2:0:0:0: tag#0 Done: TIMEOUT_ERROR Result: hostbyte=DID_OK driverbyte=DRIVER_OK
[ 111.588064] sd 2:0:0:0: tag#0 CDB: Test Unit Ready 00 00 00 00 00 00
[ 111.588064] sd 2:0:0:0: tag#0 scsi host busy 1 failed 0
[ 121.824225] INFO: task systemd-udevd:104 blocked for more than 60 seconds.
[ 121.874720] Not tainted 4.10.0-rc5+ #19
[ 121.914743] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 121.990829] systemd-udevd D25232 104 84 0x00000000
[ 122.036193] Call Trace:
[ 122.055827] __schedule+0x48c/0xc90
[ 122.086341] ? do_raw_spin_lock+0x112/0x1a0
[ 122.121098] schedule+0x4d/0xd0
[ 122.146919] async_synchronize_cookie_domain+0x133/0x1e0
[ 122.277712] ? async_unregister_domain+0x70/0x70
[ 122.326912] ? remove_wait_queue+0xc0/0xc0
[ 122.360589] ? up_read+0x1f/0x40
[ 122.391119] ? __blocking_notifier_call_chain+0x6c/0x80
[ 122.440005] async_synchronize_full+0x17/0x20
[ 122.478899] do_init_module+0x174/0x311
[ 122.517420] load_module+0x4484/0x4c00
[ 122.552531] ? m_show+0x2b0/0x2b0
[ 122.580499] ? fsnotify+0x769/0x7e0
[ 122.623893] ? module_frob_arch_sections+0x20/0x20
[ 122.671746] ? __fsnotify_parent+0x2c/0x130
[ 122.711308] ? vfs_read+0x14b/0x1b0
[ 122.742297] ? kernel_read_file+0x12a/0x350
[ 122.778480] ? set_binfmt+0x90/0x90
[ 122.826074] ? kernel_read_file_from_fd+0x49/0x80
[ 122.867793] SYSC_finit_module+0x169/0x1a0
[ 122.904224] ? SYSC_init_module+0x1d0/0x1d0
[ 122.947117] ? vma_is_stack_for_current+0x60/0x60
[ 122.988156] ? __fget+0x10b/0x150
[ 123.013801] ? lockdep_sys_exit+0x1a/0xa0
[ 123.050099] ? lockdep_sys_exit_thunk+0x16/0x30
[ 123.087355] SyS_finit_module+0xe/0x10
[ 123.115902] entry_SYSCALL_64_fastpath+0x1e/0xb2
[ 123.151843] RIP: 0033:0x7f6060499c19
[ 123.179364] RSP: 002b:00007ffec634f808 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[ 123.241863] RAX: ffffffffffffffda RBX: 000055f86ee6cbd0 RCX: 00007f6060499c19
[ 123.301211] RDX: 0000000000000000 RSI: 00007f606098fe2a RDI: 000000000000000c
[ 123.364226] RBP: 00007f606098fe2a R08: 0000000000000000 R09: 0000000000000000
[ 123.427614] R10: 000000000000000c R11: 0000000000000246 R12: 0000000000000000
[ 123.492838] R13: 000055f86ee70f30 R14: 0000000000020000 R15: 000000000aba9500
[ 123.556355]
[ 123.556355] Showing all locks held in the system:
[ 123.610348] 2 locks held by khungtaskd/17:
[ 123.645766] #0: (rcu_read_lock){......}, at: [<ffffffff9f1abc56>] watchdog+0xc6/0x530
[ 123.715830] #1: (tasklist_lock){......}, at: [<ffffffff9f111a89>] debug_show_all_locks+0x49/0x1e0
[ 123.806486] 2 locks held by kworker/u128:1/61:
[ 123.841210] #0: ("events_unbound"){......}, at: [<ffffffff9f0bf3c2>] process_one_work+0x3d2/0xa60
[ 123.909420] #1: ((&entry->work)){......}, at: [<ffffffff9f0bf3c2>] process_one_work+0x3d2/0xa60
[ 123.986273]
[ 123.999135] =============================================
[ 123.999135]
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... [ 134.463258] random: crng init done
^ permalink raw reply
* Re: Boot regression (was "Re: [PATCH] genhd: Do not hold event lock when scheduling workqueue elements")
From: hch @ 2017-02-14 13:47 UTC (permalink / raw)
To: Dexuan Cui
Cc: hch@lst.de, Jens Axboe, Bart Van Assche, hare@suse.com,
hare@suse.de, Martin K. Petersen, linux-kernel@vger.kernel.org,
linux-block@vger.kernel.org, jth@kernel.org, Nick Meier,
Alex Ng (LIS), Long Li, Adrian Suhov (Cloudbase Solutions SRL),
Chris Valean (Cloudbase Solutions SRL)
In-Reply-To: <MWHPR03MB2669B4FFC900983C8C357A77BF440@MWHPR03MB2669.namprd03.prod.outlook.com>
Hi Dexuan,
can you try the hack below for now? I disable the TUR call from
sd_check_events, which I think your VM is hanging on. The checks
it does on the sense data look a bit fishy, but so far I've not
identified a possible root cause.
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 40b4038c019e..1502e87c2be9 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1457,9 +1457,13 @@ static unsigned int sd_check_events(struct gendisk *disk, unsigned int clearing)
retval = -ENODEV;
if (scsi_block_when_processing_errors(sdp)) {
+#if 0
sshdr = kzalloc(sizeof(*sshdr), GFP_KERNEL);
retval = scsi_test_unit_ready(sdp, SD_TIMEOUT, SD_MAX_RETRIES,
sshdr);
+#else
+ retval = 0;
+#endif
}
/* failed to execute TUR, assume media not present */
^ permalink raw reply related
* Re: [PATCH v3] sd: Check for unaligned partial completion
From: Damien Le Moal @ 2017-02-14 12:47 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-block, Shaun Tancheff
In-Reply-To: <20170214124228.3386-1-damien.lemoal@wdc.com>
Jens,
My git-send-email script was using the wrong set of destination email
addresses for this patch. This should go to linux-scsi and Martin.
Resending.
My apologies about the noise.
Best regards.
On 2/14/17 21:42, Damien Le Moal wrote:
> Commit "mpt3sas: Force request partial completion alignment" was not
> considering the case of REQ_TYPE_FS commands not operating on sector
> size units (e.g. REQ_OP_ZONE_REPORT and its 64B aligned partial
> replies). This could result is incorrectly retrying (forever) those
> commands.
> =
> Move the partial completion alignement check of mpt3sas to sd_done so
> that the check comes after good_bytes & resid corrections of done in
> that function depending on the request command to avoid false positive.
> =
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> =
> ---
> =
> Changes from v2:
> - Fixed good_bytes calculation after correction of unaligned resid
> It should be good_bytes=3Dscsi_buflen() - resid, and not good_bytes-=3Dre=
sid
> =
> drivers/scsi/mpt3sas/mpt3sas_scsih.c | 15 ---------------
> drivers/scsi/sd.c | 20 ++++++++++++++++++++
> 2 files changed, 20 insertions(+), 15 deletions(-)
> =
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/=
mpt3sas_scsih.c
> index 0b5b423..1961535 100644
> --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> @@ -4658,7 +4658,6 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smi=
d, u8 msix_index, u32 reply)
> struct MPT3SAS_DEVICE *sas_device_priv_data;
> u32 response_code =3D 0;
> unsigned long flags;
> - unsigned int sector_sz;
> =
> mpi_reply =3D mpt3sas_base_get_reply_virt_addr(ioc, reply);
> scmd =3D _scsih_scsi_lookup_get_clear(ioc, smid);
> @@ -4717,20 +4716,6 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 sm=
id, u8 msix_index, u32 reply)
> }
> =
> xfer_cnt =3D le32_to_cpu(mpi_reply->TransferCount);
> -
> - /* In case of bogus fw or device, we could end up having
> - * unaligned partial completion. We can force alignment here,
> - * then scsi-ml does not need to handle this misbehavior.
> - */
> - sector_sz =3D scmd->device->sector_size;
> - if (unlikely(scmd->request->cmd_type =3D=3D REQ_TYPE_FS && sector_sz &&
> - xfer_cnt % sector_sz)) {
> - sdev_printk(KERN_INFO, scmd->device,
> - "unaligned partial completion avoided (xfer_cnt=3D%u, sector_sz=3D=
%u)\n",
> - xfer_cnt, sector_sz);
> - xfer_cnt =3D round_down(xfer_cnt, sector_sz);
> - }
> -
> scsi_set_resid(scmd, scsi_bufflen(scmd) - xfer_cnt);
> if (ioc_status & MPI2_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE)
> log_info =3D le32_to_cpu(mpi_reply->IOCLogInfo);
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index 1f5d92a..2f70b36 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -1790,6 +1790,8 @@ static int sd_done(struct scsi_cmnd *SCpnt)
> {
> int result =3D SCpnt->result;
> unsigned int good_bytes =3D result ? 0 : scsi_bufflen(SCpnt);
> + unsigned int sector_size =3D SCpnt->device->sector_size;
> + unsigned int resid;
> struct scsi_sense_hdr sshdr;
> struct scsi_disk *sdkp =3D scsi_disk(SCpnt->request->rq_disk);
> struct request *req =3D SCpnt->request;
> @@ -1829,6 +1831,24 @@ static int sd_done(struct scsi_cmnd *SCpnt)
> }
> sdkp->medium_access_timed_out =3D 0;
> =
> + /*
> + * In case of bogus fw or device, we could end up having
> + * unaligned partial completion. Check this here and force
> + * alignment.
> + */
> + resid =3D scsi_get_resid(SCpnt);
> + if (resid & (sector_size - 1)) {
> + SCSI_LOG_HLCOMPLETE(1, scmd_printk(KERN_INFO, SCpnt,
> + "Unaligned partial completion (resid=3D%u, sector_sz=3D%u)\n",
> + resid, sector_size));
> + resid =3D round_up(resid, sector_size);
> + if (resid < scsi_bufflen(SCpnt))
> + good_bytes =3D scsi_bufflen(SCpnt) - resid;
> + else
> + good_bytes =3D 0;
> + scsi_set_resid(SCpnt, resid);
> + }
> +
> if (driver_byte(result) !=3D DRIVER_SENSE &&
> (!sense_valid || sense_deferred))
> goto out;
> =
-- =
Damien Le Moal, Ph.D.
Sr. Manager, System Software Research Group,
Western Digital Corporation
Damien.LeMoal@wdc.com
(+81) 0466-98-3593 (ext. 513593)
1 kirihara-cho, Fujisawa,
Kanagawa, 252-0888 Japan
www.wdc.com, www.hgst.com
Western Digital Corporation (and its subsidiaries) E-mail Confidentiality N=
otice & Disclaimer:
This e-mail and any files transmitted with it may contain confidential or l=
egally privileged information of WDC and/or its affiliates, and are intende=
d solely for the use of the individual or entity to which they are addresse=
d. If you are not the intended recipient, any disclosure, copying, distribu=
tion or any action taken or omitted to be taken in reliance on it, is prohi=
bited. If you have received this e-mail in error, please notify the sender =
immediately and delete the e-mail in its entirety from your system.
^ permalink raw reply
* [PATCH v3] sd: Check for unaligned partial completion
From: Damien Le Moal @ 2017-02-14 12:42 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-block, Shaun Tancheff, Damien Le Moal
Commit "mpt3sas: Force request partial completion alignment" was not
considering the case of REQ_TYPE_FS commands not operating on sector
size units (e.g. REQ_OP_ZONE_REPORT and its 64B aligned partial
replies). This could result is incorrectly retrying (forever) those
commands.
Move the partial completion alignement check of mpt3sas to sd_done so
that the check comes after good_bytes & resid corrections of done in
that function depending on the request command to avoid false positive.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
Changes from v2:
- Fixed good_bytes calculation after correction of unaligned resid
It should be good_bytes=scsi_buflen() - resid, and not good_bytes-=resid
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 15 ---------------
drivers/scsi/sd.c | 20 ++++++++++++++++++++
2 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 0b5b423..1961535 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -4658,7 +4658,6 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply)
struct MPT3SAS_DEVICE *sas_device_priv_data;
u32 response_code = 0;
unsigned long flags;
- unsigned int sector_sz;
mpi_reply = mpt3sas_base_get_reply_virt_addr(ioc, reply);
scmd = _scsih_scsi_lookup_get_clear(ioc, smid);
@@ -4717,20 +4716,6 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply)
}
xfer_cnt = le32_to_cpu(mpi_reply->TransferCount);
-
- /* In case of bogus fw or device, we could end up having
- * unaligned partial completion. We can force alignment here,
- * then scsi-ml does not need to handle this misbehavior.
- */
- sector_sz = scmd->device->sector_size;
- if (unlikely(scmd->request->cmd_type == REQ_TYPE_FS && sector_sz &&
- xfer_cnt % sector_sz)) {
- sdev_printk(KERN_INFO, scmd->device,
- "unaligned partial completion avoided (xfer_cnt=%u, sector_sz=%u)\n",
- xfer_cnt, sector_sz);
- xfer_cnt = round_down(xfer_cnt, sector_sz);
- }
-
scsi_set_resid(scmd, scsi_bufflen(scmd) - xfer_cnt);
if (ioc_status & MPI2_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE)
log_info = le32_to_cpu(mpi_reply->IOCLogInfo);
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 1f5d92a..2f70b36 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1790,6 +1790,8 @@ static int sd_done(struct scsi_cmnd *SCpnt)
{
int result = SCpnt->result;
unsigned int good_bytes = result ? 0 : scsi_bufflen(SCpnt);
+ unsigned int sector_size = SCpnt->device->sector_size;
+ unsigned int resid;
struct scsi_sense_hdr sshdr;
struct scsi_disk *sdkp = scsi_disk(SCpnt->request->rq_disk);
struct request *req = SCpnt->request;
@@ -1829,6 +1831,24 @@ static int sd_done(struct scsi_cmnd *SCpnt)
}
sdkp->medium_access_timed_out = 0;
+ /*
+ * In case of bogus fw or device, we could end up having
+ * unaligned partial completion. Check this here and force
+ * alignment.
+ */
+ resid = scsi_get_resid(SCpnt);
+ if (resid & (sector_size - 1)) {
+ SCSI_LOG_HLCOMPLETE(1, scmd_printk(KERN_INFO, SCpnt,
+ "Unaligned partial completion (resid=%u, sector_sz=%u)\n",
+ resid, sector_size));
+ resid = round_up(resid, sector_size);
+ if (resid < scsi_bufflen(SCpnt))
+ good_bytes = scsi_bufflen(SCpnt) - resid;
+ else
+ good_bytes = 0;
+ scsi_set_resid(SCpnt, resid);
+ }
+
if (driver_byte(result) != DRIVER_SENSE &&
(!sense_valid || sense_deferred))
goto out;
--
2.9.3
Western Digital Corporation (and its subsidiaries) E-mail Confidentiality Notice & Disclaimer:
This e-mail and any files transmitted with it may contain confidential or legally privileged information of WDC and/or its affiliates, and are intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited. If you have received this e-mail in error, please notify the sender immediately and delete the e-mail in its entirety from your system.
^ permalink raw reply related
* Re: [PATCH v4] mmc: sdio: check the buffer address for sdio API
From: Ulf Hansson @ 2017-02-14 9:17 UTC (permalink / raw)
To: Shawn Lin
Cc: linux-mmc@vger.kernel.org, Russell King, Jens Axboe,
Christoph Hellwig, linux-block
In-Reply-To: <1486428890-28187-1-git-send-email-shawn.lin@rock-chips.com>
+Russell, Jens, Christoph, linux-block (asking for help in review)
On 7 February 2017 at 01:54, Shawn Lin <shawn.lin@rock-chips.com> wrote:
> It's fine if the host driver use PIO mode to transfer the
> vmalloc area buffer but not for DMA mode. The sdio APIs haven't
> provide the capability to tell the caller whether it will use DMA
> to finish the IO transfer or not, so don't give the randomly
> insmoded sdio function driver the possibility to break the kernel.
> Also the APIs shouldn't take the liberty to do a copy for these
> cases and just kick out these requests should be enough.
>
> This issue is observed by doing insmod a downloaded wifi module
> driver and the kernel panic right away. Unfortunately we don't have
> the source code but adding this patch that it proves that the module
> driver was passing on a vmalloc area buffer for sdio APIs.
>
> It could very easy to be reproduced by writing a simple function
> module driver and insmod it, and panic log looks like:
>
> unsigned u8 __aligned(32) buf[PAGE_SIZE];
>
> static int wifi_probe(struct sdio_func *func, const struct
> sdio_device_id *id)
> {
> sdio_claim_host(func);
> sdio_enable_func(func);
> sdio_memcpy_toio(func, 0x0, buf, 0x200);
> }
>
> [ 236.748210] wifi_probe: buf = 0xffffff8000a40b80
> [ 236.748258] swiotlb_tbl_map_single: orig_addr = 0xfffffffff8c40b80,
> tlb_addr = 0xf7eae000 //I added log here
> [ 236.748276] Unable to handle kernel paging request at virtual address
> fffffffff8c40b80
> [ 236.776486] pgd = ffffffc0b3417000
> [ 236.776789] [fffffffff8c40b80] *pgd=00000000b3427003,
> *pud=00000000b3427003, *pmd=0000000000000000
> [ 236.777601] Internal error: Oops: 96000005 [#1] PREEMPT SMP
> [ 236.778093] Modules linked in: drvtst(O+)
> [ 236.778463] CPU: 0 PID: 1918 Comm: insmod Tainted: G O
> 4.4.36 #25
> [ 236.779096] Hardware name: Rockchip RK3399 Evaluation Board v3 edp
> (Android) (DT)
> [ 236.779753] task: ffffffc0e3db0c40 ti: ffffffc0b342c000 task.ti:
> ffffffc0b342c000
> [ 236.780418] PC is at __memcpy+0x100/0x180
> [ 236.780777] LR is at swiotlb_tbl_map_single+0x254/0x274
> [ 236.781237] pc : [<ffffff80083579c0>] lr : [<ffffff800837cf70>]
> ...
>
> [ 236.941392] f460: 3d20726464615f67 6666666666783020
> [ 236.941826] [<ffffff80083579c0>] __memcpy+0x100/0x180
> [ 236.942274] [<ffffff800837dc18>] swiotlb_map_sg_attrs+0xa8/0x170
> [ 236.942810] [<ffffff800809359c>] __swiotlb_map_sg_attrs+0x24/0x8c
> [ 236.943353] [<ffffff800871113c>]
> dw_mci_pre_dma_transfer.isra.16+0xf0/0x11c
> [ 236.943967] [<ffffff80087129cc>] __dw_mci_start_request+0x17c/0x4d0
> [ 236.944520] [<ffffff80087132e0>] dw_mci_request+0xb8/0xf0
> [ 236.945002] [<ffffff80086f8b44>] __mmc_start_request+0x9c/0xc0
> [ 236.945520] [<ffffff80087ae0e8>]
> mmc_start_request.part.17+0x100/0x11c
> [ 236.946097] [<ffffff80086f9c74>] mmc_wait_for_req+0x78/0x1a8
> [ 236.946600] [<ffffff800870421c>] mmc_io_rw_extended+0x27c/0x2fc
> [ 236.947124] [<ffffff8008705800>] sdio_io_rw_ext_helper+0x1e4/0x238
> [ 236.947670] [<ffffff8008705954>] sdio_memcpy_toio+0x24/0x2c
> [ 236.948169] [<ffffff8000a40108>] wifi_probe+0xa8/0x198 [drvtst]
> [ 236.948708] [<ffffff8008704734>] sdio_bus_probe+0xb0/0x140
> [ 236.949195] [<ffffff80084bfd6c>] driver_probe_device+0x118/0x2b0
> [ 236.949724] [<ffffff80084bff68>] __driver_attach+0x64/0x90
> [ 236.950212] [<ffffff80084bee18>] bus_for_each_dev+0x80/0xb0
> [ 236.950706] [<ffffff80084bf8ac>] driver_attach+0x20/0x28
> [ 236.951176] [<ffffff80084bf45c>] bus_add_driver+0xe8/0x1ec
> [ 236.951661] [<ffffff80084c0afc>] driver_register+0x98/0xe4
> [ 236.952147] [<ffffff8008704580>] sdio_register_driver+0x24/0x2c
> [ 236.952675] [<ffffff8000a40228>] wifi_sdio_init+0x30/0x68 [drvtst]
> [ 236.953241] [<ffffff8000a4400c>] wifi_drv_init+0xc/0x38 [drvtst]
> [ 236.953789] [<ffffff8008082ba4>] do_one_initcall+0x17c/0x198
> [ 236.954293] [<ffffff800815e564>] do_init_module+0x60/0x1b8
> [ 236.954779] [<ffffff80081150f0>] load_module+0x1660/0x1a50
> [ 236.955264] [<ffffff800811562c>] SyS_init_module+0x14c/0x180
> [ 236.955765] [<ffffff80080826f0>] el0_svc_naked+0x24/0x28
>
> So the kernel crash since the vmalloc area buffer, on-stack buffer or
> the on-module buffer aren't physical continuous and swiotlb couldn't find
> the correct mapping address in fact. Anyway, don't give the chance to panic
> kernel by using sdio APIs.
>
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
>
> ---
>
> Changes in v4:
> - fix build warning by gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
>
> Changes in v3:
> - fix build issue reported by Kbuild Robot
>
> Changes in v2:
> - add new function to check the addr of vmalloc/module/stack
>
> drivers/mmc/core/sdio_io.c | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/core/sdio_io.c b/drivers/mmc/core/sdio_io.c
> index 406e5f0..4df7c6f 100644
> --- a/drivers/mmc/core/sdio_io.c
> +++ b/drivers/mmc/core/sdio_io.c
> @@ -10,6 +10,7 @@
> */
>
> #include <linux/export.h>
> +#include <linux/mm.h>
> #include <linux/mmc/host.h>
> #include <linux/mmc/card.h>
> #include <linux/mmc/sdio.h>
> @@ -298,6 +299,19 @@ unsigned int sdio_align_size(struct sdio_func *func, unsigned int sz)
> }
> EXPORT_SYMBOL_GPL(sdio_align_size);
>
> +static int sdio_io_addr_sanity_check(void *buf)
> +{
> +#if defined(CONFIG_MODULES) && defined(MODULES_VADDR)
> + unsigned long addr = (unsigned long)buf;
> +
> + if ((addr >= MODULES_VADDR && addr < MODULES_END) ||
> + object_is_on_stack(buf))
> + return 1;
> +#endif
> + return (is_vmalloc_addr(buf) || object_is_on_stack(buf));
> +
> +}
> +
> /* Split an arbitrarily sized data transfer into several
> * IO_RW_EXTENDED commands. */
> static int sdio_io_rw_ext_helper(struct sdio_func *func, int write,
> @@ -307,7 +321,7 @@ static int sdio_io_rw_ext_helper(struct sdio_func *func, int write,
> unsigned max_blocks;
> int ret;
>
> - if (!func || (func->num > 7))
> + if (!func || (func->num > 7) || sdio_io_addr_sanity_check(buf))
> return -EINVAL;
>
> /* Do the bulk of the transfer using block mode (if supported). */
> --
> 1.9.1
>
>
I somewhat understand the issue you are trying to solve when
validating the buffer for DMA. However, I don't know what a proper fix
should be. Especially since I have seen nothing similar in the kernel
so far.
Therefore I have looped in Russell King, Jens Axboe, Christoph Hellwig
and linux-block to ask for help in reviewing this. Hopefully we can
get some advise here.
To give some more background to the folkz above, the SDIO func API
(part of the MMC subsystem) is intended to be used by for example WLAN
drivers, which may be built as kernel modules. Part of SDIO func API
is about writing/reading buffers to/from an SDIO card. That may
involve doing DMA transactions, depending on what the corresponding
MMC/SDIO host controller/driver supports.
Kind regards
Uffe
^ permalink raw reply
* Re: [PATCH v2] sd: Check for unaligned partial completion
From: Hannes Reinecke @ 2017-02-14 9:08 UTC (permalink / raw)
To: Damien Le Moal, Jens Axboe; +Cc: linux-block, Shaun Tancheff
In-Reply-To: <20170214090049.29910-1-damien.lemoal@wdc.com>
On 02/14/2017 10:00 AM, Damien Le Moal wrote:
> Commit "mpt3sas: Force request partial completion alignment" was not
> considering the case of REQ_TYPE_FS commands not operating on sector
> size units (e.g. REQ_OP_ZONE_REPORT and its 64B aligned partial
> replies). This could result is incorrectly retrying (forever) those
> commands.
>
> Move the partial completion alignement check of mpt3sas to sd_done so
> that the check comes after good_bytes & resid corrections of done in
> that function depending on the request command to avoid false positive.
>
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> ---
> drivers/scsi/mpt3sas/mpt3sas_scsih.c | 15 ---------------
> drivers/scsi/sd.c | 20 ++++++++++++++++++++
> 2 files changed, 20 insertions(+), 15 deletions(-)
>
And indeed, I like this version far better than the mpt3sas-specific one.
Reviewed-by: Hannes Reinecke <hare@suse.com>
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@suse.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N�rnberg
GF: F. Imend�rffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG N�rnberg)
^ permalink raw reply
* [PATCH v2] sd: Check for unaligned partial completion
From: Damien Le Moal @ 2017-02-14 9:00 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-block, Shaun Tancheff, Damien Le Moal
Commit "mpt3sas: Force request partial completion alignment" was not
considering the case of REQ_TYPE_FS commands not operating on sector
size units (e.g. REQ_OP_ZONE_REPORT and its 64B aligned partial
replies). This could result is incorrectly retrying (forever) those
commands.
Move the partial completion alignement check of mpt3sas to sd_done so
that the check comes after good_bytes & resid corrections of done in
that function depending on the request command to avoid false positive.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 15 ---------------
drivers/scsi/sd.c | 20 ++++++++++++++++++++
2 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 0b5b423..1961535 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -4658,7 +4658,6 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply)
struct MPT3SAS_DEVICE *sas_device_priv_data;
u32 response_code = 0;
unsigned long flags;
- unsigned int sector_sz;
mpi_reply = mpt3sas_base_get_reply_virt_addr(ioc, reply);
scmd = _scsih_scsi_lookup_get_clear(ioc, smid);
@@ -4717,20 +4716,6 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply)
}
xfer_cnt = le32_to_cpu(mpi_reply->TransferCount);
-
- /* In case of bogus fw or device, we could end up having
- * unaligned partial completion. We can force alignment here,
- * then scsi-ml does not need to handle this misbehavior.
- */
- sector_sz = scmd->device->sector_size;
- if (unlikely(scmd->request->cmd_type == REQ_TYPE_FS && sector_sz &&
- xfer_cnt % sector_sz)) {
- sdev_printk(KERN_INFO, scmd->device,
- "unaligned partial completion avoided (xfer_cnt=%u, sector_sz=%u)\n",
- xfer_cnt, sector_sz);
- xfer_cnt = round_down(xfer_cnt, sector_sz);
- }
-
scsi_set_resid(scmd, scsi_bufflen(scmd) - xfer_cnt);
if (ioc_status & MPI2_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE)
log_info = le32_to_cpu(mpi_reply->IOCLogInfo);
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 1f5d92a..b0cb9c5 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1790,6 +1790,8 @@ static int sd_done(struct scsi_cmnd *SCpnt)
{
int result = SCpnt->result;
unsigned int good_bytes = result ? 0 : scsi_bufflen(SCpnt);
+ unsigned int sector_size = SCpnt->device->sector_size;
+ unsigned int resid;
struct scsi_sense_hdr sshdr;
struct scsi_disk *sdkp = scsi_disk(SCpnt->request->rq_disk);
struct request *req = SCpnt->request;
@@ -1829,6 +1831,24 @@ static int sd_done(struct scsi_cmnd *SCpnt)
}
sdkp->medium_access_timed_out = 0;
+ /*
+ * In case of bogus fw or device, we could end up having
+ * unaligned partial completion. Check this here and force
+ * alignment.
+ */
+ resid = scsi_get_resid(SCpnt);
+ if (resid & (sector_size - 1)) {
+ SCSI_LOG_HLCOMPLETE(1, scmd_printk(KERN_INFO, SCpnt,
+ "Unaligned partial completion (resid=%u, sector_sz=%u)\n",
+ resid, sector_size));
+ resid = round_up(resid, sector_size);
+ if (resid < good_bytes)
+ good_bytes -= resid;
+ else
+ good_bytes = 0;
+ scsi_set_resid(SCpnt, resid);
+ }
+
if (driver_byte(result) != DRIVER_SENSE &&
(!sense_valid || sense_deferred))
goto out;
--
2.9.3
Western Digital Corporation (and its subsidiaries) E-mail Confidentiality Notice & Disclaimer:
This e-mail and any files transmitted with it may contain confidential or legally privileged information of WDC and/or its affiliates, and are intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited. If you have received this e-mail in error, please notify the sender immediately and delete the e-mail in its entirety from your system.
^ permalink raw reply related
* Re: [PATCH] sd: Check for unaligned partial completion
From: Christoph Hellwig @ 2017-02-14 8:23 UTC (permalink / raw)
To: Damien Le Moal; +Cc: Jens Axboe, linux-block, Shaun Tancheff
In-Reply-To: <20170214081030.24558-1-damien.lemoal@wdc.com>
> + unsigned int sector_sz = SCpnt->device->sector_size;
Can you spell out size?
> + /*
> + * In case of bogus fw or device, we could end up having
> + * unaligned partial completion. Check this here.
> + */
> + resid = scsi_get_resid(SCpnt);
> + if (SCpnt->request->cmd_type == REQ_TYPE_FS &&
> + resid & (sector_sz - 1)) {
->done is only called for fs requests, so you can remove this check.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox