Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1334906rda; Mon, 23 Oct 2023 09:23:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHz9i2vi2eCkh5XXg1c0qgqMAQzuxlDUC7K6bAlTpXnBnrbHmbiYDINWeDRXUEe49nx32Gq X-Received: by 2002:a17:902:ecc6:b0:1c9:cc41:76e4 with SMTP id a6-20020a170902ecc600b001c9cc4176e4mr7143710plh.10.1698078217367; Mon, 23 Oct 2023 09:23:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698078217; cv=none; d=google.com; s=arc-20160816; b=ZcOj9S8zDcH1raCNyodEHtP3t/4Vf55Nl4A9fUTwpZ+dXvLYOaV+6ZgHoUyGozRqRf FjdXwh0Sq5h12aGvmCNbfA1rdu/U6o4l1AsDgExNsRg0090s10pB2eilvffevcM1Eiio Zuj7zE9fv83cCpRkPP4g8JIrb3bEfiJgSeK5RnbZPhIkPKpic0YVY96x4DcfXbHyRVbI 9+muchBNX7m8rOkXRT3hBhE5O0imBUTjQ29xbvkmIUaFxAQsmv9We5w6vahi0P1mN5th fOWHOf20M+lTeo0QCvnQgb5lL+EodP6FG3Urx+dT6pLB2fuNvX265u296kXLpj9QME6g wBgA== 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=nG+LC0UBPf42ZRoJpAQ40L89D9P4IT51y4qgC93SIzgd2JK3E8sd2Wt+sp1jdtl9hA PLmAoamtwFcDwJ8iSA/NAfXn3DQgWBOvH83sCh8ndN8PgoaiJ+s19RrNfcGFec9ZkRrW MhE8ll9tl/wBvcLyu2KWTchVA1XPrICTMZ1W0Gkah2pTnLFJ5SRMQCBLOTUk2Riiy0Cv KVXBhCESsHMBDCCtwIa71LgoLq4LcawegJdGnYLu0bDhFGyabMWJrVw0+cPbXV/NOGqY GKu+9Ek5j8tIRTgk+GoydEVL94V0aHP13Wqpu+u+2gKELo7lkUED46yI1FsXR857Qp+A bQTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="S/cthfh4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id jo23-20020a170903055700b001ca8f6b3b8fsi6303937plb.266.2023.10.23.09.23.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 09:23:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="S/cthfh4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id A743180A13AB; Mon, 23 Oct 2023 09:23:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233630AbjJWQXW (ORCPT + 99 others); Mon, 23 Oct 2023 12:23:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232207AbjJWQXG (ORCPT ); Mon, 23 Oct 2023 12:23:06 -0400 Received: from out-208.mta0.migadu.com (out-208.mta0.migadu.com [91.218.175.208]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDFF1D79 for ; Mon, 23 Oct 2023 09:23:00 -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=1698078179; 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=S/cthfh4emQrjcVoGLkWqQT0OvtdGJAoIvLTqkDDKVckvqP8bUpXYF9LHT/z69ET7396wu VHNZOBPwORg5a49jPPMsPr93gE7IJt9XyYCBaDWrIFujMNX6hp01vXkIeQlmRKoXZZfyEN tUKjyZoUBaxEoZLynpfz1I7/Mg/7kMg= 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 v3 03/19] lib/stackdepot: drop valid bit from handles Date: Mon, 23 Oct 2023 18:22:34 +0200 Message-Id: <5e251a589cb3142607ec5af8fcb904d424702a14.1698077459.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=-0.8 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 lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Mon, 23 Oct 2023 09:23:33 -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