Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2403185rdb; Mon, 20 Nov 2023 09:48:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IEbcKePEnM4P1bXqeChDzCSWFFFaVGvc0pfoGcLuFBc+R+zUZwT68x3BBR4/rY5NEPIWkQc X-Received: by 2002:a05:6a20:2589:b0:187:c494:37f2 with SMTP id k9-20020a056a20258900b00187c49437f2mr6879834pzd.4.1700502504369; Mon, 20 Nov 2023 09:48:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700502504; cv=none; d=google.com; s=arc-20160816; b=fcTq2QU6Jf8Mq3mfSHyxBYRAprnGZQ2Ddvku/huYZ3iMrDUSWAiFQgIag1VV0wBzvQ qHdAgX6/UN7NHu+w/fBUwpM20BqkA8XggXO1vD+jlSEce9Ni0NpHwtGURUC/UDou/bKb 9KM+xTBvGzi1GmaS1LfUJH0omZRCw3ESm23s4FE1DkGaS86lLbXPP63Wbf6zECK57S15 Z/7Unm97wzMz2UFfXWOrxyb3R2PrvXNd/AHlD0hxC1APk1hGJZA1qRCJmmvg54URLr93 uAqlWNhxpwIdJObrEB3PWwnSQ05m48+j7gaZzhfYuMIK84YmmenXYA1QkyxdETs5mOCk uNIg== 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=lmg5zTuKt1w9oWZyNpXv7HY69NJCp78Dr+tP0crczmk=; fh=qWoxmPN1zRqnLSoCWGpfFsDtzJsx/SGdqx98lbP+Uho=; b=yaGeq2Qj1Csqj+6G7DjQZgobJEA63rWVcuPGS0Dtfx0pd65kNFvFJa3dysB6oa0xhv X/BF3nzejudsktD/oImCWrgF0eoqEtHRUQ+710Ge/PoaS3SySTmOPzgxIkRaaVr7y2xu UXkCWXzOLOAXpdKeiiUkDT6e0nC/RWPW1JTW0Ht3fAh0i30Eq51IwVTqj6IMRsM3uq1X hkqKH0vUyJu+hT9pBDmcqCB4yUHDWET7iwm6NHQMg3wlnGuoqg+8aXd1S+ujh2G0qOv/ tigAydYMyP8jQqdL+dxaYAeVlYEvd6DYRMZ4XYHW2NytNbUL+BRvxBlMQeAtYT67lZNH SYYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=sig9IVvl; 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 h2-20020a056a00170200b006cbb132d46dsi1614383pfc.244.2023.11.20.09.48.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 09:48:24 -0800 (PST) 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=sig9IVvl; 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 E28AC80EE0D6; Mon, 20 Nov 2023 09:48:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234064AbjKTRrp (ORCPT + 99 others); Mon, 20 Nov 2023 12:47:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232803AbjKTRre (ORCPT ); Mon, 20 Nov 2023 12:47:34 -0500 Received: from out-187.mta1.migadu.com (out-187.mta1.migadu.com [95.215.58.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D5D5BA for ; Mon, 20 Nov 2023 09:47:30 -0800 (PST) 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=1700502449; 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=lmg5zTuKt1w9oWZyNpXv7HY69NJCp78Dr+tP0crczmk=; b=sig9IVvlHqVaQ7yAjHcKyEBZSXKZVvVyW0FFm1WUvwt3/VhlR8ohBHYAlXrR7cabYtXtPi 1x7T5BIS3RF5oH+C0wW4PoHF0fJj3mAq0pXEuDuyXI6LIJomNt8wyDqJivUeLox2pQT6re fzBBmv3FWure1h0tN/rWvxM6gmS3lDg= From: andrey.konovalov@linux.dev To: Andrew Morton Cc: Andrey Konovalov , Marco Elver , Alexander Potapenko , Dmitry Vyukov , Vlastimil Babka , kasan-dev@googlegroups.com, Evgenii Stepanov , Oscar Salvador , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH v4 04/22] lib/stackdepot: drop valid bit from handles Date: Mon, 20 Nov 2023 18:47:02 +0100 Message-Id: <34969bba2ca6e012c6ad071767197dee64dc5723.1700502145.git.andreyknvl@google.com> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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]); Mon, 20 Nov 2023 09:48:04 -0800 (PST) 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 3e71c8f61c7d..46a422d31c1f 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; }; }; @@ -309,7 +307,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