From patchwork Fri May 3 18:03:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13653180 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 0F6EDC4345F for ; Fri, 3 May 2024 18:03:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 931BE6B008C; Fri, 3 May 2024 14:03:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8E2556B0092; Fri, 3 May 2024 14:03:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7D0736B0093; Fri, 3 May 2024 14:03:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 5F0266B008C for ; Fri, 3 May 2024 14:03:26 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D15A3140F4E for ; Fri, 3 May 2024 18:03:25 +0000 (UTC) X-FDA: 82077856770.16.925DCBE Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf08.hostedemail.com (Postfix) with ESMTP id 2AF63160014 for ; Fri, 3 May 2024 18:03:23 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=c71lokwp; spf=pass (imf08.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714759404; 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=bCk72laVBztUwGuMQyJy2WFbHtRbrtEJhKEddtlywW8=; b=LrRUpFiAfeiRU9iwsRcDYNVDH97xRxZQMrSviGtga708RDQ9mE1P4KurkdrF4ezECeSBqf CASrfg/u058hjnHs7XYTqWcFQ60vqv5t+B+Fzl+Z3iA/N9HjVJDHA13mYAmRIFiSf3rRpt 7chH7v+lI/pRMZX5x9ht3EFqCi58yf8= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=c71lokwp; spf=pass (imf08.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714759404; a=rsa-sha256; cv=none; b=BrnydpY7kQIL9PDk3X4L+Irn5tIhSAkhAo9njTXzCsNn/C+kz29ip5cbS9mxc6abnYxfqi Fzs8pEToQkImicqo34727V/H0Bp43xxP2HsvIZ3H16VoFpR476q5W5g8f3RGzDxjYNwVo6 e3at4SIv445GDTZomMKlw/J47Jlvrik= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 0A45261DFD; Fri, 3 May 2024 18:03:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52DEFC4AF1A; Fri, 3 May 2024 18:03:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714759402; bh=zSTAIYDsysAOFhSKZc274DZ8idV6c4WJQL8j1/BLSlE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c71lokwplM4u6LWwWT9mEgvfvFZezL/myTEwABYNAPeXhXSK7pe5V2OOUbsCJblvJ mWEN3cCe5wg4UwB5LxnXWWrbiSkv7fFox/yfAUF3vp3J9oeSTb+oQmGRMzXdPyKX/e MlbYAfhdOK5DClrKc6TbgdoJMmn+08aYUS5exWq/5uWmcOD3aYGDPKjmZN/RQcgmJd Pcp/I3auQn0krCRzZ16b4PZMgXMARPIuN7gk1scj5aF1f47SteyRr5MMRRRItlQ8/I QHo7GGPcAMTWkReXmaBfoSobz12v5bsgxsDS3/Y+dxrR/MeGunw01ia48IkfLV/Vvr ec8AGXSHMGx/A== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/10] mm/damon/core: initialize ->esz_bp from damos_quota_init_priv() Date: Fri, 3 May 2024 11:03:09 -0700 Message-Id: <20240503180318.72798-2-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240503180318.72798-1-sj@kernel.org> References: <20240503180318.72798-1-sj@kernel.org> MIME-Version: 1.0 X-Stat-Signature: i46gne74mdnedxotcwx8zurnowwqynor X-Rspamd-Queue-Id: 2AF63160014 X-Rspamd-Server: rspam10 X-Rspam-User: X-HE-Tag: 1714759403-261115 X-HE-Meta: U2FsdGVkX18lzn2R5JT6VZXx5Z47cXo4Lz0IiLrMIap8D+MAOhq/xfeU2dQQBdTiyHiKdHGStyFwohZjnEMfVp33YbGScanKQE452XSFdLe/7XHna61VNMGkSdmHi32Qhc6HJk0C0VvetBQXsz3TVEgL1Lqp+hvnpyZtXeSfrGy1ajAceeRlNyEFi7/n/atCM0Y5+dR3ElO4mvJF9JqBaEFoz576KmigaY0Jyq3r8w2MPwxkn5ikOjYdRYZiuNlQ3pQDlp+GsrkBjoVxa+cYPOXiVqerLLOa67mattyjEo1fatVwIr47bpztw9ly+0gI83wEYU43gExq6u/ouTqvnyfba0dpwvqvVT8RVxK/7iQgZu1FUc1u9EW+CtsCsSu2XmDkjzYK5REiVrzefB+29eVsTzAakJhlw3qChGoUGBgnU1IMMyYnOTv1fINdjrK7eDwYyVWkr/zVM1dosnqI5Pf7BgWRHBlJFYbiV4P3Hpvnk7kw3DhzNW4m98FYz1Q9W0aPxkpR74qjvAIs1ZGKN4Sx4l4HpPcSX3ToKc5J+Wciv0Mo95qGftt1UwTJYJpPtXyYkkivJVWp/rBQVDUd5J4uGmRZmc4EyJLz+x2WR6pc8D26vOa7L9gbB50fZUpTMrOh2jOQRVGMD76lM+yKJr9DOXYLkerLst9+DIRfsdxch9FRn+23pas1MMQVEKsXZoB14q2ELzbo2wLTNpzgwFC7TeT3iVELvpp9zsjQSq81IzCgaAe4clA0lYNyRa0s44OK4/+mCVm6G9CgQmmb6PblaQT2KhiaWvLAFuc3FfODR38fS7OOswM6wloK3PINdSX7Q/zNPLKZGH+8RaKaNkfL0UTPyU3YnugvTYBT5NSJ7dh+H6y5NRcGvYBF6MbBbQd7/R5LC/FoW/dBdwqulAOd2f2VnhE92oXmO64rYfj0rK9h+aJvcC31rjMOeB7MffcZtLsVQLTpUKCCWz7 hU0VOyfJ sFtRGrgSRcD3LLliFVtYFKO3iLHkNI8RxHoy+6J1jl/77rB1/rKoYopF3OPyRYgwvE2Lm66Cyle4MQwZNcqg6NR9i8Cl67oe+SDrseoAwDKchfnb8R63f56Q8ZgKkPNxHKP0G82dLRXEsf1sIPGzxtMwLwVd3c3rpKhFi6MONlZsva0DX1VeyMAFQUD+DF8saBojubi90sB8RQCf3Yl25KSikSTTmlhbV7lBK+0qXypVpYRo3B5n/0QO9Lx05nunCu4geKJiANx3XkUp0mLcA7p3hShhQFe7NhMem 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: List-Subscribe: List-Unsubscribe: damos_quota_init_priv() function should initialize all private fields of struct damos_quota. However, it is not initializing ->esz_bp field. This could result in use of uninitialized variable from damon_feed_loop_next_input() function. There is no such issue at the moment because every caller of the function is passing damos_quota object that already having the field zero value. But we cannot guarantee the future, and the function is not doing what it is promising. A bug is a bug. This fix is for preventing possible future issues. Fixes: 9294a037c015 ("mm/damon/core: implement goal-oriented feedback-driven quota auto-tuning") Signed-off-by: SeongJae Park --- mm/damon/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/damon/core.c b/mm/damon/core.c index 172095e68c5d..6392f1cc97a3 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -346,6 +346,7 @@ static struct damos_quota *damos_quota_init(struct damos_quota *quota) quota->charged_from = 0; quota->charge_target_from = NULL; quota->charge_addr_from = 0; + quota->esz_bp = 0; return quota; }