From patchwork Tue Mar 28 09:58:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 7321 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2100780vqo; Tue, 28 Mar 2023 03:13:27 -0700 (PDT) X-Google-Smtp-Source: AKy350azFnDrkJKyoF+swN88AOB1ZkEDIG2LGShaLVqT7JOijTksmJ43/URaVtib8ZMCQGdw4sWO X-Received: by 2002:a17:90a:86c3:b0:231:248c:6ac4 with SMTP id y3-20020a17090a86c300b00231248c6ac4mr16501394pjv.7.1679998407010; Tue, 28 Mar 2023 03:13:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679998406; cv=none; d=google.com; s=arc-20160816; b=yEma3Zjd0bfWHiZI/OJXXZmjxLn3eWpbcQAt8RGIzbSCImKYA/56U3WWt/dpnY47de wkhQO30Aq/WTSlwk2furVN02XSi6oekepf1jSltuh22YLSY2ZNhEj+cJXqnOwk99IpWN RhT9cds40zeIsYhtynrJVAvN6SIiBlyGk5B305TZLc6GeZkfbYL1XdcXuTj1g82snmji ExeHNDhryarDuavXmgBF6FHRyQhym78S3aXfySYMUbnPUu8x06ufjKubgi6n/JpH9bwu RvD4EMC698X2D5lT+OLwrnS7sdO+knfMsCO3n8dsY+Ueq4D82RhHql952VuFcpwlzkXe tcQw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=6MISSvCouqA9cx2hoXCbIEOFQ/tw2bO4d83GG2zGgvE=; b=tmIS2+KGB2nLxAQg+bINEZ65VejgevzRPPixKtlduQh9ADzegyUR5aLDlUhD0svHhx aFz2Rc5bRoQ90c/TUR+vCD61bGtF0Vnjz2t84kZtyaqnM7R8ClqsZW1xx0+9gaN9z9fX 2kxCvwfTfOE3A6rUphGtA5AIi4m2I/dpaZ6JenMJ1y7MsgeD2UlYOzl8v8iMZvGIVURt 8EIkkZp3Y5PQNQn83CEZ/B357Ibrv7RkIIjamaaPF6bXQ1+ER1c71+MSHno9r5xEk4hz f4c6qTRfOrhOzVeFk3yLdkqT/yXA1gDtsaK9TAZEj4h7GC89QjCUmvfht0Ko0xRqY91S uRxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=H20nkFH8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u184-20020a6385c1000000b005091ced8a0csi28740279pgd.775.2023.03.28.03.13.14; Tue, 28 Mar 2023 03:13:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=H20nkFH8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232851AbjC1J7C (ORCPT + 99 others); Tue, 28 Mar 2023 05:59:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232583AbjC1J6x (ORCPT ); Tue, 28 Mar 2023 05:58:53 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66ABF55B4 for ; Tue, 28 Mar 2023 02:58:28 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id y2so7569763pfw.9 for ; Tue, 28 Mar 2023 02:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1679997508; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=6MISSvCouqA9cx2hoXCbIEOFQ/tw2bO4d83GG2zGgvE=; b=H20nkFH8jnbFmpaVjh1mbdMO4PnytobUbAcaDCPto/03C4ZSTbY+dBC4tmYFmST1km zykxLgDoF1caGudo0a3QxXnlL+P+qXERqMeAiIKI+Hq9XX3I88mHJELZJPOcK/5oDtur 9rhlcQgPkOYYH+Rpz1WfPb5STPlj70eNgl8t2oDspeGD5ir09PKjJN/a+Hm9wQFdH5T+ YVSIPggQ4i1QJVlMX5D0t0a0dsnITytGDOauSV2E7FA+zkfCMr1QwTCU340iyfMcatKG EPZhtVAXiRY7SE/c6jr0IBlKdhly/WHs5rCG9a1ei8QvlvntAnPkhRKZu1E/c1/65Pb5 MkbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679997508; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6MISSvCouqA9cx2hoXCbIEOFQ/tw2bO4d83GG2zGgvE=; b=y8zYf/vEcwX3ULo03HamnQ8Irm8Q1g1qIGlcvIEttt9mPOhHLC6OVNOo8vdlrUf+cd lg+teLRVB875YMzHIfk3o42fsgQDD7JpNynNAmB208wrOVpoVjIfYltbhkErGlmEwR85 K/oTufBwJMb6+h0C0IFUPnPiCib+w/MmwZomwr93WWhzeNECwBgMcp5FbXnY7ddbH5vn MpYsoT1HbR5LTnM48kfs/UEdtpk638w3IzMfh6ibpz0k3TZUYGBjuCaN/bgWiif5jXhr b5iWDDMIXyI4spxQR/FYYe5noKBym+QX67dYZERAEZMKmDwx9Vjtkfg1GNWYnxnNgJP5 0z2g== X-Gm-Message-State: AAQBX9fHEyovtv3ZkbcQsa0yU89NCwJ3ibJsA4nn6uXnPryHRZ5aAeL/ mpC65eJIABbAYDcKfG4hfxq4jw== X-Received: by 2002:aa7:9629:0:b0:628:1274:4d60 with SMTP id r9-20020aa79629000000b0062812744d60mr15936639pfg.21.1679997507878; Tue, 28 Mar 2023 02:58:27 -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.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 28 Mar 2023 02:58:27 -0700 (PDT) From: Muchun Song 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 Subject: [PATCH 0/6] Simplify kfence code Date: Tue, 28 Mar 2023 17:58:01 +0800 Message-Id: <20230328095807.7014-1-songmuchun@bytedance.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761606009534087770?= X-GMAIL-MSGID: =?utf-8?q?1761606009534087770?= This series aims to simplify kfence code, please review each patch separately. Thanks. Muchun Song (6): mm: kfence: simplify kfence pool initialization mm: kfence: check kfence pool size at building time mm: kfence: make kfence_protect_page() void mm: kfence: remove useless check for CONFIG_KFENCE_NUM_OBJECTS mm: kfence: change kfence pool page layout mm: kfence: replace ALIGN_DOWN(x, PAGE_SIZE) with PAGE_ALIGN_DOWN(x) arch/arm/include/asm/kfence.h | 4 +- arch/arm64/include/asm/kfence.h | 4 +- arch/parisc/include/asm/kfence.h | 7 +- arch/powerpc/include/asm/kfence.h | 8 +- arch/riscv/include/asm/kfence.h | 4 +- arch/s390/include/asm/kfence.h | 3 +- arch/x86/include/asm/kfence.h | 9 +- include/linux/kfence.h | 8 +- mm/kfence/core.c | 229 +++++++++++++------------------------- mm/kfence/kfence.h | 2 +- mm/kfence/kfence_test.c | 14 --- 11 files changed, 89 insertions(+), 203 deletions(-)