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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 F0CD8C433DB for ; Mon, 18 Jan 2021 15:48:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD53922AAA for ; Mon, 18 Jan 2021 15:48:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405908AbhARPsn (ORCPT ); Mon, 18 Jan 2021 10:48:43 -0500 Received: from gentwo.org ([3.19.106.255]:52088 "EHLO gentwo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405834AbhARPra (ORCPT ); Mon, 18 Jan 2021 10:47:30 -0500 Received: by gentwo.org (Postfix, from userid 1002) id DAB243F806; Mon, 18 Jan 2021 15:46:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id D7E153EB3B; Mon, 18 Jan 2021 15:46:43 +0000 (UTC) Date: Mon, 18 Jan 2021 15:46:43 +0000 (UTC) From: Christoph Lameter X-X-Sender: cl@www.lameter.com To: Michal Hocko cc: Vlastimil Babka , Jann Horn , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Linux-MM , kernel list , Thomas Gleixner , Sebastian Andrzej Siewior , Roman Gushchin , Johannes Weiner , Shakeel Butt , Suren Baghdasaryan , Minchan Kim Subject: Re: SLUB: percpu partial object count is highly inaccurate, causing some memory wastage and maybe also worse tail latencies? In-Reply-To: <20210118110319.GC14336@dhcp22.suse.cz> Message-ID: References: <20210118110319.GC14336@dhcp22.suse.cz> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 18 Jan 2021, Michal Hocko wrote: > > Hm this would be similar to recommending a periodical echo > drop_caches > > operation. We actually discourage from that (and yeah, some tools do that, and > > we now report those in dmesg). I believe the kernel should respond to memory > > pressure and not OOM prematurely by itself, including SLUB. > > Absolutely agreed! Partial caches are a very deep internal > implementation detail of the allocator and admin has no bussiness into > fiddling with that. This would only lead to more harm than good. > Comparision to drop_caches is really exact! Really? The maximum allocation here has a upper boundary that depends on the number of possible partial per cpu slabs. There is a worst case scenario that is not nice and wastes some memory but it is not an OOM situation and the system easily recovers from it. The slab shrinking is not needed but if you are concerned about reclaiming more memory right now then I guess you may want to run the slab shrink operation. Dropping the page cache is bad? Well sometimes you want more free memory due to a certain operation that needs to be started and where you do not want the overhead of page cache processing. You can go crazy and expect magical things from either operation. True.