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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 56A0DC433F5 for ; Tue, 11 Jan 2022 14:24:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BkXgM+TVXYQURIqmk4Nw9lSpChmfRdYtK/y0FWCV4t8=; b=SSr+9aJ6QzhnKC UZUWG+k2efMdkg9rloH5H6RFmd9NvH4yP6zaEE+mlOPOQAT6FWFb2l1SvMrIhUQf0WEBuSi/fAlX2 JoD7AG4/guZwMEawynVvND3AUlscyx2Ilf693068Jlyv20gYzDouW0Ky094g3xhFHvnc+9jcqGtPh rvWcDX823qVlS7vQBt0cBDmn6z3qKrzJBRYjobZrpHm+UQ1okdKVOK71i7ddroa7nVI8QVomG1wa+ E0565hsGx/V2ndsehuxuMJzW8O4fC53NoRsosr2z674x5jUsmzlI6M0ndf2navx0K4KLiJIkzO5+V 6fDtcHirFLtcPauGTFKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7I3I-00GYT3-3y; Tue, 11 Jan 2022 14:23:08 +0000 Received: from shark1.inbox.lv ([194.152.32.81]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7I3E-00GYPl-6I for linux-arm-kernel@lists.infradead.org; Tue, 11 Jan 2022 14:23:06 +0000 Received: from shark1.inbox.lv (localhost [127.0.0.1]) by shark1-out.inbox.lv (Postfix) with ESMTP id 9691A1118111; Tue, 11 Jan 2022 16:23:00 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=inbox.lv; s=30062014; t=1641910980; bh=B3zsr1uon94rGfrYjljVprXCVNZ2sigVuz8YLB4vUUA=; h=Date:From:To:Subject:Message-ID:In-Reply-To:References: Content-Type:X-ESPOL:from:date; b=JK87VbXvkOz1CYeEvjisnByo3iRn6ANTTZf6nyRROSoGK+1vUzuoM1wQI6qTP8TjL 0rS+Sc7zZEeS+eyUSupsICe/9A3Xun9amhUMAWH+sW6n2hSK7vYMih5merlhaAB2AR 4Xk2wDn2nf9h/x0aDl+19LheJtAcw5tTcXFa5SfY= Received: from localhost (localhost [127.0.0.1]) by shark1-in.inbox.lv (Postfix) with ESMTP id 8F78E11180F5; Tue, 11 Jan 2022 16:23:00 +0200 (EET) Received: from shark1.inbox.lv ([127.0.0.1]) by localhost (shark1.inbox.lv [127.0.0.1]) (spamfilter, port 35) with ESMTP id y1a1K5F5vyMK; Tue, 11 Jan 2022 16:23:00 +0200 (EET) Received: from mail.inbox.lv (pop1 [127.0.0.1]) by shark1-in.inbox.lv (Postfix) with ESMTP id 09BF311180EC; Tue, 11 Jan 2022 16:23:00 +0200 (EET) Date: Tue, 11 Jan 2022 23:22:48 +0900 From: Alexey Avramov To: Michal Hocko Cc: Yu Zhao , Andrew Morton , Linus Torvalds , Andi Kleen , Catalin Marinas , Dave Hansen , Hillf Danton , Jens Axboe , Jesse Barnes , Johannes Weiner , Jonathan Corbet , Matthew Wilcox , Mel Gorman , Michael Larabel , Rik van Riel , Vlastimil Babka , Will Deacon , Ying Huang , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, page-reclaim@google.com, x86@kernel.org, Konstantin Kharlamov , hakavlad@gmail.com Subject: Re: [PATCH v6 6/9] mm: multigenerational lru: aging Message-ID: <20220111232248.1629f794@mail.inbox.lv> In-Reply-To: References: <20220104202227.2903605-1-yuzhao@google.com> <20220104202227.2903605-7-yuzhao@google.com> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Virus-Scanned: OK X-ESPOL: AJ2EQ38cmnBBsMa9Lpgfme6kmZavLzouui7kz70193NHtLHdwK14EgqJeffiGwWl X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220111_062304_441998_465A611B X-CRM114-Status: GOOD ( 12.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org > I do not really see any arguments why an userspace based trashing > detection cannot be used for those. Firsly, because this is the task of the kernel, not the user space. Memory is managed by the kernel, not by the user space. The absence of such a mechanism in the kernel is a fundamental problem. The userspace tools are ugly hacks: some of them consume a lot of CPU [1], some of them consume a lot of memory [2], some of them cannot into process_mrelease() (earlyoom, nohang), some of them kill only the whole cgroup (systemd-oomd, oomd) [3] and depends on systemd and cgroup_v2 (oomd, systemd-oomd). One of the biggest challenges for userspace oom-killers is to potentially function under intense memory pressure and are prone to getting stuck in memory reclaim themselves [4]. It is strange that after decades of user complaints about thrashing and not-working OOM killer I have to explain the obvious things. The basic mechanism must be implemented in the kernel. Stop shifting responsibility to the user space! Secondly, the real reason for the min_ttl_ms mechanism is that without it, multi-minute stalls are possible [5] even when the killer is expected to arrive, and memory pressure is closed to 100 at this period [6]. This fixes a bug that does not exist in the mainline LRU (this is MGLRU-specific bug). BTW, the similar symptoms were recently fixed in the mainline [7]. [1] https://github.com/facebookincubator/oomd/issues/79 [2] https://github.com/hakavlad/nohang#memory-and-cpu-usage [3] https://github.com/facebookincubator/oomd/issues/125 [4] https://lore.kernel.org/all/CALvZod7vtDxJZtNhn81V=oE-EPOf=4KZB2Bv6Giz+u3bFFyOLg@mail.gmail.com/ [5] https://github.com/zen-kernel/zen-kernel/issues/223 [6] https://raw.githubusercontent.com/hakavlad/cache-tests/main/mg-LRU-v3_vs_classic-LRU/3-firefox-tail-OOM/mg-LRU-1/psi2 [7] https://lore.kernel.org/linux-mm/20211202150614.22440-1-mgorman@techsingularity.net/ [I am duplicating a previous message here - it was not delivered to mailing lists] _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel