Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp224536pxj; Tue, 1 Jun 2021 20:06:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHkMkeC9EqK+QWhOhZylm0wvPvgnCi+MGxcQKItbW3nNYZQ04QhRMeLgTC3I7lN7k2uKjo X-Received: by 2002:a92:d987:: with SMTP id r7mr24669001iln.85.1622603175393; Tue, 01 Jun 2021 20:06:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622603175; cv=none; d=google.com; s=arc-20160816; b=St+27nOxJ/vDw1gFJGfqTANp/IANZrRotxbwiSO/hhciPQaQG9EViQg1PzObWrGrwG g6AN9q6jRpZUJhBm/hO9eF5OXV2ASwxzbARJrfXRqaki3jYgBjCTyPwQm7fnMlL2S7nQ Ux7eVgrG8BtGlKrgtTsViSPhhlEdNWtr9HmjZf47w11N/SpjII8zggL9r24YeiXn+9YL yAydNcNaOZM5edh06vK3snf8YAYH0ljMUhp49Fu+6JjrYnoY7mu3NQi2Lnqsx6wnQKJ1 UfT2+V8fSUUpAxBNbXHu9m2bevfffg3uLmF7ihq2MG32nyx/05wj5lO+LZb584tn1EcY FA5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=/bS3mog/Y68MAU0OqICaUc/o6X78NNN07GBSSy0oZtM=; b=rqn5GEMDLAWGMfOiAtSOGwCvm6f2j7FJFocwoIQE23/Hx2sdtnUdFu1moQahCqC/RR cTp9eKb/jbjV9/McxOut+DbcJM4Tukv4dmtU0minS5PI5OBBRaIHj3Cfj0tA+30XsROT eguj0q+XVXBZdmArL2XXOMVu9v6kFEVn/Ej4njpM95MkXpackS/uAFC0MZfdGP6hLJWa 3qeoIMZgQWSAXCKbx0QwnkGwwPIqsdHcYXIVLS+9UCGOJuSPNVpvFMJ9cuJ2qIbFt9iO ZMs4Gtzb2vyvjfhEuokartnj1owp80m5idE6QwSqKr7igiwoI5DfmlkyJWOV7PXbVPQr Gwrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=TeHg5CyH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z17si16430997ill.27.2021.06.01.20.06.01; Tue, 01 Jun 2021 20:06:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=TeHg5CyH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229644AbhFBA2n (ORCPT + 99 others); Tue, 1 Jun 2021 20:28:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:58362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229586AbhFBA2n (ORCPT ); Tue, 1 Jun 2021 20:28:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7E2BA6124B; Wed, 2 Jun 2021 00:26:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1622593619; bh=qDr3ZE7diO9NQ3VqHna2Ok1cPmbxMJAtcu+G0KjSh3o=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TeHg5CyHAzCr1Pw6ge2pgVf6xLZaoeDP8ZsxqPO5vAUebYvQ9UpPvLpMhqLVl2yI7 FzMWwYU700eNhF+fCdOXK32nZFt7P3YuxjUXb3xya+EQGsDl4hPSCi0voHGDcghKqu CU3E6bv8FE8islmq7DdOEfPAbvwjSMBsJV9wWgIo= Date: Tue, 1 Jun 2021 17:26:59 -0700 From: Andrew Morton To: kernel test robot Cc: Stephen Boyd , kbuild-all@lists.01.org, clang-built-linux@googlegroups.com, Linux Memory Management List , linux-kernel@vger.kernel.org, Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Vlastimil Babka , Petr Mladek , Joe Perches Subject: Re: [PATCH v3 4/4] slub: Force on no_hash_pointers when slub_debug is enabled Message-Id: <20210601172659.fd8c40a6548a1bd43be1bf11@linux-foundation.org> In-Reply-To: <202106020644.UDFIJOUU-lkp@intel.com> References: <20210601182202.3011020-5-swboyd@chromium.org> <202106020644.UDFIJOUU-lkp@intel.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2 Jun 2021 06:45:55 +0800 kernel test robot wrote: > >> mm/slub.c:4464:30: error: use of undeclared identifier 'slub_debug_enabled' > if (static_branch_unlikely(&slub_debug_enabled)) > ^ > >> mm/slub.c:4464:30: error: use of undeclared identifier 'slub_debug_enabled' > >> mm/slub.c:4464:30: error: use of undeclared identifier 'slub_debug_enabled' > >> mm/slub.c:4464:30: error: use of undeclared identifier 'slub_debug_enabled' > >> mm/slub.c:4464:6: error: invalid argument type 'void' to unary expression > if (static_branch_unlikely(&slub_debug_enabled)) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Thanks. Stephen, how about this? --- a/mm/slub.c~slub-force-on-no_hash_pointers-when-slub_debug-is-enabled-fix +++ a/mm/slub.c @@ -117,12 +117,26 @@ */ #ifdef CONFIG_SLUB_DEBUG + #ifdef CONFIG_SLUB_DEBUG_ON DEFINE_STATIC_KEY_TRUE(slub_debug_enabled); #else DEFINE_STATIC_KEY_FALSE(slub_debug_enabled); #endif -#endif + +static inline bool __slub_debug_enabled(void) +{ + return static_branch_unlikely(&slub_debug_enabled); +} + +#else /* CONFIG_SLUB_DEBUG */ + +static inline bool __slub_debug_enabled(void) +{ + return false; +} + +#endif /* CONFIG_SLUB_DEBUG */ static inline bool kmem_cache_debug(struct kmem_cache *s) { @@ -4493,7 +4507,7 @@ void __init kmem_cache_init(void) slub_max_order = 0; /* Print slub debugging pointers without hashing */ - if (static_branch_unlikely(&slub_debug_enabled)) + if (__slub_debug_enabled()) no_hash_pointers_enable(NULL); kmem_cache_node = &boot_kmem_cache_node; _