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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86135C71133 for ; Fri, 25 Aug 2023 13:09:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 02E1890001F; Fri, 25 Aug 2023 09:09:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F1FD38E0015; Fri, 25 Aug 2023 09:09:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE8B790001F; Fri, 25 Aug 2023 09:09:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id CE4BC8E0015 for ; Fri, 25 Aug 2023 09:09:03 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 7C6BA4064F for ; Fri, 25 Aug 2023 13:09:03 +0000 (UTC) X-FDA: 81162657366.03.48F585A Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by imf29.hostedemail.com (Postfix) with ESMTP id 43484120017 for ; Fri, 25 Aug 2023 13:09:00 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=K3UoJeof; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf29.hostedemail.com: domain of quic_bibekkum@quicinc.com designates 205.220.180.131 as permitted sender) smtp.mailfrom=quic_bibekkum@quicinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692968940; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=cwouXUzDVAXE+Y59+Ft45l5xh4x2UQkftIjvqRmh1+I=; b=TusxfAg7sJkrj1eDtOgKt82YgndlKw8Dc5V2Ut73443zQpcZgN6DlmxJWT2kTco76Igb3j 4mwcXSz/bsEHgmsxBSDAC86vXjHj4kh+xpXptsTDCmWz0PEhFvk6M3Wqvr3mmxzIdaWTGd T/NBKWS6IzKo9TUV1wSIeX0+PVOsc1k= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=K3UoJeof; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf29.hostedemail.com: domain of quic_bibekkum@quicinc.com designates 205.220.180.131 as permitted sender) smtp.mailfrom=quic_bibekkum@quicinc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692968940; a=rsa-sha256; cv=none; b=rMNo7XfKO7v1ZfieisuJkyWk4vLPHMF/NO/hVXIAlE9W0p0MmHykv/SyHxZ0UxvnXYdJfy 8+vhQ/TRGlRpIm3yl2ugBrytdVtns8kazmau0sGWn8u4XaeNqCfnI6SRXEDHlKwap8zZ0K amSquHQQs1yr1BPnhZ9Rsx/Bj1fiYhk= Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37PCeNOp019270; Fri, 25 Aug 2023 13:08:59 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=cwouXUzDVAXE+Y59+Ft45l5xh4x2UQkftIjvqRmh1+I=; b=K3UoJeofuUcz39fRSiHM57vDMcqDHq8J8n2XdNE++bcQ+iO/7qAyzNpyN4XgxlRnn2qK l+WSwzfIlEeU9chZcDpJJ03mcOAnHwiJBuw5W+FU9812k9TETTcJnGPad8O6j2MbDiBE smtgFAPZd2E6LkeMbot3DD13FkQ1TJBS35IsE+k9Q+64Khkp0FKvNlVuSiXxVVoguIM6 xqEBz5GHqYryXul0rEenDnTVpi5Njj426ScEz/HaH0IEduxk9tJDkjzL4pN48aZYyni2 vcmIqNfoVdQGWAt/n3V8qpwbkxthpHmpwc3pzsRcfQVxjv7fimihk8EO7h2FaX+GqlLc kw== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3spmn38xds-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Aug 2023 13:08:58 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 37PD8MXO027216 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Aug 2023 13:08:22 GMT Received: from [10.214.66.253] (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 25 Aug 2023 06:08:20 -0700 Message-ID: <9ab7df09-e128-4940-ace5-0cc5ffa1ec4d@quicinc.com> Date: Fri, 25 Aug 2023 18:38:13 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] cma: introduce CMA_ALLOC_DEBUG config Content-Language: en-US To: Andrew Morton CC: , , Pavan Kondeti , References: <20230809131640.18791-1-quic_bibekkum@quicinc.com> <20230810095451.cada824810441ecc955e2b2e@linux-foundation.org> From: Bibek Kumar Patro In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: FhtS749M2VOErv0kSOfkotJpLQuIrwiE X-Proofpoint-GUID: FhtS749M2VOErv0kSOfkotJpLQuIrwiE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-08-25_10,2023-08-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 lowpriorityscore=0 clxscore=1015 phishscore=0 adultscore=0 priorityscore=1501 malwarescore=0 impostorscore=0 spamscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2308250116 X-Rspamd-Queue-Id: 43484120017 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: qpfy1ptr9peo6qsdgmui3mgha6z5ro1w X-HE-Tag: 1692968940-401556 X-HE-Meta: U2FsdGVkX1+RrwRwGVXTu/fj+CceX0fefw4WVtDaZqgffKeamekugWMxMVhR4z55Ir2ViYiLHvcGCyS2CDfteuBgWPgCf60RDQgRAUK2+W7F7gira8mk2FmA1Ft/Xnie9vxYGEVr8xOme/m0j/9vfy9dJIIgiA98+xiIK6pW8BIITsGNq732A562670LSe1fLE7+aM2mIyFsiH43DqkWuDcG02JIehVctH++77ZGkH35XlorD4fU7NopNZG1LtDALlthEaB1xNcme7kwBp1ONiq3pOc3SEyQ9CsPApekq2i73+1trz97XSgNXStgtFThrSO4EOIhFaW95CmavJkoEIPVPv2BbIZ+0OYUv46nrG+MJ/MZGF4yIHJM3veGhdW6vvtipa79/GV5Y4r6FJrBuijBDOJYpCkBu+UqGiGIhQda2/vEgZdAq2wY4/WeIrU4lZ+w1iMY3XO4RpGKzFVaD+m56rrBCKcvYRrkXyqemHQnrWYMr6bxh8J0i9cUKcKmx+O39YCBSkO2+tNlhqn9EtuBlP0U3l9bvdYqZNXu2kNlbtoHnER4MGFsXzFaya0l5Uph51LobmZfixXvhg89hMyrtF7yRZDW9txc/auSwIKPxgwsvimOZJ4T0TNjV3fylJxcNfOdSYN0B9k3Pb0AjjOEK5RcgOda9K6fcD2dcasK7dJKPBHa9alW1A52hQuRSqB2ocJVnp413ajn5XCSzKKuvdVWEUkYyAdM3UnLckttjaNGPO48/ByF9So1X1bSnBZdOj87xlf4wICp+tgu02mCg2NbumjOFPo5K0pF3vQZ0agEVjvcbv2qxwMwED9qEj6avE3CX1WZZPZBxdWdUYgoZBkcxCghnHrM5M6pIlQFpSRGW10wNXT5c4daetPFeuRhWeQx6umfbDGdyZ3STTrqLcyYJddiJiho6vHwBdUx3AiDJPosr+rHHzNSWUUT1bk73jfS4fbrKDLreGu E9ZgZU2V nUnJDhfNkiGoSGVx96BpD4fqAPJwPflsxsyARrG5YdK0n/1eUPSlh3Pd++wQppJ4bo4ACnLxUwi5ga8R0Z0EXu+Os60rHcn9PTmYLxIxoxMjI1B0s4pJFOdX0fQxjEqbacDEtkw2ZGeOniOG2/WBw8wa10UL4BvsutcrANDZXkMhxlkFOvkoLATog4eWMylKkEF0yWhN32zmcCyModx7k0/y0Sv/io+hRoXwc6cuHmael4llNLfyWYRxVVMXZh9Lx2tz77iw2VTam/uCIJpuLtpMK0FO0xQtomE/qXJuCAC98J40o8Qa7Z51Q2BQ7lpyITs0dl1brshO0vDAFd17DRENFrHE4tcQqEDKPA/s1Uaz/DWuBYfw3rkOSWBUgorxhXkoh 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: On 8/14/2023 8:30 AM, Pavan Kondeti wrote: > Bibek, > > On Thu, Aug 10, 2023 at 09:54:51AM -0700, Andrew Morton wrote: >> On Wed, 9 Aug 2023 18:46:40 +0530 Bibek Kumar Patro wrote: >> >>> Currently enabling CONFIG_CMA_DEBUG enables DEBUG preprocessor macro. >>> If DEBUG is defined, it's equivalent to a printk with KERN_DEBUG loglevel >>> flooding the dmesg buffer with pr_debug prints from mm/cma driver and from >>> included files as well. This results in excessive amount of CMA logging and >>> also might distract the debug teams with unrelated KERN_DEBUG prints.One of >>> the ways engineers currently tackle this problem is by passing loglevel=N >>> though commandline to suppress KERN_DEBUG messages. This approach can >>> sometimes become tiresome due to its repetitive nature. >>> This patch proposes an alternative approach by introducing a simple new >>> config CONFIG_CMA_ALLOC_DEBUG which only shows the cma bit allocation >>> status in case of cma failure and do not enable DEBUG preprocessor macro >>> from CONFIG_CMA_DEBUG avoiding excessive CMA logging from pr_debug. >>> Engineers and tech teams seeking only for bitmap status in case of cma >>> failure can use this simple config instead of worrying about changing >>> the loglevel or trying other similar workarounds. >> >> Would it be better to control this at runtime? With a /proc or /sys tunable? > Thanks Andrew for suggestion and Pavan for the details, tunable approach looks viable too since we get to control this during runtime, but had one query in mind where your inputs would help. In case any engineer wishes to check boot time CMA failures, would it be easier to use a CONFIG or /proc , /sys tunable? (Assuming for /proc or /sys tunable, one has to modify the init/post_boot scripts to mount the fs and set the tunable to true ) > IIUC, Andrew is asking/suggesting that would a runtime knob be useful > here? > > For ex: > > /proc/sys/vm/cma_dump_on_failure : This needs to be registerd in the > cma.c . grep for "register_sysctl_init" in mm code. We can set this to > true by default in case CMA_DEBUG is enabled so that current users are > not affected. > > /sys/kernel/mm/cma/bitmap_dump_on_failure : This needs to stay in > cma_sysfs.c code > > Thanks, > Pavan > > Thanks, Bibek