From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751355AbeAYIEA (ORCPT ); Thu, 25 Jan 2018 03:04:00 -0500 Received: from mail-io0-f193.google.com ([209.85.223.193]:46875 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751056AbeAYID6 (ORCPT ); Thu, 25 Jan 2018 03:03:58 -0500 X-Google-Smtp-Source: AH8x227NwJePR802oVvwKcnfGFYPP2EYlaWP64Zy+xUYvcBPnqljlV3bU/I1TAef8ODg8+OBsR1otw== Subject: Re: [PATCH 1/2] block: blk-tag: Replace GFP_ATOMIC with GFP_KERNEL in __blk_queue_init_tags To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <1516851525-6828-1-git-send-email-baijiaju1990@gmail.com> <7b20dc97-9240-726a-5664-c40c9421ef61@kernel.dk> From: Jia-Ju Bai Message-ID: Date: Thu, 25 Jan 2018 16:03:36 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <7b20dc97-9240-726a-5664-c40c9421ef61@kernel.dk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/1/25 11:44, Jens Axboe wrote: > On 1/24/18 8:38 PM, Jia-Ju Bai wrote: >> After checking all possible call chains to kmalloc here, >> my tool finds that kmalloc is never called in atomic context. >> Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL. >> >> This is found by a static analysis tool named DCNS written by myself. > These two look OK to me, mostly. It sounds good :) > One issue is that blk_queue_init_tags() > can be used to resize tags, in which case it's called with the > queue lock held. Nobody is using it like that anymore, though. So I'd > prefer if you did a v2 of this patch, and include a correction to that > comment. > I am not sure what you mean... Do you mean that the code in blk_queue_init_tags: else if (q->queue_tags) { ... } can be deleted? Or just delete the comment before blk_queue_init_tags? * Queue lock must be held here if the function is called to resize an * existing map. **/ Or add the description "The case that queue lock held is never used" in my patches? Thanks, Jia-Ju Bai