Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4240570rdb; Thu, 14 Sep 2023 16:54:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGVNHPvOiXMu1IeS9ASDLwUV06nLOXp/PpCJS8FIxXfUB7vdcVGkH7dlA8HRKmX+MPeSKVn X-Received: by 2002:a17:90a:ce8e:b0:26d:5094:13ea with SMTP id g14-20020a17090ace8e00b0026d509413eamr232020pju.0.1694735675150; Thu, 14 Sep 2023 16:54:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694735675; cv=none; d=google.com; s=arc-20160816; b=pCXF0stqgq28Rk93LF24nqOJt5Lgb7CuuBeTk2qBBynpU16hiQNDLguq+vSV43JNtD n7DDkyMFqgWNKS+Y2SeR5WKX+4ypYXIVxibbSJJN4j+veLtUxI8qHqmSLDcUwHLA8dwj GGkYUQuhLL9RPyby3E8mz16VU0JXW5QLwnqrKVT2U+AgJlyW3Wif+9KNYgCY/IvoSZf6 l+M0Sm+yniDM5HTTO/K30DRWlCb49weAWTLihaA7XcMRpt7oJThja7vTtvre3BQvvbnS HaY7s+iGuzmr8XLTydDrw6ME2FUoa9K1iVGs1mbbajjyghHWNHca1UEP5LClSxyfmWCZ 252g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eQriSK20/8KwwHOVdQKhz9C/zLOim8sff0QLVit0F7g=; fh=nfQSbTp1dWHt2Ier1Up8UhVNdXOqoJJLNvTrpT3jJEk=; b=QwYAHv9bWdA8TqfSKaNPFxFWS4k3JRrETdvQscdsw+UcjqWOfWi/2Xok1CdMkSQESU IC/pliISK8g38CtqqEpUxhES7U/ezfn7E6hJsejKflPumuZMDweayb+7Bny7oE9sIpYS cQCTKHCFRuNVLM0m7AmXJ0BIE11SCBprPleWQVNHn8XhKk8eGVvrwtjcfS51XNLYM+Q+ zaCnWlnrMSeMsjYxHUyFdlVlPVMT24qaUeMbkCdrBlJvisC6jz/bh1aln/byLf1Ro74u n639CBOOJXM9xa3/t5mHkKHstYY6SPs8CRmqyqP2ofj9MvyeZOMnyde9p7XtcLqviz7T 078w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=XFAMKTE8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id h5-20020a170902680500b001bbb5f82fecsi2405633plk.182.2023.09.14.16.54.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 16:54:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=XFAMKTE8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 5276F801D48E; Wed, 13 Sep 2023 10:15:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230367AbjIMRPE (ORCPT + 99 others); Wed, 13 Sep 2023 13:15:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230347AbjIMRO7 (ORCPT ); Wed, 13 Sep 2023 13:14:59 -0400 Received: from out-218.mta0.migadu.com (out-218.mta0.migadu.com [91.218.175.218]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AFE3DD for ; Wed, 13 Sep 2023 10:14:53 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Sep 2023 10:15:16 -0700 (PDT) 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; -- 2.25.1