Message ID | 20230328095807.7014-5-songmuchun@bytedance.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 1833BC76195 for <linux-mm@archiver.kernel.org>; Tue, 28 Mar 2023 09:58:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ACFB16B007B; Tue, 28 Mar 2023 05:58:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A58D46B007D; Tue, 28 Mar 2023 05:58:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8D2C46B007E; Tue, 28 Mar 2023 05:58:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 7A7076B007B for <linux-mm@kvack.org>; Tue, 28 Mar 2023 05:58:50 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 47AAD1A015B for <linux-mm@kvack.org>; Tue, 28 Mar 2023 09:58:50 +0000 (UTC) X-FDA: 80617858020.02.7C2E7ED Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by imf11.hostedemail.com (Postfix) with ESMTP id 8504540004 for <linux-mm@kvack.org>; Tue, 28 Mar 2023 09:58:48 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=Qx3+v0sZ; spf=pass (imf11.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.172 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679997528; a=rsa-sha256; cv=none; b=y91xWq1A5UQxj9UuKbLxlsyfNtEpH+CTcOuThSXaBZMZEQRsVnKxbyNUtS1ywXesl4dJRM TPkRavACedfjngsW+LUiKIfAdj2Fak4F5v8rovbeV2DVARJxPCahnyriYaayVS2WtVb1Nq eeCVTBFm6lhzvrCDI//ARYKywl/4lRU= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=Qx3+v0sZ; spf=pass (imf11.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.172 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679997528; 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=15Z/PJf0Etf+mCvL+KJkEExIR5UO6fpjH+VUxXpLOps=; b=HvRVIt2DYcGQVQcq4qOA2dpgzmyBNWUAhW62ZBIeajTaYpnfA0fcG5czJPvouiCv7uWfnS AMw1ohGDiBd8jzxPG14DYU1i/eqFP57aBq7HO1L4QxBHvRvfmP/69Bhg+cTT0ekNLdS6Hm e2IgA9CPj4j59FEMUQoUJDT0q3Ls8B8= Received: by mail-pf1-f172.google.com with SMTP id fd25so7592631pfb.1 for <linux-mm@kvack.org>; Tue, 28 Mar 2023 02:58:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1679997527; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=15Z/PJf0Etf+mCvL+KJkEExIR5UO6fpjH+VUxXpLOps=; b=Qx3+v0sZWmUR+ce5l5MqQpd0SAUJEWb0aMDPuqaDGWTo2nZ3Wt+/EWNMN0CiEAmd00 oTzaOuBYvp5IpyTjML80vgl9ojlZu6X7RxGSvyffWJFXCt43KPzhXd/iS8yeRgsejWrP FB+3T6fofiINoekHWqN2WApQUWGvX7bhd+zsJ0LEfvQMmZC7J/Z58o6Yu8Fg0YJgA5dD U5S/kAP6t560+N8wYkN1uqz4IRP232N9dBKfyi+Pr0qHtZeRD4S7DIfi+nbFhJk6P5UR 6HnQZc7vHWimyHei7ItyH6oDI/3Q67JEsR5mXPYeO9JRjRx5a5nwt5lMF5XG/eFNzRa0 KjZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679997527; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=15Z/PJf0Etf+mCvL+KJkEExIR5UO6fpjH+VUxXpLOps=; b=0qzazXjFdqZGmsSdk/5tVmOuNLkir6ApbMWKXOiC/Vi1GuanWdeQH0eQBXu5amcL9J JFuv6A3/M8cJL1XCH+iP6jAIFU9T863+OwAiOp37VlvDiLVbF7UtIsTjxwl12WGt59TO lKMBRvtMnfcfl1KxQuuhumhCpBHh4VH3jWQhLQLbXWJ8zKdvlPX7CmbDQ1hWVJtUE5FB pk5mGUMe0XvsI/kkje+SOmAg7nFdGwGsGhIvVSV2kiyB6BOJB45pLu7ItGj3BVt+sQtd 61ir+as/8OqBAFm+oiOr0WOeTUT0MHfs2ZVImkuHMupzgp1UOW7dhReYDX/w6nnZKbPU 2yDg== X-Gm-Message-State: AAQBX9d4awA/Nqr+gCh6PEjibgeA92QHc8+LUD5r0ebPj+xBkWcVi4/0 DMbXg/OetkNLnY1n84oX8LTU7A== X-Google-Smtp-Source: AKy350ZjS30LuwRfFP7DkSp3XNPM4Idyf1sfqofA7Lh6rHryfmWu8BfaGo3V4Xaq7lv0dFHBxL1eMg== X-Received: by 2002:a62:6454:0:b0:5a8:b2bf:26ac with SMTP id y81-20020a626454000000b005a8b2bf26acmr14066890pfb.20.1679997527531; Tue, 28 Mar 2023 02:58:47 -0700 (PDT) Received: from PXLDJ45XCM.bytedance.net ([139.177.225.236]) by smtp.gmail.com with ESMTPSA id m26-20020aa78a1a000000b005a8a5be96b2sm17207556pfa.104.2023.03.28.02.58.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 28 Mar 2023 02:58:46 -0700 (PDT) From: Muchun Song <songmuchun@bytedance.com> To: glider@google.com, elver@google.com, dvyukov@google.com, akpm@linux-foundation.org, jannh@google.com, sjpark@amazon.de, muchun.song@linux.dev Cc: kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Muchun Song <songmuchun@bytedance.com> Subject: [PATCH 4/6] mm: kfence: remove useless check for CONFIG_KFENCE_NUM_OBJECTS Date: Tue, 28 Mar 2023 17:58:05 +0800 Message-Id: <20230328095807.7014-5-songmuchun@bytedance.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) In-Reply-To: <20230328095807.7014-1-songmuchun@bytedance.com> References: <20230328095807.7014-1-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Queue-Id: 8504540004 X-Rspamd-Server: rspam01 X-Stat-Signature: d48g8nwob5gm81iqmcdt14cf5x6hq1st X-HE-Tag: 1679997528-418966 X-HE-Meta: U2FsdGVkX18k8uYsUdKVLrZRAPtfaYBFNLYRELLlkOZK4tLXDFRNJDBfKHcz3PtdC4rXfIlvppp+vd7/zaUswqJbGUEKyX5rJtVYEkIfKThroU/CXB3c2Ude5mgRTPhlcFAPz01BLEBullzP9ctdKVtC7WBrjPhqwcX675902pnrGaXM9nXEaVbr8w2+GfCFRwFlAORwtORljz6APSoSJl0a3tqw14JDMjLRxttbthwHFb/Ww40kWFDcykA9MgsXlZIaKyDOnR4bXmD+tuDD8z7kjT97TkbIOHcTPtvvgeS9EJA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cyvfoI3V2+qEZbvPd5UdNs/CKmL6Z53PXq+JwcwwNSBkdsAMJ4bH+sLgwZhW4M/L886ehrRaX/dE38Z7kpwS7EaboJrihDA7SEx4h6rB 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: <linux-mm.kvack.org> |
Series |
Simplify kfence code
|
expand
|
On Tue, Mar 28, 2023 at 11:58 AM Muchun Song <songmuchun@bytedance.com> wrote: > > The CONFIG_KFENCE_NUM_OBJECTS is limited by kconfig and vary from 1 to > 65535, so CONFIG_KFENCE_NUM_OBJECTS cannot be equabl to or smaller than Nit: "equal" > 0. Removing it to simplify code. > > Signed-off-by: Muchun Song <songmuchun@bytedance.com> Reviewed-by: Alexander Potapenko <glider@google.com>
diff --git a/mm/kfence/core.c b/mm/kfence/core.c index 5726bf2ae13c..41befcb3b069 100644 --- a/mm/kfence/core.c +++ b/mm/kfence/core.c @@ -115,7 +115,6 @@ EXPORT_SYMBOL(__kfence_pool); /* Export for test modules. */ * Per-object metadata, with one-to-one mapping of object metadata to * backing pages (in __kfence_pool). */ -static_assert(CONFIG_KFENCE_NUM_OBJECTS > 0); struct kfence_metadata kfence_metadata[CONFIG_KFENCE_NUM_OBJECTS]; /* Freelist with available objects. */
The CONFIG_KFENCE_NUM_OBJECTS is limited by kconfig and vary from 1 to 65535, so CONFIG_KFENCE_NUM_OBJECTS cannot be equabl to or smaller than 0. Removing it to simplify code. Signed-off-by: Muchun Song <songmuchun@bytedance.com> --- mm/kfence/core.c | 1 - 1 file changed, 1 deletion(-)