From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0F4E3C636CD for ; Tue, 7 Feb 2023 10:43:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:CC:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MiDMa4lUTSBPfxe1XquoHmJhavaxZ1mXn8QTRFuVpYY=; b=Ep+dQLBgKq3QOb 9OwldxY2Qi11OG9TitpZKEHPVGIavfVR3mKk/3C09EBck9f0hXj+oOsDjlKWvUKE+xUF/b1T/Fns3 X7AvFlYw2rJeDakNdrYDqxTPgGzDNEcU8L9P1M+Gx0OzSMnb1gdysThDQhMn2EZZyMr7klBgbRNfN UfB8rnSIlX7NytS4zYL98kIK8ekf2MAAzdTO65gDGPcEEM1blr6NWINVAb7UN/fFABu/V9iJLjA37 6ylVoqFtccTKQV6BquK8gLOuYth2PZaLs2mR4NPAuQ1YhQKpDapbOkPKn6Ri1JeBb7NGPAitdGbzr p7P3bljLeITIIb6apKAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPLRI-00BmJj-O2; Tue, 07 Feb 2023 10:43:04 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPLRE-00BmH3-Ao for linux-arm-kernel@lists.infradead.org; Tue, 07 Feb 2023 10:43:02 +0000 Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 317ACOtU014703; Tue, 7 Feb 2023 10:42:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=XXnbkq61QNzvmS19x4a5loZHHClJlIGCcJNDfcvfjKE=; b=Zr5MeEJwQEUcp2UMzmXFAgUhxcW+XUDGLuwspJq/Sv7FSdbWCIGFzTd3ZWHly/+KAFmw swIvasm2+Rl2Y8DD1NJe3FKtBuD+rRhDdLOGxdIMkAn+x1AM3H6zrJAk5ev+Tq0SE1S0 dJTeRE0/5SuWAHWg4wSKePpYOUk5TXDllVjPAZ0lycxKtbeQgQvi9AoBxbir1p0n7Vu8 dc6a/kyb1jxikzhu48/1ClAjWtMNAuvpBOLJ2/Tm3nnlEjNpbI0tFRdxD0akh3tm/MDt gUwZSWPIMm7VrPejWvinynkU0EPvH25r91F3Iw2teBDGXiuJe94zeoExZjtWjRVREYcv NQ== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3nkd8m11vr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Feb 2023 10:42:49 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 317AgnuH004752 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 7 Feb 2023 10:42:49 GMT Received: from [10.239.132.245] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Tue, 7 Feb 2023 02:42:46 -0800 Message-ID: Date: Tue, 7 Feb 2023 18:42:44 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH] mm: kfence: export kfence_enabled as global variables Content-Language: en-US To: Alexander Potapenko CC: Marco Elver , , , , , , Mark Rutland References: <1675750519-1064-1-git-send-email-quic_zhenhuah@quicinc.com> From: Zhenhua Huang In-Reply-To: X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: EFtdy1v4eFdo9Ed3rW9U9JTtrgGufCQ9 X-Proofpoint-ORIG-GUID: EFtdy1v4eFdo9Ed3rW9U9JTtrgGufCQ9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-07_03,2023-02-06_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 clxscore=1015 bulkscore=0 malwarescore=0 spamscore=0 mlxlogscore=737 adultscore=0 priorityscore=1501 phishscore=0 impostorscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302070095 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230207_024300_407346_9E0D3221 X-CRM114-Status: GOOD ( 12.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2023/2/7 18:28, Alexander Potapenko wrote: >>> >>> What is the problem you have encountered? Is the page-granular direct >>> map causing issues? >> We're working on a low memory target, page-granular mapping costed more >> (2M per 1GB) memory. Due to GKI constraints, it is not easy to disable >> CONFIG_KFENCE. So my intention was to move the judgement to runtime >> configurable w/ CONFIG_KFENCE on... >> >> Do you have any further suggestion/proposal on this? Many Thanks! > > Right now CONFIG_KFENCE allocates 512Kb for the GKI kernel (only 63 > objects instead of the default 255): > https://cs.android.com/android/kernel/superproject/+/common-android-mainline:common/arch/arm64/configs/gki_defconfig;l=686?q=CONFIG_KFENCE_NUM_OBJECTS > Where do 2M come from? Hi Alexander, It is not from KFENCE cost itself, but from the requirement it needs page-granular mapping. 2M per 1GB cost is from linear mapping for page granularity. You can see can_set_direct_map() is used for whether allowing section mapping or not. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel