Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp567933ybi; Wed, 19 Jun 2019 04:21:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGcaFoOr4mO5fmzu0Tv20R2zah4bRJQj08UdeNR2+mObMZkTdfU2CB3l+6g89PWjXrFwTm X-Received: by 2002:a17:90a:1d8:: with SMTP id 24mr10805083pjd.70.1560943309376; Wed, 19 Jun 2019 04:21:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560943309; cv=none; d=google.com; s=arc-20160816; b=UUdoKhI9KwVLC41z3JOcpBe5Efp5WGIU9Zi+vZpYaJrEbRmAdFmWWZ6EhhYXqdo2K4 1PQNlSCnagHOWP91ah0TfACqF830i1I5n1QzBZnO5xbvfbz8h5tEQmhZJZ1N9qwJGU1k G4feqE+BduaMioJrmrcyxTUnzfQlDcGwul4n93F70+Jf+zGHtkvvAmfY0KVUrA6b1qOW sCgSgEviT2n3LGGlSXLbn9M5jG2/BNUoBqIwjTs2rve0O9mnAZIygAC+SfmQdpROBtmh 1sAjSFGgy/c2V0Cru6CqOFlfrqgIc+4vTpJ5g5wOPPGunLVZuo0MQyQVK7XZ/gL/e1bP ly7w== 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=bpZ6wpYAxSY+LxSzfNYFKr2n8ZS1tQ5gc51zmgtfL8I=; b=d2wDqUeY0vUiJRdp7Ubsas2g57/oAi61kfwYZeCms+Bx38tBgT5zqx9n9oZ2u95fXc Lfam81Qhye7SXGoKV4QJEuFdgSWh0p/wJp2J2nunNypf70rTSExgnAxcZPp1Sz9k3Ifk EidBZ8z4+NoftHYOkE3aYYorLv+h2gj6ucYulzHutmJPNscyGM2R9idDxm7z+IWrC/Ia ud9LNJqf6I41qFPsacdoJXYA9x3tWj0JMxzS7c1lKHiFSm/IBgaANYcJCr6277uKB8MS zVkyQSIdfaI5uebvYrc1uIJvKCeu3XkyUbBfj0Yl6Acdn6yhJZbrZ5e+e1MM5NnjRPcs DjZQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i184si16237182pfb.123.2019.06.19.04.21.33; Wed, 19 Jun 2019 04:21:49 -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; 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 S1731510AbfFSLUG (ORCPT + 99 others); Wed, 19 Jun 2019 07:20:06 -0400 Received: from mx2.suse.de ([195.135.220.15]:33702 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727076AbfFSLUG (ORCPT ); Wed, 19 Jun 2019 07:20:06 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 649E0B002; Wed, 19 Jun 2019 11:20:04 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id BC8081E15DD; Wed, 19 Jun 2019 13:20:03 +0200 (CEST) Date: Wed, 19 Jun 2019 13:20:03 +0200 From: Jan Kara To: Tejun Heo Cc: axboe@kernel.dk, jbacik@fb.com, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, kernel-team@fb.com, dennis@kernel.org, jack@suse.cz Subject: Re: [PATCH 5/5] blkcg, writeback: dead memcgs shouldn't contribute to writeback ownership arbitration Message-ID: <20190619112003.GD27954@quack2.suse.cz> References: <20190613223041.606735-1-tj@kernel.org> <20190613223041.606735-6-tj@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190613223041.606735-6-tj@kernel.org> 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 Thu 13-06-19 15:30:41, Tejun Heo wrote: > wbc_account_io() collects information on cgroup ownership of writeback > pages to determine which cgroup should own the inode. Pages can stay > associated with dead memcgs but we want to avoid attributing IOs to > dead blkcgs as much as possible as the association is likely to be > stale. However, currently, pages associated with dead memcgs > contribute to the accounting delaying and/or confusing the > arbitration. > > Fix it by ignoring pages associated with dead memcgs. > > Signed-off-by: Tejun Heo > Cc: Jan Kara I see Jens has already pulled the changes so this is mostly informative but the patch looks good to me. Honza > --- > fs/fs-writeback.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c > index e41cbe8e81b9..9ebfb1b28430 100644 > --- a/fs/fs-writeback.c > +++ b/fs/fs-writeback.c > @@ -715,6 +715,7 @@ void wbc_detach_inode(struct writeback_control *wbc) > void wbc_account_io(struct writeback_control *wbc, struct page *page, > size_t bytes) > { > + struct cgroup_subsys_state *css; > int id; > > /* > @@ -726,7 +727,12 @@ void wbc_account_io(struct writeback_control *wbc, struct page *page, > if (!wbc->wb) > return; > > - id = mem_cgroup_css_from_page(page)->id; > + css = mem_cgroup_css_from_page(page); > + /* dead cgroups shouldn't contribute to inode ownership arbitration */ > + if (!(css->flags & CSS_ONLINE)) > + return; > + > + id = css->id; > > if (id == wbc->wb_id) { > wbc->wb_bytes += bytes; > -- > 2.17.1 > -- Jan Kara SUSE Labs, CR