From patchwork Mon Oct 23 16:22:34 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: 13433183 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C138FC25B43 for ; Mon, 23 Oct 2023 16:23:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2249C6B00F7; Mon, 23 Oct 2023 12:23:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E9D56B00F8; Mon, 23 Oct 2023 12:23:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E7D5A6B00F9; Mon, 23 Oct 2023 12:23:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id D14786B00F7 for ; Mon, 23 Oct 2023 12:23:02 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id AB2EFC0136 for ; Mon, 23 Oct 2023 16:23:02 +0000 (UTC) X-FDA: 81377245404.01.A599478 Received: from out-209.mta0.migadu.com (out-209.mta0.migadu.com [91.218.175.209]) by imf21.hostedemail.com (Postfix) with ESMTP id E1CE01C0015 for ; Mon, 23 Oct 2023 16:23:00 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b="S/cthfh4"; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf21.hostedemail.com: domain of andrey.konovalov@linux.dev designates 91.218.175.209 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698078181; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=eQriSK20/8KwwHOVdQKhz9C/zLOim8sff0QLVit0F7g=; b=Igl2DJ/EwRxlCd5vIucJ9j+wX7b6KTy1MpbaIbvcngHSK0EpRKCtRuvAhqU4O4ZV6l5X5y KYxH93+Lu42bxOop9g8bUmenfHsuw+Rsh3XjKMOVYrfDIDWspLUfgU5rrx5IYOOoSq6/It bVNWnSDalhweNF9DzG5LN+zsyVDA7lE= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b="S/cthfh4"; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf21.hostedemail.com: domain of andrey.konovalov@linux.dev designates 91.218.175.209 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698078181; a=rsa-sha256; cv=none; b=Lpc34N6Rm3753hY34bnD1mgM9smQa8pw02ItsGvSwOZlUyb0r5wciwxoGtI56MGGG3GNPD ERUZmlEvwMhzfWdTNHm2+OTJ/WNhGrwW+WaTJVIzLigAtjFm4UuR9aOHfY5vONUm+ATzP4 7OgWU1cy222jM0dZecWhgJN3/ixKi2U= 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 X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: E1CE01C0015 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 7o1qsbqw57ukratba64croix3sw9hkus X-HE-Tag: 1698078180-62612 X-HE-Meta: U2FsdGVkX18UydRpX+qkHyQWUELD0U0i/Md/x7gUnx00+MMbzzGhx5yeGFZNLJ7VZG71dWAI+TtjXx0R6v+bCr/juA/GfO8MEZ8cRo7uFqbsqewkEifBGkFaJIuMeXEvY61anWUpOOlor4WsPrJnrtBd+c9bmMDKuonaNM+nJjxyx+P1w0OO64JRvQ0yrNrTi5KrJq/0M0p2isfhlsBUY1+WvxWtW/NWjRvFGsaR6e7iCPHSYqQ9gE9o0OzVyg0isCbnaADJawtyp1BTP98O29KLAJ+MQiDXFjd/G8H132ODjMpX6yMNjcj2WxvedXB+m297XqhYom3xFPKFtEEKY7IA10VFQC1C5xAcFp7s9CcQKcrUL0QYTKteiztC73o697iPpMJmH9h3Hkes1xlsmkj1bbPE/PanwOqkt6oLE1Jqb7p9Poh9mqfQ7a4PWUml1isoNGFsDymc6t8QJMJW76onerbxaQ4wqAETZWTcDjQ9j4SNHBpLuCSpLOfHpuTOhntGl0pLgjmFSkWYP5xu4Yly1YsSxDejQxxcA+YmYVg3ps2Jy+MVXEKSgXqiH8Y+vJ+a65Z6IZjmt+2w5a+f8xwqYjrh3QbY7SJcQM2neMQs1CI3+RpTE1HzkDRrhxESPhhT9xNz6iyEnb/BX5GfsaV5AkW9glheqHDE80yoi1X/vFRsszzwdOfqxqIOgvzVk6eF6+plar6a1Efmj9fTVUeEDdmCe7vDEamEd38SyMECGnxJ9+ETQu1kVHJ6IszrltTc0189G9qV2ZOj3RiTeq7JATxcFVNE3M/POT/WBscph1n5vlUZocSZetqcel/KTULf2dSo6i4Iw61cFnX5VBxKfJfTnS/urojFBzY9mdoBeJftK6TFom8WhbRhymLlEGWMT+RG4XrMMlrFOvahJb1N1F2u4XLCpNiqZhtE5F2bYIF+tAyvaOPqOnrr2RCnZQErIT6Pm31rfKewdWn zu9/oBtO /qZEHziEoidL1ZnyvP1BmQQWT78QlUSax5a5LMq8541R3Vqdn4EUODIzZ1yGydVh9CaSYJi/WqRKwGgVvd5ZIBA9SLrh2qMa789tM X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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;