From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39A39C83009 for ; Wed, 29 Apr 2020 02:27:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D3BFC20730 for ; Wed, 29 Apr 2020 02:27:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20150623.gappssmtp.com header.i=@cmpxchg-org.20150623.gappssmtp.com header.b="yIS7iHAs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D3BFC20730 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 317418E0005; Tue, 28 Apr 2020 22:27:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2C7628E0001; Tue, 28 Apr 2020 22:27:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 18EEF8E0005; Tue, 28 Apr 2020 22:27:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0097.hostedemail.com [216.40.44.97]) by kanga.kvack.org (Postfix) with ESMTP id 026318E0001 for ; Tue, 28 Apr 2020 22:27:44 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id AF77A52AA for ; Wed, 29 Apr 2020 02:27:44 +0000 (UTC) X-FDA: 76759306848.30.kite08_2672839c28457 X-HE-Tag: kite08_2672839c28457 X-Filterd-Recvd-Size: 5204 Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Wed, 29 Apr 2020 02:27:44 +0000 (UTC) Received: by mail-qt1-f193.google.com with SMTP id z90so656688qtd.10 for ; Tue, 28 Apr 2020 19:27:43 -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=T8wE3++n58RIywlXsFzNVCH9uQlaA/81EBSZWWJSh6GZspuQIfO0otGSPOTtNI4q4k ezriHbe2etAkBfZBOSG1m4ElILTNUMOMT3/VkzVmj4/we8z9D8boWs+ZMfhMxr6jTrwD ALTflr5DqIQFrcgGUlHP0qUoUXMMFi84Rj4a1uvBvLJcIPIjtyQlNUQjP60aUWEcl+Gw GRIcaAN7+EFYfaW9PSJW94uBxYYqcHGPGmGizvPyCGPc2xGjdtZJVtO2uyJMnvGlxyJf 6ZmuVW2x2vZE5Pa2N+gac/w2dM4Pa7BNZgwb0ow83Wha4VyiWnZR+zTrTj6mHjeZhoNM kOlg== X-Gm-Message-State: AGi0PuYkuJHN/2UrKD93HKYeZEZmR5JUVOkuWfiD7rtBmlF9Gmy39dCX sj4cVBt/1ZMqloyY79QeRQjGxg== X-Google-Smtp-Source: APiQypLsEKenWN4WzB6ddMhGOd0xHUK1mWQIdZD+RG622mVERdaN6cZAXO8dAWWRsrXwQyIKvlFoGA== 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> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.