From patchwork Wed Sep 13 17:14:28 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: 13383616 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 70FC6EE01F0 for ; Wed, 13 Sep 2023 17:14:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 980C26B0254; Wed, 13 Sep 2023 13:14:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8BBAA6B0255; Wed, 13 Sep 2023 13:14:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 75C9A6B0256; Wed, 13 Sep 2023 13:14:53 -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 5E6636B0254 for ; Wed, 13 Sep 2023 13:14:53 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 3769C1403C3 for ; Wed, 13 Sep 2023 17:14:53 +0000 (UTC) X-FDA: 81232224066.10.112F3C9 Received: from out-220.mta0.migadu.com (out-220.mta0.migadu.com [91.218.175.220]) by imf15.hostedemail.com (Postfix) with ESMTP id 800EFA0006 for ; Wed, 13 Sep 2023 17:14:51 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=XFAMKTE8; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf15.hostedemail.com: domain of andrey.konovalov@linux.dev designates 91.218.175.220 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694625291; 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=eQriSK20/8KwwHOVdQKhz9C/zLOim8sff0QLVit0F7g=; b=s8Tp8vJoo/zwyyWYelaTOKPFLXqc6d4VCcSzzDh+BzGbp6GdUqj/E1i18Kgmwi/pqRoWGa 9bTc7KbhnwpddHVpLrMQkJKhmRxU+i+ECePiSBG0Kp/DNKgC50ZBO0OPmy/TCxgRY34/ew k6dYqqbhWHa+KcGdxyz26FYMdXu5/t8= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=XFAMKTE8; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf15.hostedemail.com: domain of andrey.konovalov@linux.dev designates 91.218.175.220 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694625291; a=rsa-sha256; cv=none; b=p8VW/oNpQ0rtwoAiZW3YxleYE/rr+GjM4WSxBF8GRaGS6m9b0PLQ9FnZjh4963pol7Giu4 lJjzhaXnxJiXoNq8mzgwBmu47qyDN1BPFAimY0QIw+KnkshOO4+nTJyKNEPDi3VtiIk5FJ w84Fd8cnsBQJgLpqFwYc59r4I2x/U3c= 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=1694625290; 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=eQriSK20/8KwwHOVdQKhz9C/zLOim8sff0QLVit0F7g=; b=XFAMKTE8wAgngJGqU3Ho9bfesOIML66PlRFcmLlbqUwEjvPJBgA62jyh52QZkOwLjDPuzU AyQx3wfOttMTFmpwW6FPSwPLuzweuqHN5H2L0Pdvtlpy0XaMKleBiTQWXdXoBao5TkmHyv tHA54Ka/Rk4e/x6SqQ17ainnSJdFZLQ= From: andrey.konovalov@linux.dev To: Marco Elver , Alexander Potapenko Cc: Andrey Konovalov , Dmitry Vyukov , Vlastimil Babka , kasan-dev@googlegroups.com, Evgenii Stepanov , Oscar Salvador , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH v2 03/19] lib/stackdepot: drop valid bit from handles Date: Wed, 13 Sep 2023 19:14:28 +0200 Message-Id: <5cbb8235fe6418f970fd0012450defdce598abcf.1694625260.git.andreyknvl@google.com> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: 800EFA0006 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 9r94j96xhy6gs4mtsn6qc4b5gj55sn4b X-HE-Tag: 1694625291-235935 X-HE-Meta: U2FsdGVkX1/9/6BRvZwY3F2o1LEjakOfVI88Y6t7gl8p7DIK3LSNxi6SPyzQTjt43feR59L+IC9Z4TH37fRse5r4ojFAdMNLgz3srE57ZPUQYPLJdsKMT/y9IOwl3HmIFwib1TIXBHqYA8MHKKJ143Y8KuRGqwRL4nuNL9HROOgxcHtqLEHlD9NDvY8TkVvDjdOs6XMnBWlY6HRt+uXZ8ZIcKZk4dEPaGfv85K5b8TfTUeBF6qqao7tckCFyt7thIerKUUz5chwcP8eL/Gn7mMemqPL6C+5x3XbivajmfCoaJPnNs8/0z0AkEaPB7ez4crjZvwy6NooCdywpoMX9q+TqZSnQcdsGRJ42fw0L8HE4HhrtGvgeNEBJr+Doy3YX7Kp1vGtVrBegrw8B76ib2IFHAJcX2rOwIGnstY1ZViaGqVol2bUqUbbTvwgQbyv7C0Idca7hRAclwYRBRHfDCowiELppvmSUdBktDN8iZ1kgRqSYDQmhVtCrQ+1+WvBwXCmQ835FdXg5H+csQfYtMV5gJYpmTzc5JkFpwcrmG8wNE+kY1UDBanZsKL6GdxXBI8C7P8SbJxUI8PKctTnjoFZTRYg9hjmzgYxkoe5ihq09YM8S2+sQgtE0JBSlEFC4uidDKcRV/ycIZxRkA/roj+bOfLzki/qGLaXquksHTAh54BGmH0GvRIbZjQNRe0qEclupOgmZT3T/wBr18ZnIMX7PeKQ2Z5cvkZF6HrBnJ3XoD/agK+UmoYbUpF+Caft6cH9ouz5L9UNkX6224hCdNKz9XHcAKdhsOf2zDa/4NiZbMKhs/yd+QkvPACQPH0Ciw9a8JD7cVtIkP+hqFMJ0TxLybLbc+kwh5uWKvFNZ1jmGAjEfRZ3D8QcKR++YnxjzsMs/ptxzF6VG3zwx1kJLoJqUKe0AZvPfkCVdpx/L5JztEstigfK5mIAGjhfHhLmTemWvJadMpmTjFiwzAeh g5TBF5DU gIYuDJL+3YYD11EuvN4hhC8L0ypu405i0wyBNBKfNfsWziS3mIPGlH0kY+wK+dVpOz/FQ2/YwnRzXDyr09ycQtq+ODkJIbFYwV2rn7/izp1x4jYI= 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. Reviewed-by: Alexander Potapenko Signed-off-by: Andrey Konovalov --- 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;