Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp183137pxb; Thu, 14 Jan 2021 03:16:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJy319v0w4F09aejBTJRhAOfun/ULfCR3gYm+15XWYrbof+8/G/T5wos7Wl6KrcPPayaci71 X-Received: by 2002:a17:906:154d:: with SMTP id c13mr4900853ejd.471.1610622978832; Thu, 14 Jan 2021 03:16:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610622978; cv=none; d=google.com; s=arc-20160816; b=wmeCmt3PiBPqjAEBOX+Gz2VtaJ/mtI0j5gudsEUkQkHUoUxGQz8ftO3wIeWJerfaLF PFeFL+hTBPWxERjR0734hIPLAzSufdC5sZB1mmRIJgE9ZpPgXFSPjMEF7EmIu8w1awIL Tci1heTTySlG3PDfks0m1bN6lCpWZkWMXprNlxicZksMGqACJACYPVZ+PFaff5yFUlVP XditY+ygSM83ldpak9hF0nn4xIuHYodAWThXOlPWCJS4eniZsenb6tBokAO7AcFClSuZ fCVOlwWwhtwaOLV3cec8f3DHuDyxCdZhtTlm+HMyfwbIyByYBcq71MqAoNRXASruETt7 0YzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=DMmS3InQFJw1ivB1xQVbzUcB8ic0R9pZm8IT14H03Ho=; b=QnGZu3PHRK0Odm9SPYkAjFoKG/C/+vwGtTvBuendcuIoxNFrjeCbr0TO3XZNf3C8AJ Jc0Mx92mA7AsnvOeFh4aKQyGCtv76DyN86NR3Nv3FffCutUk0h/dT3rFID25xW8JhDNg sFtWb4afSmZvXmbDFcnqQfBdX5VZtQ1tGosf9PJK2FzZH/3xORIsI2Heiu+G/sWeuGKN TR/SfZ5S6T8dFpx93DjUxh5qurLf7MasRgPIknnqCQj8YL3dOeOJVrlzqXaBeyLxAWKt Sjn8eI3To/Y46+NCWIB6I7YsmEK28WGDc1jYpM3NS06R74xGT4eIdGtLij+P8AL0fOZU gNEg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ks15si97431ejb.197.2021.01.14.03.15.53; Thu, 14 Jan 2021 03:16:18 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726076AbhANLNu (ORCPT + 99 others); Thu, 14 Jan 2021 06:13:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:40488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725918AbhANLNu (ORCPT ); Thu, 14 Jan 2021 06:13:50 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C8C4E238A1; Thu, 14 Jan 2021 11:13:08 +0000 (UTC) Date: Thu, 14 Jan 2021 11:13:06 +0000 From: Catalin Marinas To: Johannes Berg Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Vlastimil Babka , Johannes Berg Subject: Re: [PATCH v2] mm/slub: disable user tracing for kmemleak caches by default Message-ID: <20210114111305.GA16561@gaia> References: <20210113215114.d94efa13ba30.I117b6764e725b3192318bbcf4269b13b709539ae@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210113215114.d94efa13ba30.I117b6764e725b3192318bbcf4269b13b709539ae@changeid> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 13, 2021 at 09:51:14PM +0100, Johannes Berg wrote: > From: Johannes Berg > > If kmemleak is enabled, it uses a kmem cache for its own objects. > These objects are used to hold information kmemleak uses, including > a stack trace. If slub_debug is also turned on, each of them has > *another* stack trace, so the overhead adds up, and on my tests (on > ARCH=um, admittedly) 2/3rds of the allocations end up being doing > the stack tracing. > > Turn off SLAB_STORE_USER if SLAB_NOLEAKTRACE was given, to avoid > storing the essentially same data twice. > > Signed-off-by: Johannes Berg I think that's the simplest. Acked-by: Catalin Marinas > Perhaps instead it should go the other way around, and kmemleak > could even use/access the stack trace that's already in there ... > But I don't really care too much, I can just turn off slub debug > for the kmemleak caches via the command line anyway :-) This stack trace doesn't seem to be accessible in a unified way across the sl*b allocators. Given that kmemleak already needs to track this information for other objects (vmalloc, certain page allocations), it's probably more hassle to handle it differently for slab objects (I don't say it's impossible, just not sure it's worth). -- Catalin