Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S942030AbcJZXVc (ORCPT ); Wed, 26 Oct 2016 19:21:32 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:34020 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934068AbcJZXV0 (ORCPT ); Wed, 26 Oct 2016 19:21:26 -0400 Subject: Re: bio linked list corruption. To: Linus Torvalds References: <20161026002752.qvrm6yxqb54fiqnd@codemonkey.org.uk> <20161026163018.wx57yy554576s6e2@codemonkey.org.uk> <20161026184201.6ofblkd3j5uxystq@codemonkey.org.uk> <488f9edc-6a1c-2c68-0d33-d3aa32ece9a4@fb.com> <20161026224025.mou27kki4bslftli@codemonkey.org.uk> <2bdc068d-afd5-7a78-f334-26970c91aaca@fb.com> CC: Dave Jones , Chris Mason , "Andy Lutomirski" , Andy Lutomirski , Al Viro , Josef Bacik , David Sterba , linux-btrfs , Linux Kernel , Dave Chinner From: Jens Axboe Message-ID: <203e0319-bc9b-245c-e162-709267540d22@fb.com> Date: Wed, 26 Oct 2016 17:20:01 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [66.29.164.166] X-ClientProxiedBy: BY2PR03CA051.namprd03.prod.outlook.com (10.141.249.24) To DM5PR15MB1195.namprd15.prod.outlook.com (10.173.209.13) X-MS-Office365-Filtering-Correlation-Id: e6e8812e-8ca6-4c9b-6b85-08d3fdf6a15e X-Microsoft-Exchange-Diagnostics: 1;DM5PR15MB1195;2:4NVvgvNjtLIeo67A+Z4J6DSB62wq3LMmbS4fFWsJKpScB7k+w0wd4DvCajRLDWyx/c4pRcchB1uNaJlUKBqvwqGNterYRPsS0NDojQM3i1oJMKw4pQLLKkV79CqRWeePDPRlOKgQ4x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VYw5UWWcTzKghnWqh7S4M1udUhnrPfn+bWC5jrTIQ+23Ayi9PYqEIkDDZ47F0BYHInHVdXovgCAUhIaCCK0+pxFMS92squVdoohue0z/42RzQlLyxTedZWVWJShphqhQPkftfMiv78rO2Pe/bKfk5vZcQ=;4:gDQysgCrHfA7hKsQf0ECJgetc1dkzoaacpKfKVkRfVHDqklN7E1wZ7qn/tOki6ITUzSS2l9g+zuRVtEOUfnFDZGPRNIuJ9QexPlKy0VKIqXQ/x4z7fgZg724dAiJjSL/hrfg8+V5qHK9GM5u9CfMSMDXL8qZ47Y3cnvYWruMREhi/30cUm0eZGg/MzWHXeSQVclFt7v5ffPCH0DyCKkuGovMgHwp3pr/AzUOwKxsde1tBYit2Ovp8vAmpE9ForWRCNGRIF6OT6Yh2pc+7Nhm2r5yd1xHIXjBm1SosHDOGRRQo5Kt41xRY2j7KRcV+DK1iE141lez/d8YIRWnBeCPyuwvtIG1l45az2oEBRt1FuGfGxw47+sxuh7Pq+thuPn2X7Ylsh+OVWM7jgIk9Ke2G9y6sHwYPU6mpKoGw1RoJ03sL53BWZGHLDsKo97PCe22 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001);SRVR:DM5PR15MB1195;BCL:0;PCL:0;RULEID:;SRVR:DM5PR15MB1195; X-Forefront-PRVS: 0107098B6C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(979002)(6009001)(6049001)(7916002)(377454003)(189002)(24454002)(199003)(47776003)(101416001)(3846002)(3480700004)(76176999)(54356999)(92566002)(19580395003)(50986999)(19580405001)(81166006)(6116002)(189998001)(31686004)(77096005)(31696002)(23676002)(81156014)(42186005)(97736004)(86362001)(66066001)(65806001)(65956001)(33646002)(106356001)(64126003)(2906002)(83506001)(117156001)(68736007)(7736002)(7846002)(65826007)(230700001)(105586002)(4001350100001)(5660300001)(8676002)(36756003)(586003)(4326007)(50466002)(305945005)(110136003)(6666003)(2950100002)(93886004)(6916009)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR15MB1195;H:[192.168.1.176];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjE1TUIxMTk1OzIzOlBDcFc3SHE5Ynh1Y2NCSmVUY1RoOStvWHdD?= =?utf-8?B?Zmx3YUxab3I1ZWJkSE9jQllLOU55RHBWYmFBQ2JwTk05K3lTajBSMGhLcTNI?= =?utf-8?B?akFxQUxDQlRtL2FhU0R2ZzROM29uMWNvNW12MXNaOFhNU082QWZFODI4MVJG?= =?utf-8?B?eDFDUXdUby8yaFZTZkxuUlhDVkc5dG9nekl5Qk5MSWZBNGNsTndCQVRwck9j?= =?utf-8?B?YXlhaG82QnlLM3AwMDByazFId3FQK2ZZa2huc1BzYjF2cHNJVUtyU3dSeUEy?= =?utf-8?B?MExLclk0cUxMMzV4aU9EOUprdzRKQ1krakVNeHIwdzRoN2pwWlNVaFhmL3RX?= =?utf-8?B?RWg4N2ZoZjFKTGd0bWpTUzQ0cnBEVUJZZ1pIV3dUSEt3OHhNWW4xeTFSS3ps?= =?utf-8?B?L2IxZERkVlpDZHNHSkJFTFcxMWlpYnljN0x3VGlubEU0S1JTbUpVSjRvZEg4?= =?utf-8?B?dXRZY2w3RWlMcHdtaWN1MWlyblFNVmxXL1IzYzRqZFB2N0o0MC9FZnZ6WUxs?= =?utf-8?B?TzNyQnJHYUZxU3JLd09BMTBXUVl3aHIrdFlVNE40ZXpkalFQQllYRlJZaEZK?= =?utf-8?B?NHVLVzg3cU9rN1JZREJFckwzRXZ3MjVZM0RoWUFiTXVUZ1Z3R1E4dVl6b29H?= =?utf-8?B?N3RPU2RLWTR3bk9qYlA4MWRMNnBLamxBSkR4OFpQUDkvUTRIQXYrVndxR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USISHvRLHpvy5ld5K4vz0HJJeePu/a6jHl9RTGAMCmsCghqQyLE=;7:J6U50eAPGy4bJsrWVVOwa8HOF2NCSQhw/zmmVAHl+EtZTi7ynppYV2D8X/JMXZi2QpaPaduit6OK9geLoQ2bPh6w9JFZIaJRs9ZOAnFKNP/h/SEUxPC6SYmA2Fv7+miWbpE8OWKQZYEjkkFQldy8cu1Eixsf6oKvZtzIkj4VNgQOoc7/PajUBJqb8rC+gqTP7LQHREtGdLDN9/rqFssaSpLhXDFC/gA5ZmPmtSxNIOEQ6icAE3OjcnKZvAOEOokHEOeZgp++yWoWNa8eh1z0Lt2MzuA0wZ+3HSUfD3UHZWl46vhhea8SMM63bMMP5c/xE644+EFPouqkFPFHaV19kT/gPt7kPvbZhROK9Y0eY/4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM5PR15MB1195;20:5VMj1scdg+GcYFTqIxdSdbnO4gpC+EWyB8P01+d0GREeih3+zsIEUmicGc6qTPh4Fetxoz/BiLZN9NT0zEapWtB05Lwomgml74kRuA4hMqg1Fz7JQMgceaxT7VcrQPZae0RKUsorSAyMLF9IU1bb3bqhs51rZz969c3a/AfkzMQ= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Oct 2016 23:20:09.1346 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR15MB1195 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-10-26_14:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1151 Lines: 37 On 10/26/2016 05:08 PM, Linus Torvalds wrote: > On Wed, Oct 26, 2016 at 4:03 PM, Jens Axboe wrote: >> >> Actually, I think I see what might trigger it. You are on nvme, iirc, >> and that has a deep queue. > > Yes. I have long since moved on from slow disks, so all my systems are > not just flash, but m.2 nvme ssd's. > > So at least that could explain why Dave sees it at bootup but I don't. Yep, you'd never sleep during normal boot. The original patch had a problem, though... This one should be better. Too many 'data's, we'll still need to assign ctx/hctx, we should just use the current ones, not the original ones. diff --git a/block/blk-mq.c b/block/blk-mq.c index ddc2eed64771..e56fec187ba6 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1217,9 +1224,9 @@ static struct request *blk_mq_map_request(struct request_queue *q, blk_mq_set_alloc_data(&alloc_data, q, 0, ctx, hctx); rq = __blk_mq_alloc_request(&alloc_data, op, op_flags); - hctx->queued++; - data->hctx = hctx; - data->ctx = ctx; + data->hctx = alloc_data.hctx; + data->ctx = alloc_data.ctx; + data->hctx->queued++; return rq; } -- Jens Axboe