From patchwork Tue Aug 29 17:11:13 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: 13369232 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 42BBCC83F14 for ; Tue, 29 Aug 2023 17:11:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8C01D8E0030; Tue, 29 Aug 2023 13:11:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 86DF58E002F; Tue, 29 Aug 2023 13:11:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7350F8E0030; Tue, 29 Aug 2023 13:11:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 5ED8B8E002F for ; Tue, 29 Aug 2023 13:11:40 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 392BA4024F for ; Tue, 29 Aug 2023 17:11:40 +0000 (UTC) X-FDA: 81177783960.03.64DEB31 Received: from out-244.mta1.migadu.com (out-244.mta1.migadu.com [95.215.58.244]) by imf29.hostedemail.com (Postfix) with ESMTP id 8801412002A for ; Tue, 29 Aug 2023 17:11:38 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=FdmqrQoR; spf=pass (imf29.hostedemail.com: domain of andrey.konovalov@linux.dev designates 95.215.58.244 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=1693329098; 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=J9x0A1WNFQDshCpK/emmSalBuss8B7zIgs4IPlFr17A=; b=kG6H9MJwzu8rzLrY2PGe8x3r0nVTDoFq8rIk+2cGQNIXid4Qr5KeC/fQu+T6TfuiyOAbkq toIhcDZUYE5IWBllZzesN5n7xCV4PcETxjUP8ZscsBaYo6YLX18nHXsKd0+Z8Qx2kWNvJe nr3fGOrOUNhpLRmFAWvTqCaPlUhaJ7A= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1693329098; a=rsa-sha256; cv=none; b=O7wFfzBPggljMwGFJpbSEyVQgrFqEHtoSoCz0P+/aFdxNarEtIuz6Y4rolYJrbXq/9M2js zaUm6dcGfSYcyj20dw6d5ycgLMEABaE7vowbA39oGqK1wsTkj+1UPKrNu6ajUk15uYOUY1 kcaH6t8evUkYFp2X+8UvnaZl/6CQEto= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=FdmqrQoR; spf=pass (imf29.hostedemail.com: domain of andrey.konovalov@linux.dev designates 95.215.58.244 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev; dmarc=pass (policy=none) header.from=linux.dev 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=1693329097; 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=J9x0A1WNFQDshCpK/emmSalBuss8B7zIgs4IPlFr17A=; b=FdmqrQoRG911hkZBrs9+qOuzijl9EyrM9zkCfxSRiSKdthhj9DynENOHTygZicJGL6ttQd b8bicv/bN9d7rHnZGH7XvWbnvE0ExxkcPNoHVf4CMtYnM6Xf5U4ohouTeDLn5GYyzrjaNE Ef5USp/vQmHcZo4oq0IjadJbI/g7Dw4= From: andrey.konovalov@linux.dev To: Marco Elver , Alexander Potapenko Cc: Andrey Konovalov , Dmitry Vyukov , Vlastimil Babka , kasan-dev@googlegroups.com, Evgenii Stepanov , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH 03/15] stackdepot: drop valid bit from handles Date: Tue, 29 Aug 2023 19:11:13 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: 8801412002A X-Rspam-User: X-Stat-Signature: wxaaafe7rt8pa8m9pwynbhebn7npsjed X-Rspamd-Server: rspam03 X-HE-Tag: 1693329098-173220 X-HE-Meta: U2FsdGVkX18ap0cVTt6OaSEpjmebK5n5K7ZvM/y7WmuXFNG5Z4ezTZttwETlHTgbPePxDnOwpGrRzkZ5PbdB95Y4HTikmfeUgpU7nUTBToJjpy5wd2TcmDZv5e2Izy95HEXZF/kHBLzgR1+n2wbdThsi6L+DiFYa9PBt/MP6Qiysg1wVccgYcVzg2vqlW2mui4ZX7WcHnrOii/JtMCj7KYK92dC8H+sFxA+na2e48pz+4nNs73h4eAkkGJo1eJLm5VDe15wAZPYb5DIbIge/RqG6sFikgc/vWrpbLJNQo6LpPfPSQLkxVp+3wSAznP9UmiglzV54yrsfRWjITIwlB8sbv7vOA8/Hu5CmjQbpRMucVDTnsMBUvDbkzIMu6VXY+FKQS18M3QWdxo8kcHkipG4U2ex1omC28iEgHbdU1dzrHCvzk4Gsd8PXwMaE4w9ukWYKjz8BRQbm48dnyPJh3aHel2DFmPJc5PKiwAuPtDNrLz9yP1TrJ3WnhSmRhyaH9aL5QQUiA3IPKK0UMghL9ws9oq2rfGN9fNHw3WW6UYMd9l4ZnlyWo55h0BnGoyIN0ToKyJzYUJJZ+aA2XI6j6zktozMlxJkgRxE+1DGviGHxsmJuwjRJ0VVkhifkeZOPeQYdMXlgRAmIAY4OAD7nvmUyzIKqBwKIUNGnW1UWrCHPc9EnN1Bv6+uPuVendwYQ4k/s0+b4fb4NzqR+/lp6aH8urkh5b875Gz6cxmBobVDL7IisA1u8qWWKBW7eKYTK3tItPxg6Wt4nFT6umv2Pldkgv+p2bkYC5el+jJ4TB5UMwBWhPZ66+Fu9bOnxWxELX01MIYtn/rMaQsbrc9tzjYL01rUqvJgMMJabpAVyw4Wu1rNuZvAD7Odk732f5YV8Y3Szij+3DNuan3MHwej7R/cZxO8LN1e+uN3UALIbZ5RGE/aFa52yx4f5sGQiECsOesrq3EET0gGlKBMWHlq QiTud8Nu WiBW86dFLf4itiVr7IAx0fmY2kkicK36wsQeL7bcWpO8hs+aQyjZ53LItRVYvccag2Qdx8d99dAapPR3uXVEywdLFeQ== 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 Stack depot doesn't use the valid bit in handles in any way, so drop it. Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko --- lib/stackdepot.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/stackdepot.c b/lib/stackdepot.c index 0772125efe8a..482eac40791e 100644 --- a/lib/stackdepot.c +++ b/lib/stackdepot.c @@ -32,13 +32,12 @@ #define DEPOT_HANDLE_BITS (sizeof(depot_stack_handle_t) * 8) -#define DEPOT_VALID_BITS 1 #define DEPOT_POOL_ORDER 2 /* Pool size order, 4 pages */ #define DEPOT_POOL_SIZE (1LL << (PAGE_SHIFT + DEPOT_POOL_ORDER)) #define DEPOT_STACK_ALIGN 4 #define DEPOT_OFFSET_BITS (DEPOT_POOL_ORDER + PAGE_SHIFT - DEPOT_STACK_ALIGN) -#define DEPOT_POOL_INDEX_BITS (DEPOT_HANDLE_BITS - DEPOT_VALID_BITS - \ - DEPOT_OFFSET_BITS - STACK_DEPOT_EXTRA_BITS) +#define DEPOT_POOL_INDEX_BITS (DEPOT_HANDLE_BITS - DEPOT_OFFSET_BITS - \ + STACK_DEPOT_EXTRA_BITS) #define DEPOT_POOLS_CAP 8192 #define DEPOT_MAX_POOLS \ (((1LL << (DEPOT_POOL_INDEX_BITS)) < DEPOT_POOLS_CAP) ? \ @@ -50,7 +49,6 @@ union handle_parts { struct { u32 pool_index : DEPOT_POOL_INDEX_BITS; u32 offset : DEPOT_OFFSET_BITS; - u32 valid : DEPOT_VALID_BITS; u32 extra : STACK_DEPOT_EXTRA_BITS; }; }; @@ -303,7 +301,6 @@ depot_alloc_stack(unsigned long *entries, int size, u32 hash, void **prealloc) stack->size = size; stack->handle.pool_index = pool_index; stack->handle.offset = pool_offset >> DEPOT_STACK_ALIGN; - stack->handle.valid = 1; stack->handle.extra = 0; memcpy(stack->entries, entries, flex_array_size(stack, entries, size)); pool_offset += required_size;