From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965311AbdKGPWV (ORCPT ); Tue, 7 Nov 2017 10:22:21 -0500 Received: from resqmta-ch2-01v.sys.comcast.net ([69.252.207.33]:36190 "EHLO resqmta-ch2-01v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754910AbdKGPWU (ORCPT ); Tue, 7 Nov 2017 10:22:20 -0500 Date: Tue, 7 Nov 2017 09:22:18 -0600 (CST) From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Miles Chen cc: Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, wsd_upstream@mediatek.com, linux-mediatek@lists.infradead.org Subject: Re: [PATCH] slub: Fix sysfs duplicate filename creation when slub_debug=O In-Reply-To: <1510023934-17517-1-git-send-email-miles.chen@mediatek.com> Message-ID: References: <1510023934-17517-1-git-send-email-miles.chen@mediatek.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CMAE-Envelope: MS4wfImg3v/DRc5Pf5VO0m9RZg2SrQtr4gU2GF01A/zrUDC1FjxBePeHJPR0mnjkUeQoi8QIK4o+9e4seC5HeR3sv4mA/HxcdbOotsSm4uwxh1yg/MryvAsW QuB/wrbM8+iiOx5f1PAa/zmGl3fazvrX88brLjrfLuLiMVmU+qFy72HLVehi9DRc998lHRa2K0j0X96F/4xuls8/lMMMFkjbrxxqExtAUI9GYt0O4jaxd+TO jbGJFYA4+4+fp1paeqXt1HJGLNB27+pcVFv5LCQt7pku7Xnptf/Cpp0rPv9V/eF4OvSGMLJ5liyHi8MnBgfMv0qjKbZdcigbbuZhk0tvJXC+iMheu8dAI2Qn xNQ677fRofj1igpZhERX+L8rSb6XzOWcNw/fRUKQ4OU7DJfqP1b/Q220y7pQ12OlOyT66tlw+QlPJim3P4hrGg97CS/2nAqahaFgZz12MpLjK0a7ybs= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 7 Nov 2017, miles.chen@mediatek.com wrote: > When slub_debug=O is set. It is possible to clear debug flags > for an "unmergeable" slab cache in kmem_cache_open(). > It makes the "unmergeable" cache became "mergeable" in sysfs_slab_add(). Right but that is only if disable_higher_order_debug is set. > These caches will generate their "unique IDs" by create_unique_id(), > but it is possible to create identical unique IDs. In my experiment, > sgpool-128, names_cache, biovec-256 generate the same ID ":Ft-0004096" > and the kernel reports "sysfs: cannot create duplicate filename > '/kernel/slab/:Ft-0004096'". Ok then the aliasing failed for some reason. The creation of the unique id and the alias detection needs to be in sync otherwise duplicate filenames are created. What is the difference there? The clearing of the DEBUG_METADATA_FLAGS looks ok to me. kmem_cache_alias should do the same right?