Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1276120imm; Fri, 29 Jun 2018 14:58:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfzTi2Wpmm6EqyfIFQxRIVWYVDGC9qmVJab2Jt8qkADuQKHCXXussQ7SbhtiCRf6tHZLEmg X-Received: by 2002:a65:5bc4:: with SMTP id o4-v6mr10488263pgr.448.1530309517893; Fri, 29 Jun 2018 14:58:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530309517; cv=none; d=google.com; s=arc-20160816; b=p0cwO7SZhIhkFLbAzQeBRPCwUPj1UsLYCPO6Sw68vczVncFdAvAYC6wVft/3KJY+fD BACO78kW9R2M/S/W34a3PsB+EzXKfB8SBIb7t9HtAkVwv8oq1OiddStMK2uxFugYO5WD GBhBs0WT/khYkRFilcxIqCjdWCFyPsD6YB1+uhMscODnVjLWfG/Mqm25vEmJrrRZTRM+ /iK7cpqb+fpXxmpw/Vlpw7DaAThMjaijoL7g9iejF1ejwCylkTvnPK4oBbqAD36oed2g /yxBlhh9zN3pCAMIUeKqwPQXVlVzNdeR5+iiaiLor9HsRMUlBytpFKGOjCcwXabijGHp drWA== 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=Anhkm0Ac9/J1np2yjyV7az952Re4XQTOLceXYvsTzSbv0cNdpQo3C6/VchEY2Rtf2n o2R06ZAB/hd6HeVCORkL/HgkjfLz+VjfYMVe+sQB9QUe78nXgT2RaAxgsmpse9YVBtWq Rj9tWxEDuvZ3YXVcgLJIAvp1KOPvqsmEtNF4OdETf6nNRUZ1/i9PAIazsND1vM/WKtM4 6m+a+sFDeTXUUwJIZuGgKLKLXUjVxbPEnjP8PNb2nXSgoVo0rfito0o9842OwpGmAlIq eNDc7YFhJmavDEzS8r+WUxO899sERsmokkCc5WfP1NsVCi82dg/tn2wwreoyNFaRtkPJ G6Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b="Ov8xea/y"; 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 k6-v6si8985898pgk.256.2018.06.29.14.58.22; Fri, 29 Jun 2018 14:58:37 -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="Ov8xea/y"; 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 S935370AbeF2T0a (ORCPT + 99 others); Fri, 29 Jun 2018 15:26:30 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:41393 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936270AbeF2T0F (ORCPT ); Fri, 29 Jun 2018 15:26:05 -0400 Received: by mail-qt0-f196.google.com with SMTP id y20-v6so8814150qto.8 for ; Fri, 29 Jun 2018 12:26:05 -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=Ov8xea/y8QEs2VzZ3lU1vnXx1Ntzy8yO/UstJ/rEdlIP1+ZCOgbdIta8PBIamYqLL7 Ocb0WNJofDZGBkz45mFNxZmiosHU/LZf2To0WV1bOw5UMGBzw/Rv+MEM6sHSWiTNcXYM spVOboERE1RTPy5DIVaZXOwK1H+OiUGpQY6KeSMpNwAtpyAJEvaoLMVLD3Ug4ou0WJJ2 x8tPOCJkd7Wi5YTrpFqLO2mZB6M1LhxzKbIUqGGrxNJqe6Lx5iGUeOn5BKg8fRN290Ep pcmmdlFUQRxxJGBqYMdAaV8trxIaSHfmrqqYgxwu38pFISpZ7lmVDAozu5NAva5z1thK 8V0A== 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=P6DK7UhbzBslnqlwgr1/clg7YOb6TYh7zNmossueZJpD5X6gZVgSQNru/2DTIZ/x+7 LR68nTHyooumdDvGCFhGe47aNKhWmRSofupAbwmDC/gAi14vEXrOX7fLC74ZZjMdQCNs Onq+zLqvMbU0cDaB4oSEEWGPNFAiCppO6fI8IJ4IQi8Fc+jr1DK14TZDKz/K6TtuA6rF 6sYazyuwzF0GhGkYw0FAcSUxOlSV0i71o3nU4+5lnA0ogGl78XeMJQeGFt+/GmdLooH0 lLlxH+S16HGcZdfLhTGFTKozSog6SZyjq8WjpTSanLsgxMvaOQf1QvbQgHtxZR9uJBBp e0CA== X-Gm-Message-State: APt69E1RycQlSOMBiWeZvs5Si4sD5T7VUdPRcx5rcR/K+YB7nLlItXL8 fPnsE5g/HylYwA2Wxmo8Is7A0A== X-Received: by 2002:ac8:40ca:: with SMTP id f10-v6mr14375253qtm.387.1530300364762; Fri, 29 Jun 2018 12:26:04 -0700 (PDT) Received: from localhost ([107.15.81.208]) by smtp.gmail.com with ESMTPSA id a127-v6sm5798121qkd.9.2018.06.29.12.26.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jun 2018 12:26:04 -0700 (PDT) From: Josef Bacik To: axboe@kernel.dk, kernel-team@fb.com, linux-block@vger.kernel.org, akpm@linux-foundation.org, hannes@cmpxchg.org, tj@kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: Josef Bacik Subject: [PATCH 14/14] skip readahead if the cgroup is congested Date: Fri, 29 Jun 2018 15:25:42 -0400 Message-Id: <20180629192542.26649-15-josef@toxicpanda.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180629192542.26649-1-josef@toxicpanda.com> References: <20180629192542.26649-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