Received: by 10.223.164.202 with SMTP id h10csp852598wrb; Thu, 9 Nov 2017 15:53:18 -0800 (PST) X-Google-Smtp-Source: ABhQp+RUHL8S/tPsayTzGoDVFY/uaxm+fZ62Y0Ks41MpeTtrL/OR7P3YvMsAyl9TdhqJXwJILMTF X-Received: by 10.99.112.69 with SMTP id a5mr2080923pgn.179.1510271598398; Thu, 09 Nov 2017 15:53:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510271598; cv=none; d=google.com; s=arc-20160816; b=nEMUz+mPEaQUNdIDf7bJAc4Hr/KgvzywEtwIHP3H5j9S8FqVD9Ocp7VS8dHsQGHU+X wEeTDyYO4jtmg2T7LYGWOszy41ippp77xzNr8xLZtBY7KJ2fBY0xEH1d6EpamjEv5ZkY aKd179adi/LAPDb5bYkPSrjsvDFVtiTW1Rx+NRP+o9tTq0ZZTSONGW7EMTseXppLpABS DbQpG8FYq3Fowjpkzv0tmDMG3ZASk4vkS4KoeZMBshcw5TJ7KcPQoHhuPbGbV6xc6OBi 14bwMox0jO/9DuVwoQ6XlKqGoAUGVAWmM3RhQVnWZYOVmet3OUdxIL+VgeaS4I/knTIE 5VVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=OkREmYk58C4wVRLTYCWXXvSD1njvvyG39bDlQD8o5c8=; b=BPvVgLRkBgQ75LZZPWHN/ONI0J2NEz3vPu+gPrkH1SJQ25Cb3UwJgGqspezWT0ssiJ eGbHLgzgH4l1pbVUwCtUmwWLaeG0IR0l5V0hYIju1N9q1rohTRi1hOE9qNHiwMEDPdOH WgO9MHUCtcjtDnqFw/9dJldvKu7dcZ7PK/+7mSZFmbhSQXMUI0vShLqWo5BW3YRuPKJN Oamytfwy2UKJ3P21l+uO2uENpkhu+UOB2MHq8I72bKJNByLiCK7/eGilLz0FauLumrBC qDc1a6a4yekj4hV60WpIHW+b79GTi9l/aRzEUUY3nVIJXDOjgvyvGTbfMgRafEN3gSAq E+HA== 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 a5si7384505pgc.127.2017.11.09.15.53.06; Thu, 09 Nov 2017 15:53:18 -0800 (PST) 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 S1755485AbdKIXv6 (ORCPT + 83 others); Thu, 9 Nov 2017 18:51:58 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:62134 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1755031AbdKIXv4 (ORCPT ); Thu, 9 Nov 2017 18:51:56 -0500 X-UUID: 00d23a122d6e46f2af28fb33409f17ae-20171110 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 734283456; Fri, 10 Nov 2017 07:51:53 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs03n2.mediatek.inc (172.21.101.182) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Fri, 10 Nov 2017 07:51:52 +0800 Received: from [172.21.77.33] (172.21.77.33) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Fri, 10 Nov 2017 07:51:52 +0800 Message-ID: <1510271512.11555.3.camel@mtkswgap22> Subject: Re: [PATCH] slub: Fix sysfs duplicate filename creation when slub_debug=O From: Miles Chen To: Christopher Lameter CC: Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , , , , Date: Fri, 10 Nov 2017 07:51:52 +0800 In-Reply-To: References: <1510023934-17517-1-git-send-email-miles.chen@mediatek.com> <1510119138.17435.19.camel@mtkswgap22> <1510217554.32371.17.camel@mtkswgap22> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2017-11-09 at 09:49 -0600, Christopher Lameter wrote: > On Thu, 9 Nov 2017, Miles Chen wrote: > > > In this fix patch, it disables slab merging if SLUB_DEBUG=O and > > CONFIG_SLUB_DEBUG_ON=y but the debug features are disabled by the > > disable_higher_order_debug logic and it holds the "slab merging is off > > if any debug features are enabled" behavior. > > Sounds good. Where is the patch? > > Sorry for confusing, I meant the original patch of this thread :-) By checking disable_higher_order_debug & (slub_debug & SLAB_NEVER_MERGE), we can detect if a cache is unmergeable but become mergeable because the disable_higher_order_debug=1 logic. Those kind of caches should be keep unmergeable. diff --git a/mm/slub.c b/mm/slub.c index 1efbb812..8cbf9f7 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -5704,6 +5704,10 @@ static int sysfs_slab_add(struct kmem_cache *s) return 0; } + if (!unmergeable && disable_higher_order_debug && + (slub_debug & SLAB_NEVER_MERGE)) + unmergeable = 1; + if (unmergeable) { /* * Slabcache can never be merged so we can use the name proper. From 1583604182303202547@xxx Thu Nov 09 15:50:36 +0000 2017 X-GM-THRID: 1583422685647743875 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread