From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58B74280331 for ; Wed, 19 Aug 2026 03:46:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787111215; cv=none; b=SiXxmDP0595QdDPD0rwEPW1E2Q73fvJiWYYnnHokQESla+a33N9wP5x8imVHIScYJO1VLZE6qMzuY/s2rrwslWx6rstI2+HtYrixyK5zaqHs0bjegfXkJB7lbMkhrGUkVliPaYboFy6D+rpvdvW7j72ZXrYpT4LLdb1XiCj0HXw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787111215; c=relaxed/simple; bh=2kpwbvLUbGYWq3YDOK4UcWjIZVsG8O3FbxaIgWRz6Xo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t+34Me5Gh7k4/3szgqyr+yA5BoCFR8z+t9uEHVTB1rQsInIULX62GCf0jbXb9EFlQtp1fF9FfamjvYANsudcrJGcd0zE1MfPbfRAeVqmTTktJX4DQNF1FZP7CVsZViF3Pp9XoTh6p/QWh6mdPv7RzVQ6+5rPpth0tWbUeUuL7BM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dVsITPIj; arc=none smtp.client-ip=209.85.167.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dVsITPIj" Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-4b28d9537bcso337362b6e.0 for ; Tue, 18 Aug 2026 20:46:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787111213; x=1787716013; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=wnMZaxIAAqG9Z6waMDFWf6/fX7Qd0skMNVzaHv1c1+U=; b=dVsITPIjBlqToHAoDV3Yi/7Suspj1HXy/9gbZbw6O1hhA/zPYg3Xs1noIzb/NY7O+D 2cfuUVlkXLaX8m80ByWUXrYvQAQSAzjyX5Kdd0cYOSslpb2JEf02CXu9uJGbKaHCT/Wb ASlvxxs/+r6WyIHFn9GVsG9Zz7f/zWWepHBXV92tNs2AAlUeKJ6wqfPK4CZi+eGgGztr Awc5cPvsxrkQIQCZnnmS/WlQoc+gRoWVh0vWG1NFWU+8PwVG/Vks4AfhIWtxQqd4Hu9q 56JxPZ4DQ0Z791f+k8C+SgDJvFemq9zPKFAZ9cAL2ZcEfGvPT8L+Xw4KcpXGgK06wrgk Ay1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787111213; x=1787716013; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=wnMZaxIAAqG9Z6waMDFWf6/fX7Qd0skMNVzaHv1c1+U=; b=fW2s1YcTK++sbxx1+7rkJL0x/cpmvUvwsa9caWitvx1x4T6mWu8CyPzzrI+GYL/nAn BBSOL2Vz+3BVoILE2PwHkLJVCgrB1rLOjFpyeoQn2Fzi+C98hKV/NqCQoQ1V8DGtZCdy Ubznupu/BOoEkJ0xk0uuMPtLbu8xvebcQvxTLRA2+DnTTC0Yg3hMd6NdE2MTuc47akAh PDn/YJ1iO7PLU5SkWUVDHCPeIvxigHdvIw6UiI4N/J0QyGR6r7MCebC14oyixTEe9TAw TCSxSX/ydTrl7OXq6+5zaU9IkTl+BNgGcF1TsqUIGudXgvDu0bM53kE4OWT2nDlIfp13 AMVA== X-Forwarded-Encrypted: i=1; AHgh+RpXho13yPkNZpxTNWJoZ29nvNLXV6K912Yd4Uo1jOONyhIoCxJMHrusvCaxI5WfDxolrcp28x5XY5JzChE=@vger.kernel.org X-Gm-Message-State: AOJu0YyMWaUvE0XF4569jcSIFTXx+Tlq0IeXrBHDocmkHFpv4zdsO8mV DFKJrIDKhmAI7wK2QTdy1TtoW789xW/rCQ2w0/sMhGqGroh9t7Ti7S9o X-Gm-Gg: AR+sD12iOsloRi/QmcrgdBxxoD1L1bPdYtjFVSxzWALnqVgVAvvWhvt9A3rGeHkjqzt zlpwT5edZvOM89RfyOvs5biK1TPSni4M3snQYyYxv9/x62MDi/f0xPrtE16R1QszD4ZWiv0IbB2 /WTy6qxupmAkrLKS6h2KubtLXHHj9/k9v3PU0ccavzx6jeUOC+6S8ctALXs7APDn6PQ5W/LqmQI xGQSau+761uYHWLbpDHenq0mbSTTAaAat+WSDj1LMniBX8m+06nngP0FUKPtoBnPy/MGRTpBg8n 9MMSav0YIAb1Ck5/aKQf+O47WuKIhn3ZkzVJREVecW+e4VG4SdXDdz+mtcua+osGcx757tBePho W9OWbdWCVViBYeltrXTOELzWRNH3ujvXsmnNpCln8uaUTHGEbTvO428+pPJOOkpWsNnEzSjudXc MNW/IZ3TTlq/4PPt5/0xgPDLVKY3lPJn+XgMChoSzmvjioy8wjQRlFqhGkr7ibEp6kTq1VGY+kX uyYej+urnKO34RN6iw= X-Received: by 2002:a05:6808:d54:b0:4b2:9bf4:ae15 with SMTP id 5614622812f47-4b2baa4ad0amr1628346b6e.11.1787111212097; Tue, 18 Aug 2026 20:46:52 -0700 (PDT) Received: from localhost ([2a03:2880:10ff:49::]) by smtp.gmail.com with ESMTPSA id 5614622812f47-4b2960493ebsm4717715b6e.11.2026.08.18.20.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Aug 2026 20:46:51 -0700 (PDT) From: Joshua Hahn To: Song Hu Cc: joshua.hahnjy@gmail.com, akpm@linux-foundation.org, apopple@nvidia.com, axelrasmussen@google.com, baohua@kernel.org, bsegall@google.com, byungchul@sk.com, cgroups@vger.kernel.org, david@kernel.org, dietmar.eggemann@arm.com, gourry@gourry.net, hannes@cmpxchg.org, harry@kernel.org, jackmanb@google.com, juri.lelli@redhat.com, kasong@tencent.com, kernel-team@meta.com, kprateek.nayak@amd.com, liam@infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, ljs@kernel.org, matthew.brost@intel.com, mgorman@suse.de, mhocko@kernel.org, mhocko@suse.com, mingo@redhat.com, muchun.song@linux.dev, peterz@infradead.org, qi.zheng@linux.dev, rakie.kim@sk.com, rientjes@google.com, roman.gushchin@linux.dev, rostedt@goodmis.org, rppt@kernel.org, shakeel.butt@linux.dev, surenb@google.com, tjmercier@google.com, vbabka@kernel.org, vincent.guittot@linaro.org, vschneid@redhat.com, weixugc@google.com, ying.huang@linux.alibaba.com, yosry@kernel.org, yuanchu@google.com, ziy@nvidia.com Subject: Re: [RFC PATCH v3 09/14] mm/memcontrol: Make memory.high tier-aware Date: Tue, 18 Aug 2026 20:46:49 -0700 Message-ID: <20260819034650.708665-1-joshua.hahnjy@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260818012115.65838-1-husong@kylinos.cn> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Tue, 18 Aug 2026 09:21:15 +0800 Song Hu wrote: Hi Song, thank you for your reply. > (pre-existing, not from this series - mentioning it here because > it reworks memory.high behaviour) > > The penalty computation in calculate_high_delay() can overflow: > > penalty_jiffies = max_overage * max_overage * HZ; > > max_overage is a fixed-point relative overage: > calculate_overage() returns (usage - high) << 20 / high, so the > square times HZ wraps once (usage - high) / high reaches > 4096 / sqrt(HZ). That is roughly 130x at HZ=1000 and 259x at > HZ=250 - reachable when memory.high is tightened far below the > current usage of a large working set. > > Most wrapped values are still caught by the 2s clamp in > mem_cgroup_handle_over_high(), but residues below the clamp pass > through, and some of them produce far less throttling than > intended - down to no sleep at all. > > check_mul_overflow() with a clamp would saturate the penalty > instead of wrapping it. Could be folded in while memory.high is > being reworked, or a standalone fix. I think this could be a real concern, but I'm not sure that my series is the right place to fold this change in. Namely because I don't touch the penalty_jiffies / throttling part at all. Maybe a standalone fix could be worth it? : -) I have no plans at the moment so please feel free to take a crack at it if you think it's a good idea! Joshua