Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp431291pxm; Wed, 2 Mar 2022 19:16:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJw36hUR+ddviBbtOsGSCPIAXRORr/fb5VDi7vBIpt6NEXt45b32xn5zn1QecKPx6SALI+NZ X-Received: by 2002:a17:90a:a510:b0:1bc:5887:d957 with SMTP id a16-20020a17090aa51000b001bc5887d957mr3074493pjq.38.1646277373312; Wed, 02 Mar 2022 19:16:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646277373; cv=none; d=google.com; s=arc-20160816; b=nJCmM/oqAALNMh14fSg5b7Ni2VO2La+RFhyKbdm4NZ+VgfnWFbTzx47eblO87xRm9Y wU+N38DM1D2uEjHxHvpii1XLDdu98P4W15QDqjwVjaqD/+cHMR+MavrDFj75c4lkfqWv r/rcgxAhXGd6et8iQnm8ENPRbTszvpHevm7dXew/IIA5y79jZzAlIilOkaXLIFQ3ePPV mOOXG4ta9WQDIjsCY6PAqrj4XHQjpInM1ZrHZbUro2JSMX7896HqIdLaG79jwBqJA5wK RILUOjN74D+9QSXL0iKu1fILKesgxgv31ZVlOsiO25i54lg07q51e6nXn8WUoj60gGqF UPoQ== 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; bh=+nktFMqBOuPmhd71Wom9B2aD6CzsyplNxR1u378XOkk=; b=kT8MaGr3lU3zrKxrLl58V+2m8+rUjE/IVwkKmAInIxNFocFN3Ibmg5EDdiYGpzKOpo AZBuadaBY1csbuzv5E2RGue8QymMPMjtkkLUVQ+/0Reym8QK9YBcUiDyw7yJ83gGs5vv SKsbVwoZydl7zBr2Sq33jQIbtcAniWGGWr/PTfOxz7STg1sIFkYcp8Nfr5bUY3NM4+jJ ILsA0JqOiMaM53eXpcEo7cPlFHNsfV5jBYRQ8mi+B04MCkv8XQxoXihVXgdPttzxpBMI ahwGVP0HRP60MdQPnM6vOHQcTZYeF8YpimWp86e/+Uu65D7oNCFRcAR/BEK01qXOqYpT 78PA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 193-20020a6306ca000000b0036c4f1f8da6si863231pgg.370.2022.03.02.19.16.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 19:16:13 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E2298F8BB8; Wed, 2 Mar 2022 19:15:23 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231979AbiCCDQG (ORCPT + 99 others); Wed, 2 Mar 2022 22:16:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231932AbiCCDQE (ORCPT ); Wed, 2 Mar 2022 22:16:04 -0500 Received: from out30-43.freemail.mail.aliyun.com (out30-43.freemail.mail.aliyun.com [115.124.30.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 326DAEF096 for ; Wed, 2 Mar 2022 19:15:17 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R931e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04357;MF=dtcccc@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0V650kF3_1646277305; Received: from localhost.localdomain(mailfrom:dtcccc@linux.alibaba.com fp:SMTPD_---0V650kF3_1646277305) by smtp.aliyun-inc.com(127.0.0.1); Thu, 03 Mar 2022 11:15:14 +0800 From: Tianchen Ding To: Alexander Potapenko , Marco Elver , Dmitry Vyukov , Andrew Morton Cc: kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 0/2] Alloc kfence_pool after system startup Date: Thu, 3 Mar 2022 11:15:03 +0800 Message-Id: <20220303031505.28495-1-dtcccc@linux.alibaba.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no 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 KFENCE aims at production environments, but it does not allow enabling after system startup because kfence_pool only alloc pages from memblock. Consider the following production scene: At first, for performance considerations, production machines do not enable KFENCE. However, after running for a while, the kernel is suspected to have memory errors. (e.g., a sibling machine crashed.) So other production machines need to enable KFENCE, but it's hard for them to reboot. The 1st patch allows re-enabling KFENCE if the pool is already allocated from memblock. The 2nd patch applies the main part. Tianchen Ding (2): kfence: Allow re-enabling KFENCE after system startup kfence: Alloc kfence_pool after system startup mm/kfence/core.c | 106 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 87 insertions(+), 19 deletions(-) -- 2.27.0