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 9649EC433E0 for ; Tue, 12 Jan 2021 16:36:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4C8F822CBE for ; Tue, 12 Jan 2021 16:36:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405094AbhALQgP (ORCPT ); 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.