From patchwork Mon Jan 30 20:49:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: andrey.konovalov@linux.dev X-Patchwork-Id: 13121816 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DFFFC636D6 for ; Mon, 30 Jan 2023 20:49:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5FB4B6B0081; Mon, 30 Jan 2023 15:49:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5ABB06B0082; Mon, 30 Jan 2023 15:49:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 44E936B0083; Mon, 30 Jan 2023 15:49:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 34A786B0081 for ; Mon, 30 Jan 2023 15:49:53 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id D4CEB160184 for ; Mon, 30 Jan 2023 20:49:52 +0000 (UTC) X-FDA: 80412657024.08.DD591B1 Received: from out-45.mta1.migadu.com (out-45.mta1.migadu.com [95.215.58.45]) by imf06.hostedemail.com (Postfix) with ESMTP id 9ABE9180009 for ; Mon, 30 Jan 2023 20:49:50 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=iZ2SF3e9; spf=pass (imf06.hostedemail.com: domain of andrey.konovalov@linux.dev designates 95.215.58.45 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675111790; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=c95lndz29O0di2fe/164kz+dHAmKL4r6SFIURNRPYhs=; b=TbK4RNegW86w3k2MM8Pd1WKSRYFS0E6itsQsOgE7FVIGGtsm0R+jGrIiyOip9bJwN1NJ+O glIsCFLbsEyxoi70AbEVEx7TnZ4hw6TYo16BDQG5QhS6BxlqiAbpdIfmakaB6b9MupboIw 6w/L7QuR5ByfXBQLZuON6ZwWuA8eaA0= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=iZ2SF3e9; spf=pass (imf06.hostedemail.com: domain of andrey.konovalov@linux.dev designates 95.215.58.45 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675111790; a=rsa-sha256; cv=none; b=XKHpWokDQD1d9n2rzY0CzQ5bxexwXuhtlvG6NYKTdvKNIM/IIrkaIuX6vQZnliu8GaaDRm FGt7Wb3fVp9JwCMrZvMdjDEvaRCpI9TqB/7q7czchtM8LFw30EWsfZkYeLPrrpoy30ahff qvSH+2+7mREHTWO4Ag4VMAY4psudQGc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1675111789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c95lndz29O0di2fe/164kz+dHAmKL4r6SFIURNRPYhs=; b=iZ2SF3e9VXqpvKUr8HduRr1XOXKe7dSysCB1n/ECP4tg1ImAdKKoy2eqgkG+rRAub4slvK j7oGY2uIyxOmpcwpIzP6Xcn2HJ6z/TAb1IUyQWvHGGTzHFEIzfekx1C2191yTDtOsoVOMk 9aSD8JTfQNTK/XnjW9Emdd1TFDrL4xQ= From: andrey.konovalov@linux.dev To: Marco Elver , Alexander Potapenko Cc: Andrey Konovalov , Vlastimil Babka , kasan-dev@googlegroups.com, Evgenii Stepanov , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH 05/18] lib/stackdepot: rename stack_depot_disable Date: Mon, 30 Jan 2023 21:49:29 +0100 Message-Id: <293567627b0d59f1ae5a27ac9537c027a5ff729d.1675111415.git.andreyknvl@google.com> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: d9ixz9dsw7wex8fr6yxneqq86oft5ku7 X-Rspamd-Queue-Id: 9ABE9180009 X-HE-Tag: 1675111790-620970 X-HE-Meta: U2FsdGVkX18GB4wN1+eS5NpTDujhelYahsL4EaVxVcBnb0HOdlB+aXA04e0OluLyxTjcCx3V4QGZeCkB3RNl6VJASVyj83N1T+475hdlc+CP58cl/MHOVhkytQOycLvmfh2YUD8K9BOt8EQW+2cKO22ODinfh6snsLStJ5VqzXsdYoOX9GboStEbkfMngP2Pr2n4B+O29kHG6xbdHsdGDMe1LWGmZABB327fw6zedpOs+pOJwpSBHpF1sWanXqqxRCrP9DB+i3Ol8GJxVBVu+hwqbDhMvy3TzfsyyTMieoehyJpGuPQPmT6dCO/PtbXkdO5Vwa0I9FHMTuVqb64Mlqk0ziDl1s2869NRuWFDjbwmqEtJZYwyoxecNQYkW7H/b/gfqAfbIXLtnoac9AgpiOLQgJ6Cx9bVA3qPfqAiOBr5qr5EO0NIu1SwJWzc9ggyu8uX9KtvNBwC1YaEItLzsUKzSu42TdYsueUaPLUHw5L37hvuXwGwdBUxxLrz8HxFmmH9O7P/8gDSCoOtEze4fUbikD4OuclhElkR3Jh1dhNWXu3WEXOyyeGGLJFqkrHMVTcKnB4OG5RH3IRtgC0ERUthcEbbR7UkVG9Wzjnk700ETUwV1+n4638Gxb2Q43UgfKEuUJpR6yCq9t9sTljf43SjVRKYEERysNDbtRz7klzU0CzMIlMB2oHpBWADA06U/pCl6RUjg/jK1aCEdNfwKo2EuMQNKKohB7mzrvF0PFWVMR72G9JrD69wb/booJBy1p2Me2UJMibWXCrjWrK7cPle5l6LEs8cJX7CgTpC0R6kwwIh2nz9bNjPzwQtvkWsexVTu26QuICbTDgNAi50kgpwNFPlJZWcfIT1tyVt4ILsSKXD308zr7ykfO2MFWd3L0xuk7JQA5Bfox3HHHnAXPioLTm7dDlyZm0V7iLvxx4SvILtq6bKYOv6A2TxsU4Q1rUJ4o/X45CtC5DeSwa jw/BiKo5 L2yJ5Eno4tgYcjAiID3n5Ut5qB4QY0zxOwjJlcN3sFj4CM1MUYrG6LSXcZdnS+m4C5GdhaYK5uNnkI4IisA46QC8CjPdi689gPB7w57z0zHtoq7NFMk6aUWY7Uvl7O46LmxvC5xBxu2SxreeIDc1sUBCOQQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Andrey Konovalov Rename stack_depot_disable to stack_depot_disabled to make its name look similar to the names of other stack depot flags. Also put stack_depot_disabled's definition together with the other flags. Also rename is_stack_depot_disabled to disable_stack_depot: this name looks more conventional for a function that processes a boot parameter. No functional changes. Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko --- lib/stackdepot.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/stackdepot.c b/lib/stackdepot.c index 8743fad1485f..6e8aef12cf89 100644 --- a/lib/stackdepot.c +++ b/lib/stackdepot.c @@ -71,6 +71,7 @@ struct stack_record { unsigned long entries[]; /* Variable-sized array of entries. */ }; +static bool stack_depot_disabled; static bool __stack_depot_early_init_requested __initdata = IS_ENABLED(CONFIG_STACKDEPOT_ALWAYS_INIT); static bool __stack_depot_early_init_passed __initdata; @@ -91,21 +92,20 @@ static DEFINE_RAW_SPINLOCK(depot_lock); static unsigned int stack_hash_order; static unsigned int stack_hash_mask; -static bool stack_depot_disable; static struct stack_record **stack_table; -static int __init is_stack_depot_disabled(char *str) +static int __init disable_stack_depot(char *str) { int ret; - ret = kstrtobool(str, &stack_depot_disable); - if (!ret && stack_depot_disable) { + ret = kstrtobool(str, &stack_depot_disabled); + if (!ret && stack_depot_disabled) { pr_info("disabled\n"); stack_table = NULL; } return 0; } -early_param("stack_depot_disable", is_stack_depot_disabled); +early_param("stack_depot_disable", disable_stack_depot); void __init stack_depot_request_early_init(void) { @@ -128,7 +128,7 @@ int __init stack_depot_early_init(void) if (kasan_enabled() && !stack_hash_order) stack_hash_order = STACK_HASH_ORDER_MAX; - if (!__stack_depot_early_init_requested || stack_depot_disable) + if (!__stack_depot_early_init_requested || stack_depot_disabled) return 0; if (stack_hash_order) @@ -145,7 +145,7 @@ int __init stack_depot_early_init(void) if (!stack_table) { pr_err("hash table allocation failed, disabling\n"); - stack_depot_disable = true; + stack_depot_disabled = true; return -ENOMEM; } @@ -158,7 +158,7 @@ int stack_depot_init(void) int ret = 0; mutex_lock(&stack_depot_init_mutex); - if (!stack_depot_disable && !stack_table) { + if (!stack_depot_disabled && !stack_table) { unsigned long entries; int scale = STACK_HASH_SCALE; @@ -184,7 +184,7 @@ int stack_depot_init(void) stack_table = kvcalloc(entries, sizeof(struct stack_record *), GFP_KERNEL); if (!stack_table) { pr_err("hash table allocation failed, disabling\n"); - stack_depot_disable = true; + stack_depot_disabled = true; ret = -ENOMEM; } stack_hash_mask = entries - 1; @@ -354,7 +354,7 @@ depot_stack_handle_t __stack_depot_save(unsigned long *entries, */ nr_entries = filter_irq_stacks(entries, nr_entries); - if (unlikely(nr_entries == 0) || stack_depot_disable) + if (unlikely(nr_entries == 0) || stack_depot_disabled) goto fast_exit; hash = hash_stack(entries, nr_entries);