Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5319365imm; Sun, 22 Jul 2018 19:22:27 -0700 (PDT) X-Google-Smtp-Source: AAOMgpebDqqfm9Vx41XWxqIsXwVhrbcQmd9DZDNrJmOK2nhw+HvetpbJM/mlCz2QZTiplGpEkwYU X-Received: by 2002:a62:990f:: with SMTP id d15-v6mr11333413pfe.162.1532312547094; Sun, 22 Jul 2018 19:22:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532312547; cv=none; d=google.com; s=arc-20160816; b=wINqui8lWbJEEm15kYlQrV9za+i5pkL6rIO5BgawhZB+2e6s5IM+ai6E8e/USKm9Bl 89+VBMkamhCFsCLIXemkS3BOEyruTXv5GydUVg1WnyXiso8lhqSgCxCP49aYX1V8MUk9 apSW8fqOYXw1QpBUH9x8uqn4xdLr3g9+gFEMtYwnygevHNyBvYQ4F6L57lcRaJ4dbPGZ drrI9S17CJ+eon120xeqTAg6nrVe4s6OQ0cjT3TbprBU/4SEzt0ZOFc1pwpIeCTnbWul BncQEglROJIS1V3aRB8DgImmL/+4awKgh7KEJnPxQE5yGR50l+oD9NpY5UOWfn1It64d 3Hzg== 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=u7xZlJQ5KP9xxRXKk73VOjCWYGFJfRdlavf4Ev+KEaI=; b=dhdZSc9Wxzz+BkNtr85JRHfizL/wsobqNEtAHW5MYqJeopf9Zkh44nCvELSH/7oJRa WDTsLxH3fZwXWvVDzaxemYKlv4qYdvKUoYy1kqMJ4i4LHg6Zl/0f5GtY/Y8d42QLNhjc fgh2Fc5t0VSsYud/VDhX5l3zJGSPsJe+yj2FO106eMEOX8+AxRY8P9/aYC9Mopi6a8CK CRg7TbhamYJ3OoDYnlt2Q7u0xN5vmTEUskRHxg70EFVr6FwNm+XH/iV7qRhUZUXo+kz0 jLxAN5hDXjyyaWkHfeO0it6iVCX09NGB4pXnKWA1YIT/bIHc0xlmbG5O2/MBj3LP2E+H 3RAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BqsjbhGq; 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=QUARANTINE 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 y10-v6si7610182pgf.312.2018.07.22.19.22.12; Sun, 22 Jul 2018 19:22:27 -0700 (PDT) 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=BqsjbhGq; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731247AbeGWDUP (ORCPT + 99 others); Sun, 22 Jul 2018 23:20:15 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:46376 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730798AbeGWDUP (ORCPT ); Sun, 22 Jul 2018 23:20:15 -0400 Received: by mail-pg1-f196.google.com with SMTP id p23-v6so11087387pgv.13; Sun, 22 Jul 2018 19:21:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=u7xZlJQ5KP9xxRXKk73VOjCWYGFJfRdlavf4Ev+KEaI=; b=BqsjbhGqME3UjTlserDHUGUeNzsEZRFWgK6Q+CRfHwTKSqvv5ow7ItIez2O92t8M3j YtbmXmlE++BFFyyn58lggvWFAWombmuQTRRyekiT7vf+FBJ5LILPydVvmHO8U508vhuM IUuHl+rljojbO+3bbOG21lpCjMItIKKK84oDAVXx1QxE6M5DCIUGGKTUssQo2ielPykk YWYSS9UWN5LUyFj8//B5d/gW87Flt8f2T8NqqYrBVfwGKl+BNlbCGo6WKwK5GwAJEl6s RtSOqYgKcco3S5TfdYIStTeyXOMHb1l4Yx6CdoXg15pPmv45YRIDpRB6za4yGmdnzd0y PaXQ== 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=u7xZlJQ5KP9xxRXKk73VOjCWYGFJfRdlavf4Ev+KEaI=; b=uoIXeyQiC9WVvUK+bFuc/+k0Z/5u2j4FaPXBB7C7be57E8XBrgcwWyMlFQh83aa/1D XuCOFBs3JUU0c7Fer5AGiaP9Bv9mPEAyTQtFlem6itUEnBtLDt7o3lUMWGda2iwtaXiA AFVvlyIPQPXyIC8n2ESh9qM6dCHe8TJWxff9oRN+V/LXRLYqJcTcQVNxn5AAsxcb8qUS UXFj2xSp74LPh2eur49x6Eqpdet+1nKS6BGXndSPazyk2aRK0T+O+WPWpaOSgbeWGyEP bX/GpDDhsfY1LPN6uhLtpPl0gUZMrhnUaCHB2NxWwklwxKKpak5k8+UKTjX/p8XEh3CV KYVg== X-Gm-Message-State: AOUpUlFnVFKdfNBpeDdy9T0z7ye1zz00v9ahEQjDJwau/lYHkQNmcwWa F5UNAm0emg+6ukFSpNDwOpU82Skh X-Received: by 2002:a65:5641:: with SMTP id m1-v6mr10725181pgs.246.1532312484522; Sun, 22 Jul 2018 19:21:24 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:c122:f95a:1d53:1f82]) by smtp.gmail.com with ESMTPSA id n18-v6sm13783715pfa.50.2018.07.22.19.21.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Jul 2018 19:21:23 -0700 (PDT) From: Jia-Ju Bai To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] block: ioprio: Replace GFP_ATOMIC with GFP_KERNEL in set_task_ioprio() Date: Mon, 23 Jul 2018 10:21:16 +0800 Message-Id: <20180723022116.6919-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org set_task_ioprio() is only called by SYSCALL_DEFINE3(), ext4_fill_super(), ext4_remount() and reada_start_machine_worker(). And these functions are not called in atomic context. set_task_ioprio() calls get_task_io_context with GFP_ATOMIC, which is unnecessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. I also manually check the kernel code before reporting it. Signed-off-by: Jia-Ju Bai --- block/ioprio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/ioprio.c b/block/ioprio.c index 6f5d0b6625e3..42d91ee7080f 100644 --- a/block/ioprio.c +++ b/block/ioprio.c @@ -51,7 +51,7 @@ int set_task_ioprio(struct task_struct *task, int ioprio) if (err) return err; - ioc = get_task_io_context(task, GFP_ATOMIC, NUMA_NO_NODE); + ioc = get_task_io_context(task, GFP_KERNEL, NUMA_NO_NODE); if (ioc) { ioc->ioprio = ioprio; put_io_context(ioc); -- 2.17.0