From patchwork Tue Aug 28 20:13:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 145364 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1589305ljw; Tue, 28 Aug 2018 13:13:56 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaJSp85+BRBqmcMjZhzu0AHhFKMW8n8CtRKa5owfvB3rRgZ9+F5/T4O0lm3ivpPTSbhZo3h X-Received: by 2002:a17:902:1025:: with SMTP id b34-v6mr2941469pla.291.1535487236553; Tue, 28 Aug 2018 13:13:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535487236; cv=none; d=google.com; s=arc-20160816; b=srBxmMdhg5cTtsnfI9BWP+Aygu3Z5ytfB7/yvEwpiiVtfwZqficy7AVaNHS/iJDCHj myYAoDbEySfsD9DrULUKf9n9Xax9OpeyWAvF0JLNbxjgXhMRxGHpOvjC1hwfY5WrOD/U olSQY0GY4pzzXC/Zd0mw2Xc1VD2rIiNIU95I04w5nMAP91SpR4WjoxWmI2aq3K9V/OZl GOv1XfZeY2BLhSSLOOlNf0Q8pCpqbJyMZemWswWCnJYECy0vl9B5tvNahF//lLHlW7K5 WOQ9rLKYQGM0kckMXw3imbQI2DgdHCV+bCG4M90k7pNb8vs5qjMIATm9CPqxYz0gYDo4 8iAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=5BJrgdZSmdKlPX4RPaS1C+BNPd9RzMdGtWKF+5j30P4=; b=Ij2BX+cnhhEXjDKbLTxhEYU5e2vzwgBDJ6Svjel1vwYvKzxGarZanAYEU4raT2qnSv WAg3CJTX6fc2rn5y/HzVu1d6TyJCdPzwPpjW4f9cIWrDRXiiSbQC7foJQquyqpz18X7U 0RM0jT88vPuS4NEuKhOqDoVHyrWwIBda7CROiYu7vE0MUyED0KKbkLcYvL9FJTdEJQ2T Yp/VBZk4trbSgpysK7s96CFUcVD75JgjB8oMGXmMbHrj3c0vdVtG9Mj9baXuuO4Q8Qk9 8uBymyXG3VIng8yLCPNyRAgvpJd8dVKxUs7Lf2Z+3Mhm9uIrC7EYYm1KiKSTDcWJTzZk PohQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ymj2RWyL; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y10-v6si1906969pgf.312.2018.08.28.13.13.56; Tue, 28 Aug 2018 13:13:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@linaro.org header.s=google header.b=Ymj2RWyL; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727166AbeH2AHJ (ORCPT + 13 others); Tue, 28 Aug 2018 20:07:09 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:44534 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726961AbeH2AHJ (ORCPT ); Tue, 28 Aug 2018 20:07:09 -0400 Received: by mail-pl1-f196.google.com with SMTP id ba4-v6so1195948plb.11 for ; Tue, 28 Aug 2018 13:13:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5BJrgdZSmdKlPX4RPaS1C+BNPd9RzMdGtWKF+5j30P4=; b=Ymj2RWyLp/DKzB0X6duIV3ZI+xX6OQqQoPfWD0hiVFke5zvwHbwfojiYH9RyiJzF7n AR6qEi2YOvh/tPNsZ3pGitxxCStbhn2oPJB/FYHsqUjdA+/nn2YI4jsY7Y6xaW9KJGkJ AfGieoGDjF3UZ9lpXgR7080T+Y/sQXYHziQ8M= 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:in-reply-to :references; bh=5BJrgdZSmdKlPX4RPaS1C+BNPd9RzMdGtWKF+5j30P4=; b=G+VicP6KMIswVHl+814Lq35d98c+jMYAVZYZGaZIZq5PpSAZAgoMMnxRjGw5sWgPSS qbTsV/jeh7vRFXSp5fi3WaM34enIdGzS0fD1oYs0W9VwnM3k/d7Ir32P70as/tfVGn87 qRb+7syhvTNpUyI87t8hGwSmOLpBWS2Ojl/1njZpKio58WKW+nat8Jh1sgJQ4e6haVPl vjHtDQdGNjoVEGwXmsjQMKvv4ei7f3YSvr/kJFsPK5kZy1A9KpzOEJRh0ICTd1uS8Lue YSn3Lne6/RAVpC4Fu3q5QWhuMC3Jj2VkjMB9q+VlqSHHYDQ+ZZPfx5yJNPoS+M4J86AF wV0Q== X-Gm-Message-State: APzg51CR4wFTGuxCG8s0myhijg5RumFgl8b9XmCPhNGnT8omyktVNF8y /aD+QoKeDyatTL6PkfjfoXrQXg== X-Received: by 2002:a17:902:4e:: with SMTP id 72-v6mr2908935pla.318.1535487235066; Tue, 28 Aug 2018 13:13:55 -0700 (PDT) Received: from localhost.localdomain ([49.207.48.21]) by smtp.gmail.com with ESMTPSA id t86-v6sm3098181pfe.109.2018.08.28.13.13.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Aug 2018 13:13:53 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , Tejun Heo , Jens Axboe Subject: [PATCH for-4.9.y 08/14] block, blkcg: use __GFP_NOWARN for best-effort allocations in blkcg Date: Wed, 29 Aug 2018 01:43:19 +0530 Message-Id: <1535487205-26280-9-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535487205-26280-1-git-send-email-amit.pundir@linaro.org> References: <1535487205-26280-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tejun Heo commit e00f4f4d0ff7e13b9115428a245b49108d625f09 upstream. blkcg allocates some per-cgroup data structures with GFP_NOWAIT and when that fails falls back to operations which aren't specific to the cgroup. Occassional failures are expected under pressure and falling back to non-cgroup operation is the right thing to do. Unfortunately, I forgot to add __GFP_NOWARN to these allocations and these expected failures end up creating a lot of noise. Add __GFP_NOWARN. Signed-off-by: Tejun Heo Reported-by: Marc MERLIN Reported-by: Vlastimil Babka Signed-off-by: Jens Axboe Signed-off-by: Amit Pundir --- To be applied on 4.4.y as well. Build tested on v4.4.153. block/blk-cgroup.c | 9 +++++---- block/cfq-iosched.c | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 6cd839c1f507..f570f387034d 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -185,7 +185,8 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg, } wb_congested = wb_congested_get_create(&q->backing_dev_info, - blkcg->css.id, GFP_NOWAIT); + blkcg->css.id, + GFP_NOWAIT | __GFP_NOWARN); if (!wb_congested) { ret = -ENOMEM; goto err_put_css; @@ -193,7 +194,7 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg, /* allocate */ if (!new_blkg) { - new_blkg = blkg_alloc(blkcg, q, GFP_NOWAIT); + new_blkg = blkg_alloc(blkcg, q, GFP_NOWAIT | __GFP_NOWARN); if (unlikely(!new_blkg)) { ret = -ENOMEM; goto err_put_congested; @@ -1022,7 +1023,7 @@ blkcg_css_alloc(struct cgroup_subsys_state *parent_css) } spin_lock_init(&blkcg->lock); - INIT_RADIX_TREE(&blkcg->blkg_tree, GFP_NOWAIT); + INIT_RADIX_TREE(&blkcg->blkg_tree, GFP_NOWAIT | __GFP_NOWARN); INIT_HLIST_HEAD(&blkcg->blkg_list); #ifdef CONFIG_CGROUP_WRITEBACK INIT_LIST_HEAD(&blkcg->cgwb_list); @@ -1238,7 +1239,7 @@ int blkcg_activate_policy(struct request_queue *q, if (blkg->pd[pol->plid]) continue; - pd = pol->pd_alloc_fn(GFP_NOWAIT, q->node); + pd = pol->pd_alloc_fn(GFP_NOWAIT | __GFP_NOWARN, q->node); if (!pd) swap(pd, pd_prealloc); if (!pd) { diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index b2dc1c1f08c6..a4e2d0104af4 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -3868,7 +3868,8 @@ cfq_get_queue(struct cfq_data *cfqd, bool is_sync, struct cfq_io_cq *cic, goto out; } - cfqq = kmem_cache_alloc_node(cfq_pool, GFP_NOWAIT | __GFP_ZERO, + cfqq = kmem_cache_alloc_node(cfq_pool, + GFP_NOWAIT | __GFP_ZERO | __GFP_NOWARN, cfqd->queue->node); if (!cfqq) { cfqq = &cfqd->oom_cfqq;