From patchwork Fri Feb 10 21:15:52 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: 13136452 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 7CE7FC05027 for ; Fri, 10 Feb 2023 21:16:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 57D386B0187; Fri, 10 Feb 2023 16:16:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 54D616B0184; Fri, 10 Feb 2023 16:16:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3ECB26B0188; Fri, 10 Feb 2023 16:16:15 -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 2B6B06B0186 for ; Fri, 10 Feb 2023 16:16:15 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 06C341C6B6C for ; Fri, 10 Feb 2023 21:16:15 +0000 (UTC) X-FDA: 80452640310.06.79743E9 Received: from out-14.mta0.migadu.com (out-14.mta0.migadu.com [91.218.175.14]) by imf20.hostedemail.com (Postfix) with ESMTP id 352FA1C0004 for ; Fri, 10 Feb 2023 21:16:12 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=SbrBALja; spf=pass (imf20.hostedemail.com: domain of andrey.konovalov@linux.dev designates 91.218.175.14 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=1676063773; 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=1W2C2HZe7YWsaOly5qIInZGLXczRmh4K22qjFQ2kImw=; b=xggxK0LuTOAXZlk2HcFhNA9qlay3BP5AJrw80aB6SiG72TukPqv6XIZ53WSk9Ttr6kz1BK YZHjku9fs55Oc+Ub/b6dKeir4aD2d7fxikuEEUi4MJIVND3WrtCt37H7Rs8nj5XDtLRgPb hTYrIjTPlGqaU0JFnqtCs57rEeGj1VE= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=SbrBALja; spf=pass (imf20.hostedemail.com: domain of andrey.konovalov@linux.dev designates 91.218.175.14 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=1676063773; a=rsa-sha256; cv=none; b=XjOwzVaqHLbAOXkSg3zMp62KZVOO2usZyHRVuQ84ey26XLjTuMvA26+m1kssgmzbIz89QO 6LI+j8d6TFlHjxuLJGtlpp7mTFFYY8pRa97BjCeQjjofZuZf0jmOYTQerjIdCMs7psh7rH b9tWPIG7gSEMnE5WwN4aqytPBb5Vbzw= 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=1676063771; 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=1W2C2HZe7YWsaOly5qIInZGLXczRmh4K22qjFQ2kImw=; b=SbrBALja+Ooglua5ZF4CpZXeCqhnn3ktsGqlo80JYGScIgCd0Ef8Sogpvh9B6KEJ1l9nbn bTrUyYzIfNYfjbYKAuyfsSFN/0AdP6+6xd5cjSKKeHV5VDBTK/njzgsYccEE+MB4tqIlLk Obf2ZoUmkwsQQEiMXFd5LJ0j55MgSt0= 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 v2 04/18] lib/stackdepot: rename stack_depot_disable Date: Fri, 10 Feb 2023 22:15:52 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 352FA1C0004 X-Stat-Signature: sojtj3adujibsord5mpxsejddyrui3q1 X-HE-Tag: 1676063772-539145 X-HE-Meta: U2FsdGVkX19zUVLGerWjVisqj6Bltiky+rVII8zJA6+QM8S/7bV5I22+5xytg1H7zyzVRT4y7J434x+wCsw2xRWa1iLCgSVfu79Q/yEN8gVutN+I8SMl0qpNDdt7TsKVl5RnUPN1WwqzMPDPsNQZCR3DHWvI9ppK1brUACEmosaFkis5JeUHVuyFdu3rgrAO+J8i1cch534SnfvK1ihSJZjUomvtQEuxKtalxjdvXp8KRZwZ+EOc2oAfRzKzK+29lWlsHTloqkalrzm3mKJICgCsNkAC3eIQ6zy5KXrfEZDfOM9xM5C0ewQ1FM1l8efa8NPD+zEM1mtSK1BWKj6P1P15vvRn604ql3E4GUuT3NOp4KIEkG3IwXFmclDvIMGhUKM9IOpwrIZXSZXRCN7o3X47jE4YHkJW8rIr9u9NhqM7585AzvhOkKTpKqVnvdySZmACmVEVYwKzD76NsZxPX0ot5ty8a5X5UBIxdzy6Ainkl+x1a72DZy2S4ThJbL8j2RuK7V++SwXI5rX04oURUGavWR+BaxIWb6SdhuPY5EDHm8UL8JAZ4czpPLHUurnA1NaQrhteEm/0WqckFnSoLyg1lOnW53J9pIqc5iTeJ/7IybB8AymS/C4oYSw2kXnUoBiP3dEnX0C0ETnxFwwtuT6UT7xIt3gx/b+Ud130me8AshjJM7XXKnwNHL59PLT9V8FQacRUtDE8Typ4J4YDYW/vegU+kibg2Muc0if+EJY2EODrrkvE2rul47BArOfGeagMJlRNjCbMCq4mlN749fFTgNKCxv8SiT//Fcag8I9tbQjQR5VLOQGKocmCyyuN1Yc9oyugz+QbxppcWekChwklZAbwTzeYGYld3VEaNRrNrgpHrU5vF6dC8cjc0q89qE3CEzp9DgFnwkY5UP0AsWIzjuDECYMBGYMXq2+hCGd2RTVNMHxLS7wwVuKryXP9yYe6F0KblGS2k6Muq3s lYpFFUO4 h4D/1EkG0ZTL8IFGapS0PDr6HBzfx0uL2f4wdJ5pl3i2F/Ca4ebJfqIJKmPgclZfJ8ojCVJldLR0dROhO4MLMkMZ0yFYmwUs6YyIDhRq6eNhtDrSGGzPWOIwURQbNH34Kt645zM7wxawiO0UWutX4qjy3fg== 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. Reviewed-by: Alexander Potapenko Signed-off-by: Andrey Konovalov --- lib/stackdepot.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/stackdepot.c b/lib/stackdepot.c index 136706efe339..202e07c4f02d 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; @@ -353,7 +353,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);