Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755967AbcCTPdz (ORCPT ); Sun, 20 Mar 2016 11:33:55 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:34875 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752219AbcCTPdp (ORCPT ); Sun, 20 Mar 2016 11:33:45 -0400 Subject: Re: [PATCH] blk-mq: Use proper cpumask iterator To: Thomas Gleixner References: Cc: Peter Zijlstra , Xiong Zhou , "linux-kernel@vger.kernel.org" , Ingo Molnar , Borislav Petkov , Andreas Herrmann From: Jens Axboe Message-ID: <56EEC2D6.5090603@kernel.dk> Date: Sun, 20 Mar 2016 09:33:42 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 508 Lines: 13 On 03/19/2016 04:30 AM, Thomas Gleixner wrote: > queue_for_each_ctx() iterates over per_cpu variables under the assumption that > the possible cpu mask cannot have holes. That's wrong as all cpumasks can have > holes. In case there are holes the iteration ends up accessing uninitialized > memory and crashing as a result. > > Replace the macro by a proper for_each_possible_cpu() loop and drop the unused > macro blk_ctx_sum() which references queue_for_each_ctx(). Thanks Thomas, applied. -- Jens Axboe