Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933750AbcKPPLW (ORCPT ); Wed, 16 Nov 2016 10:11:22 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:60008 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933488AbcKPPLQ (ORCPT ); Wed, 16 Nov 2016 10:11:16 -0500 Subject: Re: [PATCH] block: deal with stale req count of plug list To: Ming Lei , References: <1479290825-23201-1-git-send-email-ming.lei@canonical.com> CC: , Christoph Hellwig , Shaohua Li , Jens Axboe From: Jens Axboe Message-ID: <320f5131-f61a-9a33-31f4-b510857a4a30@fb.com> Date: Wed, 16 Nov 2016 08:10:18 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1479290825-23201-1-git-send-email-ming.lei@canonical.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [216.160.245.98] X-ClientProxiedBy: DM2PR10CA0034.namprd10.prod.outlook.com (10.160.213.44) To BN6PR15MB1188.namprd15.prod.outlook.com (10.172.205.142) X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1188;2:Os/OimMZ8+eb7cxcNrJsO4QLCtvr2RrukSDoaU0v1Z1/pdPwHHhFDsUe6yalddfJCi4gV7DNKQrQjFhT8qEjs55wqG9yKHpWlFojG+I6ABorZRloqjWLW6zCQ6m76kfWHAQ79VymdtSj0sESpfCQ52tAKxmbV/uphvO172NySq8=;3:M+D67H/LW8hmaFaYNAQ6zqI40Pqz8DUmPBuANDu5WPN924rAf4OiDSF0rpvWRO8GGSBpDu2rTCKtFJiO9guuxVh2WdE1Su6f2+SaTnsd0S+FLoA9uPXO3oRvJc/sWS+9SJ3nBig440sBAhF9NtCbBopkhXix3dajEL4PEUytbtM=;25:CseSS4wlrI7ADa6xabBWJDe7QNiOQ1ITO2XqSYGhD6GTBTdxuU/X7RNZ5Gv7Mx2K+g9V+lqsK8O4W51PIAnOqUjlizA5q6ECtua6Uy5pNiPIjeqHLn6n2glqCcFBu6yDqKbhKNkAOg3CNgAxyWz3CIXfj95pMiu3CdnZmzcuSy0WGP5PUjcqcl9sJYbipw/51xU9Agm3JGmxWHMs9KWCCVtKo/6bZz4zI38E7v7VucwplXm/4jA8ccnEiLaFv8tvKR0cpo3Gqx52z5ZZsrK2ZfR0QIrouKwo07i8YLHAezhkAm+9v2cQ0VeylLyyC4Q/mS+RffvlPW7BCsInvFlhWogJWbftDMqBQh+VmUQRuywymBU87hj97N+bVEpzCwdYxrV92WvH/BKnOQdfBf3wwa8OEJhhOkAkw1+5qKS3lu8EFLginnN/su8DSb5AUr2O0MWby2Ldmif7Q5RJXihXNw== X-MS-Office365-Filtering-Correlation-Id: 6dc8bffa-61eb-4f47-9936-08d40e32aff4 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN6PR15MB1188; X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1188;31:4Fmy6Kw5P3jgSgXcQOVeun1JqMCPeEs2IbTOyC6pNbZ4HuJdt1HUJy07WchQd08xKgKEvR3Dd4354TXVcNDNiU5gtTILcFZBVb6ChqC99n+jp85GI7NnqCGrfPWahL+RnfqsZZwnCVyosNOj2rkUkpEu+cjkPLDfl/osnwgQmoPIU2nSJTNgSQ8JVU69k223UsBpgYbQf5VA3TdbnrAI2tnsmURraUC853wHPp/cTgEsS/IvrKnViVIJK5sQFeF87l5lhLdD38W/wOXiAAE/GtN7HKzBzZ8SfpcbEpx3Oro=;20:k9SzCa4EncYwGGKrA2SkBPvWlLl94RFYL2Y8ovuxhdyK3hRSeaKQEQntGMkBOiFgoG5+nUgsRsF7t9NrSbShteKOrUoCvgEBYQZt2UIluXoUBWI+/nOv3Iqwj5xYfCFIEZEXTz/vM7K7/S6Y29CNH1PjMJIEV5+l9nv26sd5o+WYEjErOK0Ty+bwCK3C/2LeYu88e/QXKuwivEqjvFqTUVDKHRCOsiHVPgfNIy3g6nMCwkq13viNJffqbQhDGq7o X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6060326)(6040281)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041223)(6061324);SRVR:BN6PR15MB1188;BCL:0;PCL:0;RULEID:;SRVR:BN6PR15MB1188; X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1188;4:ur/qHWrPtRtOuCCHC7rRgvUPjiXL67GXDx8jQkHpvl/5Ux339ZTL9dFId1Ob+LEdrbiGHNSUvAgq5OlfIIOC/JPUB8reSl7w/Ee2+f2KeJfv3ahfQXZtFNhqcBN1isqOGB3yDzNKokC8bWu0SNOM7VvbjAVnnobCEtWbk6I4o9QW91wKye4qsMLE1mhabEkNIMn2MVcTOVv0ht+h/aIDuxGKbTxgODbGXHv+ZUxWJsJzAtX6YvGjTDtCVjjNpsyv2ivO1gl7N2ZWLApcrH+KE7sRJTP0BbnQTvUVpGTm3ZFGtmtILCl/+fzV/grmZy9o6Td4VON5vwgYyitc5b5Y0qlqreGUWge4bgJWBPa4IoU23kO0vCwUA5IDhJ6RO2E4+HbpvGFqS911fiF+F7tGQNJfr+zwWcRhcH8GazIIR04AHfHCc7hUN2LWaUZMI+3LPOB/hcrap0YIYoijnA5RnQ== X-Forefront-PRVS: 01283822F8 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(6049001)(7916002)(199003)(189002)(377454003)(24454002)(117156001)(76176999)(68736007)(54356999)(50986999)(229853002)(77096005)(66066001)(31696002)(8676002)(86362001)(65806001)(3846002)(2906002)(97736004)(65956001)(81166006)(31686004)(5001770100001)(64126003)(50466002)(4001350100001)(101416001)(33646002)(81156014)(23746002)(47776003)(7736002)(106356001)(42186005)(7846002)(2950100002)(105586002)(65826007)(36756003)(6666003)(83506001)(189998001)(230700001)(5660300001)(305945005)(92566002)(4326007)(6116002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR15MB1188;H:[192.168.1.129];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;BN6PR15MB1188;23:vCaTsQjTyJkjdA1KaRuu7ZL9xXIfsXmEUhfYj?= =?Windows-1252?Q?Q/lw/sT0L2c7cbnfEZQGDn5soekuxKJXPK9VekR2vx1pMGT5pEdWZmZN?= =?Windows-1252?Q?gKH3RnB6j/z9AQuXlYH2Ng86dGH7lr0rP47mFUN08KvcNW7lEuI7XZa7?= =?Windows-1252?Q?RXA4EOiuU5hdpO1Eqd8L0CdMxLxRynWzN7n150gi7jKTeD0nIHX7vuR+?= =?Windows-1252?Q?D8oXdnVElY1Ris5wXJShV5uScTthGq0CU6tMy9Jifq+wckNnL1fKf3+t?= =?Windows-1252?Q?7R3Tls14whCoE5s0k4QiBZ0PjFgWRGzUBQjnfduSocdQ+vxZpL+4+7vm?= =?Windows-1252?Q?PCa32SfI9/SmYYWyVWs/MgtrnC0TNc1bVTFtPxbyE4N2vvftxv6GCEpI?= =?Windows-1252?Q?+9FKtlJqlJ3RjCuiIG7TdE0nMr4O/S0lbG1jE9b1XSJOlk8vQxa0tWof?= =?Windows-1252?Q?ZMaWYdRlB3lrIjyZbmUNPB9Fo66Wl9ZQHCfm9d7OMI5GlxzfijZ1OkpE?= =?Windows-1252?Q?rDZv5SpMDiwM21t1N6j2F2OEg22qdYw98DnAosj7F9LzHrQ7XBaFnsFo?= =?Windows-1252?Q?Eb5ZoaVkguD9KFy4FsHM3qQe8CeqNZcbgjLoa9+mUm2ykOdIDCXMBsNi?= =?Windows-1252?Q?xnOYztYTZXYCiYjNrxW1dhWYFQUetRZqLV77QBzJV/JpAdQKFmHZin1l?= =?Windows-1252?Q?A1esFP5xfx0ccOdE1DCoJIsz9gnvX5La1WRGCfF5hCTMLv2vCXjURXBJ?= =?Windows-1252?Q?LSIRVJXlucBGesXhubR8KSLQ0DEXMZGQBB3q8yOh+pVmMbKhtwZ0S3gH?= =?Windows-1252?Q?ksbjG9cjNYIVpdBH8p4WvVFRDv5UH/fUasMJrfb2KxsLFpPXf9aEI1Uz?= =?Windows-1252?Q?r3YidSkkxFsU6/T8YiakaGK3yoaPDqigTEa6veqCjDQSSeFhi3hzQLni?= =?Windows-1252?Q?8CTR8JfHrKYFg3wJMdd+y7LcDzcwhfIfyldznzBB9m9uqjMwEqX/JIjz?= =?Windows-1252?Q?uwo94e2TDIlyTrsXafVZUljnwvKHASXdawyih5TqWyoyLs01aLbYqfcB?= =?Windows-1252?Q?k/NHwO3LunKYfIg1bDUOCAraa5wcmi5fmY2zhS9qY3AJp2PyGqyjI/qn?= =?Windows-1252?Q?F7buDX3sktC1UGn845gzHI4cX2TLIXed0Gh2plY+b3FOES7uL2yp2NJQ?= =?Windows-1252?Q?2GOEpeoKMUmjk2RFDnU7bFKMOm8+5CJrxHot9+4WTTPi2aGySAL5Z4K5?= =?Windows-1252?Q?uWnn5yZtmZkCHt1Ll5oxEz2L+/cyFsYMq3Go4nMfK+tf7b2TUlaTrAdo?= =?Windows-1252?Q?/HTKY1frsfunkGGtXsc00D/ZpVPDM5xiXBdBrnT1vPYP9uDDsR5W4+8n?= =?Windows-1252?Q?Ks4aCk067DlzRsZyxMJuf7g0BYRYfkZzg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1188;6:IfLAiDqdguzBWfgzznYmpk7n/XL6+zWv5YnkPbqZtO6vg9nhZiaXOeCvcGkN6/WfBKo9IJiR7MQ2WdSLTg8EPViM1VSS/ejq9+IYdsw5KLgdBnweUCIZpmvnYHl00I0fGKyCoDR0CJ07CMWyQUo12jV3cfpmCraXPxLPIPjLa7E2HyIDheGnhdKnB2/72bzJJs6kpc2K56+6hkDHOI9RMdRdX6RCuxlAppcbypcSk0CTB4Xq74hc2146tAX2EcmkfZNy0zgAiOyamSBhrNWwDHvnhlVXCgD2twYAWEUETlst02MsyaIsi3Zs5YWXg1MXEQCpdIKpTg8aAKdgWePtt2CwNlxMV7oJp9DjPc2v+VU=;5:00KoTGeY37/ZTJS4mFGDXFG0uOWwx2XlW7pm7cJeU7McwmIbDtApUmDlwnp26TnkC/DR55ocyi8ikMuu7bltwu9w1DMQAUZ14Se6n7ulA8ISmks9Uqgd80kmHq0smjGV0L/Ywa6TY1zEDxsFYE9R0A==;24:gyL2fVcOVVP0PYOe0mGOf6aCFRu8+BQIBhk54OtoQE8+7jOE6OGR6jjXL5PyeLbHC7fLUR22UyiSJPU2OrpMYyyQ/WFfTkW6UCSLlE2YS9k= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1188;7:eAFj71FtHFnSPzvrGrAMxi9w0FfwwWXFGLphf3i25W0mvyXU+33Xe1Ve+UaQE15qT529RX9WYIJoOBvw4cvamcVHVA+EncnFzc1DvD8+rPpX/6i1pQ/Ho83bo6fNgqzpaQNFJyXrZGZt2TRuoJ+U6/bf5gJC8fAHYpoWK32/nc7zrl829M13gyDHGB3zMhrOWeWypDolroRTgado8IGZeFqVYeIDu85lH0I/swvnRFFAwDprv6ea69O3NhmnvZCV7H6bTpGNaR6yaZGFBIqJmroHyEVJTzSX2mdwnDKvTt7GGfgXazzwpxVlEXMGMzYm8KkjRmg8wB4L4gx11ZucIiL+cTOYMOf8kIyzZ2Hkdic=;20:JliaZu4PXkMc7lhoL9LAIRV4ItS5S63SzOom7Lg9Ex54GkYlPoOabsFMg2I7YUVpV3QHX6kWWyU94apL1g0uVIEuCW94aF8PRvwBxceQPdLW+5b8W4nEfA9kIKCa01VbiUhQ+AS4p4n1mTC6y6FSUpFi33KPdyoyMt80szG2Jy0= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Nov 2016 15:10:22.3023 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR15MB1188 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-11-16_06:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 505 Lines: 14 On 11/16/2016 03:07 AM, Ming Lei wrote: > In both legacy and mq path, req count of plug list is computed > before allocating request, so the number can be stale when falling > back to slept allocation, also the new introduced wbt can sleep > too. > > This patch deals with the case by checking if plug list becomes > empty, and fixes the KASAN report of 'BUG: KASAN: stack-out-of-bounds' > which is introduced by Shaohua's patches of dispatching big request. Thanks Ming, added for 4.10. -- Jens Axboe