Received: by 10.223.176.46 with SMTP id f43csp1533103wra; Wed, 24 Jan 2018 18:58:58 -0800 (PST) X-Google-Smtp-Source: AH8x225pVovuvGTUhfXa4vW8pZNVjSvgtehMVZifckLwUaxlfcWRlI7grvrBrSBIVixGbSp9wiaL X-Received: by 2002:a17:902:b909:: with SMTP id bf9-v6mr10271583plb.218.1516849138870; Wed, 24 Jan 2018 18:58:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516849138; cv=none; d=google.com; s=arc-20160816; b=xGexNbTY0rI66Ko+tdHCGogfxNyIgh4xXrhLRYXXPrqjM1UbsyLcYc2YlW63JvpEoy YPMLiHcqWQq3k9IsZz/ZSMxzeJ3xkx1q0RZauPBr65tFqbg1pGr+3BMw6OwukcI3Qmxw GpaL1CMxvCGIZkbG8QMesUmqAAJZTHXCMhYlHYBWb72ZoA5L8+Cbx30wrW0PKjy5aw3A UolsauW/lMq0w5T53YKZzeqf69q0UUddDnXVRAXT2L3OPjNYslCY0yQ38DTp1rZsldgi RcWuwd8l4XOfirOe+uca3mrNbV0VeMQp1vkR5Haa+hMzGDf5m+GR1GIiD3YL6OrKO9as MnJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=o/fdBlDgIEUiPnRZNpvfLONaCefqAtaUxbmCTujlZg4=; b=VqeqxoyzU7pgNDudx7H5xwa9JsxL4H4/DB/1CWW/VJ8rdA7K9l+gXOfvI9ncLWzhCL kw4AJDl9i1oPMKwFQgrW3yZ+GZnbCdFjS3osVh+jV5bEtSb/cV4W0NW1VbYkqqTPyxMu bUOKbY5OeL9g9GWtz+O9/y+pxuVXaMfgHdTIf9Fz2pizusVaWIFQH/Wk8+9/+z8vCXME riEwAeSlUKSoWGia0NJCT7QcFZ9o+NZIbXUY+mxGzzxLm93cqGSDC2PfssksC0kjEPDw j2Fr6Z/8ZVYkRppDC3+qg8MPAR6sY+re8QAs8iUvo2lq5xtwMDihRd3sH+gx0/58D1Yr LuKg== ARC-Authentication-Results: i=1; mx.google.com; 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 x5si933704pgo.709.2018.01.24.18.58.43; Wed, 24 Jan 2018 18:58:58 -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; 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 S933235AbeAYC6P (ORCPT + 99 others); Wed, 24 Jan 2018 21:58:15 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:55536 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751762AbeAYC6O (ORCPT ); Wed, 24 Jan 2018 21:58:14 -0500 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1eeXjv-0007NB-Ds; Thu, 25 Jan 2018 02:58:11 +0000 Date: Thu, 25 Jan 2018 02:58:11 +0000 From: Al Viro To: Jia-Ju Bai Cc: axboe@kernel.dk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] block: blk-mq-sched: Replace GFP_ATOMIC with GFP_KERNEL in blk_mq_sched_assign_ioc Message-ID: <20180125025811.GT13338@ZenIV.linux.org.uk> References: <1516848386-5720-1-git-send-email-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1516848386-5720-1-git-send-email-baijiaju1990@gmail.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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...