From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933304AbeAYDeQ (ORCPT ); Wed, 24 Jan 2018 22:34:16 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:33818 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932956AbeAYDeP (ORCPT ); Wed, 24 Jan 2018 22:34:15 -0500 X-Google-Smtp-Source: AH8x225EnZuG9HWpDThrVu6xeyU5rmETjCgVbMwjkluMFLwLFlWqdqvONKOJ17dT6+o6Co3waj6mUQ== From: Jia-Ju Bai To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH 1/2] block: blk-tag: Replace GFP_ATOMIC with GFP_KERNEL in __blk_queue_init_tags Date: Thu, 25 Jan 2018 11:38:45 +0800 Message-Id: <1516851525-6828-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Jia-Ju Bai --- block/blk-tag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-tag.c b/block/blk-tag.c index 09f19c6..84db7f663 100644 --- a/block/blk-tag.c +++ b/block/blk-tag.c @@ -124,7 +124,7 @@ static struct blk_queue_tag *__blk_queue_init_tags(struct request_queue *q, { struct blk_queue_tag *tags; - tags = kmalloc(sizeof(struct blk_queue_tag), GFP_ATOMIC); + tags = kmalloc(sizeof(struct blk_queue_tag), GFP_KERNEL); if (!tags) goto fail; -- 1.7.9.5