Received: by 10.223.164.202 with SMTP id h10csp1621505wrb; Wed, 8 Nov 2017 07:07:51 -0800 (PST) X-Google-Smtp-Source: ABhQp+T1PGAbkK9YSgG+K/bdEBo0BiOzSKxYo/D2a0pydu2ynnABIC2Xv1WH9JJvOFhs+RnkzbPk X-Received: by 10.84.211.105 with SMTP id b96mr724604pli.86.1510153671281; Wed, 08 Nov 2017 07:07:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510153671; cv=none; d=google.com; s=arc-20160816; b=pT8keECQFV7ARo3S4lF1qoQOSeiSs7MfbxrolUcP8MgbfFZxvuixqiXmO7vOX7/OUo pYVjJXWIgsJlIfpQ3EPBm+lHbKFPZRhy1m6MBK0Gx0ItBn4kIIZ0MM6N+CPMqd14cLYb cR5kJj4WdY9c9Baa2ZZeUZq6PAGFyWIrO1sqY5mzR+j3fyMnRuhq2pYnYDxFbxNi/lB0 yrj1Bcd79VaqPzu1d/DJNyEvE1TyA5Kxt8eIUsjWGNdj6HUzUxy/RmGsLEQ26FjuIb4b Vx2zxWYCSwovPNADgEwJrHvPFnYN9sbS/8ewH2MpmhIFwE/mcV/60MjetblgxjupZ5kx qFwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=RX0fgNPc+qGCLDp537bU8UPuZtiQ7atuB7XmnqJRk48=; b=XcwiyNPg9D8XSlBfMrpr0WSPFq4fC/1Bp1nRJbYjKiJLsWkJVW/+qHY700wUWH6pa+ F75QXo+EKXeP6VE/le07+HhVWmoGDvaCxaZkz+49tvqXEeI6msr3lvMkXeOZN1jH0Fj6 zUoO/rg6LagOgbhLa55LkZK3nmA8gjw17+xuwlRZEDgvJ/xMptGTcAQdSnKk5b7jdR/G HeW8NYNKFZWkzdXnH7hpQhJg0BLwO5P44rpauvzwZ4OaI75oKqAyXiv6RlOwKyADXTic M9XPKzkDb7UKJ9nOnHzztGPM+cNZ9ay4D9kKpchoQ8K0C9RMsY6RZ2I7d5sdUG31KJh9 38YA== 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 p6si4067286pgf.676.2017.11.08.07.07.38; Wed, 08 Nov 2017 07:07:51 -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 S1752699AbdKHPFP (ORCPT + 83 others); Wed, 8 Nov 2017 10:05:15 -0500 Received: from resqmta-ch2-10v.sys.comcast.net ([69.252.207.42]:35236 "EHLO resqmta-ch2-10v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752021AbdKHPFO (ORCPT ); Wed, 8 Nov 2017 10:05:14 -0500 Received: from resomta-ch2-14v.sys.comcast.net ([69.252.207.110]) by resqmta-ch2-10v.sys.comcast.net with ESMTP id CRujecdEMFIJUCRujevOm5; Wed, 08 Nov 2017 15:05:13 +0000 Received: from gentwo.org ([98.222.162.64]) by resomta-ch2-14v.sys.comcast.net with SMTP id CRuieWhaj6QapCRuiek2cL; Wed, 08 Nov 2017 15:05:13 +0000 Received: by gentwo.org (Postfix, from userid 1001) id 2DE081160190; Wed, 8 Nov 2017 09:05:12 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 2A9A6116017D; Wed, 8 Nov 2017 09:05:12 -0600 (CST) Date: Wed, 8 Nov 2017 09:05:12 -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: <1510119138.17435.19.camel@mtkswgap22> Message-ID: References: <1510023934-17517-1-git-send-email-miles.chen@mediatek.com> <1510119138.17435.19.camel@mtkswgap22> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CMAE-Envelope: MS4wfIklR98fdY5i0OKVhfH2ea7l4PAFimOdNj4kXvUmbp0E66CTbspgTJyrd5l3fzSEUa3/5jBGpkLs5+7/sVudht9MEQ8aKC/XeOz+KSX28ZCMRHHoWElM MhaFQL+XVpcTwvf1gmqobZsHx8kSkba+Az2uMyfHzkCcwDtLAl124C+0EXNf21n0vm9+XHPESyO0IislLTDWbbsud0kHi1dIjLo9MvqMQczMzOZRn8+uXbVO NUjleWIkMlf2te12IX0IWpczTcytt1sr+rP4FHHTW4CasI2boIQ2ViP94LC0SlpE4x0sE8iyGO2Gvlmc2+X/J3+QGYFfk06LPSWsYoF6Uqv8bcaoRTtlQ7qA oaIEyh3uW6o64i1QA54RFwToucPAK9XDL6PdwBf1DQMfJysHfkjcECMB4JHIS6weFSo/NMY7fFdq9w6Fi44U6rqGO4aJvZ+ibWNojBeGqFAlYsdOw8Q= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 8 Nov 2017, Miles Chen wrote: > > 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 aliasing failed because find_mergeable() returns if (flags & > SLAB_NEVER_MERGE) is true. So we do not go to search for alias caches. > > __kmem_cache_alias() > find_mergeable() > kmem_cache_flags() --> setup flag by the slub_debug > if (flags & SLAB_NEVER_MERGE) return NULL; > ... > search alias logic... > > > The flags maybe changed if disable_higher_order_debug=1. So the > unmergeable cache becomes mergeable later. Ok so make sure taht the aliasing logic also clears those flags before checking for SLAB_NEVER_MERGE. > > The clearing of the DEBUG_METADATA_FLAGS looks ok to me. kmem_cache_alias > > should do the same right? > > > Yes, I think clearing DEBUG_METADATA flags in kmem_cache_alias is > another solution for this issue. > > We will need to do calculate_sizes() by using original flags and compare > the order of s->size and s->object_size when > disable_higher_order_debug=1. Hmmm... Or move the aliasing check to a point where we know the size of the slab objects? From 1583483249016245684@xxx Wed Nov 08 07:48:25 +0000 2017 X-GM-THRID: 1583422685647743875 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread