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: 139077 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:a8d:b0:3f2:4152:657d with SMTP id gr13csp72712vqb; Wed, 13 Sep 2023 13:36:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMnJMZRgePcKUeEPDHDBjEEr0sYY5knSSer2p0pD+3IO9eGJaOKsLJlA5KqUYlF7bAH4Cs X-Received: by 2002:a05:6a20:3d82:b0:149:602e:9239 with SMTP id s2-20020a056a203d8200b00149602e9239mr5819084pzi.21.1694637379315; Wed, 13 Sep 2023 13:36:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694637379; cv=none; d=google.com; s=arc-20160816; b=L1i9OWWY5XWAYAlCllskCYXGu5ymbegFgjvj8PqmMMO0Lo4Xd/7svXYILZEp/+q48R m6OkDcWMnfEbB5TUNPG+arBBjdjbWiF3Rn/cCZl2psYgenCU2+gDfAFAkiZ6TLKWDtjq hBu1TiWhobd2ivMkiKX6nqtau8AeLifhJkb34x8No99rRRjglFYfgAB1GXMWmwiuZ/gf YHZQiv4RWouRlp2hrxO12I5BTjE6hcc5V7d/U3E1B6pLSDNbZ/dMnSBpdAXJ/FkSbFv7 rEjxsNyn/HPqkkgEA+enRyONRCxvqhr+IWWGeje1PLo+knGtwBK82NXatxkDqGCjUuiV CbeA== 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 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id d3-20020a63f243000000b0056952b496efsi10689280pgk.366.2023.09.13.13.35.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 13:36:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; 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 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id B6D2D8113411; Wed, 13 Sep 2023 10:15:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230437AbjIMRPE (ORCPT + 34 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 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 (morse.vger.email [0.0.0.0]); Wed, 13 Sep 2023 10:15:25 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776956084450984375 X-GMAIL-MSGID: 1776956084450984375 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;