Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3198869pxb; Tue, 12 Jan 2021 08:39:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyyVvFppYN38aMTbJGKT28lyAvqz5uLH5WnIOhIr1IYASqpcEsbsxKN/LDGy2CZhFZbMqPf X-Received: by 2002:a50:8744:: with SMTP id 4mr15184edv.362.1610469579780; Tue, 12 Jan 2021 08:39:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610469579; cv=none; d=google.com; s=arc-20160816; b=NtfWDrc4sDEZFWQB7CPMsVcI/br5SLNAcRL3XL14ggmwD57g0UTYRiOLYtHeD3Q248 UpGHolqNvo1A5Ej0YaZjRn3LYNqZXu673ySMVi8X/8fvXzqgHVmv2FrgdBi4DSRbURDf sBMEAodRQntSTrB85w5IsaU4NlZmyMd+TER5+mI9sLjHoqCx74wFfZgUfvThNBCa9hxB fSQxj58+Aoo/twbg1t3fsC2d8AY36mYNzCvSvhykpwJjn8AleADu96tr7zityoucrn7v PyXohfyXcLqRtKW1N6MR5QD/DetXt6vXbkvLY+XgzVN8pbBZi/kAcC2OV5DTi2850bRV P1BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=MxCA8HJECsjmosM8tthrozFX1IyJOixd+wxNEWFqHEA=; b=kQy+347TcbcC1JgBPokRTVkQbYG+fpEYNYGeG9ll6GHvcKA8xSRt3f0lWoN0PycmTk G1nHGGe12ILaIjCi9rNtqvaUWKlWGCJJSzyZz6M2AjVZJWny0xmVOmmmTuYMC3F9GUe/ drrnnXcqM1cnKOvvFuOn0ICyIVVlvcw7QfzKGoYbnZ13dwGcM9+H4OdmXm294LrymRXk PXTx3+I81UlGYRC682hsHlrM0u+A2GaVsmMa/lNHahej9TGAqSdC/WP98bRzL4kfIxXl KVJVWMfxfew2TLLRu0IkwGuvT1g2TCP017Rau6qdPfRB2qY8Q8O/W/EZdrSJbizYW782 DZmA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j7si1306699ejf.125.2021.01.12.08.39.15; Tue, 12 Jan 2021 08:39:39 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387812AbhALQgP (ORCPT + 99 others); Tue, 12 Jan 2021 11:36:15 -0500 Received: from gentwo.org ([3.19.106.255]:50638 "EHLO gentwo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727421AbhALQgO (ORCPT ); Tue, 12 Jan 2021 11:36:14 -0500 Received: by gentwo.org (Postfix, from userid 1002) id D69533F5AA; Tue, 12 Jan 2021 16:35:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id D41703E9B5; Tue, 12 Jan 2021 16:35:28 +0000 (UTC) Date: Tue, 12 Jan 2021 16:35:28 +0000 (UTC) From: Christoph Lameter X-X-Sender: cl@www.lameter.com To: Jann Horn cc: 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: Message-ID: References: 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 Tue, 12 Jan 2021, Jann Horn wrote: > [This is not something I intend to work on myself. But since I > stumbled over this issue, I figured I should at least document/report > it, in case anyone is willing to pick it up.] Well yeah all true. There is however a slabinfo tool that has an -s option to shrink all slabs. slabinfo -s So you could put that somewhere that executes if the system is idle or put it into cron or so. This is a heavy handed operation through. You could switch off partial cpu slabs completely to avoid the issue. Nothing came to mind in the past on how to solve this without sacrificing significant performance or cause some system processing at random times while the shrinking runs. No one wants any of that. Being able to do it from userspace cleanly shifts the burden to userspace ;-) You can even do random heavy system processing from user space if you put a sleep there for random seconds between the shrinking runs.