Received: by 10.223.176.46 with SMTP id f43csp1573293wra; Wed, 24 Jan 2018 19:43:20 -0800 (PST) X-Google-Smtp-Source: AH8x227uLL2KzQIjZzoEFYd4OZhmhvBvEorefePCf1xA5TTZPzyyTOZYIxN2nZEJWgm9cA0z1ai9 X-Received: by 2002:a17:902:bcc5:: with SMTP id o5-v6mr10222189pls.67.1516851799845; Wed, 24 Jan 2018 19:43:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516851799; cv=none; d=google.com; s=arc-20160816; b=W2/hEzBI2Ef9YGtGw/R+j1JzfUcsM6igrj4kuTYMXErYcqv6ZgLeq+g4gbLi/Vzpat Ik2tYYWNah3IYU9w4T8ODz81psmJ7PcVC1ZCR6QfwqH06mIGmR+C8LXcVsAmcommD4/s R3fckonnbIIIRR8N5kLexI+7pbOMzdNHh+5fok0BbR0cAZVJ4kRfkegpSyVRNG5p6BZh pSLyWfQ+IX+ew7u+MPU1SfJPRkMLdTIgmXajxKpI9XEAH+jk6WczNJf9cbK6DyIJNYvJ F7tc5eyX+Gf/59Zxbi9zoMdWXqHH+HwmJUM1eGayTN2OfJ80Dq6j67yzJo45VMPE646w 7YTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=LzXsjD+Gmx5uKiNCPMnMFf/XAaGdiWxsz8G3jI3G/KA=; b=Mm0MoAsnGT0EylpXjHHNQuLEfwy6N41R/mMONaBBjx0yU3yhv7Zwb38Hc271+HLKFp EGQ8e5TawyLqeB34P43taEmE5vt9ulGvefmcHNolERQwQ4umKEluDTGzvUE/AZhth+fo 0bDIbgkIvQrWgdC0ChM0CNOXOYMXPbxxd5FHi69ZFLgfU/sxEUpo2Y/+rY47OIrYETt7 TN5TM3HRx7f23xGHPsZYij0U0gg9ngydxhky/r5f7uEAxg8uvYv6g2nDYyJ+XXRyBqPZ 3D3CRi9kdx6BV3WneJ1gxy49zzK+LuEGkK2vq/VelJQi8qpDnjqKLofyscIDhPgcxPv0 M4Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=b/6lcf+3; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z8-v6si1242986plo.762.2018.01.24.19.43.05; Wed, 24 Jan 2018 19:43:19 -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=@163.com header.s=s110527 header.b=b/6lcf+3; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933966AbeAYDlE (ORCPT + 99 others); Wed, 24 Jan 2018 22:41:04 -0500 Received: from m12-15.163.com ([220.181.12.15]:56353 "EHLO m12-15.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933726AbeAYDlC (ORCPT ); Wed, 24 Jan 2018 22:41:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Subject:From:Message-ID:Date:MIME-Version; bh=LzXsj D+Gmx5uKiNCPMnMFf/XAaGdiWxsz8G3jI3G/KA=; b=b/6lcf+3PqXmAq+lAS/qf +axTV5lM8rB9PNQEhPg7MIiInAb9nzeLYI7L7J2cKhwJc1AdI7o99eP19KDFQR4F aS9Yg5UJGFbYCiRBZEXIqLMupyyKYNaKD9vqSDYf36ctmJnbJkvU69KIgCFyl9+v WeJMjaYN7bsGy+ilOWbyjQ= Received: from [166.111.70.14] (unknown [166.111.70.14]) by smtp11 (Coremail) with SMTP id D8CowAA3qxjHUWlarLYuEA--.55663S2; Thu, 25 Jan 2018 11:40:57 +0800 (CST) Subject: Re: [PATCH] block: blk-mq-sched: Replace GFP_ATOMIC with GFP_KERNEL in blk_mq_sched_assign_ioc To: Jens Axboe , Jia-Ju Bai Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <1516848386-5720-1-git-send-email-baijiaju1990@gmail.com> <7a1809ce-c456-0d53-4d3b-2368fb19bfd8@kernel.dk> From: Jia-Ju Bai Message-ID: <00ecf255-c5cf-1e32-d754-96f70460a734@163.com> Date: Thu, 25 Jan 2018 11:40:38 +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: <7a1809ce-c456-0d53-4d3b-2368fb19bfd8@kernel.dk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-CM-TRANSID: D8CowAA3qxjHUWlarLYuEA--.55663S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Xr4kXr1Utw18JFy3XFWDArb_yoWfXwbEga 109w1kCw17KFsF9an3GF4YkFZrK3WrXryxXay5GF15Xry5Aa1xCF4xCr93Zr4S9rWruF15 uw15Zws5CrnY9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUnKg43UUUUU== X-Originating-IP: [166.111.70.14] X-CM-SenderInfo: xedlyx5dmximizq6il2tof0z/1tbiTgnYelUC11BH9QAAsH Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/1/25 11:34, Jens Axboe wrote: > On 1/24/18 7:46 PM, Jia-Ju Bai wrote: >> The function ioc_create_icq here is not 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. > But it's running off the IO submission path, so by definition the GFP > mask cannot include anything that will do IO. GFP_KERNEL will make > it deadlock prone. > > It could be GFP_NOIO, but that's also overlooking the fact that we can > have preemption disabled here. > > On top of all that, we want something quick here, and it's OK that > it fails. That's preferable to blocking. So we want an atomic alloc, > even if we could tolerate a blocking one. > > So I think you need to fix your static analysis tool, it's missing > a few key things. > Okay, thanks for your advice. Thanks, Jia-Ju Bai