Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1384697imm; Tue, 5 Jun 2018 13:47:10 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKJBs60PkUdI8ZwCpcHeDRJxOwUIYs3DZYp9i5GK48gxzuHlj+Lji/FXnQ3l/q/hG4tXw5y X-Received: by 2002:a63:7207:: with SMTP id n7-v6mr130051pgc.195.1528231629947; Tue, 05 Jun 2018 13:47:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528231629; cv=none; d=google.com; s=arc-20160816; b=RWE6KxmPtI5QAZdp3jM/4OM1J5KMT0v+iXrlFaOS9FizMMmVO/DCW98ocHHWfivNXk O6elnNakC0vDdBCgMbe7wlnTrSDwHc35lLMierntXPFmBGeyZPQ+8XjgXqunGagKuV20 R/nCzlpev1BXP997Zykf8pxPTSThwqi7xjP3UnLuuw8hTL+5IU+bJ8pppr/xaX0bldgO hCmFKXcFkop064uM0dVzUUSpaVKoNo09gYW6k+hrWwfvE5qbXC7Rk+H1nA5YTpg8S7K9 gjWqSCM/c3p6aiQensvFiiYvkXjDw9eGmUSXx/wUZS7Jc6P6FzUzzErYC3txcfkTfQ6v cZLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=z8nr+s+6UN9sya9xYi0cmUsiiC9TfLk6sQU4t4K2+KE=; b=S0UVaoGbdWadMuDXqt4UPx91o7c7qHKJOFG2luV5QFutvC8oIXsdLPcvqFdbC1bLAA 24yphYRkXhULxq+0hpsSdFCI5hQ4Njr6V/Pj7mELKa/ZJnkUqEKfcwge2lA8zaHLfOsf 3KA5MLPF2wLbwdpla64UpxgEBGQVCPMOniJOw+qwi/LifOL4MPRQ9OfolmN5tqkjucMS pPJpXqVecar4jn112jzKOU01wVOMY1pQWgc6EJ79NsPIRI+eosj4XwtPljhJk2vEnImu RsQ+OvR6j9t/vzv0nji9EMCAyO0TlgeuklntvCBJSW3untKPtlz1DNL08AtoSlsi8DaM B+BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=GWjkiTZE; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j29-v6si14088387pga.195.2018.06.05.13.46.47; Tue, 05 Jun 2018 13:47:09 -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=fail header.i=@gmail.com header.s=20161025 header.b=GWjkiTZE; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752122AbeFEUqC (ORCPT + 99 others); Tue, 5 Jun 2018 16:46:02 -0400 Received: from mail-yw0-f193.google.com ([209.85.161.193]:34528 "EHLO mail-yw0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751842AbeFEUqA (ORCPT ); Tue, 5 Jun 2018 16:46:00 -0400 Received: by mail-yw0-f193.google.com with SMTP id b125-v6so1200381ywe.1; Tue, 05 Jun 2018 13:45:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=z8nr+s+6UN9sya9xYi0cmUsiiC9TfLk6sQU4t4K2+KE=; b=GWjkiTZE0vvsydpDXYNJdQOLehKPIKhdmkhMZAvkXLulYFT44dDUgw3+YaAhkt3tb/ CM4Sb6b9D6+NbChO8NQ7+1FlQtarST5chmGAhZXIIoFuSgOkmrTJ9VxZ+UOHd7TWTsue Ot8aGrbrj5r45dCycudQpHVvkYsix7jtHShguxMxRs2VxJke4UiSz+D1h+9QUfIoqsjh +Q1G6kiDGCi9L0oyolFL5kvYeaNyiOtOqSmcdpt1c4uSRaud2kxjVgreETGCqdYDodV2 jIeG75kysJM/A2dkPgBpYE1HE36d8C5aW57xDktVFgzyW0tgOS3LzyWuNq7r8eCbkyUR MEBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=z8nr+s+6UN9sya9xYi0cmUsiiC9TfLk6sQU4t4K2+KE=; b=rsC7o2bW7rI9dfdmnPfiZvQBAwBeMj8kCg9HZY6P6z/LT8MvqYv+1MBX6XT3ujf9XA Coxf99RlEqgDoOI3i+ZcPsZlwb95DE/RBsnTDNAHYgy22oATa3xwcH1V8uVQVx0lU98P IxebV3sbnsyJoaMSH3fdDOO+KgWq5zIUgcsjsHM1UIj6r/KwB+3tVoB6Owqsf7k7EbDd b9YR8o6yzr1PnoU3D917uQ5iyQfbfZ9yAne9sHiPjZg1MJ5N15d//xdyidXlYXdu8f1j pwlFcGav7U4t8+RaLh0hEZRn9L1DeIxpv/GTl045jJo6rhf7IR67HrW4Z3GGBIs23gnL XGcw== X-Gm-Message-State: APt69E0pVyFHBhmeuZY+JYqAhFmFkql0ycrhkBBeMa2ASO+LXWYTAdGj dY8653J9YZAkb/k52cTPIGrQvkNB X-Received: by 2002:a0d:ecd6:: with SMTP id v205-v6mr109549ywe.390.1528231559316; Tue, 05 Jun 2018 13:45:59 -0700 (PDT) Received: from localhost ([2620:10d:c091:200::4810]) by smtp.gmail.com with ESMTPSA id p22-v6sm5613573ywp.105.2018.06.05.13.45.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jun 2018 13:45:58 -0700 (PDT) Date: Tue, 5 Jun 2018 13:45:56 -0700 From: Tejun Heo To: Josef Bacik Cc: axboe@kernel.dk, kernel-team@fb.com, linux-block@vger.kernel.org, akpm@linux-foundation.org, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Josef Bacik Subject: Re: [PATCH 06/13] blkcg: add generic throttling mechanism Message-ID: <20180605204556.GJ1351649@devbig577.frc2.facebook.com> References: <20180605132948.1664-1-josef@toxicpanda.com> <20180605132948.1664-7-josef@toxicpanda.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180605132948.1664-7-josef@toxicpanda.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 05, 2018 at 09:29:41AM -0400, Josef Bacik wrote: > From: Josef Bacik > > Since IO can be issued from literally anywhere it's almost impossible to > do throttling without having some sort of adverse effect somewhere else > in the system because of locking or other dependencies. The best way to > solve this is to do the throttling when we know we aren't holding any > other kernel resources. Do this by tracking throttling in a per-blkg > basis, and if we require throttling flag the task that it needs to check > before it returns to user space and possibly sleep there. > > This is to address the case where a process is doing work that is > generating IO that can't be throttled, whether that is directly with a > lot of REQ_META IO, or indirectly by allocating so much memory that it > is swamping the disk with REQ_SWAP. We can't use task_add_work as we > don't want to induce a memory allocation in the IO path, so simply > saving the request queue in the task and flagging it to do the > notify_resume thing achieves the same result without the overhead of a > memory allocation. > > Signed-off-by: Josef Bacik Acked-by: Tejun Heo -- tejun