Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4011124imm; Mon, 25 Jun 2018 08:16:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJdFBj5zuvHaelcqcnGBdsOL7DijkPFqzFUs3fX/CHWpc/f26jWEzQn6Dcfqn8cGWlslHbF X-Received: by 2002:a62:b24f:: with SMTP id x76-v6mr10320321pfe.147.1529939801524; Mon, 25 Jun 2018 08:16:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529939801; cv=none; d=google.com; s=arc-20160816; b=Hg3R+RB8iLX0PUBg2tZVKiZKXh6uLcVtKTNTkJ7GO/cc7wIjId7tXILi6n37kXhvMB mcUc0IQK5kFFogCSw+mMhHWk1D4ayVRXAL+PoYIoFwbg9p1mOH8li+sCg10C2zo6T2lV iJSrkqC5/l8axQDTg0N2HcA1/3lm2p8/RypEdsVMaQJnDkhGUXHLtFoVvnbVn0WEebwE 2Vb8JFv1dqp0c5faX2jIgBLi8Hd0hoK+FmfAM+vwrWzNVvbfAMDLIPb/fcnI7BbXm88s hf/9/P7gUixHLM2UVz/uHL9LFXro04KQr85B5jNGEGC6pGrvjkXrLmOafyeWK6kxMjAE 7d0w== 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=I1KqJ09/Y9VO/VmHIddPxhlI+JNBCrcVYnWeMoZOd/c=; b=KkoOuPCTBmeZbJwLmTAG/yFuzeMdtDfTmTj7zpsP3UMXCtaXLmv1QrsgT2jfn59Fwi DUCKaD/EPsdQ1YYFvQbkCJu+07WOUHZfZy7Gos1N0vk2BDHXk5U/sBVWwE+kOaizMvt/ HzjHcAtT/xUt7srJPLtM02I+tFoG3w2B/fozF313syc2ifl4Eqe+b5ly8qr+X592zb29 f3/ob1wfRw1P+zfk7rCyIvngp869mFjjI0ms/xxMHbgCQitM8G1u046qJwnHyPjTaEDT xhWsZYk1eA9Cw6UXCkvlw7gIU4l1lTKi+F5I+RyYpzQhx3SJFx5Yb8eDpXEZXDgc8VRt luDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b=MVm3juD2; 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 w135-v6si14136220pff.18.2018.06.25.08.16.26; Mon, 25 Jun 2018 08:16:41 -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=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b=MVm3juD2; 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 S934974AbeFYPOQ (ORCPT + 99 others); Mon, 25 Jun 2018 11:14:16 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:33333 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934872AbeFYPNH (ORCPT ); Mon, 25 Jun 2018 11:13:07 -0400 Received: by mail-qt0-f196.google.com with SMTP id l10-v6so12257173qtj.0 for ; Mon, 25 Jun 2018 08:13:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=I1KqJ09/Y9VO/VmHIddPxhlI+JNBCrcVYnWeMoZOd/c=; b=MVm3juD2xKZX3dYF8WMBWCsBcGVI/sbBPW4FyC29SqDhEKBn7h5h6I8s1m7alhQNRG 80bAiZKJgsjz9Eju7BtwX9nR/vSSTxowg3sjqw+Ac5SKykni00uootHS4Lm22svLZWgr FQjImYVI9MxOZ8sGswWRBufoR/9/GwP/ppY5Wq+DYcbHGUrpRH+3Crq/FNl8fajydvS9 NF4ynaZvv97WmmXoh/3NUyJE5/C3eU+gkO8r87IVKs3Ab6oQLY6bpCDWqrEx8sRJf6RO XnNuGnzycw46NyouCuwv/jTxlzuos0bojiwPz/yzzXMozNXuMsEwnXdkDdGNNDl3xIUC qDDA== 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=I1KqJ09/Y9VO/VmHIddPxhlI+JNBCrcVYnWeMoZOd/c=; b=ABS7QlPbTg48XyrGITcfPOAR+U8AE0JzFYlQ35iTkq2XPxsQablH1UrurlItAVv2Qs TLsQuq3wv91vLrUtUlRuN82QKEXvbomm+eCIv2pl1hx3F3TqdIb8rpgb3RCP2W7iNVdd sPmk0816/g/e9fG5wK3iZfdlcTppL0TfqzexAjaIm8IHaUJl3cMtgAJREOnovuWSiFWS MLwX2/xuI3RQEYT7Q2Fh7qsreQrpFkfIIQn0z0KlfUai3Feo8FPht/ivD61SiMpumXVV c5gUGp+N8zQV63i0Q9/28stoiJGa0iLAppHnfyx6EbP7HmufDQB88QAZMql+uOsN0xT7 lCLA== X-Gm-Message-State: APt69E3M7YwqlJGXrJZFNmK5Wv2Q0ekXV1ECNHgD+u+N7lOAMAZ8ctR9 mp+XpW7yloslW3LbG3mho/wPvQ== X-Received: by 2002:a0c:b41e:: with SMTP id u30-v6mr8718091qve.102.1529939586708; Mon, 25 Jun 2018 08:13:06 -0700 (PDT) Received: from localhost ([107.15.81.208]) by smtp.gmail.com with ESMTPSA id m63-v6sm10699398qke.9.2018.06.25.08.13.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Jun 2018 08:13:06 -0700 (PDT) From: Josef Bacik To: axboe@kernel.dk, linux-block@vger.kernel.org, kernel-team@fb.com, akpm@linux-foundation.org, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, tj@kernel.org, linux-fsdevel@vger.kernel.org Cc: Josef Bacik Subject: [PATCH 14/15] skip readahead if the cgroup is congested Date: Mon, 25 Jun 2018 11:12:42 -0400 Message-Id: <20180625151243.2132-15-josef@toxicpanda.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180625151243.2132-1-josef@toxicpanda.com> References: <20180625151243.2132-1-josef@toxicpanda.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Josef Bacik We noticed in testing we'd get pretty bad latency stalls under heavy pressure because read ahead would try to do its thing while the cgroup was under severe pressure. If we're under this much pressure we want to do as little IO as possible so we can still make progress on real work if we're a throttled cgroup, so just skip readahead if our group is under pressure. Signed-off-by: Josef Bacik --- mm/readahead.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mm/readahead.c b/mm/readahead.c index 539bbb6c1fad..cda6b09e0a59 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "internal.h" @@ -500,6 +501,9 @@ void page_cache_sync_readahead(struct address_space *mapping, if (!ra->ra_pages) return; + if (blk_cgroup_congested()) + return; + /* be dumb */ if (filp && (filp->f_mode & FMODE_RANDOM)) { force_page_cache_readahead(mapping, filp, offset, req_size); @@ -550,6 +554,9 @@ page_cache_async_readahead(struct address_space *mapping, if (inode_read_congested(mapping->host)) return; + if (blk_cgroup_congested()) + return; + /* do read-ahead */ ondemand_readahead(mapping, ra, filp, true, offset, req_size); } -- 2.14.3