Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp6115775imb; Fri, 8 Mar 2019 09:34:33 -0800 (PST) X-Google-Smtp-Source: APXvYqxpT3c82V+W5HeyubIroI7PBi4nW58jEJwzcJekVMofkOVgpZYf/Qz65Q/wPeciK+n8yGA5 X-Received: by 2002:a63:d112:: with SMTP id k18mr17996045pgg.426.1552066473155; Fri, 08 Mar 2019 09:34:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552066473; cv=none; d=google.com; s=arc-20160816; b=bEsy0bzQtzATop7GO/CkE7q42S4+qRs2++45Pdv90oD0uLZM7Kcwf+Hj6ZYHkwf+M2 2FapEJ8DYlTvhf2X/xL8lAyB3jp7CeWm03t7ZfTB/yApA4nMUQ4/s32SYC/p/3EQNeTe bo3OLidO6EJYiBHU7v9PjUYcwdWlnwdWrj1gYJhaX7P/W/OViDUbwFNjZvdw25AvoWON j/Sfa57p5KLRrmZr+6h8toJG1+HFSbrBVtEvbLpaZchr13Z+vrg4zZA+OiUkmDSwkHfi JzAFsioKrkT31xMrQ51YLSfFcHNKYzMEYQo+Aij2XOLRkxGfDUl5llUyvxlhTGSDvs+J zkfA== 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; bh=y41igMRdVdi6O2TKhS1LdJCmwZwAdJ7DsR9RZUvhSc0=; b=dXv07MeG9mAniKzcKSuzqAuB/ORVcvOGSA2whfIWDtnGqpaSZ/XndbFTMVwlHskjGf Cndpd9JaiGgtE/RdkEFfjYT0GxSZw8QAQHIXnQ3rlfwUvbdO7JO0DqbhZNTsOFeCx5oJ 2inDGb3Li7R2OUHB09L97IiUuvMT6JHwuQNDqmyU0h1sowX8vKzf+1M9QukEMb/++bBG gL3Y74N9Ftoosi7HUCaSVXl7pLS5j2viMn2R5RHy5OwUPjJd/pWB3IFM+7YbOBHcThKS o0jtMnDqvp8XXj7cQxLa7xE2vCBukGW18LQjLmivyGBriZnaGvNZXIsecoKN4v0TU7m8 /j0w== ARC-Authentication-Results: i=1; mx.google.com; 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=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 2si7664337pfd.129.2019.03.08.09.34.17; Fri, 08 Mar 2019 09:34:33 -0800 (PST) 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; 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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726814AbfCHRcU (ORCPT + 99 others); Fri, 8 Mar 2019 12:32:20 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:48184 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726395AbfCHRcT (ORCPT ); Fri, 8 Mar 2019 12:32:19 -0500 Received: from mail-wr1-f69.google.com ([209.85.221.69]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1h2JM2-00058h-0L for linux-kernel@vger.kernel.org; Fri, 08 Mar 2019 17:32:18 +0000 Received: by mail-wr1-f69.google.com with SMTP id o6so10504863wrm.2 for ; Fri, 08 Mar 2019 09:32:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=y41igMRdVdi6O2TKhS1LdJCmwZwAdJ7DsR9RZUvhSc0=; b=VGMqzRfpnAg+GBO9p/Y00f5RmTrewP6W4GpHqBpLemXnxZCN7v0JQPpqj59q3T4zeF FTGpsgnSVN1XFCWhIoWhHNAUB8N7Vi0sMBzra62c9aglGpPxx2ddoINhewPxTDEJZA6c w02y5nV3Ancv+mXj/lHJQk4TT6M66LrNjZrz+NZFtlCeGw8KeS8Lrr1RSu7DDOpj0MRB yvl4yBy1R89Kn+1jlNFQaqjDrH0mYLSaX7nF2Qqtx4vfofwS7sY7AZNAkUow4zWisInB sEityjGPTsqBTC5mIkTArsBHmMjKkeO5PYQrspldfeuE8Bsh47JQZJAxYj1i29qHiO/3 L4Fw== X-Gm-Message-State: APjAAAVjzf/QJibIA1hbMLOFeZ2NpN+3ued8C/uN63uEZlIDNlnFj2AI w2BbLo4vtzmWaW0fNJGw4q6QP8ppTmf+flVbMUJ2GiXECIGFOYWaAf+O5jczByaBZ7iCVNcb15M +Bnvk1j5PWQa8regSmKPLXsrvTiw5BIq75xfC7c/Duw== X-Received: by 2002:a5d:6288:: with SMTP id k8mr12639922wru.173.1552066337671; Fri, 08 Mar 2019 09:32:17 -0800 (PST) X-Received: by 2002:a5d:6288:: with SMTP id k8mr12639905wru.173.1552066337361; Fri, 08 Mar 2019 09:32:17 -0800 (PST) Received: from localhost (host22-124-dynamic.46-79-r.retail.telecomitalia.it. [79.46.124.22]) by smtp.gmail.com with ESMTPSA id l18sm8233877wrv.20.2019.03.08.09.32.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Mar 2019 09:32:16 -0800 (PST) Date: Fri, 8 Mar 2019 18:32:15 +0100 From: Andrea Righi To: Josef Bacik Cc: Tejun Heo , Li Zefan , Paolo Valente , Johannes Weiner , Jens Axboe , Vivek Goyal , Dennis Zhou , cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/3] blkcg: sync() isolation Message-ID: <20190308173215.GA10148@xps-13> References: <20190307180834.22008-1-andrea.righi@canonical.com> <20190308172219.clcu6ehjav6y2hxi@MacBook-Pro-91.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190308172219.clcu6ehjav6y2hxi@MacBook-Pro-91.local> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 08, 2019 at 12:22:20PM -0500, Josef Bacik wrote: > On Thu, Mar 07, 2019 at 07:08:31PM +0100, Andrea Righi wrote: > > = Problem = > > > > When sync() is executed from a high-priority cgroup, the process is forced to > > wait the completion of the entire outstanding writeback I/O, even the I/O that > > was originally generated by low-priority cgroups potentially. > > > > This may cause massive latencies to random processes (even those running in the > > root cgroup) that shouldn't be I/O-throttled at all, similarly to a classic > > priority inversion problem. > > > > This topic has been previously discussed here: > > https://patchwork.kernel.org/patch/10804489/ > > > > Sorry to move the goal posts on you again Andrea, but Tejun and I talked about > this some more offline. > > We don't want cgroup to become the arbiter of correctness/behavior here. We > just want it to be isolating things. > > For you that means you can drop the per-cgroup flag stuff, and only do the > priority boosting for multiple sync(2) waiters. That is a real priority > inversion that needs to be fixed. io.latency and io.max are capable of noticing > that a low priority group is going above their configured limits and putting > pressure elsewhere accordingly. Alright, so IIUC that means we just need patch 1/3 for now (with the per-bdi lock instead of the global lock). If that's the case I'll focus at that patch then. > > Tejun said he'd rather see the sync(2) isolation be done at the namespace level. > That way if you have fs namespacing you are already isolated to your namespace. > If you feel like tackling that then hooray, but that's a separate dragon to slay > so don't feel like you have to right now. Makes sense. I can take a look and see what I can do after posting the new patch with the priority inversion fix only. > > This way we keep cgroup doing its job, controlling resources. Then we allow > namespacing to do its thing, isolating resources. Thanks, > > Josef Looks like a good plan to me. Thanks for the update. -Andrea