Received: by 10.223.176.46 with SMTP id f43csp1566242wra; Wed, 24 Jan 2018 19:35:29 -0800 (PST) X-Google-Smtp-Source: AH8x2263/wSczLyAofcFPz49WdG0ZGPDU32eYl2oZ9IZoQ5ikJJ6TOsVD6OHnNSwd9xRfw02ps+Q X-Received: by 2002:a17:902:52f:: with SMTP id 44-v6mr9770092plf.65.1516851329119; Wed, 24 Jan 2018 19:35:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516851329; cv=none; d=google.com; s=arc-20160816; b=HBhCJVcclBTb7SDhLcgEFFt5v4qiVNTAATig3HZ3B1wOjIiy7iOYAjuvxx5rdFtwiY UYuESMTjyoxGLwWkcu3yh2CmYKEGwJuvixf3lxoWVSv1O4Y1NrWG4fnugogjDrYuGF8I Lv+206rrWK1Egy83ZQgwxS1uo0+epwTIAEMMNGbh/r44vXpNhxKGMHQzyIkf/djtdh1u UAMJu3cUcYGoFOPHWNOq55f/u19492C4OFYTWnFcaa7zqR8qBFrhz2nP3c8SkdOJ5m19 ILWVwkUqNIE7/7U2tbmfMD9Dsz/k+PoXbNbDhGz9iXI7BJ7fL5KyJPWi+c5yJDenK9Sl VluA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=ZzIIIcbr1bO7steGGqg8CgesHVL8qke674vw7ettQCQ=; b=XwfJnN2UPvL+verQOdC57MUs1QmZysYT9m1VXIyWbIkHgHlvcjtIIj11eP5+OFuDCO mcOLAAiN6j92FMo+HeUI3NRmq9Ny2ybQINQRCqngdDkrj5CH0hKc4qYqu23FBB95ucur /Ksla+xVUDdqctGg5IJuXUXH2+hWDs7Itnna6EuYu+7lBdqtnJpAqSwuHtz2rIDA3J34 HwnkClRfw0lAwz5pc6XL5Btge+KxE3Z+gy16cRTddMZyZnOb81Qr2OAZRYHIhD52p/Bm 0zxyzDA8r7O75wTy3wywmIVfSOQgtVbopf1wc193WGCBytLjaJ/3ggsdt0U9362ULfbv 6aAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jcn5uNtn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t5si977846pgb.595.2018.01.24.19.35.15; Wed, 24 Jan 2018 19:35:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jcn5uNtn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933422AbeAYDek (ORCPT + 99 others); Wed, 24 Jan 2018 22:34:40 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:39358 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933307AbeAYDeh (ORCPT ); Wed, 24 Jan 2018 22:34:37 -0500 Received: by mail-pf0-f193.google.com with SMTP id e11so4816847pff.6; Wed, 24 Jan 2018 19:34:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ZzIIIcbr1bO7steGGqg8CgesHVL8qke674vw7ettQCQ=; b=jcn5uNtnlAZFKaLQ/Ga4QwxyMPcGopJqSrn1ESl1QsSl0Zpmt4ZqZsMbOd/Fhh+9zH myel09P46jx4sogSRuTm+1zb9h+pd9XQnP/hnlBX75rkxurxVNu601QcOqiRu4pLtq9Z CiHQGxlU6TxFF4NDkalCsjpTFD7syWAft0r5qOUaqb7akK0GwscgtvrU2dq4XiFcRdkZ cdsiHsgdzNYWlD9VGwwmC+2g2yogkisFnr8Y77gKZ8u/OngglytnsPvaesybmk3EHVcK T4L6Hg+fG8RIP9X36scqGfMKoNv0vYaTpo0eSRo1Iq3qs3uW3Vm2tEC5LmBAJfClhxKR yKHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZzIIIcbr1bO7steGGqg8CgesHVL8qke674vw7ettQCQ=; b=mhsHYmOxwLgZutoZAOwk73AfFkk9mywAYmmhRL551ZKTaEdBEQ46LB/OlBP0cdBWbp ihIH3q47zgGM9oUGSSWD5gnUdmAaaFOxYZ20oRBnDo9zKdlwv4heuYGzl5NeYLDwhvR5 PsA3K3dcCb7twZKOL3yXWGud6y/1wf4tat8B5QrEAs5kzQykVs/GyCwMW6h1OVt8x7Ee jkl5ctPr97uyUx/9hEg2MlEDcVFBtUQZqLiL41SX/zavhc1uekUuN/7uI0jdyi7vNSAs cPJQeeVfdtMx9h5uUQoit7kp7O4BdJMZW/37IAB9xZPtoRhvC0Ia+n/vo4zRmm1EbHKy m+BA== X-Gm-Message-State: AKwxytevaoE8g5rN5YDV/110YCdnJqP57O4sWuEPI9SYms2goL3pwVxu 4qn1eBPsvaRjf2W5mY2sdr4= X-Received: by 2002:a17:902:3281:: with SMTP id z1-v6mr10021515plb.431.1516851277380; Wed, 24 Jan 2018 19:34:37 -0800 (PST) Received: from bai-oslab.tsinghua.edu.cn ([2402:f000:1:4413:af:5698:7220:1b27]) by smtp.gmail.com with ESMTPSA id x124sm11430163pfx.105.2018.01.24.19.34.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jan 2018 19:34:37 -0800 (PST) From: Jia-Ju Bai To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH 2/2] block: blk-tag: Replace GFP_ATOMIC with GFP_KERNEL in init_tag_map Date: Thu, 25 Jan 2018 11:38:56 +0800 Message-Id: <1516851536-6871-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After checking all possible call chains to init_tag_map here, my tool finds that init_tag_map 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/blk-tag.c b/block/blk-tag.c index 09f19c6..177b6d1 100644 --- a/block/blk-tag.c +++ b/block/blk-tag.c @@ -99,12 +99,12 @@ void blk_queue_free_tags(struct request_queue *q) __func__, depth); } - tag_index = kzalloc(depth * sizeof(struct request *), GFP_ATOMIC); + tag_index = kzalloc(depth * sizeof(struct request *), GFP_KERNEL); if (!tag_index) goto fail; nr_ulongs = ALIGN(depth, BITS_PER_LONG) / BITS_PER_LONG; - tag_map = kzalloc(nr_ulongs * sizeof(unsigned long), GFP_ATOMIC); + tag_map = kzalloc(nr_ulongs * sizeof(unsigned long), GFP_KERNEL); if (!tag_map) goto fail; -- 1.7.9.5