Received: by 10.223.176.46 with SMTP id f43csp1565812wra; Wed, 24 Jan 2018 19:34:59 -0800 (PST) X-Google-Smtp-Source: AH8x227ZJzIetZN8coSTet6gxq464xsRRMrDdg4X7sy74UG7p9nZI5ov+1kIdBNvrVJXljOYrxal X-Received: by 10.98.70.18 with SMTP id t18mr14892865pfa.14.1516851299759; Wed, 24 Jan 2018 19:34:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516851299; cv=none; d=google.com; s=arc-20160816; b=khQxzD0KHPSqGdKKuoNAl4jCqUXfduWg36PGkIz3FCrQJu5uv0jn8lqkQUdUYrJhVB ZwWQRj+kLfx00Ou6CXVO+luFjvUuAFX8hwKBco933rbxXKQp2uh3yQuLQb0LMjHseXgT LJ3dva8gsKXsYTKQuyyGHtcRV14+RY4LNGLW/DuF+MUkgZPfNDunGY/cPg+O+8f4hcL2 eOCrMNsokajOi8PeuGRCM0efV4tId+2YekvuyGYtvww1bhtt2W7a9v3K/cek5HCobcB0 zBxsEHf0OKofzXM3cMIzgkaN3JvpVRKa+WFIxa6uZHn5KZt7EbSK7/eoqgA5KcAIkjjS RXAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=n5NXVOQns1dknLOyLMmQ+T2YXu3KBzXOyfcszfzTd2c=; b=uol++raH/3dAn+706q/2SHnuXWv2zc72alCaKv2kx9WAYZodyxJKx87oplx9sLyTQg mxWIIREw6gImZrIzqgG1NlSslnFMWCsuod5/8yP0+56pkoe5Hdhda8Fh8sGLnZ+YWBXz wpdWVL9IZCajOltw49+YJXuxzPIMCAD1EQsADv8ejza4PARMR9vuhNkDQQmACUvk6J5B K2eeaZG5hVqyq0ujtEL3qglbKCyTJbJOMn93MpEOBNaciOEBJ/DTDWsqN+oShDXmGEJs l6/uXf1lqnoGLMl2lbdKtXSWaxeWTrbeVHRy0Q8+p3kKdZAILygSOd5FWZpKP3JrhUJy FXzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=qTmiUnhM; 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 o123si3885254pfb.313.2018.01.24.19.34.45; Wed, 24 Jan 2018 19:34:59 -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=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=qTmiUnhM; 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 S933369AbeAYDeU (ORCPT + 99 others); Wed, 24 Jan 2018 22:34:20 -0500 Received: from mail-it0-f67.google.com ([209.85.214.67]:44233 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933307AbeAYDeR (ORCPT ); Wed, 24 Jan 2018 22:34:17 -0500 Received: by mail-it0-f67.google.com with SMTP id b5so7657192itc.3 for ; Wed, 24 Jan 2018 19:34:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=n5NXVOQns1dknLOyLMmQ+T2YXu3KBzXOyfcszfzTd2c=; b=qTmiUnhMy0bbv+AxrZQjLSrt/JBD4PqFg/m8OwyxyS2hzCLEUJsqFo9IyKtG+sqKM2 tS00w8jREsPbF+XJ/fkbF2UkkXKp44MX86gBOxzA67IY4gWNMxRRJ6aVxPlTOubuZN1o ceWnsV5yZvmB39eHt+3M2Q5iYNFR0+MWCAS/03txBBvLJKvs+Z/Rcp0s9i96yWH4jNbe PGDwbe+MGkrb5N0fWZvmLbxK+rIdiU29HGgRTEkm+XWi/N1LupNHcHFItVx2gO64PhAC 9a4tu9tEXGTF8TrsRQyzR1DYIQ87CF75K3qWRse9rX48wSslifu00fcJjiv9jb5wMBlv m1ag== 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-language :content-transfer-encoding; bh=n5NXVOQns1dknLOyLMmQ+T2YXu3KBzXOyfcszfzTd2c=; b=Y2eplxUXRIPGKKhZSWVseSASfEWuhLQ5EeRFe4ZkMtXcPkRwrf0KmR6PVYiwEFioeW ulnfrawJqRIktNRhKXUZOVezBySvZrPcBS9j8azpb5Hs67+LhYxxjmaTqGdL3pxMJhie UaL6sfD6lZlGbKu0DR1QSnNLJch2gzn8bnToQ+dGVk2gVfw2DfP8j4neE30cJfkmydyb ETFPDwmEAR+FsTugptES3ZpWC1T4hgDn3DH1LoIaaUy7hEPzuZxw/JhlvMEfHM81NDza edfYbnsIq2Fe7dl0P5mvecYod9uOAKqNci/IFTsY89jld5F1I54iztNnTFrbgysSGf39 VNKA== X-Gm-Message-State: AKwxyteWVHE8e9+arlIr4wWr+TrStAfxOxYohx0g/dy/ES73/vIQjXgt f9Lyc6Tet5gkpEYbHRRX+HMeEo0vgb4= X-Received: by 10.36.170.7 with SMTP id b7mr11430661itf.147.1516851256439; Wed, 24 Jan 2018 19:34:16 -0800 (PST) Received: from [192.168.1.154] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id a19sm1006709ioc.17.2018.01.24.19.34.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jan 2018 19:34:15 -0800 (PST) Subject: Re: [PATCH] block: blk-mq-sched: Replace GFP_ATOMIC with GFP_KERNEL in blk_mq_sched_assign_ioc To: Jia-Ju Bai Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <1516848386-5720-1-git-send-email-baijiaju1990@gmail.com> From: Jens Axboe Message-ID: <7a1809ce-c456-0d53-4d3b-2368fb19bfd8@kernel.dk> Date: Wed, 24 Jan 2018 20:34:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:58.0) Gecko/20100101 Thunderbird/58.0 MIME-Version: 1.0 In-Reply-To: <1516848386-5720-1-git-send-email-baijiaju1990@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Jens Axboe