Received: by 10.223.176.46 with SMTP id f43csp1547008wra; Wed, 24 Jan 2018 19:14:57 -0800 (PST) X-Google-Smtp-Source: AH8x226V+XgRTdRvISivWBGb72xTcRLazGxZ9bKUlo+Uk68GIL8MFs26dQnbXePW5eo+N56KGVhU X-Received: by 10.101.67.193 with SMTP id n1mr12144258pgp.116.1516850097730; Wed, 24 Jan 2018 19:14:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516850097; cv=none; d=google.com; s=arc-20160816; b=h3XexjAYkldR+4ZGpE/DkHHKxPsmR4lDX+6kwEL16rOVjBD0uGHfZI7yBM2/NocMsf rhAWA2Y29lX9RE87kU7r+w2fb8Z4l1erEAGkbtC4ZpQneQQf2R5LhGIy8jOaNMVk/aNe bhGc1WLlanbEVd1iQtguqA+2mHkxn4GpWFle+V92lWZUR4Cm/sl4oHzO3pVs67eWa2nS daI8JAGlb215xGGRrC5BOyZkL4WSy7EFJeYVyIFNbWouVR2zJk4EY3zNHbHLbFvqf/2V N1Vk82Oaa7RALpKjjquvBX57DcoCIRSdrzm2a0k1tbFfPpegVMyBS3l/iurxyo1zrcA7 OMhA== 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=EtVZhaI+/9D/G2c//Kxlv7a5nug6e6tT57MdtQNV7qw=; b=OCGTVkkVEAnPIAAJ7JeQE2ISVoDAERN0dC4QNeif9oJplOyktJLY8Shg9nEZ826bTP HaJbMuCR/lfW/MKTgeTDLx+fB995vCwG9mu3Okn7KNXAmmGCEL6Ak5QBPywGI91ekqfw yvKa9YkF07j4YLNch4eXHVbOgYc4/WyIQffRye8ScWVJgMnU5kfgKjy6NDt7phDyJ4Rs H8HNpbcJCFWvjIUJ0MwyRa0JSMMxLPrYy5UaE4+wEG3nV/HVdMVy5z31GkF0oBVaNY4p mLnGN+qq7Cy2QKZZyYOaXke+DIhPYymHQUhST4tfJPv3bg2mwU+D6gotQdj/WsKJ2Was UdvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Nj2eTc0z; 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 l14si945597pgc.608.2018.01.24.19.14.43; Wed, 24 Jan 2018 19:14:57 -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=Nj2eTc0z; 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 S933145AbeAYDOT (ORCPT + 99 others); Wed, 24 Jan 2018 22:14:19 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:38562 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751762AbeAYDOR (ORCPT ); Wed, 24 Jan 2018 22:14:17 -0500 Received: by mail-pf0-f193.google.com with SMTP id k19so4776842pfj.5; Wed, 24 Jan 2018 19:14:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=EtVZhaI+/9D/G2c//Kxlv7a5nug6e6tT57MdtQNV7qw=; b=Nj2eTc0zR8NsBAJAxYl9hBk4xMxm/LjkCmrvH65sWpaKXZJAuQfZkS3h2SDuBT5HR+ nbnXh6JUFagucEpGFxfQhmC+gBCMWXdtx65/tWnSC1KtD0jbiVWyLSdUMwOmPzjRr1rd gR9Q3Kl0f3it2syuxbZPunSh0wiqO7KaVyVStr/0tmyfTwqAU4WEbR4m3jleh7KHtDbC uufgG5/huGG4hYPZDWSuly79oTg8UcYvaiAoOFrRC7ZFKhzMBcG8MLduhYwz5u73ShPF /aTBB5xt1u/kN71XdC1vk3cd43umZRyuscP6NbOwYVPtXfa+6qff/RSPJTxywVRW1cYG D86A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=EtVZhaI+/9D/G2c//Kxlv7a5nug6e6tT57MdtQNV7qw=; b=hc4FJHwMx/OrCfiHRzk5QJfDSkvlJrQF+LvZLLcaXiIV63W1PfTvaxe5c4oUl5dvwm y/KWBKR1DciZo/OK4zUiyxJvO+i/MPLcnl8VGTmKaXSFeboLfZGSX6cxXbVm+ipDftdB Gh1OGLwixpHmdmXb+LOrVnXayK/hfxc9m0YvajPj6HMpBg+sSwuohuG+SCWpwkhnyM6o OlbftWuA0rTOcA0HJjO0yekCOPCZNBK9mEY/POr9OAi+YKujXAGXnHsBupGOKZ2FN/Zk 0MBhNPLH2I+8oe0DaVXrs1pyaem+HaAPGvO3MOH2/DQ2Wbf2ywx7IWlfnl3gigBoFLX5 bi5Q== X-Gm-Message-State: AKwxytfW3Bo8E/5XEbMJIaE6pLcT7sjy6hlrCPpEhSrjmH1+joPbq0FV AsB6C7KIR05154KuRzbaeE4iM7Vc X-Received: by 10.98.19.137 with SMTP id 9mr14619892pft.5.1516850056830; Wed, 24 Jan 2018 19:14:16 -0800 (PST) Received: from ?IPv6:2402:f000:1:1501:200:5efe:166.111.70.14? ([2402:f000:1:1501:200:5efe:a66f:460e]) by smtp.gmail.com with ESMTPSA id i3sm2126522pgs.63.2018.01.24.19.14.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jan 2018 19:14:16 -0800 (PST) Subject: Re: [PATCH] block: blk-mq-sched: Replace GFP_ATOMIC with GFP_KERNEL in blk_mq_sched_assign_ioc To: Al Viro Cc: axboe@kernel.dk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <1516848386-5720-1-git-send-email-baijiaju1990@gmail.com> <20180125025811.GT13338@ZenIV.linux.org.uk> From: Jia-Ju Bai Message-ID: <70efc238-9517-7cfa-03ce-ba9c3ba0ebd4@gmail.com> Date: Thu, 25 Jan 2018 11:13:56 +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: <20180125025811.GT13338@ZenIV.linux.org.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/1/25 10:58, Al Viro wrote: > On Thu, Jan 25, 2018 at 10:46:26AM +0800, 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. > Umm... Some human-readable analysis would be welcome. FWIW, I've tried to > put a proof together, but... > struct blk_mq_ops->timeout = nvme_timeout > nvme_timeout() > nvme_alloc_request() > blk_mq_alloc_request_hctx() > blk_mq_get_request() > blk_mq_sched_assign_ioc() > ... and while I have not traced the call chain further, the look of that > function (nvme_timeout()) strongly suggests that it *is* meant to be > called from bloody atomic context. > > "My tool has found that place/put together a proof" is nice, but it > doesn't replace the proof itself... Thanks for reply :) I have checked the given call chain, and find that nvme_dev_disable in nvme_timeout calls mutex_lock that can sleep. Thus, I suppose this call chain is not in atomic context. Besides, how do you find that "function (nvme_timeout()) strongly suggests that it *is* meant to be called from bloody atomic context"? I check the comments in nvme_timeout, and do not find related description... By the way, do you mean that I should add "My tool has proved that this function is never called in atomic context" in the description? Thanks, Jia-Ju Bai