From patchwork Mon Nov 20 17:47:02 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: 167312 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp105873vqb; Mon, 20 Nov 2023 09:48:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IGPoCWGOmR7gu81cuFNl416bUyN3OU/f7UGiD7vBvjNC/efWo++Tz825WApLq6IiD8z9lJ0 X-Received: by 2002:a17:90b:4aca:b0:27d:3ecb:3cbb with SMTP id mh10-20020a17090b4aca00b0027d3ecb3cbbmr6359310pjb.37.1700502499913; Mon, 20 Nov 2023 09:48:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700502499; cv=none; d=google.com; s=arc-20160816; b=eAnXcCfMutHOJLNWfnxN2BGw4yAQnd6zQ4APafpyGM5s/2911EHqO70QT/llLyALRU 6OzcKPZPAM8DBBGK3Je7dWI+cM34fUt2tCGExxc5nLLpsTwhmPjTNg8h/CgZnL3D3S4c D8fiTAYcXLu04p8rBohyxLdmb8hclcJQMGt9/1SpnetwETJ7WIQOJrb1LKTFmDG624R/ aDdusc3/WZ9uOhXK0XvWbAvTmlikPRqYZ7SiJOR5RKeEcBgpvvbvSvTmOqIAe+65WOj7 IsUeL9Pq3L1F6lmhcJe6mwbuFqKTz7yUhnUBoMooFEb+6CkhRotEAYovbC4xEgky4LkF MBag== 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 Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id bk14-20020a17090b080e00b00283a251c077si6235706pjb.94.2023.11.20.09.48.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 09:48:19 -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 A41FC8059E73; Mon, 20 Nov 2023 09:47:55 -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 S234078AbjKTRrp (ORCPT + 27 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 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:47:55 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783106109693357693 X-GMAIL-MSGID: 1783106109693357693 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 Reviewed-by: Oscar Salvador --- 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;