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=-2.3 required=3.0 tests=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 4BD22C3F2C6 for ; Tue, 3 Mar 2020 16:05:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1AA5A20CC7 for ; Tue, 3 Mar 2020 16:05:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730226AbgCCQFF (ORCPT ); Tue, 3 Mar 2020 11:05:05 -0500 Received: from gentwo.org ([3.19.106.255]:43296 "EHLO gentwo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728714AbgCCQFE (ORCPT ); Tue, 3 Mar 2020 11:05:04 -0500 Received: by gentwo.org (Postfix, from userid 1002) id EACA73F1C0; Tue, 3 Mar 2020 16:05:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id E968E3EECA; Tue, 3 Mar 2020 16:05:03 +0000 (UTC) Date: Tue, 3 Mar 2020 16:05:03 +0000 (UTC) From: Christopher Lameter X-X-Sender: cl@www.lameter.com To: Roman Gushchin cc: Wen Yang , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Xunlei Pang , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/slub: improve count_partial() for CONFIG_SLUB_CPU_PARTIAL In-Reply-To: <20200227183519.GA50628@carbon.dhcp.thefacebook.com> Message-ID: References: <20200222092428.99488-1-wenyang@linux.alibaba.com> <20200224165750.GA478187@carbon.dhcp.thefacebook.com> <20200227183519.GA50628@carbon.dhcp.thefacebook.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 27 Feb 2020, Roman Gushchin wrote: > 1) Reading /proc/slabinfo can cause latency spikes in concurrent memory allocations. > This is the problem which Wen raised initially. Ok. Maybe cache the values or do not read /proc/slabinfo? Use /sys/kernel/slab/... instead? > 2) The number of active objects as displayed in /proc/slabinfo is misleadingly > big if CONFIG_SLUB_CPU_PARTIAL is set. Ok that cou.d be fixed by counting the partial slabs when computing /proc/slabinfo output but that would increase the times even more. > Maybe mixing them in a single workaround wasn't the best idea, but what do you > suggest instead? Read select values from /sys/kernel/slab/.... to determine the values you need and avoid reading those that cause latency spikes. Use the number of slabs for example to estimate the number of objects instead of the number of objects which requires scanning through all the individual slab pages.