Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2156395imm; Thu, 21 Jun 2018 08:03:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKoIJ9TuzadUEZnShuLgolglJmnQn/yKwhkIimob0NbmJwI/8BtUFfh1Bky2F/bGqR2xVda X-Received: by 2002:a63:40c7:: with SMTP id n190-v6mr23033247pga.248.1529593392742; Thu, 21 Jun 2018 08:03:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529593392; cv=none; d=google.com; s=arc-20160816; b=My63zpoydHn3ksRpsHuJMChs6eqtQsKbnxgZ7x36fJLPfXMWh/RhaTTHxHn/KBCHJY Kb2VXu1US0G2NjsoW+/B3yAj+gKaWxp+e8eiNOQ1zkEW/BniyGUFaSkf0wYDlgCZxm0k 3/1UZVOz00AwAIj5+K3LkF/AtVL4cJkWdu0tyHJI2dQL+FugcwUhOQ9czu0SlYIfVacm BP9xg/Eryu+hAlVKtD+tEl6qtJNXuGrmsP1Wu70iIg3CXMQovViFL4w2vllVx0lp2FjO zBWHV/z+cFmG3OMk5FQp0dcba8ERaQLjtqDt3azaIN3kj6/a3NqVBXVQA1VV5Dvc99kA nhNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=zZ8pEvlLox0hQw6dIM7K3x4H+5dHD8WHYx3/VRBi7Y4=; b=R0z3t/ukp9B3TPsrXLVL6GnUXZk+cZamo6JVF4JplLXClzcejZuQEUrMHc2yfhtGtH Kro1wWfupfDi9T5W8SPaEzQs8THHzlTvr/ZVFpzsVsl8BQlJAsc/gv1gefZCh54c233Z 54NdompzM2BYKZvpN9LnkHBZ5y2xB1un/AjLsSXZHyzubA0vB/2ts1HRGvb3YEqzMfSH VBbMn4coJvNA2n6VtaHel9sY4xKF1W+5d434p1UWgdJd/deEncXLMATRNhyP8koK7bJJ GshGtT3AjBy5zNfGyZu7DP+RhhG2/zBQpKvElSS3WYzUSTDUXYuU5J6r5zegLG0v8bWN DZzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g63-v6si5104717pfk.74.2018.06.21.08.02.58; Thu, 21 Jun 2018 08:03:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933297AbeFUPBa (ORCPT + 99 others); Thu, 21 Jun 2018 11:01:30 -0400 Received: from mx2.suse.de ([195.135.220.15]:32795 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932747AbeFUPB2 (ORCPT ); Thu, 21 Jun 2018 11:01:28 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id DB52CAD68; Thu, 21 Jun 2018 15:01:26 +0000 (UTC) Date: Thu, 21 Jun 2018 17:01:22 +0200 From: Michal Hocko To: Christopher Lameter Cc: Shakeel Butt , "Jason A . Donenfeld" , David Rientjes , Pekka Enberg , Joonsoo Kim , Andrew Morton , Andrey Ryabinin , linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] slub: track number of slabs irrespective of CONFIG_SLUB_DEBUG Message-ID: <20180621150122.GB13063@dhcp22.suse.cz> References: <20180620224147.23777-1-shakeelb@google.com> <010001641fe92599-9006a895-d1ea-4881-a63c-f3749ff9b7b3-000000@email.amazonses.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <010001641fe92599-9006a895-d1ea-4881-a63c-f3749ff9b7b3-000000@email.amazonses.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 21-06-18 01:15:30, Cristopher Lameter wrote: > On Wed, 20 Jun 2018, Shakeel Butt wrote: > > > For !CONFIG_SLUB_DEBUG, SLUB does not maintain the number of slabs > > allocated per node for a kmem_cache. Thus, slabs_node() in > > __kmem_cache_empty(), __kmem_cache_shrink() and __kmem_cache_destroy() > > will always return 0 for such config. This is wrong and can cause issues > > for all users of these functions. > > > CONFIG_SLUB_DEBUG is set by default on almost all builds. The only case > where CONFIG_SLUB_DEBUG is switched off is when we absolutely need to use > the minimum amount of memory (embedded or some such thing). I thought those would be using SLOB rather than SLUB. > > > The right solution is to make slabs_node() work even for > > !CONFIG_SLUB_DEBUG. The commit 0f389ec63077 ("slub: No need for per node > > slab counters if !SLUB_DEBUG") had put the per node slab counter under > > CONFIG_SLUB_DEBUG because it was only read through sysfs API and the > > sysfs API was disabled on !CONFIG_SLUB_DEBUG. However the users of the > > per node slab counter assumed that it will work in the absence of > > CONFIG_SLUB_DEBUG. So, make the counter work for !CONFIG_SLUB_DEBUG. > > Please do not do this. Find a way to avoid these checks. The > objective of a !CONFIG_SLUB_DEBUG configuration is to not compile in > debuggin checks etc etc in order to reduce the code/data footprint to the > minimum necessary while sacrificing debuggability etc etc. > > Maybe make it impossible to disable CONFIG_SLUB_DEBUG if CGROUPs are in > use? Why don't we simply remove the config option altogether and make it enabled effectively. -- Michal Hocko SUSE Labs