Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1012457yba; Thu, 4 Apr 2019 02:24:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYenYxyPnojEkcgq1qflIRLDNdRVzxnG6AahdCV6Om8YlduW0u5qbpG6gED3RnbJpjAdV8 X-Received: by 2002:a63:6fcd:: with SMTP id k196mr4733098pgc.238.1554369871517; Thu, 04 Apr 2019 02:24:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554369871; cv=none; d=google.com; s=arc-20160816; b=kAZktXbJ75XNXdn5s/p1EHjVaD9YD/hgSVFqY39c1GpbnLKPWsAbEmwvTN+LiJB02z LyTnKcb+CT8gsgXgJIAr+FIIbBkDz6H+Y5MMIbEp8NXwLBs7bu0lWvrOdwDtC7/NFTZp wIL5BxoATzkz+WuHEZvFKYAQs8Nkso/Y/ClMeFbSEr16IXrFfMcHLJb+gR5mzGfjqCNf n58qSg9xl78gG0RtdBH3F/3smHoAIhYUm0+pV4AbkyNsuJAxFbZIjdmL32ZAqRJduIZV 96QcwWDT7RLUIflhh4Fsu692D4DpgYvMis04tCJn8DxNGx2eB9ejq0q8vuQ/bkmt+gT9 14Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=V9WCW+58a6z3WaR4DjrxqBV8pnkPxZyniSrFxwSIA8U=; b=mvaqH9P9FWenJ6Yi+LfPrQ+6dTmCHB5Svj8rPTdaY3C102KKfol8nhA6VmDTjxQUSw hM8ZwbaV/fI3cJnqHSpuZsXqXTDB70/+GbCGSRMFdRDBtjn3ZAOTP4DQiAIqMGNmdGQP n1wNZSFtVaztE7HUMtT6Hubosi6l+pNfcYrEdePp0j48srtlVqq+w8JfKPE5NxEvrpMB ao/jZC+EE782C7Pxu5OuKtxsnsKdzRWIcrOG4dHfFznGyYIrJbMHnA7Kj4hLiBakHzjK joGixhWFBcnwuesSqMPjolTV8Qa63DlpsP9fkueBRzNwXzIzegHcR4G0jXRmpBiBlTWW jcBQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v5si14720852pfm.134.2019.04.04.02.24.16; Thu, 04 Apr 2019 02:24:31 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388174AbfDDJW6 (ORCPT + 99 others); Thu, 4 Apr 2019 05:22:58 -0400 Received: from mx2.suse.de ([195.135.220.15]:35664 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387934AbfDDJPo (ORCPT ); Thu, 4 Apr 2019 05:15:44 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4AA13ADC4; Thu, 4 Apr 2019 09:15:43 +0000 (UTC) From: Vlastimil Babka To: linux-mm@kvack.org Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Mel Gorman , linux-kernel@vger.kernel.org, Vlastimil Babka Subject: [RFC 0/2] add static key for slub_debug Date: Thu, 4 Apr 2019 11:15:29 +0200 Message-Id: <20190404091531.9815-1-vbabka@suse.cz> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I looked a bit at SLUB debugging capabilities and first thing I noticed is there's no static key guarding the runtime enablement as is common for similar debugging functionalities, so here's a RFC to add it. Can be further improved if there's interest. It's true that in the alloc fast path the debugging check overhead is AFAICS amortized by the per-cpu cache, i.e. when the allocation is from there, no debugging functionality is performed. IMHO that's kinda a weakness, especially for SLAB_STORE_USER, so I might also look at doing something about it, and then the static key might be more critical for overhead reduction. In the freeing fast path I quickly checked the stats and it seems that in do_slab_free(), the "if (likely(page == c->page))" is not as likely as it declares, as in the majority of cases, freeing doesn't happen on the object that belongs to the page currently cached. So the advantage of a static key in slow path __slab_free() should be more useful immediately. Vlastimil Babka (2): mm, slub: introduce static key for slub_debug mm, slub: add missing kmem_cache_debug() checks mm/slub.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) -- 2.21.0