From patchwork Fri Feb 10 21:15:48 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: 13136450 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 E99E3C05027 for ; Fri, 10 Feb 2023 21:16:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B2B8B6B0180; Fri, 10 Feb 2023 16:16:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A3D516B0184; Fri, 10 Feb 2023 16:16:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 77A476B0181; Fri, 10 Feb 2023 16:16:14 -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 6437E6B0180 for ; Fri, 10 Feb 2023 16:16:14 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 281E740203 for ; Fri, 10 Feb 2023 21:16:14 +0000 (UTC) X-FDA: 80452640268.14.AC4CB4C Received: from out-52.mta0.migadu.com (out-52.mta0.migadu.com [91.218.175.52]) by imf02.hostedemail.com (Postfix) with ESMTP id 1953980026 for ; Fri, 10 Feb 2023 21:16:11 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=g4VXUY+C; spf=pass (imf02.hostedemail.com: domain of andrey.konovalov@linux.dev designates 91.218.175.52 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=1676063772; 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:references:dkim-signature; bh=SVXQhPxtDUlvcBHu0yCHUaIQvvsOva2Wy+xT1T1B0xM=; b=mhZLovfhVM4vMBnLiSsM/11a/Oytx5gumrZmlZR46FCR3PD3ID7TyXmnwUq7YTzpCxODdF 7I1WFcDr+oGuy19Fqcj8jZ2sYkI2XpfrAzG0nBX6dQlcPksyvbYy6ucM3ixDcdczmjjPQi 3o/DChlZQ6FCvehbka5AwU1P2iIvwvo= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=g4VXUY+C; spf=pass (imf02.hostedemail.com: domain of andrey.konovalov@linux.dev designates 91.218.175.52 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=1676063772; a=rsa-sha256; cv=none; b=LHCVYLaMafQVUJZdAt3rXRpEe0L7B1zUcpwQHpbYkjewiONdOgay+1NSGfPHQo48+l6Ci0 TVeWwotjHetrZmt8xF31l+upxkRBXO9XyyYD/5tQwzfSXUvdkQGL2NM/e3KxG2etMBc25D 6KmjukC2psMmyzYaCckFTs8EpWUvpL0= 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=1676063769; 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; bh=SVXQhPxtDUlvcBHu0yCHUaIQvvsOva2Wy+xT1T1B0xM=; b=g4VXUY+C4aROZALZ/m0wYHFweJzqrsxkZpLJojP2JcL0petnwLSwd/Z80ClP+ddd1SJZoh pnPHpajSdtcvCOUCkJOlkWBGMudWmAo3OcCBtXiNOl6VhIkZijYh9/JJCDTrn4TmdQFaFl guDvrD9WiNbSsMPxQiXhHHsigN0sBeI= 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 00/18] lib/stackdepot: fixes and clean-ups Date: Fri, 10 Feb 2023 22:15:48 +0100 Message-Id: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 1953980026 X-Rspam-User: X-Stat-Signature: cc1wwoz755eibxq95ekmfoko1ccf1fph X-HE-Tag: 1676063771-781192 X-HE-Meta: U2FsdGVkX1/VVlwcnpiumvNXGv7yfS5xc9gvUxCgXeDz7uUDsUBuf2FlPmIpZabRb3T5jdcMeBgDIDIPiKF6Y7rH34dyHWMVboS05HDf3cVe8ZmY/pMb7XabEdZLKJ0jHvUPeeTZyijOJuOc5sB8dj9ci54PJjeaypclrltnHIFxfy+1Or6LeXH1aPGt/pT+z6WPKvxHOhkV5GC+qamXWdBEgoJL/KvvCBHHZdFhPIzQFffwFPim7K+YSvUZENi8WVwFDU0UonBmT/Y7SXcJeQ0GEuHsDjdsG0/YfDaj4vRvLuhVejnysSy2SfnMlYERPwZucBk4X1/A6GBv8TlAchH9o8Wshvh5cvhSnELNe5UVcYRLLMUv1mfUnNUVrzIyYyWHL0pERQMZqMd0R/KX+pFY8e4rQFwVQcCnwjUHLFEYtk/8aYDoCZMbVAQSxrN9ZTEdz8Z16TeY5Pq5p15wEjsiq/ikh8juyfficFpFNRdnJmcWDgQA/Obd97xMSUcUmw8Lbvi2u6vXj6/0l+uEWP5jCo95une/1VZj3Pt5xxzWTjkciR4BoOu2PoFfcExTr2mftkfPBF7pZUDfOjfYNgqvJJiE/er3bzaInoHEMu34TRC5bEQlKKn+GdiAytDtQVosTDRBe5TIlyJydOgEhIT3i65xLguwp8gQEj8wnEUYmLDiKJY1yyZRQtYwWsATIti2P8lqul4JuvxdZQXK++ueDQXFak3yrWc32Xzs2BKfRctT5lF3UmwL/q9whAuFlL0UC9FzlU74ramrVRXf4GktIjS1tpG3zKjLGwjwf87Fi86ujHH4OKp9IXIWLsmnGyeQuwNvv/0IPF6FLFd5V9Fp8PZGeKnNym9zpzzV/hA3kxriv31b0t8RBYCYARTmEhXb0Oqr6wjVX/+z43lEQgyi0Q9AvLFKt86iMfq1QtYz8gJvhOccPiIhd7BGZqYAe0AOix/wrwHL/SraS+1 Rb4dVCZC na4tZl183G93kQZ4AzrAfkZ+YIqt8ZbyTXuuSKw4j1BPoHRrW5YRO1aC6T5mpXx/jB2k+EEXmDn05kdu4jozbuKbnN/Q92NQQIaCN 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 A set of fixes, comments, and clean-ups I came up with while reading the stack depot code. Changes v1->v2: - Drop "lib/stackdepot: fix setting next_slab_inited in init_stack_slab", as there is no bug to fix. - Use "pool" instead of "slab" for memory regions that store stack traces. - Rename next_slab/pool_inited to next_slab/pool_required and annotate its uses with comments, see new patch #13. - Use STACK_HASH_TABLE_SCALE as a new name for STACK_HASH_SCALE. - Mark stack_depot_set_extra_bits as __must_check. - Only assign extra bits in stack_depot_set_extra_bits for non-empty handles. - Minor comment fixes. Andrey Konovalov (18): lib/stackdepot: put functions in logical order lib/stackdepot: use pr_fmt to define message format lib/stackdepot, mm: rename stack_depot_want_early_init lib/stackdepot: rename stack_depot_disable lib/stackdepot: annotate init and early init functions lib/stackdepot: lower the indentation in stack_depot_init lib/stackdepot: reorder and annotate global variables lib/stackdepot: rename hash table constants and variables lib/stackdepot: rename slab to pool lib/stackdepot: rename handle and pool constants lib/stackdepot: rename init_stack_pool lib/stacktrace: drop impossible WARN_ON for depot_init_pool lib/stackdepot: annotate depot_init_pool and depot_alloc_stack lib/stackdepot: rename next_pool_inited to next_pool_required lib/stacktrace, kasan, kmsan: rework extra_bits interface lib/stackdepot: annotate racy pool_index accesses lib/stackdepot: various comments clean-ups lib/stackdepot: move documentation comments to stackdepot.h include/linux/stackdepot.h | 152 +++++++-- lib/stackdepot.c | 654 ++++++++++++++++++------------------- mm/kasan/common.c | 2 +- mm/kmsan/core.c | 10 +- mm/page_owner.c | 2 +- mm/slub.c | 4 +- 6 files changed, 457 insertions(+), 367 deletions(-)