Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1956885lqm; Fri, 3 May 2024 11:03:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUVAoFx41soTJqDFpnIMbgQ9HSd5umwzzCuOtgUPJ5UAXOE7PYp9cd5G13omY/y9s4UypDnXoIdqdTgZZ7hg6TCcqW5AyryxOnd0FPi9A== X-Google-Smtp-Source: AGHT+IHnqkOUf9uVA6nSllUsEmn0xPkJxahQXahxOa70V8/Wcf6Rochhit9IaU0kIFbiEI4F0Kby X-Received: by 2002:a05:620a:2953:b0:790:98cd:647e with SMTP id n19-20020a05620a295300b0079098cd647emr4578624qkp.11.1714759418286; Fri, 03 May 2024 11:03:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714759418; cv=pass; d=google.com; s=arc-20160816; b=uETNyuLEKs8DDjaYi9q/sBsDG6nwHDBG3bQ1dh9FH7nX2ZKQF+Vbxds2fKFzy8yh4U oh8ioqte/Aw1qe6QXDDYZ/TETuoXuU6BUqXgehhJ4twWHBfORkBcYKVeg35QewWmBvzE XUyh2CuL4SKHU3/RtaUL9skgBEGCowFFs7yaVFFcKgGAUtHZyBGRbhMvMjyFcPcjL4gs cZgKXJ379n3ZhhakYuwBiU4OYiTpRNIWRGnF4fBhU7qSkijShpZzURubIg6+JwAUghWp LaUQWjL4LKzQvVDCyjHQ06BHwTGcg8QxrmFJWyNT88j2Myoqr5s/JHZ2Su10b/5L3mRs Fr0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=bCk72laVBztUwGuMQyJy2WFbHtRbrtEJhKEddtlywW8=; fh=BzdeVYqZhG5iuwuKJRNLP969rvCput73lx0iwx2zu7A=; b=MpL2I99kWsjUk69F0Y+ZPdp2ZUraWMAJf7RUQeqZol+/koWCZAhhBDZdPkN9oveSVR bBTJVqHFgfpP3YE6O666BslPlzNITUMh+xsb+pH4DT4v8RdsoU6CbLJ9IE0SKRKW1LSo ASl3VT/eArjmhMSlpN7ypPpo6MG05Y3vB3Fkf2Ye+RaLWysW36DDq+ExUwp3Zh+0hKOd Mti2MWSBL9XYyEPy9zPzCo55F0BfjqmvTn8rw4HygwdjuLT4EakpEC+1Onh2Zgem+o8o 7nEIZYdcM3XMtiIc4jWdbxq8Gb6YY6NqsRoyFAwch0OdP4/4O/iIRVj7J56T530BNpI2 tf/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c71lokwp; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-167996-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167996-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o22-20020a05620a2a1600b00790ec573ccbsi4133939qkp.226.2024.05.03.11.03.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 11:03:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167996-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c71lokwp; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-167996-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167996-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id F31941C219D4 for ; Fri, 3 May 2024 18:03:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EBE891586D3; Fri, 3 May 2024 18:03:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c71lokwp" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1BE99158219; Fri, 3 May 2024 18:03:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714759403; cv=none; b=eRN6GhBoE+vSo7MCSghJPaVW9ptfGq6gb4jwpNpO5yVu2COzSr47Vey1yudZPM5peQEf0OyUZSOZlPg8MxNnjDvwxBLNBPlFj7ug2OO3sW0KCF1lRZaAfoOKX3qraF3OAypD02Cpz3ac2hGgGlZZXeT/VzoDvcW65zFQ7O3grCA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714759403; c=relaxed/simple; bh=zSTAIYDsysAOFhSKZc274DZ8idV6c4WJQL8j1/BLSlE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=T9Y3YRLUMezD2UsEppCCij/G8QmI12ZNxXctzEQ7Eqn9xoQInXWVNUzdGuNTM7gA1YL/YnhgJN8t74/cTsZbv01f8OnmiygZSfK0NSP3rfFSXOb1W8s0PpcpC7njXop1BozqVkN+J9I0z2ethFdt63sZWZxIXwwgZZ3GUHvsQh0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c71lokwp; arc=none smtp.client-ip=10.30.226.201 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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; } -- 2.39.2