Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp111450ybz; Tue, 28 Apr 2020 19:29:31 -0700 (PDT) X-Google-Smtp-Source: APiQypJtjm1wCT1baLy2KGuWtf0k0Kz0BZFKD64RuEh2Xxzb9z7MxHVcy+jIYNPeKOcDW5W9h/T3 X-Received: by 2002:a05:6402:1fc:: with SMTP id i28mr604747edy.18.1588127370866; Tue, 28 Apr 2020 19:29:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588127370; cv=none; d=google.com; s=arc-20160816; b=fZi2NVl29eNr8k5hGWaM/kFdN8a55Srxpla9DPzTpx0TlQLCxM/MHq91iqvJlodFzC bSRNCQ6J8L0u0JFBiyjBjfKsyeIT10jwreNfqe8S+a9kvcZ/fwbvKVf46I/EyrS438LX VdQwqwTaPPMwrwBWxlFcVztqQ0SHaXfWHtv6N2b8bCrmdzsOjNA10nzgQf8sHhG7giif RymS/UiCwXYYtimXQSHAYK2ZHB7WqOKIPNE0dZUSWfr+X6suExw1vO/hyc9ddTnuAf5x kNAQARa86UZsDOGcXqK6pXEir0XLBI0qN+DVtMoCP0dhS9WbL8vTvYQjYU7+wf6TfFaU NcQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=j2BqRPlqFlKV+qbCocfSi2x/JssbK9MFgCKLqYpp14M=; b=eww0NSkqKHL+win8o9S1IIZkk0ilxy6Nv7HBGoV+zXwigMm+P391Zwk3PRMp93BQui IPNMUpcaHgLfJ4itWvLnxitwCMa3m8Z8Rz8Eo1lDXro7kvq0aGpYYieWHxBF/J193hsO pDSDOELYWAOYMOYykDTLy7XEfhCv1DZtHIqP6SRVQbCkJoyQLZPpIzv+60jdmQDTE36x CPGy7I3LgQk7TP5eYotCVesIpm3RCahPtlTE3VI7Cl7GIerTpzy5dBHhXTXieLOJwTM6 QlRzf8X8QsB7zdz3a8gu1QSyXwH+BopwMGImdBt0dRwg9uAbDNWIe4vYOAvVoVrGnnCK 6tLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=yIS7iHAs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id by15si2876231ejb.229.2020.04.28.19.29.06; Tue, 28 Apr 2020 19:29:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=yIS7iHAs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726527AbgD2C1p (ORCPT + 99 others); Tue, 28 Apr 2020 22:27:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726507AbgD2C1o (ORCPT ); Tue, 28 Apr 2020 22:27:44 -0400 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46D20C03C1AE for ; Tue, 28 Apr 2020 19:27:44 -0700 (PDT) Received: by mail-qt1-x841.google.com with SMTP id s30so700919qth.2 for ; Tue, 28 Apr 2020 19:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=j2BqRPlqFlKV+qbCocfSi2x/JssbK9MFgCKLqYpp14M=; b=yIS7iHAsJKIugA/8A/w12xYgJlTB3URYy1+zVBuG/07z9SfuYhVCBj5PiJkT0Sl+ji cXf8c1c1kahDA3yAOtTmKXArjKHd14VfmKaMdkMTPmYUTGT9rsh59FKalKFxHpPk83j/ 6h5k65Ipm/JdoKcB0TayOyf566CF1TYMAnhztvxsSe+BwiBqA3qd2wd4dPDUqUbXZhpF uHbegIniPpIGde6atAbSiqkWT/YfgXbyfmFXEoZf/A4Dbl49g/JVdbycBygXIQdXrWsS 7yHAyDqE2Kg2ihWZShc7QF2VtZtp/xOzHOrit4A75A9vYuKtIEkgUrnHDttEgHdPRgAE B1jg== 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; bh=j2BqRPlqFlKV+qbCocfSi2x/JssbK9MFgCKLqYpp14M=; b=a9OP2yN4m2xrjI7JD6Udl9QuzcMW1EyA2PgEqyIMtjK0BdXFLyMtSbNZoyJKoL860A 6epKxHMw6GOlfNojz4aRHNfg/1DSkETiGCfe0K68uJ3F1VbAYrAKiv/0eLmDgzi9ls7k qAwfLyXdGs1Cro5IWsVIrSYYZRlNmlsjTsrkPzDijY/H007iDkyvK1cTffumDEKKGBSk vaAwK39yQTjFt2TgIydUzKLCcIZbLn9g6A57/BB2D3/2vcDOgQ8sjekhN74B8AN34shX o4oQ5hGuTqaWkVbq9kox9Ks0vnFHPF19agEXvAOSz/eckMIsG6Z0ddkvSYhndeoNkNor OtYw== X-Gm-Message-State: AGi0PuZaGYJ0OLJgtj04faiKD0QFKG34XzwORREg9EPUzX2IPrBdQgaP 6ZChOK0yAP0Q4KeAFK04VzbBeA== X-Received: by 2002:ac8:4ccc:: with SMTP id l12mr31941572qtv.129.1588127263372; Tue, 28 Apr 2020 19:27:43 -0700 (PDT) Received: from localhost (70.44.39.90.res-cmts.bus.ptd.net. [70.44.39.90]) by smtp.gmail.com with ESMTPSA id s190sm5345219qkh.23.2020.04.28.19.27.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Apr 2020 19:27:42 -0700 (PDT) Date: Tue, 28 Apr 2020 22:27:32 -0400 From: Johannes Weiner To: Dave Chinner Cc: Dan Schatzberg , Jens Axboe , Alexander Viro , Jan Kara , Amir Goldstein , Tejun Heo , Li Zefan , Michal Hocko , Vladimir Davydov , Andrew Morton , Hugh Dickins , Roman Gushchin , Shakeel Butt , Chris Down , Yang Shi , Ingo Molnar , "Peter Zijlstra (Intel)" , Mathieu Desnoyers , "Kirill A. Shutemov" , Andrea Arcangeli , Thomas Gleixner , "open list:BLOCK LAYER" , open list , "open list:FILESYSTEMS (VFS and infrastructure)" , "open list:CONTROL GROUP (CGROUP)" , "open list:CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG)" Subject: Re: [PATCH v5 0/4] Charge loop device i/o to issuing cgroup Message-ID: <20200429022732.GA401038@cmpxchg.org> References: <20200428161355.6377-1-schatzberg.dan@gmail.com> <20200428214653.GD2005@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200428214653.GD2005@dread.disaster.area> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 29, 2020 at 07:47:34AM +1000, Dave Chinner wrote: > On Tue, Apr 28, 2020 at 12:13:46PM -0400, Dan Schatzberg wrote: > > This patch series does some > > minor modification to the loop driver so that each cgroup can make > > forward progress independently to avoid this inversion. > > > > With this patch series applied, the above script triggers OOM kills > > when writing through the loop device as expected. > > NACK! > > The IO that is disallowed should fail with ENOMEM or some similar > error, not trigger an OOM kill that shoots some innocent bystander > in the head. That's worse than using BUG() to report errors... Did you actually read the script? It's OOMing because it's creating 256M worth of tmpfs pages inside a 64M cgroup. It's not killing an innocent bystander, it's killing in the cgroup that is allocating all that memory - after Dan makes sure that memory is accounted to its rightful owner. As opposed to before this series, where all this memory isn't accounted properly and goes to the root cgroup - where, ironically, it could cause OOM and kill an actually innocent bystander.